-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcORF_prediction_tech_reps.sh
206 lines (162 loc) · 26.5 KB
/
cORF_prediction_tech_reps.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
#!/bin/bash
#SBATCH --job-name=marta
#SBATCH --output=marta-%j.out
#SBATCH --error=marta-%j.err
#SBATCH -C new
#SBATCH --nodes=1
#SBATCH --ntasks=20
#SBATCH --mem=500G
SAMPLE_path=/nfs/brubeck.bx.psu.edu/scratch6/marta/Capture_great_apes/All_samples/overhang/new_barcodes/IsoCon_15/annotate_clusters
output_path=/nfs/brubeck.bx.psu.edu/scratch6/marta/Capture_great_apes/All_samples/overhang/new_barcodes/IsoCon_15/annotate_clusters/orf_prediction_tech_rep
db_path=/nfs/brubeck.bx.psu.edu/scratch6/marta/Capture_great_apes/All_samples/overhang/new_barcodes/IsoCon_15/annotate_clusters/db/
mkdir -p $output_path
for SAMPLE in 1_1 1_2 2_1 2_2 3_1 3_2 4_1 4_2 5_1 5_2 6_1 6_2 7_1 7_2 8_1 8_2
do
getorf -sequence $SAMPLE_path/$SAMPLE/final_candidates_BPY2.fa -find 1 -minsize 150 -outseq $output_path/$SAMPLE\_BPY2\_50aa_and_more_orf_START_STOP.fasta
awk '/^>/ {printf("%s%s\t",(N>0?"\n":""),$0);N++;next;} {printf("%s",$0);} END {printf("\n");}' $output_path/$SAMPLE\_BPY2\_50aa_and_more_orf_START_STOP.fasta > $output_path/$SAMPLE\_BPY2\_50aa_and_more_orf_linearized_START_STOP.fasta
awk -F '\t' '{printf("%d\t%s\t%s\n",length($2),substr($1,1,15),$0);}' $output_path/$SAMPLE\_BPY2\_50aa_and_more_orf_linearized_START_STOP.fasta | sort -k2,2 -k1,1n | cut -f3,4 | tr "\t" "\n" > $output_path/$SAMPLE\_BPY2\_50aa_and_more_orf_sorted_START_STOP.fasta
getorf -sequence $SAMPLE_path/$SAMPLE/final_candidates_BPY2.fa -find 3 -minsize 150 -outseq $output_path/$SAMPLE\_BPY2\_50aa_and_more_orf_START_STOP_nuc.fasta
awk '/^>/ {printf("%s%s\t",(N>0?"\n":""),$0);N++;next;} {printf("%s",$0);} END {printf("\n");}' $output_path/$SAMPLE\_BPY2\_50aa_and_more_orf_START_STOP_nuc.fasta > $output_path/$SAMPLE\_BPY2\_50aa_and_more_orf_linearized_START_STOP_nuc.fasta
awk -F '\t' '{printf("%d\t%s\t%s\n",length($2),substr($1,1,15),$0);}' $output_path/$SAMPLE\_BPY2\_50aa_and_more_orf_linearized_START_STOP_nuc.fasta | sort -k2,2 -k1,1n | cut -f3,4 | tr "\t" "\n" > $output_path/$SAMPLE\_BPY2\_50aa_and_more_orf_sorted_START_STOP_nuc.fasta
makeblastdb -in $output_path/$SAMPLE\_BPY2\_50aa_and_more_orf_START_STOP.fasta -title pdbaa1 -dbtype prot -out $output_path/$SAMPLE\_BPY2\_pdbaa1 -parse_seqids
blastp -query $db_path/Ychr_proteins_with_XKRY_mod.fa -db $output_path/$SAMPLE\_BPY2\_pdbaa1 -evalue 1e-30 -outfmt 11 -out $output_path/$SAMPLE\_BPY2\_query_human_Y_prot_results_blastp_START_STOP.txt
blast_formatter -archive $output_path/$SAMPLE\_BPY2\_query_human_Y_prot_results_blastp_START_STOP.txt -outfmt "6 qseqid sseqid qcovs length pident evalue bitscore mismatch gaps qstart qend sstart send qseq sseq" -out $output_path/$SAMPLE\_BPY2\_query_human_Y_prot_START_STOP_tabular.txt
awk '!x[$2]++' $output_path/$SAMPLE\_BPY2\_query_human_Y_prot_START_STOP_tabular.txt > $output_path/$SAMPLE\_BPY2\_query_human_Y_prot_START_STOP_unique.txt
sort -rn -k4 $output_path/$SAMPLE\_BPY2\_query_human_Y_prot_START_STOP_unique.txt > $output_path/$SAMPLE\_BPY2\_query_human_Y_prot_START_STOP_unique_sorted.txt
sort -rn -k4 $output_path/$SAMPLE\_BPY2\_query_human_Y_prot_START_STOP_tabular.txt > $output_path/$SAMPLE\_BPY2\_query_human_Y_prot_START_STOP_tabular_sorted.txt
done
for SAMPLE in 1_1 1_2 2_1 2_2 3_1 3_2 4_1 4_2 5_1 5_2 6_1 6_2 7_1 7_2 8_1 8_2
do
getorf -sequence $SAMPLE_path/$SAMPLE/final_candidates_CDY.fa -find 1 -minsize 150 -outseq $output_path/$SAMPLE\_CDY\_50aa_and_more_orf_START_STOP.fasta
awk '/^>/ {printf("%s%s\t",(N>0?"\n":""),$0);N++;next;} {printf("%s",$0);} END {printf("\n");}' $output_path/$SAMPLE\_CDY\_50aa_and_more_orf_START_STOP.fasta > $output_path/$SAMPLE\_CDY\_50aa_and_more_orf_linearized_START_STOP.fasta
awk -F '\t' '{printf("%d\t%s\t%s\n",length($2),substr($1,1,15),$0);}' $output_path/$SAMPLE\_CDY\_50aa_and_more_orf_linearized_START_STOP.fasta | sort -k2,2 -k1,1n | cut -f3,4 | tr "\t" "\n" > $output_path/$SAMPLE\_CDY\_50aa_and_more_orf_sorted_START_STOP.fasta
getorf -sequence $SAMPLE_path/$SAMPLE/final_candidates_CDY.fa -find 3 -minsize 150 -outseq $output_path/$SAMPLE\_CDY\_50aa_and_more_orf_START_STOP_nuc.fasta
awk '/^>/ {printf("%s%s\t",(N>0?"\n":""),$0);N++;next;} {printf("%s",$0);} END {printf("\n");}' $output_path/$SAMPLE\_CDY\_50aa_and_more_orf_START_STOP_nuc.fasta > $output_path/$SAMPLE\_CDY\_50aa_and_more_orf_linearized_START_STOP_nuc.fasta
awk -F '\t' '{printf("%d\t%s\t%s\n",length($2),substr($1,1,15),$0);}' $output_path/$SAMPLE\_CDY\_50aa_and_more_orf_linearized_START_STOP_nuc.fasta | sort -k2,2 -k1,1n | cut -f3,4 | tr "\t" "\n" > $output_path/$SAMPLE\_CDY\_50aa_and_more_orf_sorted_START_STOP_nuc.fasta
makeblastdb -in $output_path/$SAMPLE\_CDY\_50aa_and_more_orf_START_STOP.fasta -title pdbaa1 -dbtype prot -out $output_path/$SAMPLE\_CDY\_pdbaa1 -parse_seqids
blastp -query $db_path/Ychr_proteins_with_XKRY_mod.fa -db $output_path/$SAMPLE\_CDY\_pdbaa1 -evalue 1e-30 -outfmt 11 -out $output_path/$SAMPLE\_CDY\_query_human_Y_prot_results_blastp_START_STOP.txt
blast_formatter -archive $output_path/$SAMPLE\_CDY\_query_human_Y_prot_results_blastp_START_STOP.txt -outfmt "6 qseqid sseqid qcovs length pident evalue bitscore mismatch gaps qstart qend sstart send qseq sseq" -out $output_path/$SAMPLE\_CDY\_query_human_Y_prot_START_STOP_tabular.txt
awk '!x[$2]++' $output_path/$SAMPLE\_CDY\_query_human_Y_prot_START_STOP_tabular.txt > $output_path/$SAMPLE\_CDY\_query_human_Y_prot_START_STOP_unique.txt
sort -rn -k4 $output_path/$SAMPLE\_CDY\_query_human_Y_prot_START_STOP_unique.txt > $output_path/$SAMPLE\_CDY\_query_human_Y_prot_START_STOP_unique_sorted.txt
sort -rn -k4 $output_path/$SAMPLE\_CDY\_query_human_Y_prot_START_STOP_tabular.txt > $output_path/$SAMPLE\_CDY\_query_human_Y_prot_START_STOP_tabular_sorted.txt
done
for SAMPLE in 1_1 1_2 2_1 2_2 3_1 3_2 4_1 4_2 5_1 5_2 6_1 6_2 7_1 7_2 8_1 8_2
do
getorf -sequence $SAMPLE_path/$SAMPLE/final_candidates_DAZ.fa -find 1 -minsize 150 -outseq $output_path/$SAMPLE\_DAZ\_50aa_and_more_orf_START_STOP.fasta
awk '/^>/ {printf("%s%s\t",(N>0?"\n":""),$0);N++;next;} {printf("%s",$0);} END {printf("\n");}' $output_path/$SAMPLE\_DAZ\_50aa_and_more_orf_START_STOP.fasta > $output_path/$SAMPLE\_DAZ\_50aa_and_more_orf_linearized_START_STOP.fasta
awk -F '\t' '{printf("%d\t%s\t%s\n",length($2),substr($1,1,15),$0);}' $output_path/$SAMPLE\_DAZ\_50aa_and_more_orf_linearized_START_STOP.fasta | sort -k2,2 -k1,1n | cut -f3,4 | tr "\t" "\n" > $output_path/$SAMPLE\_DAZ\_50aa_and_more_orf_sorted_START_STOP.fasta
getorf -sequence $SAMPLE_path/$SAMPLE/final_candidates_DAZ.fa -find 3 -minsize 150 -outseq $output_path/$SAMPLE\_DAZ\_50aa_and_more_orf_START_STOP_nuc.fasta
awk '/^>/ {printf("%s%s\t",(N>0?"\n":""),$0);N++;next;} {printf("%s",$0);} END {printf("\n");}' $output_path/$SAMPLE\_DAZ\_50aa_and_more_orf_START_STOP_nuc.fasta > $output_path/$SAMPLE\_DAZ\_50aa_and_more_orf_linearized_START_STOP_nuc.fasta
awk -F '\t' '{printf("%d\t%s\t%s\n",length($2),substr($1,1,15),$0);}' $output_path/$SAMPLE\_DAZ\_50aa_and_more_orf_linearized_START_STOP_nuc.fasta | sort -k2,2 -k1,1n | cut -f3,4 | tr "\t" "\n" > $output_path/$SAMPLE\_DAZ\_50aa_and_more_orf_sorted_START_STOP_nuc.fasta
makeblastdb -in $output_path/$SAMPLE\_DAZ\_50aa_and_more_orf_START_STOP.fasta -title pdbaa1 -dbtype prot -out $output_path/$SAMPLE\_DAZ\_pdbaa1 -parse_seqids
blastp -query $db_path/Ychr_proteins_with_XKRY_mod.fa -db $output_path/$SAMPLE\_DAZ\_pdbaa1 -evalue 1e-30 -outfmt 11 -out $output_path/$SAMPLE\_DAZ\_query_human_Y_prot_results_blastp_START_STOP.txt
blast_formatter -archive $output_path/$SAMPLE\_DAZ\_query_human_Y_prot_results_blastp_START_STOP.txt -outfmt "6 qseqid sseqid qcovs length pident evalue bitscore mismatch gaps qstart qend sstart send qseq sseq" -out $output_path/$SAMPLE\_DAZ\_query_human_Y_prot_START_STOP_tabular.txt
awk '!x[$2]++' $output_path/$SAMPLE\_DAZ\_query_human_Y_prot_START_STOP_tabular.txt > $output_path/$SAMPLE\_DAZ\_query_human_Y_prot_START_STOP_unique.txt
sort -rn -k4 $output_path/$SAMPLE\_DAZ\_query_human_Y_prot_START_STOP_unique.txt > $output_path/$SAMPLE\_DAZ\_query_human_Y_prot_START_STOP_unique_sorted.txt
sort -rn -k4 $output_path/$SAMPLE\_DAZ\_query_human_Y_prot_START_STOP_tabular.txt > $output_path/$SAMPLE\_DAZ\_query_human_Y_prot_START_STOP_tabular_sorted.txt
done
for SAMPLE in 1_1 1_2 2_1 2_2 3_1 3_2 4_1 4_2 5_1 5_2 6_1 6_2 7_1 7_2 8_1 8_2
do
getorf -sequence $SAMPLE_path/$SAMPLE/final_candidates_HSFY.fa -find 1 -minsize 150 -outseq $output_path/$SAMPLE\_HSFY\_50aa_and_more_orf_START_STOP.fasta
awk '/^>/ {printf("%s%s\t",(N>0?"\n":""),$0);N++;next;} {printf("%s",$0);} END {printf("\n");}' $output_path/$SAMPLE\_HSFY\_50aa_and_more_orf_START_STOP.fasta > $output_path/$SAMPLE\_HSFY\_50aa_and_more_orf_linearized_START_STOP.fasta
awk -F '\t' '{printf("%d\t%s\t%s\n",length($2),substr($1,1,15),$0);}' $output_path/$SAMPLE\_HSFY\_50aa_and_more_orf_linearized_START_STOP.fasta | sort -k2,2 -k1,1n | cut -f3,4 | tr "\t" "\n" > $output_path/$SAMPLE\_HSFY\_50aa_and_more_orf_sorted_START_STOP.fasta
getorf -sequence $SAMPLE_path/$SAMPLE/final_candidates_HSFY.fa -find 3 -minsize 150 -outseq $output_path/$SAMPLE\_HSFY\_50aa_and_more_orf_START_STOP_nuc.fasta
awk '/^>/ {printf("%s%s\t",(N>0?"\n":""),$0);N++;next;} {printf("%s",$0);} END {printf("\n");}' $output_path/$SAMPLE\_HSFY\_50aa_and_more_orf_START_STOP_nuc.fasta > $output_path/$SAMPLE\_HSFY\_50aa_and_more_orf_linearized_START_STOP_nuc.fasta
awk -F '\t' '{printf("%d\t%s\t%s\n",length($2),substr($1,1,15),$0);}' $output_path/$SAMPLE\_HSFY\_50aa_and_more_orf_linearized_START_STOP_nuc.fasta | sort -k2,2 -k1,1n | cut -f3,4 | tr "\t" "\n" > $output_path/$SAMPLE\_HSFY\_50aa_and_more_orf_sorted_START_STOP_nuc.fasta
makeblastdb -in $output_path/$SAMPLE\_HSFY\_50aa_and_more_orf_START_STOP.fasta -title pdbaa1 -dbtype prot -out $output_path/$SAMPLE\_HSFY\_pdbaa1 -parse_seqids
blastp -query $db_path/Ychr_proteins_with_XKRY_mod.fa -db $output_path/$SAMPLE\_HSFY\_pdbaa1 -evalue 1e-30 -outfmt 11 -out $output_path/$SAMPLE\_HSFY\_query_human_Y_prot_results_blastp_START_STOP.txt
blast_formatter -archive $output_path/$SAMPLE\_HSFY\_query_human_Y_prot_results_blastp_START_STOP.txt -outfmt "6 qseqid sseqid qcovs length pident evalue bitscore mismatch gaps qstart qend sstart send qseq sseq" -out $output_path/$SAMPLE\_HSFY\_query_human_Y_prot_START_STOP_tabular.txt
awk '!x[$2]++' $output_path/$SAMPLE\_HSFY\_query_human_Y_prot_START_STOP_tabular.txt > $output_path/$SAMPLE\_HSFY\_query_human_Y_prot_START_STOP_unique.txt
sort -rn -k4 $output_path/$SAMPLE\_HSFY\_query_human_Y_prot_START_STOP_unique.txt > $output_path/$SAMPLE\_HSFY\_query_human_Y_prot_START_STOP_unique_sorted.txt
sort -rn -k4 $output_path/$SAMPLE\_HSFY\_query_human_Y_prot_START_STOP_tabular.txt > $output_path/$SAMPLE\_HSFY\_query_human_Y_prot_START_STOP_tabular_sorted.txt
done
for SAMPLE in 1_1 1_2 2_1 2_2 3_1 3_2 4_1 4_2 5_1 5_2 6_1 6_2 7_1 7_2 8_1 8_2
do
getorf -sequence $SAMPLE_path/$SAMPLE/final_candidates_PRY.fa -find 1 -minsize 150 -outseq $output_path/$SAMPLE\_PRY\_50aa_and_more_orf_START_STOP.fasta
awk '/^>/ {printf("%s%s\t",(N>0?"\n":""),$0);N++;next;} {printf("%s",$0);} END {printf("\n");}' $output_path/$SAMPLE\_PRY\_50aa_and_more_orf_START_STOP.fasta > $output_path/$SAMPLE\_PRY\_50aa_and_more_orf_linearized_START_STOP.fasta
awk -F '\t' '{printf("%d\t%s\t%s\n",length($2),substr($1,1,15),$0);}' $output_path/$SAMPLE\_PRY\_50aa_and_more_orf_linearized_START_STOP.fasta | sort -k2,2 -k1,1n | cut -f3,4 | tr "\t" "\n" > $output_path/$SAMPLE\_PRY\_50aa_and_more_orf_sorted_START_STOP.fasta
getorf -sequence $SAMPLE_path/$SAMPLE/final_candidates_PRY.fa -find 3 -minsize 150 -outseq $output_path/$SAMPLE\_PRY\_50aa_and_more_orf_START_STOP_nuc.fasta
awk '/^>/ {printf("%s%s\t",(N>0?"\n":""),$0);N++;next;} {printf("%s",$0);} END {printf("\n");}' $output_path/$SAMPLE\_PRY\_50aa_and_more_orf_START_STOP_nuc.fasta > $output_path/$SAMPLE\_PRY\_50aa_and_more_orf_linearized_START_STOP_nuc.fasta
awk -F '\t' '{printf("%d\t%s\t%s\n",length($2),substr($1,1,15),$0);}' $output_path/$SAMPLE\_PRY\_50aa_and_more_orf_linearized_START_STOP_nuc.fasta | sort -k2,2 -k1,1n | cut -f3,4 | tr "\t" "\n" > $output_path/$SAMPLE\_PRY\_50aa_and_more_orf_sorted_START_STOP_nuc.fasta
makeblastdb -in $output_path/$SAMPLE\_PRY\_50aa_and_more_orf_START_STOP.fasta -title pdbaa1 -dbtype prot -out $output_path/$SAMPLE\_PRY\_pdbaa1 -parse_seqids
blastp -query $db_path/Ychr_proteins_with_XKRY_mod.fa -db $output_path/$SAMPLE\_PRY\_pdbaa1 -evalue 1e-30 -outfmt 11 -out $output_path/$SAMPLE\_PRY\_query_human_Y_prot_results_blastp_START_STOP.txt
blast_formatter -archive $output_path/$SAMPLE\_PRY\_query_human_Y_prot_results_blastp_START_STOP.txt -outfmt "6 qseqid sseqid qcovs length pident evalue bitscore mismatch gaps qstart qend sstart send qseq sseq" -out $output_path/$SAMPLE\_PRY\_query_human_Y_prot_START_STOP_tabular.txt
awk '!x[$2]++' $output_path/$SAMPLE\_PRY\_query_human_Y_prot_START_STOP_tabular.txt > $output_path/$SAMPLE\_PRY\_query_human_Y_prot_START_STOP_unique.txt
sort -rn -k4 $output_path/$SAMPLE\_PRY\_query_human_Y_prot_START_STOP_unique.txt > $output_path/$SAMPLE\_PRY\_query_human_Y_prot_START_STOP_unique_sorted.txt
sort -rn -k4 $output_path/$SAMPLE\_PRY\_query_human_Y_prot_START_STOP_tabular.txt > $output_path/$SAMPLE\_PRY\_query_human_Y_prot_START_STOP_tabular_sorted.txt
done
for SAMPLE in 1_1 1_2 2_1 2_2 3_1 3_2 4_1 4_2 5_1 5_2 6_1 6_2 7_1 7_2 8_1 8_2
do
getorf -sequence $SAMPLE_path/$SAMPLE/final_candidates_RBMY.fa -find 1 -minsize 150 -outseq $output_path/$SAMPLE\_RBMY\_50aa_and_more_orf_START_STOP.fasta
awk '/^>/ {printf("%s%s\t",(N>0?"\n":""),$0);N++;next;} {printf("%s",$0);} END {printf("\n");}' $output_path/$SAMPLE\_RBMY\_50aa_and_more_orf_START_STOP.fasta > $output_path/$SAMPLE\_RBMY\_50aa_and_more_orf_linearized_START_STOP.fasta
awk -F '\t' '{printf("%d\t%s\t%s\n",length($2),substr($1,1,15),$0);}' $output_path/$SAMPLE\_RBMY\_50aa_and_more_orf_linearized_START_STOP.fasta | sort -k2,2 -k1,1n | cut -f3,4 | tr "\t" "\n" > $output_path/$SAMPLE\_RBMY\_50aa_and_more_orf_sorted_START_STOP.fasta
getorf -sequence $SAMPLE_path/$SAMPLE/final_candidates_RBMY.fa -find 3 -minsize 150 -outseq $output_path/$SAMPLE\_RBMY\_50aa_and_more_orf_START_STOP_nuc.fasta
awk '/^>/ {printf("%s%s\t",(N>0?"\n":""),$0);N++;next;} {printf("%s",$0);} END {printf("\n");}' $output_path/$SAMPLE\_RBMY\_50aa_and_more_orf_START_STOP_nuc.fasta > $output_path/$SAMPLE\_RBMY\_50aa_and_more_orf_linearized_START_STOP_nuc.fasta
awk -F '\t' '{printf("%d\t%s\t%s\n",length($2),substr($1,1,15),$0);}' $output_path/$SAMPLE\_RBMY\_50aa_and_more_orf_linearized_START_STOP_nuc.fasta | sort -k2,2 -k1,1n | cut -f3,4 | tr "\t" "\n" > $output_path/$SAMPLE\_RBMY\_50aa_and_more_orf_sorted_START_STOP_nuc.fasta
makeblastdb -in $output_path/$SAMPLE\_RBMY\_50aa_and_more_orf_START_STOP.fasta -title pdbaa1 -dbtype prot -out $output_path/$SAMPLE\_RBMY\_pdbaa1 -parse_seqids
blastp -query $db_path/Ychr_proteins_with_XKRY_mod.fa -db $output_path/$SAMPLE\_RBMY\_pdbaa1 -evalue 1e-30 -outfmt 11 -out $output_path/$SAMPLE\_RBMY\_query_human_Y_prot_results_blastp_START_STOP.txt
blast_formatter -archive $output_path/$SAMPLE\_RBMY\_query_human_Y_prot_results_blastp_START_STOP.txt -outfmt "6 qseqid sseqid qcovs length pident evalue bitscore mismatch gaps qstart qend sstart send qseq sseq" -out $output_path/$SAMPLE\_RBMY\_query_human_Y_prot_START_STOP_tabular.txt
awk '!x[$2]++' $output_path/$SAMPLE\_RBMY\_query_human_Y_prot_START_STOP_tabular.txt > $output_path/$SAMPLE\_RBMY\_query_human_Y_prot_START_STOP_unique.txt
sort -rn -k4 $output_path/$SAMPLE\_RBMY\_query_human_Y_prot_START_STOP_unique.txt > $output_path/$SAMPLE\_RBMY\_query_human_Y_prot_START_STOP_unique_sorted.txt
sort -rn -k4 $output_path/$SAMPLE\_RBMY\_query_human_Y_prot_START_STOP_tabular.txt > $output_path/$SAMPLE\_RBMY\_query_human_Y_prot_START_STOP_tabular_sorted.txt
done
for SAMPLE in 1_1 1_2 2_1 2_2 3_1 3_2 4_1 4_2 5_1 5_2 6_1 6_2 7_1 7_2 8_1 8_2
do
getorf -sequence $SAMPLE_path/$SAMPLE/final_candidates_TSPY.fa -find 1 -minsize 150 -outseq $output_path/$SAMPLE\_TSPY\_50aa_and_more_orf_START_STOP.fasta
awk '/^>/ {printf("%s%s\t",(N>0?"\n":""),$0);N++;next;} {printf("%s",$0);} END {printf("\n");}' $output_path/$SAMPLE\_TSPY\_50aa_and_more_orf_START_STOP.fasta > $output_path/$SAMPLE\_TSPY\_50aa_and_more_orf_linearized_START_STOP.fasta
awk -F '\t' '{printf("%d\t%s\t%s\n",length($2),substr($1,1,15),$0);}' $output_path/$SAMPLE\_TSPY\_50aa_and_more_orf_linearized_START_STOP.fasta | sort -k2,2 -k1,1n | cut -f3,4 | tr "\t" "\n" > $output_path/$SAMPLE\_TSPY\_50aa_and_more_orf_sorted_START_STOP.fasta
getorf -sequence $SAMPLE_path/$SAMPLE/final_candidates_TSPY.fa -find 3 -minsize 150 -outseq $output_path/$SAMPLE\_TSPY\_50aa_and_more_orf_START_STOP_nuc.fasta
awk '/^>/ {printf("%s%s\t",(N>0?"\n":""),$0);N++;next;} {printf("%s",$0);} END {printf("\n");}' $output_path/$SAMPLE\_TSPY\_50aa_and_more_orf_START_STOP_nuc.fasta > $output_path/$SAMPLE\_TSPY\_50aa_and_more_orf_linearized_START_STOP_nuc.fasta
awk -F '\t' '{printf("%d\t%s\t%s\n",length($2),substr($1,1,15),$0);}' $output_path/$SAMPLE\_TSPY\_50aa_and_more_orf_linearized_START_STOP_nuc.fasta | sort -k2,2 -k1,1n | cut -f3,4 | tr "\t" "\n" > $output_path/$SAMPLE\_TSPY\_50aa_and_more_orf_sorted_START_STOP_nuc.fasta
makeblastdb -in $output_path/$SAMPLE\_TSPY\_50aa_and_more_orf_START_STOP.fasta -title pdbaa1 -dbtype prot -out $output_path/$SAMPLE\_TSPY\_pdbaa1 -parse_seqids
blastp -query $db_path/Ychr_proteins_with_XKRY_mod.fa -db $output_path/$SAMPLE\_TSPY\_pdbaa1 -evalue 1e-30 -outfmt 11 -out $output_path/$SAMPLE\_TSPY\_query_human_Y_prot_results_blastp_START_STOP.txt
blast_formatter -archive $output_path/$SAMPLE\_TSPY\_query_human_Y_prot_results_blastp_START_STOP.txt -outfmt "6 qseqid sseqid qcovs length pident evalue bitscore mismatch gaps qstart qend sstart send qseq sseq" -out $output_path/$SAMPLE\_TSPY\_query_human_Y_prot_START_STOP_tabular.txt
awk '!x[$2]++' $output_path/$SAMPLE\_TSPY\_query_human_Y_prot_START_STOP_tabular.txt > $output_path/$SAMPLE\_TSPY\_query_human_Y_prot_START_STOP_unique.txt
sort -rn -k4 $output_path/$SAMPLE\_TSPY\_query_human_Y_prot_START_STOP_unique.txt > $output_path/$SAMPLE\_TSPY\_query_human_Y_prot_START_STOP_unique_sorted.txt
sort -rn -k4 $output_path/$SAMPLE\_TSPY\_query_human_Y_prot_START_STOP_tabular.txt > $output_path/$SAMPLE\_TSPY\_query_human_Y_prot_START_STOP_tabular_sorted.txt
done
for SAMPLE in 1_1 1_2 2_1 2_2 3_1 3_2 4_1 4_2 5_1 5_2 6_1 6_2 7_1 7_2 8_1 8_2
do
getorf -sequence $SAMPLE_path/$SAMPLE/final_candidates_VCY_chimp_bonobo.fa -find 1 -minsize 150 -outseq $output_path/$SAMPLE\_VCY_chimp_bonobo\_50aa_and_more_orf_START_STOP.fasta
awk '/^>/ {printf("%s%s\t",(N>0?"\n":""),$0);N++;next;} {printf("%s",$0);} END {printf("\n");}' $output_path/$SAMPLE\_VCY_chimp_bonobo\_50aa_and_more_orf_START_STOP.fasta > $output_path/$SAMPLE\_VCY_chimp_bonobo\_50aa_and_more_orf_linearized_START_STOP.fasta
awk -F '\t' '{printf("%d\t%s\t%s\n",length($2),substr($1,1,15),$0);}' $output_path/$SAMPLE\_VCY_chimp_bonobo\_50aa_and_more_orf_linearized_START_STOP.fasta | sort -k2,2 -k1,1n | cut -f3,4 | tr "\t" "\n" > $output_path/$SAMPLE\_VCY_chimp_bonobo\_50aa_and_more_orf_sorted_START_STOP.fasta
getorf -sequence $SAMPLE_path/$SAMPLE/final_candidates_VCY_chimp_bonobo.fa -find 3 -minsize 150 -outseq $output_path/$SAMPLE\_VCY_chimp_bonobo\_50aa_and_more_orf_START_STOP_nuc.fasta
awk '/^>/ {printf("%s%s\t",(N>0?"\n":""),$0);N++;next;} {printf("%s",$0);} END {printf("\n");}' $output_path/$SAMPLE\_VCY_chimp_bonobo\_50aa_and_more_orf_START_STOP_nuc.fasta > $output_path/$SAMPLE\_VCY_chimp_bonobo\_50aa_and_more_orf_linearized_START_STOP_nuc.fasta
awk -F '\t' '{printf("%d\t%s\t%s\n",length($2),substr($1,1,15),$0);}' $output_path/$SAMPLE\_VCY_chimp_bonobo\_50aa_and_more_orf_linearized_START_STOP_nuc.fasta | sort -k2,2 -k1,1n | cut -f3,4 | tr "\t" "\n" > $output_path/$SAMPLE\_VCY_chimp_bonobo\_50aa_and_more_orf_sorted_START_STOP_nuc.fasta
makeblastdb -in $output_path/$SAMPLE\_VCY_chimp_bonobo\_50aa_and_more_orf_START_STOP.fasta -title pdbaa1 -dbtype prot -out $output_path/$SAMPLE\_VCY_chimp_bonobo\_pdbaa1 -parse_seqids
blastp -query $db_path/Ychr_proteins_with_XKRY_mod.fa -db $output_path/$SAMPLE\_VCY_chimp_bonobo\_pdbaa1 -evalue 1e-30 -outfmt 11 -out $output_path/$SAMPLE\_VCY_chimp_bonobo\_query_human_Y_prot_results_blastp_START_STOP.txt
blast_formatter -archive $output_path/$SAMPLE\_VCY_chimp_bonobo\_query_human_Y_prot_results_blastp_START_STOP.txt -outfmt "6 qseqid sseqid qcovs length pident evalue bitscore mismatch gaps qstart qend sstart send qseq sseq" -out $output_path/$SAMPLE\_VCY_chimp_bonobo\_query_human_Y_prot_START_STOP_tabular.txt
awk '!x[$2]++' $output_path/$SAMPLE\_VCY_chimp_bonobo\_query_human_Y_prot_START_STOP_tabular.txt > $output_path/$SAMPLE\_VCY_chimp_bonobo\_query_human_Y_prot_START_STOP_unique.txt
sort -rn -k4 $output_path/$SAMPLE\_VCY_chimp_bonobo\_query_human_Y_prot_START_STOP_unique.txt > $output_path/$SAMPLE\_VCY_chimp_bonobo\_query_human_Y_prot_START_STOP_unique_sorted.txt
sort -rn -k4 $output_path/$SAMPLE\_VCY_chimp_bonobo\_query_human_Y_prot_START_STOP_tabular.txt > $output_path/$SAMPLE\_VCY_chimp_bonobo\_query_human_Y_prot_START_STOP_tabular_sorted.txt
done
for SAMPLE in 1_1 1_2 2_1 2_2 3_1 3_2 4_1 4_2 5_1 5_2 6_1 6_2 7_1 7_2 8_1 8_2
do
getorf -sequence $SAMPLE_path/$SAMPLE/final_candidates_VCY_human.fa -find 1 -minsize 150 -outseq $output_path/$SAMPLE\_VCY_human\_50aa_and_more_orf_START_STOP.fasta
awk '/^>/ {printf("%s%s\t",(N>0?"\n":""),$0);N++;next;} {printf("%s",$0);} END {printf("\n");}' $output_path/$SAMPLE\_VCY_human\_50aa_and_more_orf_START_STOP.fasta > $output_path/$SAMPLE\_VCY_human\_50aa_and_more_orf_linearized_START_STOP.fasta
awk -F '\t' '{printf("%d\t%s\t%s\n",length($2),substr($1,1,15),$0);}' $output_path/$SAMPLE\_VCY_human\_50aa_and_more_orf_linearized_START_STOP.fasta | sort -k2,2 -k1,1n | cut -f3,4 | tr "\t" "\n" > $output_path/$SAMPLE\_VCY_human\_50aa_and_more_orf_sorted_START_STOP.fasta
getorf -sequence $SAMPLE_path/$SAMPLE/final_candidates_VCY_human.fa -find 3 -minsize 150 -outseq $output_path/$SAMPLE\_VCY_human\_50aa_and_more_orf_START_STOP_nuc.fasta
awk '/^>/ {printf("%s%s\t",(N>0?"\n":""),$0);N++;next;} {printf("%s",$0);} END {printf("\n");}' $output_path/$SAMPLE\_VCY_human\_50aa_and_more_orf_START_STOP_nuc.fasta > $output_path/$SAMPLE\_VCY_human\_50aa_and_more_orf_linearized_START_STOP_nuc.fasta
awk -F '\t' '{printf("%d\t%s\t%s\n",length($2),substr($1,1,15),$0);}' $output_path/$SAMPLE\_VCY_human\_50aa_and_more_orf_linearized_START_STOP_nuc.fasta | sort -k2,2 -k1,1n | cut -f3,4 | tr "\t" "\n" > $output_path/$SAMPLE\_VCY_human\_50aa_and_more_orf_sorted_START_STOP_nuc.fasta
makeblastdb -in $output_path/$SAMPLE\_VCY_human\_50aa_and_more_orf_START_STOP.fasta -title pdbaa1 -dbtype prot -out $output_path/$SAMPLE\_VCY_human\_pdbaa1 -parse_seqids
blastp -query $db_path/Ychr_proteins_with_XKRY_mod.fa -db $output_path/$SAMPLE\_VCY_human\_pdbaa1 -evalue 1e-30 -outfmt 11 -out $output_path/$SAMPLE\_VCY_human\_query_human_Y_prot_results_blastp_START_STOP.txt
blast_formatter -archive $output_path/$SAMPLE\_VCY_human\_query_human_Y_prot_results_blastp_START_STOP.txt -outfmt "6 qseqid sseqid qcovs length pident evalue bitscore mismatch gaps qstart qend sstart send qseq sseq" -out $output_path/$SAMPLE\_VCY_human\_query_human_Y_prot_START_STOP_tabular.txt
awk '!x[$2]++' $output_path/$SAMPLE\_VCY_human\_query_human_Y_prot_START_STOP_tabular.txt > $output_path/$SAMPLE\_VCY_human\_query_human_Y_prot_START_STOP_unique.txt
sort -rn -k4 $output_path/$SAMPLE\_VCY_human\_query_human_Y_prot_START_STOP_unique.txt > $output_path/$SAMPLE\_VCY_human\_query_human_Y_prot_START_STOP_unique_sorted.txt
sort -rn -k4 $output_path/$SAMPLE\_VCY_human\_query_human_Y_prot_START_STOP_tabular.txt > $output_path/$SAMPLE\_VCY_human\_query_human_Y_prot_START_STOP_tabular_sorted.txt
done
for SAMPLE in 1_1 1_2 2_1 2_2 3_1 3_2 4_1 4_2 5_1 5_2 6_1 6_2 7_1 7_2 8_1 8_2
do
getorf -sequence $SAMPLE_path/$SAMPLE/final_candidates_XKRY.fa -find 1 -minsize 150 -outseq $output_path/$SAMPLE\_XKRY\_50aa_and_more_orf_START_STOP.fasta
awk '/^>/ {printf("%s%s\t",(N>0?"\n":""),$0);N++;next;} {printf("%s",$0);} END {printf("\n");}' $output_path/$SAMPLE\_XKRY\_50aa_and_more_orf_START_STOP.fasta > $output_path/$SAMPLE\_XKRY\_50aa_and_more_orf_linearized_START_STOP.fasta
awk -F '\t' '{printf("%d\t%s\t%s\n",length($2),substr($1,1,15),$0);}' $output_path/$SAMPLE\_XKRY\_50aa_and_more_orf_linearized_START_STOP.fasta | sort -k2,2 -k1,1n | cut -f3,4 | tr "\t" "\n" > $output_path/$SAMPLE\_XKRY\_50aa_and_more_orf_sorted_START_STOP.fasta
getorf -sequence $SAMPLE_path/$SAMPLE/final_candidates_XKRY.fa -find 3 -minsize 150 -outseq $output_path/$SAMPLE\_XKRY\_50aa_and_more_orf_START_STOP_nuc.fasta
awk '/^>/ {printf("%s%s\t",(N>0?"\n":""),$0);N++;next;} {printf("%s",$0);} END {printf("\n");}' $output_path/$SAMPLE\_XKRY\_50aa_and_more_orf_START_STOP_nuc.fasta > $output_path/$SAMPLE\_XKRY\_50aa_and_more_orf_linearized_START_STOP_nuc.fasta
awk -F '\t' '{printf("%d\t%s\t%s\n",length($2),substr($1,1,15),$0);}' $output_path/$SAMPLE\_XKRY\_50aa_and_more_orf_linearized_START_STOP_nuc.fasta | sort -k2,2 -k1,1n | cut -f3,4 | tr "\t" "\n" > $output_path/$SAMPLE\_XKRY\_50aa_and_more_orf_sorted_START_STOP_nuc.fasta
makeblastdb -in $output_path/$SAMPLE\_XKRY\_50aa_and_more_orf_START_STOP.fasta -title pdbaa1 -dbtype prot -out $output_path/$SAMPLE\_XKRY\_pdbaa1 -parse_seqids
blastp -query $db_path/Ychr_proteins_with_XKRY_mod.fa -db $output_path/$SAMPLE\_XKRY\_pdbaa1 -evalue 1e-30 -outfmt 11 -out $output_path/$SAMPLE\_XKRY\_query_human_Y_prot_results_blastp_START_STOP.txt
blast_formatter -archive $output_path/$SAMPLE\_XKRY\_query_human_Y_prot_results_blastp_START_STOP.txt -outfmt "6 qseqid sseqid qcovs length pident evalue bitscore mismatch gaps qstart qend sstart send qseq sseq" -out $output_path/$SAMPLE\_XKRY\_query_human_Y_prot_START_STOP_tabular.txt
awk '!x[$2]++' $output_path/$SAMPLE\_XKRY\_query_human_Y_prot_START_STOP_tabular.txt > $output_path/$SAMPLE\_XKRY\_query_human_Y_prot_START_STOP_unique.txt
sort -rn -k4 $output_path/$SAMPLE\_XKRY\_query_human_Y_prot_START_STOP_unique.txt > $output_path/$SAMPLE\_XKRY\_query_human_Y_prot_START_STOP_unique_sorted.txt
sort -rn -k4 $output_path/$SAMPLE\_XKRY\_query_human_Y_prot_START_STOP_tabular.txt > $output_path/$SAMPLE\_XKRY\_query_human_Y_prot_START_STOP_tabular_sorted.txt
done