-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcurate_pipeline.sh
More file actions
26 lines (22 loc) · 1.21 KB
/
curate_pipeline.sh
File metadata and controls
26 lines (22 loc) · 1.21 KB
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
#!/bin/bash
for f in * #loops through all of the files in the working directory
do
GENENAME="$f"
echo $GENENAME
if [ -d $f ];then #check if the files is actually a directory. all the genes should have their own directory. no other directories should be present.
cd $f
for files in *
do
# echo "$files"
if [[ "$files" == *"protein"* ]];then ###the program will run mafft, pal2nal, and iqtree as long as the appropriate file "protein_*genename*_final.fasta" is in the directory
mafft --localpair --maxiterate 1000 --amino "$files" > "aligned_$files"
perl /home/leann/lib/pal2nal.v14/pal2nal.pl "aligned_$files" "${GENENAME}.fa" -output fasta > "nuc_${GENENAME}_aligned.fasta"
iqtree -s "nuc_${GENENAME}_aligned.fasta" -nt 3
# perl /home/leann/lib/Fasta2Phylip.pl "nuc_${GENENAME}_aligned.fasta" "nuc_${GENENAME}_aligned.phy" #this transform the fasta alignment into a phylip file for codeml
python /home/leann/lib/longevity_dnds/scripts/fasta2phy.py "nuc_${GENENAME}_aligned.fasta" > "nuc_${GENENAME}_aligned.phy"
cp "nuc_${GENENAME}_aligned.fasta.treefile" /home/leann/lib/single_copy_dnds/run2_treefiles/"${GENENAME}_tree.nwk"
fi
done
cd ..
fi
done