Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Purecn/run #3140

Merged
merged 36 commits into from
Jul 14, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
563a8ed
Set up nf-core template for purecn/run module
aldosr Mar 1, 2023
1cbba6c
Add run script and I/O
aldosr Mar 1, 2023
24dfc84
Clean TODOs and set main script
aldosr Mar 27, 2023
148be9f
Merge branch 'master' into purecn/run
aldosr Mar 27, 2023
fe68198
Fix duplicate entry
aldosr Mar 27, 2023
1188f63
Merge branch 'master' into purecn/run
aldosr May 30, 2023
7efedb6
Set up main script
aldosr May 30, 2023
69b4b5f
[ci skip] Format with prettier
aldosr May 30, 2023
b9abf03
Merge branch 'master' into purecn/run
aldosr Jun 6, 2023
8054685
Merge branch 'master' into purecn/run
aldosr Jul 4, 2023
218986d
[ci skip] Address review question and set up stub
aldosr Jul 4, 2023
9e85346
Merge remote-tracking branch 'origin/purecn/run' into purecn/run
aldosr Jul 4, 2023
4db4cea
Merge branch 'master' into purecn/run
aldosr Jul 4, 2023
8515a53
[ci skip] Set stub for testing
aldosr Jul 5, 2023
d21dda4
Merge branch 'master' into purecn/run
aldosr Jul 5, 2023
1f1ad8a
Reformat with prettier
aldosr Jul 5, 2023
397ff7b
Merge remote-tracking branch 'origin/purecn/run' into purecn/run
aldosr Jul 5, 2023
56b9f9d
[CI skip] Adjust some typos
aldosr Jul 6, 2023
0024556
[CI skip] Set up test script using stub
aldosr Jul 6, 2023
4fcf9d9
Set up test yml
aldosr Jul 6, 2023
08e7352
Merge branch 'master' into purecn/run
aldosr Jul 6, 2023
205abd4
Reformat with prettier
aldosr Jul 6, 2023
7665ef3
Merge remote-tracking branch 'origin/purecn/run' into purecn/run
aldosr Jul 6, 2023
c77c9ec
Set up meta.yml file and fix typos
aldosr Jul 6, 2023
de57416
Reformat with prettier
aldosr Jul 6, 2023
2247914
Fix typo
aldosr Jul 6, 2023
ceace12
Remove quay.io from container string
aldosr Jul 6, 2023
41c8602
Merge branch 'master' into purecn/run
aldosr Jul 6, 2023
ee8f831
Merge branch 'master' into purecn/run
aldosr Jul 12, 2023
0aa72d7
Merge branch 'master' into purecn/run
aldosr Jul 12, 2023
1210b43
Remove optional input argument
aldosr Jul 14, 2023
a3acfbd
Add optional outputs and clean non-mandatory parameters
aldosr Jul 14, 2023
aa961d0
Clean non-mandatory outputs
aldosr Jul 14, 2023
a4e7d59
Reformat outputs
aldosr Jul 14, 2023
707633f
Fix minor and address reviews
aldosr Jul 14, 2023
69e226b
Merge branch 'master' into purecn/run
aldosr Jul 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 100 additions & 0 deletions modules/nf-core/purecn/run/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
process PURECN_RUN {
tag "$meta.id"
label 'process_medium'

// WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions.
conda "bioconda::bioconductor-purecn=2.4.0 bioconda::bioconductor-txdb.hsapiens.ucsc.hg38.knowngene=3.16.0 bioconductor-txdb.hsapiens.ucsc.hg19.knowngene=3.2.2 bioconda::bioconductor-org.hs.eg.db=3.16.0"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/mulled-v2-582ac26068889091d5e798347c637f8208d77a71:a29c64a63498b1ee8b192521fdf6ed3c65506994-0':
'quay.io/biocontainers/mulled-v2-582ac26068889091d5e798347c637f8208d77a71:a29c64a63498b1ee8b192521fdf6ed3c65506994-0' }"

input:
tuple val(meta), path(vcf)
path tumor_coverage
path normal_coverage
path normal_db
path intervals
path mapping_bias
path blacklist
val genome
lbeltrame marked this conversation as resolved.
Show resolved Hide resolved
val segmentation_function
val model_type
val seed_val

