-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathphylo.sh
51 lines (34 loc) · 853 Bytes
/
phylo.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
#!/bin/bash
# scripts to reproduce the analysis and figures from Bai et al., 2015
#
# originally by Ruben Garrido-Oter
# exits whenever a function returns 1
set -e
# parse arguments
config_file="$1"
# check paths file
if [ ! -f $config_file ]
then
echo "invalid config file"
return 1
fi
# load paths
source $config_file
# load functions
source phylo.functions.sh
# cleanup
rm -f $working_dir/amphora_all.ffn
# extract sequences, align and build tree
genome_list=$(cut -f 1 $data_dir/mapping.txt | grep -v "ID")
amphora_list=$(cat $path_to_db/amphora/amphora_list.txt)
# for each genome in the mapping file
for genome_id in $genome_list
do
getAmphoraGenes $genome_id
done
alignAmphoraSeqs
concatenateAmphoraSeqs
buildMLTree
./phylo.R $mapping_file $working_dir/amphora.tree $working_dir
log "DONE!"