Skip to content

Commit

Permalink
Merge branch 'main' into smw-gha-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinlibuit committed Jul 19, 2023
2 parents e53b862 + 40d89f8 commit 5e6fcf9
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 39 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/pytest-workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ jobs:
# For every workflow, test it with MiniWDL and Cromwell
tag: ["${{ fromJson(needs.changes.outputs.workflows) }}"]
engine: ["miniwdl", "cromwell"]
exclude:
- tag: "wf_theiacov_illumina_pe"
engine: "miniwdl"
- tag: "wf_theiacov_illumina_se"
engine: "miniwdl"
defaults:
run:
# Play nicely with miniconda
Expand Down
2 changes: 1 addition & 1 deletion tasks/phylogenetic_inference/task_lyveset.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ task lyveset {
Array[File] read2
File reference_genome
String dataset_name
String docker_image = "quay.io/staphb/lyveset:1.1.4f"
String docker_image = "staphb/lyveset:1.1.4f"
Int memory = 64
Int cpu = 16
Int disk_size = 100
Expand Down
54 changes: 23 additions & 31 deletions tasks/taxon_id/task_nextclade.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -91,45 +91,41 @@ task nextclade_output_parser {
tamiflu_aa_subs = tamiflu_aa_subs + "~{tamiflu_aa_substitutions}".split(',')
print(tamiflu_aa_subs)
def intersection(lst1, lst2):
# returns intersection between nextclade identified aa substitutions and
# tamiflu associated aa substitutions
return list(set(lst1) & set(lst2))
with codecs.open("./input.tsv",'r') as tsv_file:
tsv_reader=csv.reader(tsv_file, delimiter="\t")
tsv_data=list(tsv_reader)
tsv_reader = csv.reader(tsv_file, delimiter="\t")
tsv_data = list(tsv_reader)
if len(tsv_data)==1:
if len(tsv_data) == 1:
tsv_data.append(['NA']*len(tsv_data[0]))
tsv_dict=dict(zip(tsv_data[0], tsv_data[1]))
tsv_dict = dict(zip(tsv_data[0], tsv_data[1]))
# parse 'clade_legacy' column if sars-cov-2, if false then parse 'clade' column
# combine 'clade_nextstrain' and 'clade_who' column if sars-cov-2, if false then parse 'clade' column
if ("~{organism}" == "sars-cov-2"):
with codecs.open("NEXTCLADE_CLADE", 'wt') as Nextclade_Clade:
nc_clade=tsv_dict['clade_legacy']
if nc_clade=='':
nc_clade='NA'
else:
nc_clade=nc_clade
nc_clade = tsv_dict['clade_nextstrain']
who_clade = tsv_dict['clade_who']
if (nc_clade != who_clade) and (nc_clade != '') and (who_clade != ''):
nc_clade = nc_clade + " (" + who_clade + ")"
if nc_clade == '':
nc_clade = 'NA'
Nextclade_Clade.write(nc_clade)
else:
with codecs.open("NEXTCLADE_CLADE", 'wt') as Nextclade_Clade:
nc_clade=tsv_dict['clade']
if nc_clade=='':
nc_clade='NA'
else:
nc_clade=nc_clade
nc_clade = tsv_dict['clade']
if nc_clade == '':
nc_clade = 'NA'
Nextclade_Clade.write(nc_clade)
with codecs.open("NEXTCLADE_AASUBS", 'wt') as Nextclade_AA_Subs:
nc_aa_subs=tsv_dict['aaSubstitutions']
if nc_aa_subs=='':
nc_aa_subs='NA'
nc_aa_subs = tsv_dict['aaSubstitutions']
if nc_aa_subs == '':
nc_aa_subs = 'NA'
else:
nc_aa_subs=nc_aa_subs
# if organism is flu, return list of aa subs associated with tamiflu resistance
if ("~{organism}" == "flu" and "~{NA_segment}" == "true"):
tamiflu_subs = intersection(tamiflu_aa_subs, nc_aa_subs.split(','))
Expand All @@ -138,22 +134,18 @@ task nextclade_output_parser {
Nextclade_AA_Subs.write(nc_aa_subs)
with codecs.open("NEXTCLADE_AADELS", 'wt') as Nextclade_AA_Dels:
nc_aa_dels=tsv_dict['aaDeletions']
if nc_aa_dels=='':
nc_aa_dels='NA'
else:
nc_aa_dels=nc_aa_dels
nc_aa_dels = tsv_dict['aaDeletions']
if nc_aa_dels == '':
nc_aa_dels = 'NA'
Nextclade_AA_Dels.write(nc_aa_dels)
with codecs.open("NEXTCLADE_LINEAGE", 'wt') as Nextclade_Lineage:
if 'lineage' in tsv_dict:
nc_lineage=tsv_dict['lineage']
nc_lineage = tsv_dict['lineage']
if nc_lineage is None:
nc_lineage=""
else:
nc_lineage=nc_lineage
nc_lineage = ""
else:
nc_lineage=""
nc_lineage = ""
Nextclade_Lineage.write(nc_lineage)
CODE
>>>
Expand Down
4 changes: 2 additions & 2 deletions tests/workflows/theiacov/test_wf_theiacov_clearlabs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@
- path: miniwdl_run/call-nextclade/task.log
contains: ["wdl", "theiacov_clearlabs", "nextclade", "done"]
- path: miniwdl_run/call-nextclade/work/NEXTCLADE_VERSION
md5sum: d5f4e83525024cba7eb7489cd5209e7d
md5sum: 91a455762183b41af0d8de5596e28e7f
- path: miniwdl_run/call-nextclade/work/_miniwdl_inputs/0/clearlabs.medaka.consensus.fasta
md5sum: d41d8cd98f00b204e9800998ecf8427e
- path: miniwdl_run/call-nextclade/work/clearlabs.medaka.consensus.nextclade.auspice.json
Expand Down Expand Up @@ -276,7 +276,7 @@
- path: miniwdl_run/call-nextclade/work/nextclade_gene_S.translation.fasta
md5sum: 0ce44a0a8e2784ca4b3e8d8f03211813
- path: miniwdl_run/call-nextclade_output_parser/command
md5sum: 15e4d72fff3a4e2b81ce30a4668266f0
md5sum: a01b0a826425399bc59854b7c74acb1e
- path: miniwdl_run/call-nextclade_output_parser/inputs.json
contains: ["nextclade_tsv", "tsv"]
- path: miniwdl_run/call-nextclade_output_parser/outputs.json
Expand Down
4 changes: 2 additions & 2 deletions tests/workflows/theiacov/test_wf_theiacov_fasta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
- path: miniwdl_run/call-nextclade/stdout.txt
- path: miniwdl_run/call-nextclade/task.log
- path: miniwdl_run/call-nextclade/work/NEXTCLADE_VERSION
md5sum: d5f4e83525024cba7eb7489cd5209e7d
md5sum: 91a455762183b41af0d8de5596e28e7f
- path: miniwdl_run/call-nextclade/work/_miniwdl_inputs/0/clearlabs.fasta.gz
- path: miniwdl_run/call-nextclade/work/clearlabs.fasta.gz.nextclade.auspice.json
- path: miniwdl_run/call-nextclade/work/clearlabs.fasta.gz.nextclade.json
Expand Down Expand Up @@ -100,7 +100,7 @@
- path: miniwdl_run/call-nextclade/work/nextclade_gene_S.translation.fasta
md5sum: e630a638abbb2c8ab4a8b74455e9668f
- path: miniwdl_run/call-nextclade_output_parser/command
md5sum: 632edfc9ac20d8134d3e22f507de1e08
md5sum: 8bab8bc62cb16fff613907f34c54ec51
- path: miniwdl_run/call-nextclade_output_parser/inputs.json
- path: miniwdl_run/call-nextclade_output_parser/outputs.json
- path: miniwdl_run/call-nextclade_output_parser/stderr.txt
Expand Down
4 changes: 2 additions & 2 deletions tests/workflows/theiacov/test_wf_theiacov_ont.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@
- path: miniwdl_run/call-nextclade/task.log
contains: ["wdl", "theiacov_ont", "done"]
- path: miniwdl_run/call-nextclade/work/NEXTCLADE_VERSION
md5sum: d5f4e83525024cba7eb7489cd5209e7d
md5sum: 91a455762183b41af0d8de5596e28e7f
- path: miniwdl_run/call-nextclade/work/_miniwdl_inputs/0/ont.medaka.consensus.fasta
md5sum: d41d8cd98f00b204e9800998ecf8427e
- path: miniwdl_run/call-nextclade/work/nextclade.aligned.fasta
Expand Down Expand Up @@ -285,7 +285,7 @@
- path: miniwdl_run/call-nextclade/work/ont.medaka.consensus.nextclade.json
- path: miniwdl_run/call-nextclade/work/ont.medaka.consensus.nextclade.tsv
- path: miniwdl_run/call-nextclade_output_parser/command
md5sum: 65e8a95529a0466257beed44ec71d2ca
md5sum: 5354c0f11f6f2301ce6f0a07dc3b3aca
- path: miniwdl_run/call-nextclade_output_parser/inputs.json
contains: ["nextclade_tsv", "tsv"]
- path: miniwdl_run/call-nextclade_output_parser/outputs.json
Expand Down
2 changes: 1 addition & 1 deletion workflows/utilities/data_import/wf_basespace_fetch.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ task fetch_bs {
# rename FASTQ files to add back in underscores that Illumina/Basespace changed into hyphens
echo "Concatenating and renaming FASTQ files to add back underscores in basespace_sample_name"
# setting a new bash variable to use for renaming during concatenation of FASTQs
SAMPLENAME_HYPHEN_INSTEAD_OF_UNDERSCORES=$(echo $sample_identifier | sed 's|_|-|g')
SAMPLENAME_HYPHEN_INSTEAD_OF_UNDERSCORES=$(echo $sample_identifier | sed 's|_|-|g' | sed 's|\.|-|g')

#Combine non-empty read files into single file without BaseSpace filename cruft
##FWD Read
Expand Down

0 comments on commit 5e6fcf9

Please sign in to comment.