Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

augur pipelines #151

Merged
merged 4 commits into from
Aug 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .dockstore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ workflows:
primaryDescriptorPath: /pipes/WDL/workflows/assemble_refbased.wdl
testParameterFiles:
- /test/input/WDL/test_inputs-assemble_refbased-local.json
- name: augur_export_only
subclass: WDL
primaryDescriptorPath: /pipes/WDL/workflows/augur_export_only.wdl
testParameterFiles:
- empty.json
- name: augur_from_assemblies
subclass: WDL
primaryDescriptorPath: /pipes/WDL/workflows/augur_from_assemblies.wdl
Expand All @@ -35,14 +40,14 @@ workflows:
primaryDescriptorPath: /pipes/WDL/workflows/augur_from_beast_mcc.wdl
testParameterFiles:
- /test/input/WDL/test_inputs-augur_from_beast_mcc-local.json
- name: augur_from_msa
- name: augur_from_mltree
subclass: WDL
primaryDescriptorPath: /pipes/WDL/workflows/augur_from_msa.wdl
primaryDescriptorPath: /pipes/WDL/workflows/augur_from_mltree.wdl
testParameterFiles:
- empty.json
- name: augur_from_newick
- name: augur_from_msa
subclass: WDL
primaryDescriptorPath: /pipes/WDL/workflows/augur_from_newick.wdl
primaryDescriptorPath: /pipes/WDL/workflows/augur_from_msa.wdl
testParameterFiles:
- empty.json
- name: bams_multiqc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version 1.0

import "../tasks/tasks_nextstrain.wdl" as nextstrain

workflow augur_from_newick {
workflow augur_export_only {
meta {
description: "Convert a newick formatted phylogenetic tree into a json suitable for auspice visualization. See https://nextstrain-augur.readthedocs.io/en/stable/usage/cli/export.html"
author: "Broad Viral Genomics"
Expand Down
109 changes: 109 additions & 0 deletions pipes/WDL/workflows/augur_from_mltree.wdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
version 1.0

import "../tasks/tasks_nextstrain.wdl" as nextstrain

workflow augur_from_mltree {
meta {
description: "Take a premade maximum likelihood tree (Newick format) and run the remainder of the augur pipeline (timetree modificaitons, ancestral inference, etc) and convert to json representation suitable for Nextstrain visualization. See https://nextstrain.org/docs/getting-started/ and https://nextstrain-augur.readthedocs.io/en/stable/"
author: "Broad Viral Genomics"
email: "[email protected]"
}

input {
File raw_tree
File msa_or_vcf
File sample_metadata
File ref_fasta
File genbank_gb
File auspice_config
File? clades_tsv
Array[String]? ancestral_traits_to_infer
}

parameter_meta {
raw_tree: {
description: "Maximum likelihood tree (newick format).",
patterns: ["*.nwk", "*.newick"]
}
msa_or_vcf: {
description: "Multiple sequence alignment (aligned fasta) or variants (vcf format).",
patterns: ["*.fasta", "*.fa", "*.vcf", "*.vcf.gz"]
}
sample_metadata: {
description: "Metadata in tab-separated text format. See https://nextstrain-augur.readthedocs.io/en/stable/faq/metadata.html for details.",
patterns: ["*.txt", "*.tsv"]
}
ref_fasta: {
description: "A reference assembly (not included in assembly_fastas) to align assembly_fastas against. Typically from NCBI RefSeq or similar.",
patterns: ["*.fasta", "*.fa"]
}
genbank_gb: {
description: "A 'genbank' formatted gene annotation file that is used to calculate coding consequences of observed mutations. Must correspond to the same coordinate space as ref_fasta. Typically downloaded from the same NCBI accession number as ref_fasta.",
patterns: ["*.gb", "*.gbf"]
}
ancestral_traits_to_infer: {
description: "A list of metadata traits to use for ancestral node inference (see https://nextstrain-augur.readthedocs.io/en/stable/usage/cli/traits.html). Multiple traits may be specified; must correspond exactly to column headers in metadata file. Omitting these values will skip ancestral trait inference, and ancestral nodes will not have estimated values for metadata."
}
auspice_config: {
description: "A file specifying options to customize the auspice export; see: https://nextstrain.github.io/auspice/customise-client/introduction",
patterns: ["*.json", "*.txt"]
}
clades_tsv: {
description: "A TSV file containing clade mutation positions in four columns: [clade gene site alt]; see: https://nextstrain.org/docs/tutorials/defining-clades",
patterns: ["*.tsv", "*.txt"]
}
}

call nextstrain.refine_augur_tree {
input:
raw_tree = raw_tree,
msa_or_vcf = msa_or_vcf,
metadata = sample_metadata
}
if(defined(ancestral_traits_to_infer) && length(select_first([ancestral_traits_to_infer,[]]))>0) {
call nextstrain.ancestral_traits {
input:
tree = refine_augur_tree.tree_refined,
metadata = sample_metadata,
columns = select_first([ancestral_traits_to_infer,[]])
}
}
call nextstrain.ancestral_tree {
input:
tree = refine_augur_tree.tree_refined,
msa_or_vcf = msa_or_vcf
}
call nextstrain.translate_augur_tree {
input:
tree = refine_augur_tree.tree_refined,
nt_muts = ancestral_tree.nt_muts_json,
genbank_gb = genbank_gb
}
if(defined(clades_tsv)) {
call nextstrain.assign_clades_to_nodes {
input:
tree_nwk = refine_augur_tree.tree_refined,
nt_muts_json = ancestral_tree.nt_muts_json,
aa_muts_json = translate_augur_tree.aa_muts_json,
ref_fasta = ref_fasta,
clades_tsv = select_first([clades_tsv])
}
}
call nextstrain.export_auspice_json {
input:
tree = refine_augur_tree.tree_refined,
sample_metadata = sample_metadata,
node_data_jsons = select_all([
refine_augur_tree.branch_lengths,
ancestral_traits.node_data_json,
ancestral_tree.nt_muts_json,
translate_augur_tree.aa_muts_json,
assign_clades_to_nodes.node_clade_data_json]),
auspice_config = auspice_config
}

output {
File time_tree = refine_augur_tree.tree_refined
File auspice_input_json = export_auspice_json.virus_json
}
}