Skip to content

Commit

Permalink
fix fasta input, reference optional
Browse files Browse the repository at this point in the history
  • Loading branch information
RaverJay committed Apr 9, 2024
1 parent 0906eb9 commit a65bb06
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
23 changes: 16 additions & 7 deletions CholerAegon.nf
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,15 @@ process prepare_fasta {
input:
tuple val(name), path(fasta)
output:
tuple val(name), path("fixed_names/${name}.fasta")
tuple val(name), val("pre-assembled"), path("fixed_names/${name}.fasta")
shell:
'''
mkdir fixed_name
mkdir fixed_names
for F in *.fa *.fasta *.fna; do
if [ -e "$F" ]; then
ln -s $F fixed_names/!{name}.fasta
ln -s ../$F fixed_names/!{name}.fasta
fi
done
'''
}

Expand Down Expand Up @@ -444,13 +446,20 @@ process summary_report {

input:
path(amr_results)
path(fastani_results)
file(fastani_results)
output:
path("CholerAegon_summary_report_*.html")
script:
"""
summary_report.py --amr_results ${amr_results} --fastani_results ${fastani_results}
"""
if (params.genome_reference) {
"""
summary_report.py --amr_results ${amr_results} --fastani_results ${fastani_results}
"""
}
else {
"""
summary_report.py --amr_results ${amr_results}
"""
}
}


Expand Down
2 changes: 2 additions & 0 deletions bin/summary_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,8 @@ def stringify(strlst):
self.predictiondataraw['Drug class resistances'] = data['DRUG_CLASS_RESISTANCES']

def drugs_markup(str):
if str == '.':
return str
drugs = str.split(';')
drugs_f = []
for d in drugs:
Expand Down

0 comments on commit a65bb06

Please sign in to comment.