Skip to content

Commit

Permalink
Make pangolin update optional (#48)
Browse files Browse the repository at this point in the history
* Make pangolin update optional

* Update conda env directory name
  • Loading branch information
dfornika authored May 28, 2021
1 parent 54a4d03 commit 831c4d3
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/create_conda_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ set -eo pipefail

export PATH=/opt/miniconda3/bin:$PATH

mamba env create --prefix /home/runner/.conda/envs/ncov-qc-724a4524bfccdf191bf8550202dac824 --file /home/runner/work/ncov-tools-nf/ncov-tools-nf/environments/ncov-tools-1.5.yml
mamba env create --prefix /home/runner/.conda/envs/ncov-qc-40e1fefdb1b312663435a35c6d6cb9da --file /home/runner/work/ncov-tools-nf/ncov-tools-nf/environments/ncov-tools-1.5.yml
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,23 @@ A `metadata.tsv` file may be optionally provided. If it is provided, it should f

The `completeness_threshold` can optionally be modified. Its default value is the same as that of `ncov-tools`, `0.75`.

The `--update_pangolin` flag allows control over whether or not pangolin will be updated prior to running ncov-tools.

In the command below, `[square brackets]` indicate optional parameters. `<angled brackets>` indicate a placeholder to be replaced by the user in a real pipeline invocation.

```
nextflow run BCCDC-PHL/ncov-tools-nf \
-profile conda \
--cache ~/.conda/envs \
--run_name <run_name> \
--artic_analysis_dir <output/from/ncov2019-artic-nf> \
[--update_pangolin] \
[--completeness_threshold <completeness_threshold>] \
[--metadata <metadata.tsv>] \
[--downsampled] \
[--split_by_plate] \
[--freebayes_consensus] \
[--freebayes_variants] \
--run_name <run_name> \
--artic_analysis_dir <output/from/ncov2019-artic-nf> \
--outdir <ncov-tools-output> \
```

Expand Down
9 changes: 6 additions & 3 deletions environments/ncov-tools-1.5.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@ dependencies:
- poppler
- gofasta
- numpy=1.19.1
- biopython=1.77
- biopython=1.74
- snpeff=5.0-0
- pangolin=2.4.2
- pangolearn
- pip:
- dendropy>=4.4.0
- pyvcf
- ncov-parser
- git+https://github.com/hCoV-2019/lineages.git
- git+https://github.com/hCoV-2019/pangolin.git
- git+https://github.com/cov-lineages/pangoLEARN.git
- git+https://github.com/jts/ncov-watch.git
- git+https://github.com/cov-lineages/scorpio.git
- git+https://github.com/cov-lineages/constellations.git

2 changes: 1 addition & 1 deletion main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ workflow {
ch_artic_analysis_dir = Channel.fromPath(params.artic_analysis_dir, type: 'dir')
ch_metadata = Channel.fromPath(params.metadata, type: 'file')

update_pangolin(Channel.value(true))
update_pangolin(Channel.value(params.update_pangolin))
download_ncov_tools(ch_ncov_tools_version)
download_artic_ncov2019(ch_primer_scheme_version.combine(ch_primer_scheme_name))
download_ncov_watchlists(ch_ncov_watchlists_version)
Expand Down
15 changes: 12 additions & 3 deletions modules/ncov-tools.nf
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
process update_pangolin {

tag { should_update.toString() }

executor 'local'

input:
val(should_update)

output:
val(true)
val(did_update)

script:
"""
pangolin --update
did_update = should_update
should_update_string = should_update ? "true" : "false"
"""
should_update=${should_update_string}
if [ "\$should_update" = true ]
then
pangolin --update
fi
"""
}

Expand Down
3 changes: 2 additions & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ params {
split_by_plate = false
freebayes_consensus = false
freebayes_variants = false
update_pangolin = false
}

profiles {
Expand All @@ -29,5 +30,5 @@ process {
manifest {
mainScript = 'main.nf'
nextflowVersion = '>=20.01.0'
version = '1.5.4'
version = '1.5.5'
}

0 comments on commit 831c4d3

Please sign in to comment.