Skip to content

Commit

Permalink
Merge pull request #85 from theiagen/smw-nextcladeauguradd-dev
Browse files Browse the repository at this point in the history
Add nextclade_clade to Augur_Prep
  • Loading branch information
kevinlibuit authored Jun 9, 2023
2 parents 5f157af + d0463d0 commit 4019ee3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tasks/utilities/task_augur_utilities.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ task prep_augur_metadata {
String county = ""
String? pango_lineage
String? nextclade_clade
String? organism = "sars-cov-2"
Int disk_size = 10
Expand All @@ -343,11 +344,16 @@ task prep_augur_metadata {
assembly_header=$(grep -e ">" ~{assembly} | sed 's/\s.*$//' | sed 's/>//g' )
pangolin_header=""
nextclade_header=""
# if pango_lineage defined, add to metadata
if [[ "~{pango_lineage}" ]]; then
pangolin_header="pango_lineage"
fi
# if pango_lineage defined, add to metadata
if [[ "~{nextclade_clade}" ]]; then
nextclade_header="pango_lineage"
fi
if [[ "~{organism}" == "sars-cov-2" ]]; then
virus="ncov"
Expand All @@ -356,8 +362,8 @@ task prep_augur_metadata {
fi
# write everything to a file
echo -e "strain\tvirus\tdate\tregion\tcountry\tdivision\tlocation\t${pangolin_header}" > augur_metadata.tsv
echo -e "\"${assembly_header}\"\t\"${virus}\"\t\"~{collection_date}\"\t\"~{continent}\"\t\"~{country}\"\t\"~{state}\"\t\"~{county}\"\t\"~{pango_lineage}\"" >> augur_metadata.tsv
echo -e "strain\tvirus\tdate\tregion\tcountry\tdivision\tlocation\t${pangolin_header}\t${nextclade_header}" > augur_metadata.tsv
echo -e "\"${assembly_header}\"\t\"${virus}\"\t\"~{collection_date}\"\t\"~{continent}\"\t\"~{country}\"\t\"~{state}\"\t\"~{county}\"\t\"~{pango_lineage}\"\t\"~{nextclade_clade}\"" >> augur_metadata.tsv
>>>
output {
File augur_metadata = "augur_metadata.tsv"
Expand Down
2 changes: 2 additions & 0 deletions workflows/phylogenetics/wf_augur_prep.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ workflow augur_prep {
String state
String continent
String? pango_lineage
String? nextclade_clade
String? county
}
call augur_utils.prep_augur_metadata {
Expand All @@ -21,6 +22,7 @@ workflow augur_prep {
state = state,
continent = continent,
pango_lineage = pango_lineage,
nextclade_clade = nextclade_clade,
county = county
}
call versioning.version_capture {
Expand Down

0 comments on commit 4019ee3

Please sign in to comment.