-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnew_designation.sh
executable file
·32 lines (25 loc) · 1.14 KB
/
new_designation.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
#! /bin/bash
set -e
#command line inputs
echo "What is the name of the folder containing your sequences and metadata?"
read runname
#make sure the metadata is named to work in future script
mv -vn $runname/*.csv $runname/$runname"_metadata.csv"
#alignment
mkdir $runname/Alignment
mafft $runname/*.fasta > $runname/$runname"_aligned.fasta"
mv $runname/$runname"_aligned.fasta" $runname/Alignment
#mafft sometimes messes names up so they don't match the tree, in case this happens have this line (though will need to fix later):
awk '{sub(/,/,"_")}1' $runname/Alignment/$runname"_aligned.fasta" > temp.fasta && mv temp.fasta $runname/Alignment/$runname"_aligned.fasta"
#IQTree
mkdir $runname/Trees
iqtree -s $runname/Alignment/$runname"_aligned.fasta" -B 1000
mv $runname/Alignment/$runname"_aligned.fasta."* $runname/Trees
#Timetree
mkdir $runname/Timetree
treetime ancestral --aln $runname/Alignment/$runname"_aligned.fasta" --tree $runname/Trees/$runname"_aligned.fasta.contree" --outdir $runname/Timetree
#Lineage assignment
mkdir $runname/Outputs
mkdir $runname/Figures
Rscript Run/run_designation.R $runname
rm -r $runname/Figures/$runname"_sunburst_files/"