-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #184 from broadinstitute/dp-clades
add new sarscov2_lineages workflow and travis cleanups
- Loading branch information
Showing
19 changed files
with
153 additions
and
471 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
version 1.0 | ||
|
||
task nextclade_one_sample { | ||
meta { | ||
description: "Nextclade classification of one sample. Leaving optional inputs unspecified will use SARS-CoV-2 defaults." | ||
} | ||
input { | ||
File genome_fasta | ||
File? root_sequence | ||
File? auspice_reference_tree_json | ||
File? qc_config_json | ||
File? gene_annotations_json | ||
File? pcr_primers_csv | ||
} | ||
String basename = basename(genome_fasta, ".fasta") | ||
command { | ||
set -e | ||
nextclade.js --version > VERSION | ||
nextclade.js \ | ||
--input-fasta "~{genome_fasta}" \ | ||
~{"--input-root-seq " + root_sequence} \ | ||
~{"--input-tree " + auspice_reference_tree_json} \ | ||
~{"--input-qc-config " + qc_config_json} \ | ||
~{"--input-gene-map " + gene_annotations_json} \ | ||
~{"--input-pcr-primers " + pcr_primers_csv} \ | ||
--output-json "~{basename}".nextclade.json \ | ||
--output-tsv "~{basename}".nextclade.tsv \ | ||
--output-tree "~{basename}".nextclade.auspice.json | ||
cp "~{basename}".nextclade.tsv input.tsv | ||
python3 <<CODE | ||
# transpose table | ||
with open('input.tsv', 'rt') as inf: | ||
with open('transposed.tsv', 'wt') as outf: | ||
for c in zip(*(l.rstrip().split('\t') for l in inf)): | ||
outf.write('\t'.join(c)+'\n') | ||
CODE | ||
} | ||
runtime { | ||
docker: "neherlab/nextclade:0.10.0" | ||
memory: "3 GB" | ||
cpu: 2 | ||
disks: "local-disk 50 HDD" | ||
dx_instance_type: "mem1_ssd1_v2_x2" | ||
} | ||
output { | ||
String nextclade_version = read_string("VERSION") | ||
File nextclade_json = "~{basename}.nextclade.json" | ||
File auspice_json = "~{basename}.nextclade.auspice.json" | ||
File nextclade_tsv = "~{basename}.nextclade.tsv" | ||
String nextclade_clade = read_map("transposed.tsv")["clade"] | ||
} | ||
} | ||
task pangolin_one_sample { | ||
meta { | ||
description: "Pangolin classification of one SARS-CoV-2 sample." | ||
} | ||
input { | ||
File genome_fasta | ||
Int? min_length | ||
Float? max_ambig | ||
Boolean include_putative = true | ||
} | ||
String basename = basename(genome_fasta, ".fasta") | ||
command { | ||
set -e | ||
pangolin -v > VERSION_PANGOLIN | ||
pangolin -lv > VERSION_LINEAGES | ||
pangolin -pv > VERSION_PANGOLEARN | ||
pangolin "~{genome_fasta}" \ | ||
--outfile "~{basename}.pangolin_report.csv" \ | ||
-t "$(nproc)" \ | ||
--include-putative \ | ||
~{"--min-length " + min_length} \ | ||
~{"--max-ambig " + max_ambig} \ | ||
~{true="--include-putative" false="" include_putative} \ | ||
--verbose | ||
cp "~{basename}.pangolin_report.csv" input.csv | ||
python3 <<CODE | ||
# transpose table and convert csv to tsv | ||
with open('input.csv', 'rt') as inf: | ||
with open('transposed.tsv', 'wt') as outf: | ||
for c in zip(*(l.rstrip().split(',') for l in inf)): | ||
outf.write('\t'.join(c)+'\n') | ||
CODE | ||
} | ||
runtime { | ||
docker: "staphb/pangolin:2.1.1" | ||
memory: "3 GB" | ||
cpu: 2 | ||
disks: "local-disk 50 HDD" | ||
dx_instance_type: "mem1_ssd1_v2_x2" | ||
} | ||
output { | ||
String pangolin_version = read_string("VERSION_PANGOLIN") | ||
String lineages_version = read_string("VERSION_LINEAGES") | ||
String pangolearn_version = read_string("VERSION_PANGOLEARN") | ||
File pangolin_csv = "~{basename}.pangolin_report.csv" | ||
String pangolin_clade = read_map("transposed.tsv")["lineage"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
version 1.0 | ||
|
||
import "../tasks/tasks_sarscov2.wdl" as sarscov2 | ||
|
||
workflow sarscov2_lineages { | ||
meta { | ||
description: "Call Nextclade and Pangolin lineages on a single SARS-CoV-2 genome" | ||
} | ||
|
||
input { | ||
File genome_fasta | ||
} | ||
|
||
call sarscov2.nextclade_one_sample { | ||
input: | ||
genome_fasta = genome_fasta | ||
} | ||
|
||
call sarscov2.pangolin_one_sample { | ||
input: | ||
genome_fasta = genome_fasta | ||
} | ||
|
||
output { | ||
String nextclade_clade = nextclade_one_sample.nextclade_clade | ||
File nextclade_tsv = nextclade_one_sample.nextclade_tsv | ||
String pangolin_clade = pangolin_one_sample.pangolin_clade | ||
File pangolin_csv = pangolin_one_sample.pangolin_csv | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.