|
0
|
1 #!/bin/bash
|
|
|
2 set -e;
|
|
|
3 email_address_of_user=$1;
|
|
|
4 echo "email: " $email_address_of_user;
|
|
|
5
|
|
|
6 echo "Calculation of Y-linked genes started."
|
|
|
7 ./scripts/prepare_statistics.sh;
|
|
|
8 echo "Statistics done";
|
|
|
9
|
|
|
10 #filter contigs, which are candidate Y genes - very divergent from their X counterparts
|
|
|
11 perl scripts/filter_diverged_Y_contigs.pl scripts/statistics/stat_mother scripts/statistics/stat_father scripts/statistics/stat_daughter scripts/statistics/stat_son >Y_results.txt;
|
|
|
12 perl scripts/get_sequences_based_on_ids.pl references/reference_male.fasta Y_list >Y_results_sequences.txt;
|
|
|
13
|
|
|
14 if [[ -s Y_list ]] ; then
|
|
|
15 get_results_in_bam_file ()
|
|
|
16 {
|
|
|
17 for ARG in "$@";
|
|
|
18 do
|
|
|
19 ./scripts/createBamFromResults.sh Y_list bam/aln_cleaned_sorted_deduplicated_${ARG}_male.bam bam/${ARG}_male.bam;
|
|
|
20 samtools index bam/${ARG}_male.bam;
|
|
|
21 done;
|
|
|
22 }
|
|
|
23
|
|
|
24 get_results_in_bam_file mother father daughter son;
|
|
|
25 wait;
|
|
|
26 #send BAM files with corresponding contigs
|
|
|
27 mutt -s "LINKYX: Results of computation for Y-linked genes" $email_address_of_user -a bam/mother_male.bam -a bam/mother_male.bam.bai -a bam/father_male.bam -a bam/father_male.bam.bai -a bam/daughter_male.bam -a bam/daughter_male.bam.bai -a bam/son_male.bam -a bam/son_male.bam.bai < messages_to_user/message_results_sentBamY;
|
|
|
28 else
|
|
|
29 #we found NO genes
|
|
|
30 echo "No sequences found." >Y_results.txt;
|
|
|
31 echo "No sequences found." >Y_results_sequences.txt;
|
|
|
32 fi |