Skip to content

Commit

Permalink
update shell script
Browse files Browse the repository at this point in the history
  • Loading branch information
yilin xu authored and yilin xu committed Jan 17, 2021
1 parent 40428a8 commit 2c1a636
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ copy credentials.json gen3-augur/config
## Using Conda
An `environment.yml` file is provided and can be used to build a virtual environment containing all dependencies. Create the environment using:
```
conda env create -f enviroment.yml
conda env create -f environment.yml
```
Then activate the environment for use:
```
Expand Down
4 changes: 4 additions & 0 deletions config/credentials.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"api_key": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6ImZlbmNlX2tleV8yMDIwLTAzLTE4VDE4OjIwOjI3WiJ9.eyJwdXIiOiJhcGlfa2V5IiwiYXVkIjpbImRhdGEiLCJ1c2VyIiwiZmVuY2UiLCJvcGVuaWQiXSwic3ViIjoiMjkiLCJpc3MiOiJodHRwczovL2NoaWNhZ29sYW5kLnBhbmRlbWljcmVzcG9uc2Vjb21tb25zLm9yZy91c2VyIiwiaWF0IjoxNjEwOTIyNzY0LCJleHAiOjE2MTM1MTQ3NjQsImp0aSI6ImU5YzZmZTU3LTNlZjUtNDNhZi04MjRiLWM4MTc3ODhjMjdiYyIsImF6cCI6IiJ9.TFJ11LtZ4RRM6WTnO4k1P1z0cPrm-nEI0eE1sr6F45VFY9g4ohFcEASJEzUOzdmIqsF0JlHj9RhPvvRlxejxhZSS1Zd9OWvCvZfUE5DRFqWR8hCAbto00Th0H3qf_mwXNI6rw2oDCJ-YgH13KX0xQA7ANgaa99LQX_B0fTaTZTijZd1YAPxSAQXJwp4uhlMsR94ldDao4YDVJSPU5kae96QvMY5kNxeOkSmFR65DCky7RiPXvZx2K4vyPDdZ89oir81wWBedtZ7wW3g8GFcUdNsUsXY8OLbPM8XOicdk6e-i4KRCgfrk2nU5BiqyE8-A78op_LUGUygytq_U8dPI9Q",
"key_id": "e9c6fe57-3ef5-43af-824b-c817788c27bc"
}
41 changes: 41 additions & 0 deletions gen3-augur-fasta.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/sh
set -ex

today=$(date +'%m%d%y')

# Run Augur pipeline
# Filter
echo "Filter fasta files"
augur filter --sequences data/covid19_Gagnon_Chicago_${today}.fasta --metadata data/covid19_Gagnon_Chicago_${today}.csv --output results/covid19_${today}_filter.fasta &&

# Alignment(default mafft tool)
echo "Run alignment"
augur align --sequences results/covid19_${today}_filter.fasta --reference-sequence config/sequence.gb --output results/covid19_${today}_aligned.fasta --fill-gaps --nthreads auto &&

# Create raw tree
echo "Create raw tree"
augur tree --alignment results/covid19_${today}_aligned.fasta --output results/covid19_${today}_tree_raw.nwk --nthreads auto &&

# Refine tree
echo "Refine tree"
augur refine --tree results/covid19_${today}_tree_raw.nwk --alignment results/covid19_${today}_aligned.fasta --metadata data/covid19_Gagnon_Chicago_${today}.csv --output-tree results/covid19_${today}_tree.nwk --output-node-data results/covid19_${today}_branch_lengths.json --timetree --coalescent opt --date-confidence --date-inference marginal --clock-filter-iqd 4 &&

# Refine traits
echo "Refine traits"
augur traits --tree results/covid19_${today}_tree.nwk --metadata data/covid19_Gagnon_Chicago_${today}.csv --output results/covid19_${today}_traits.json --columns location --confidence &&

# Ancestry Inference
echo "Infer ancestry"
augur ancestral --tree results/covid19_${today}_tree.nwk --alignment results/covid19_${today}_aligned.fasta --output-node-data results/covid19_${today}_nt_muts.json --inference joint &&

# Mutation Translate
echo "Mutation translation"
augur translate --tree results/covid19_${today}_tree.nwk --ancestral-sequences results/covid19_${today}_nt_muts.json --reference-sequence config/sequence.gb --output results/covid19_${today}_aa_muts.json &&

# Labeling clades as specified in config/clades.tsv
augur clades --tree results/covid19_${today}_tree.nwk --mutations results/covid19_${today}_nt_muts.json results/covid19_${today}_aa_muts.json --clades config/clades.tsv --output results/covid19_${today}_clade.json


# Export json
echo "Export json"
augur export v2 --tree results/covid19_${today}_tree.nwk --metadata data/covid19_Gagnon_Chicago_${today}.csv --node-data results/covid19_${today}_branch_lengths.json results/covid19_${today}_traits.json results/covid19_${today}_nt_muts.json results/covid19_${today}_aa_muts.json results/covid19_${today}_clade.json --colors config/color_schemes.tsv --lat-longs config/latitude_longitude.tsv --auspice-config config/auspice_config.json --output auspice/covid19_${today}.json
5 changes: 4 additions & 1 deletion gen3-augur.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ augur ancestral --tree results/covid19_${today}_tree.nwk --alignment results/cov
echo "Mutation translation"
augur translate --tree results/covid19_${today}_tree.nwk --ancestral-sequences results/covid19_${today}_nt_muts.json --reference-sequence config/sequence.gb --output results/covid19_${today}_aa_muts.json &&

# Labeling clades as specified in config/clades.tsv
augur clades --tree results/covid19_${today}_tree.nwk --mutations results/covid19_${today}_nt_muts.json results/covid19_${today}_aa_muts.json --clades config/clades.tsv --output results/covid19_${today}_clade.json

# Export json
echo "Export json"
augur export v2 --tree results/covid19_${today}_tree.nwk --metadata data/covid19_${today}_genbank.csv --node-data results/covid19_${today}_branch_lengths.json results/covid19_${today}_traits.json results/covid19_${today}_nt_muts.json results/covid19_${today}_aa_muts.json --colors config/color_schemes.tsv --lat-longs config/latitude_longitude.tsv --auspice-config config/auspice_config.json --output auspice/covid19_${today}.json
augur export v2 --tree results/covid19_${today}_tree.nwk --metadata data/covid19_${today}_genbank.csv --node-data results/covid19_${today}_branch_lengths.json results/covid19_${today}_traits.json results/covid19_${today}_nt_muts.json results/covid19_${today}_aa_muts.json results/covid19_${today}_clade.json --colors config/color_schemes.tsv --lat-longs config/latitude_longitude.tsv --auspice-config config/auspice_config.json --output auspice/covid19_${today}.json

0 comments on commit 2c1a636

Please sign in to comment.