diff --git a/workflows/process/freyja.nf b/workflows/process/freyja.nf index af999b6..4dc63a5 100644 --- a/workflows/process/freyja.nf +++ b/workflows/process/freyja.nf @@ -12,10 +12,18 @@ process freyja { tuple val(name), path("*_freyja_plot.svg"), path("*_freyja_plot.png"), emit: plots, optional: true script: - if ( params.freyja_update ) { freyja_update_cmd = "freyja update" } - else { freyja_update_cmd = " " } + if ( params.freyja_update ) + { freyja_update_cmd = "mkdir data; freyja update --outdir data" + // here we will download the latest Freyja data again instead of using the files obtained when installing the conda env + freyja_ref_data = "data" + } + else + { freyja_update_cmd = " " + // this is the original path where inside of the container the Freyja data is stored + freyja_ref_data = "/opt/conda/envs/freyja-env/lib/python3.10/site-packages/freyja/data/" + } """ - sed -i "s/^>.*\$/>MN908947.3/" ${reference} #rename reference-sequence as Alignment is done with this sequence-name even so using the same reference freyja will detect deviating names and thro an error + sed -i "s/^>.*\$/>MN908947.3/" ${reference} #rename reference-sequence as Alignment is done with this sequence-name even so using the same reference freyja will detect deviating names and throw an error mkdir -p freyja_result/ ${freyja_update_cmd} @@ -28,6 +36,8 @@ process freyja { freyja demix ${name}_freyja_variants.tsv \ ${name}_freyja_depths.tsv \ --output freyja_result/${name}_freyja_demix.tsv \ + --barcodes ${freyja_ref_data}/usher_barcodes.csv \ + --lineageyml ${freyja_ref_data}/lineages.yml freyja aggregate freyja_result/ \ --output ${name}_freyja_aggregate.tsv \ @@ -35,12 +45,14 @@ process freyja { freyja plot ${name}_freyja_aggregate.tsv \ --output ${name}_freyja_plot.svg \ --lineages \ - --mincov 10.0 #default minCoverage: 60 + --mincov 10.0 #default minCoverage: 60 \ + --lineageyml ${freyja_ref_data}/lineages.yml freyja plot ${name}_freyja_aggregate.tsv \ --output ${name}_freyja_plot.png \ --lineages \ - --mincov 10.0 #default minCoverage: 60 + --mincov 10.0 #default minCoverage: 60 \ + --lineageyml ${freyja_ref_data}/lineages.yml mv freyja_result/${name}_freyja_demix.tsv \$PWD #freyha_demix.tsv is put into a folder before to give it to freyja aggregate """