annotate Y.sh @ 11:4b7740f6305f

toolshed10
author biomonika <biomonika@psu.edu>
date Wed, 10 Sep 2014 10:32:35 -0400
parents 1955f03f092e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
1955f03f092e initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
1 #!/bin/bash
1955f03f092e initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
2 set -e;
1955f03f092e initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
3 email_address_of_user=$1;
1955f03f092e initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
4 echo "email: " $email_address_of_user;
1955f03f092e initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
5
1955f03f092e initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
6 echo "Calculation of Y-linked genes started."
1955f03f092e initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
7 ./scripts/prepare_statistics.sh;
1955f03f092e initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
8 echo "Statistics done";
1955f03f092e initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
9
1955f03f092e initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
10 #filter contigs, which are candidate Y genes - very divergent from their X counterparts
1955f03f092e initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
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;
1955f03f092e initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
12 perl scripts/get_sequences_based_on_ids.pl references/reference_male.fasta Y_list >Y_results_sequences.txt;
1955f03f092e initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
13
1955f03f092e initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
14 if [[ -s Y_list ]] ; then
1955f03f092e initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
15 get_results_in_bam_file ()
1955f03f092e initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
16 {
1955f03f092e initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
17 for ARG in "$@";
1955f03f092e initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
18 do
1955f03f092e initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
19 ./scripts/createBamFromResults.sh Y_list bam/aln_cleaned_sorted_deduplicated_${ARG}_male.bam bam/${ARG}_male.bam;
1955f03f092e initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
20 samtools index bam/${ARG}_male.bam;
1955f03f092e initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
21 done;
1955f03f092e initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
22 }
1955f03f092e initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
23
1955f03f092e initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
24 get_results_in_bam_file mother father daughter son;
1955f03f092e initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
25 wait;
1955f03f092e initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
26 #send BAM files with corresponding contigs
1955f03f092e initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
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;
1955f03f092e initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
28 else
1955f03f092e initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
29 #we found NO genes
1955f03f092e initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
30 echo "No sequences found." >Y_results.txt;
1955f03f092e initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
31 echo "No sequences found." >Y_results_sequences.txt;
1955f03f092e initial commit
biomonika <biomonika@psu.edu>
parents:
diff changeset
32 fi