Skip to content
New issue

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

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

Already on GitHub? # to your account

Module:snppileup #24

Merged
merged 39 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
72efa75
Add snppileup module
nikhil Dec 19, 2023
c42f422
Add test config files
nikhil Dec 19, 2023
c7bb668
Fix test input
nikhil Jan 2, 2024
872392e
Reconfigure snp input
nikhil Jan 2, 2024
8349d61
Fix stub test
nikhil Jan 2, 2024
c0037e7
Some cleanup
nikhil Jan 4, 2024
30c16a4
Use the proper config
nikhil Jan 4, 2024
cbe3174
Add snap file for snppileup
nikhil Jan 4, 2024
5f46ddd
Merge branch 'develop' of github.com:mskcc-omics-workflows/modules in…
nikhil Jan 12, 2024
bcfbf80
Ignore conda snppileup test
nikhil Jan 12, 2024
f364d55
Fix formatting
nikhil Jan 12, 2024
a3964ec
Set meta to correct input and outputs
nikhil Jan 12, 2024
d0beab3
Add tag to snppileup test
nikhil Jan 12, 2024
62c3db9
Fix meta to be more specific on files
nikhil Jan 12, 2024
62a350d
Fix testing tags
nikhil Jan 12, 2024
ccdd6f7
Update snppileup description
nikhil Jan 12, 2024
64cc75d
Add description of additional meta fields
nikhil Jan 12, 2024
4cf2bd5
Fix snppileup input channels
nikhil Jan 23, 2024
885ded6
Add dyanamic tool version detection
nikhil Jan 23, 2024
6d83534
Fix test files:
nikhil Jan 23, 2024
9bc5708
Add mskcc custom test bams and dbsnp
nikhil Jan 23, 2024
9bf89fc
Formatting fix
nikhil Jan 23, 2024
9e37674
Add snppileup snap file
nikhil Jan 23, 2024
2111387
Update test repo links
nikhil Jan 29, 2024
f99bfb2
Update stub test to properly output gz files
nikhil Jan 29, 2024
5cbc524
Add stub test
nikhil Jan 29, 2024
b572ff4
Add snap file
nikhil Jan 29, 2024
58eeddc
Merge branch 'develop' into feature/snppileup
nikhil Jan 29, 2024
4a3cb70
Fix config formatting
nikhil Jan 30, 2024
b37624f
Merge branch 'feature/snppileup' of github.com:mskcc-omics-workflows/…
nikhil Jan 30, 2024
d174456
Fix test data config
nikhil Jan 30, 2024
b140e27
Refactor test data structure
nikhil Jan 30, 2024
a465cff
Fix snppileup test
nikhil Jan 30, 2024
c75a808
Update meta.yml to remove extra meta field
nikhil Jan 31, 2024
fcc13c3
Merge branch 'develop' of github.com:mskcc-omics-workflows/modules in…
nikhil Feb 26, 2024
158072d
Add extra testing files
nikhil Feb 26, 2024
176a9e7
Add optional parameter for extra bams
nikhil Feb 26, 2024
5ee88cc
Updated tests to work with and test the extra bam parameter
nikhil Feb 26, 2024
cfdde76
Add updated snap file
nikhil Feb 26, 2024
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
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@ jobs:
tags: gbcms
- profile: "conda"
tags: polysolver
- profile: "conda"
tags: snppileup
env:
NXF_ANSI_LOG: false
SENTIEON_LICENSE_BASE64: ${{ secrets.SENTIEON_LICENSE_BASE64 }}
Expand Down
9 changes: 9 additions & 0 deletions modules/msk/snppileup/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
name: "snppileup"
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- "YOUR-TOOL-HERE"
57 changes: 57 additions & 0 deletions modules/msk/snppileup/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
process SNPPILEUP {
tag "$meta.id"
label 'process_medium'

container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'docker://mskcc/facets-suite:2.0.9':
'docker.io/mskcc/facets-suite:2.0.9' }"

input:

tuple val(meta), path(normal), path(normal_index), path(tumor), path(tumor_index)
tuple val(meta1), path(dbsnp), path(dbsnp_index)