output:
tuple val(meta), path("*.csv") , emit: csv
tuple val(meta), path("*_variants.csv") , emit: variants_csv
tuple val(meta), path("*.pdf") , emit: pdf
tuple val(meta), path("*.rds") , emit: rds
tuple val(meta), path("*_amplification_pvalues.csv") , emit: csv
tuple val(meta), path("*_chromosomes.pdf") , emit: chr_pdf
tuple val(meta), path("*_dnacopy.seg") , emit: seg
tuple val(meta), path("*_genes.csv") , emit: genes_csv
tuple val(meta), path("*_local_optima.pdf") , emit: local_optima_pdf
tuple val(meta), path("*.log") , emit: log
tuple val(meta), path("*_loh.vcf") , emit: loh_vcf
tuple val(meta), path("*_loh.vcf.gz") , emit: loh_vcf_gz
tuple val(meta), path("*_loh.vcf.gz.tbi") , emit: loh_vcf_tbi
tuple val(meta), path("*_loh.csv") , emit: loh_csv
tuple val(meta), path("*_loh-effects-stats.csv") , emit: loh_stats_csv
tuple val(meta), path("*_loh-effects-stats.genes.txt") , emit: loh_effects_txt
tuple val(meta), path("*_loh-effects-stats.html") , emit: loh_effects_html
tuple val(meta), path("*_loh-effects.vcf.gz") , emit: loh_effects_vcf
tuple val(meta), path("*_loh-effects.vcf.gz.tbi") , emit: loh_effects_tbi
tuple val(meta), path("*-purecn-lohsummary.yaml") , emit: loh_summary_yaml
tuple val(meta), path("*_loh-effects.csv") , emit: loh_effects_csv
tuple val(meta), path("*_segmentation.pdf") , emit: segmentation_pdf
tuple val(meta), path("*-sort_coverage_loess.png") , emit: sort_coverage_loess_png
tuple val(meta), path("*-sort_coverage_loess_qc.txt") , emit: sort_coverage_loess_qc_txt
tuple val(meta), path("*-sort_coverage_loess.txt.gz") , emit: sort_coverage_loess_txt_gz
tuple val(meta), path("*-sort_coverage.txt.gz") , emit: sort_coverage_txt_gz
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def normal_cov = normal_coverage ? "--fun-segmentation ${normal_coverage}" : ""
def segmentation = segmentation_function ? "--fun-segmentation ${segmentation_function}" : ""
def map_bias = mapping_bias ? "--mapping-bias-file ${mapping_bias}" : ""
def model = model_type ? "--model ${model_type}" : ""
def blacklist = snp_blacklist ? "--snp-blacklist ${snp_blacklist}" : ""
def seed = seed_val ? "--seed ${seed_val}" : ""
def VERSION = '2.4.0' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.

"""
library_path=\$(Rscript -e 'cat(.libPaths(), sep = "\\n")')
Rscript "\$library_path"PureCN.R \\
--out ./ \\
--tumor ${tumor_coverage} \\
--normal ${normal_cov} \\
--sampleid ${prefix} \\
--vcf ${vcf} \\
--normaldb ${normal_db} \\
--intervals ${intervals} \\
lbeltrame marked this conversation as resolved.
Show resolved Hide resolved
--genome ${genome} \\
--stats-file ${prefix}_stats.txt \\
${segmentation} \\
${map_bias} \\
${args}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
purecn: ${VERSION}
END_VERSIONS
"""

stub:

//TODO add STUB

"""

cat <<-END_VERSIONS > versions.yml
"${task.process}":
purecn: ${VERSION}
END_VERSIONS
"""
}
50 changes: 50 additions & 0 deletions modules/nf-core/purecn/run/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: "purecn_run"
description: run PureCN to normalize, segment and determine purity and ploidy
keywords:
- copy number alteration calling
tools:
- "purecn":
description: "Copy number calling and SNV classification using targeted short read sequencing"
homepage: "https://bioconductor.org/packages/release/bioc/html/PureCN.html"
documentation: "https://bioconductor.org/packages/release/bioc/html/PureCN.html"
tool_dev_url: "https://github.com/lima1/PureCN"
doi: "10.1186/s13029-016-0060-z"
licence: "Artistic-2.0"

## TODO nf-core: Add a description of all of the variables used as input
input:
# Only when we have meta
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
#
## TODO nf-core: Delete / customise this example input
- bam:
type: file
description: BAM/CRAM/SAM file
pattern: "*.{bam,cram,sam}"

## TODO nf-core: Add a description of all of the variables used as output
output:
#Only when we have meta
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
#
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
## TODO nf-core: Delete / customise this example output
- bam:
type: file
description: Sorted BAM/CRAM/SAM file
pattern: "*.{bam,cram,sam}"

authors:
- "@aldosr"
- "@lbeltrame"
4 changes: 4 additions & 0 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2779,6 +2779,10 @@ prokka:
- modules/nf-core/prokka/**
- tests/modules/nf-core/prokka/**

purecn/run:
- modules/nf-core/purecn/run/**
- tests/modules/nf-core/purecn/run/**

purecn/normaldb:
- modules/nf-core/purecn/normaldb/**
- tests/modules/nf-core/purecn/normaldb/**
Expand Down
15 changes: 15 additions & 0 deletions tests/modules/nf-core/purecn/run/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env nextflow

nextflow.enable.dsl = 2

include { PURECN_RUN } from '../../../../../modules/nf-core/purecn/run/main.nf'

workflow test_purecn_run {

input = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true)
]

PURECN_RUN ( input )
}
5 changes: 5 additions & 0 deletions tests/modules/nf-core/purecn/run/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {

publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }

}
12 changes: 12 additions & 0 deletions tests/modules/nf-core/purecn/run/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## TODO nf-core: Please run the following command to build this file:
# nf-core modules create-test-yml purecn/run
- name: "purecn run"
command: nextflow run ./tests/modules/nf-core/purecn/run -entry test_purecn_run -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/purecn/run/nextflow.config
tags:
- "purecn"
- "purecn/run"
files:
- path: "output/purecn/test.bam"
md5sum: e667c7caad0bc4b7ac383fd023c654fc
- path: "output/purecn/versions.yml"
md5sum: a01fe51bc4c6a3a6226fbf77b2c7cf3b