output:
tuple val(meta), path("*.snp_pileup.gz") , emit: pileup
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}"

"""
/usr/bin/snp-pileup \
${args} \
${dbsnp} \
${prefix}.snp_pileup.gz \
${normal} \
${tumor}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
htslib: \$(bgzip --version | grep -oP '(?<=\\(htslib\\) ).*')
htstools: 0.1.1
r: \$(R --version | grep -oP '(?<=R version ).*(?=\\()')
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"

"""
echo "stub test" >> ${prefix}.snp_pileup
gzip ${prefix}.snp_pileup

cat <<-END_VERSIONS > versions.yml
"${task.process}":
htslib: \$(bgzip --version | grep -oP '(?<=\\(htslib\\) ).*')
htstools: 0.1.1
r: \$(R --version | grep -oP '(?<=R version ).*(?=\\()')
END_VERSIONS
"""
}
65 changes: 65 additions & 0 deletions modules/msk/snppileup/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "snppileup"
description: Calculate snp pileups from a bam pair
keywords:
- snp
- pileup
- bams
- dbsnp
tools:
- "htstools":
description: "Contains tools to process bam files for downstream copy number analysis."
homepage: "https://github.com/mskcc/htstools"
documentation: "https://github.com/mskcc/htstools"

input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'pair_id' ]`
- meta1:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'pair_id' ]`
- normal:
type: file
description: "Normal bam file"
pattern: "*.bam"
- normal_index:
type: file
description: "Index of the normal bam file"
pattern: "*.bai"
- tumor:
type: file
description: "Tumor bam file"
pattern: "*.bam"
- tumor_index:
type: file
description: "Index of tumor bam file"
pattern: "*.bai"
- dbsnp:
type: file
description: The NCBI provided database vcf file on genetic variation
pattern: "*.vcf.gz"
- dbsnp_index:
type: file
description: The index of the dbsnp vcf file
pattern: "*.vcf.gz.tbi"

output:
- pileup:
type: file
description: The pileup file
pattern: "*.snp_pileup.gz"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"

authors:
- "@nikhil"
maintainers:
- "@nikhil"
77 changes: 77 additions & 0 deletions modules/msk/snppileup/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
nextflow_process {

name "Test SNPPILEUP"
script "../main.nf"
process "SNPPILEUP"
config "./nextflow.config"

tag "modules"
tag "modules_nfcore"
tag "modules_msk"
tag "snppileup"

test("snppileup - bam") {

when {
process {
"""
meta = [ id:'test' ] // meta map
input[0] = [
meta,
file(params.test_data_mskcc['bam_files']['test_argos_sample_1_normal_bam'], checkIfExists: true),
file(params.test_data_mskcc['bam_files']['test_argos_sample_1_normal_bam_bai'], checkIfExists: true),
file(params.test_data_mskcc['bam_files']['test_argos_sample_1_tumor_bam'], checkIfExists: true),
file(params.test_data_mskcc['bam_files']['test_argos_sample_1_tumor_bam_bai'], checkIfExists: true)
]
input[1] = [
meta,
file(params.test_data_mskcc['hg37']['dbsnp_138_b37_chr17_vcf_gz'], checkIfExists: true),
file(params.test_data_mskcc['hg37']['dbsnp_138_b37_chr17_vcf_gz_tbi'], checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}

}

test("snppileup - bam - stub") {

options "-stub"

when {
process {
"""
meta = [ id:'test' ] // meta map
input[0] = [
meta,
file("stub_file"),
file("stub_file1"),
file("stub_file2"),
file("stub_file3")
]
input[1] = [
meta,
file("stub_file4"),
file("stub_file5")
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}

}

}
60 changes: 60 additions & 0 deletions modules/msk/snppileup/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"snppileup - bam - stub": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.snp_pileup.gz:md5,3d77e3e110a219d3495d44e243450313"
]
],
"1": [
"versions.yml:md5,0ca251848ee099aebdade397bedf463f"
],
"pileup": [
[
{
"id": "test"
},
"test.snp_pileup.gz:md5,3d77e3e110a219d3495d44e243450313"
]
],
"versions": [
"versions.yml:md5,0ca251848ee099aebdade397bedf463f"
]
}
],
"timestamp": "2024-01-29T15:06:34.676228"
},
"snppileup - bam": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.snp_pileup.gz:md5,deac57ec8a27969028af701840d2b0ee"
]
],
"1": [
"versions.yml:md5,0ca251848ee099aebdade397bedf463f"
],
"pileup": [
[
{
"id": "test"
},
"test.snp_pileup.gz:md5,deac57ec8a27969028af701840d2b0ee"
]
],
"versions": [
"versions.yml:md5,0ca251848ee099aebdade397bedf463f"
]
}
],
"timestamp": "2024-01-29T15:06:28.546836"
}
}
10 changes: 10 additions & 0 deletions modules/msk/snppileup/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
params {
enable_conda = false
}

process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
withName: 'SNPPILEUP' {
ext.args = '--count-orphans --gzip --pseudo-snps 50 -r 25,0'
}
}
2 changes: 2 additions & 0 deletions modules/msk/snppileup/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
snppileup:
- "modules/msk/snppileup/**"
32 changes: 21 additions & 11 deletions tests/config/test_data.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

params {
// Base directory for test data
test_data_base = "https://raw.githubusercontent.com/nf-core/test-datasets/modules"
test_data_base = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules'
test_data_base_msk = 'https://github.com/mskcc-omics-workflows/test-datasets/raw'

test_data {
'sarscov2' {
Expand Down Expand Up @@ -293,7 +294,6 @@ params {
vep_cache = "${params.test_data_base}/data/genomics/homo_sapiens/genome/vep.tar.gz"
affy_array_samplesheet = "${params.test_data_base}/data/genomics/homo_sapiens/array_expression/GSE38751.csv"
affy_array_celfiles_tar = "${params.test_data_base}/data/genomics/homo_sapiens/array_expression/GSE38751_RAW.tar"

}
'pangenome' {
pangenome_fa = "${params.test_data_base}/data/pangenomics/homo_sapiens/pangenome.fa"
Expand Down Expand Up @@ -520,8 +520,8 @@ params {
gmx = "${params.test_data_base}/data/genomics/homo_sapiens/gene_set_analysis/c1.symbols.reduced.gmx"
}
'cnvkit' {
amplicon_cnr = "https://raw.githubusercontent.com/etal/cnvkit/v0.9.9/test/formats/amplicon.cnr"
amplicon_cns = "https://raw.githubusercontent.com/etal/cnvkit/v0.9.9/test/formats/amplicon.cns"
amplicon_cnr = 'https://raw.githubusercontent.com/etal/cnvkit/v0.9.9/test/formats/amplicon.cnr'
amplicon_cns = 'https://raw.githubusercontent.com/etal/cnvkit/v0.9.9/test/formats/amplicon.cns'
}
}
'bacteroides_fragilis' {
Expand All @@ -530,7 +530,6 @@ params {
genome_gbff_gz = "${params.test_data_base}/data/genomics/prokaryotes/bacteroides_fragilis/genome/genome.gbff.gz"
genome_paf = "${params.test_data_base}/data/genomics/prokaryotes/bacteroides_fragilis/genome/genome.paf"
genome_gff_gz = "${params.test_data_base}/data/genomics/prokaryotes/bacteroides_fragilis/genome/genome.gff.gz"

}
'hamronization' {
genome_abricate_tsv = "${params.test_data_base}/data/genomics/prokaryotes/bacteroides_fragilis/hamronization/genome.abricate.tsv"
Expand Down Expand Up @@ -599,7 +598,7 @@ params {
'txt' {
hello = "${params.test_data_base}/data/generic/txt/hello.txt"
}
'cooler'{
'cooler' {
test_pairix_pair_gz = "${params.test_data_base}/data/genomics/homo_sapiens/cooler/cload/hg19/hg19.GM12878-MboI.pairs.subsample.blksrt.txt.gz"
test_pairix_pair_gz_px2 = "${params.test_data_base}/data/genomics/homo_sapiens/cooler/cload/hg19/hg19.GM12878-MboI.pairs.subsample.blksrt.txt.gz.px2"
test_pairs_pair = "${params.test_data_base}/data/genomics/homo_sapiens/cooler/cload/hg19/hg19.sample1.pairs"
Expand All @@ -608,7 +607,6 @@ params {
hg19_chrom_sizes = "${params.test_data_base}/data/genomics/homo_sapiens/cooler/cload/hg19/hg19.chrom.sizes"
test_merge_cool = "${params.test_data_base}/data/genomics/homo_sapiens/cooler/merge/toy/toy.symm.upper.2.cool"
test_merge_cool_cp2 = "${params.test_data_base}/data/genomics/homo_sapiens/cooler/merge/toy/toy.symm.upper.2.cp2.cool"

}
'pairtools' {
mock_4dedup_pairsam = "${params.test_data_base}/data/genomics/homo_sapiens/pairtools/mock.4dedup.pairsam"
Expand All @@ -626,7 +624,7 @@ params {
genome_file = "${params.test_data_base}/data/generic/unsorted_data/unsorted_text/test.genome"
intervals = "${params.test_data_base}/data/generic/unsorted_data/unsorted_text/test.bed"
numbers_csv = "${params.test_data_base}/data/generic/unsorted_data/unsorted_text/test.csv"
}
}
}
}
'proteomics' {
Expand All @@ -641,7 +639,6 @@ params {
mq_contrasts = "${params.test_data_base}/data/proteomics/maxquant/MaxQuant_contrasts.csv"
mq_proteingroups = "${params.test_data_base}/data/proteomics/maxquant/MaxQuant_proteinGroups.txt"
mq_samplesheet = "${params.test_data_base}/data/proteomics/maxquant/MaxQuant_samplesheet.tsv"

}
'parameter' {
maxquant = "${params.test_data_base}/data/proteomics/parameter/mqpar.xml"
Expand Down Expand Up @@ -672,10 +669,10 @@ params {
plant_wga_multicut = "${params.test_data_base}/data/imaging/ilp/plant_wga.multicut.ilp"
plant_wga_pixel_class = "${params.test_data_base}/data/imaging/ilp/plant_wga.pixel_prob.ilp"
}
'tiff' {
'tiff' {
mouse_heart_wga = "${params.test_data_base}/data/imaging/tiff/mindagap.mouse_heart.wga.tiff"
}
'ome-tiff' {
'ome-tiff' {
cycif_tonsil_channels = "${params.test_data_base}/data/imaging/ome-tiff/cycif-tonsil-channels.csv"
cycif_tonsil_cycle1 = "${params.test_data_base}/data/imaging/ome-tiff/cycif-tonsil-cycle1.ome.tif"
cycif_tonsil_cycle2 = "${params.test_data_base}/data/imaging/ome-tiff/cycif-tonsil-cycle2.ome.tif"
Expand Down Expand Up @@ -710,4 +707,17 @@ params {
}
}
}

'test_data_mskcc' {
'bam_files' {
test_argos_sample_1_normal_bam = "${params.test_data_base_msk}/bam_files/bams/argos_processed/sample_1_normal.chr17.rg.md.abra.printreads.bam"
test_argos_sample_1_normal_bam_bai = "${params.test_data_base_msk}/bam_files/bams/argos_processed/sample_1_normal.chr17.rg.md.abra.printreads.bam.bai"
test_argos_sample_1_tumor_bam = "${params.test_data_base_msk}/bam_files/bams/argos_processed/sample_1_tumor.chr17.rg.md.abra.printreads.bam"
test_argos_sample_1_tumor_bam_bai = "${params.test_data_base_msk}/bam_files/bams/argos_processed/sample_1_tumor.chr17.rg.md.abra.printreads.bam.bai"
}
'hg37' {
dbsnp_138_b37_chr17_vcf_gz = "${params.test_data_base_msk}/hg37/genomic_reference/GRCH37/vcf/dbsnp_138.b37.chr17.vcf.gz"
dbsnp_138_b37_chr17_vcf_gz_tbi = "${params.test_data_base_msk}/hg37/genomic_reference/GRCH37/vcf/dbsnp_138.b37.chr17.vcf.gz.tbi"
}
}
}
Loading