forked from nf-core/modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix version string spurious text in singularity tests * Add NGSCheckMate subworkflow * Remember to save files * Fix bracket * Update meta * Update meta/channel name * Update NCM * Update ncm test * Add the config file * Remove tests on bcftools files as failing conda * Update subworkflows/nf-core/bam_ngscheckmate/main.nf Co-authored-by: Maxime U Garcia <[email protected]> * Update subworkflows/nf-core/bam_ngscheckmate/main.nf Co-authored-by: Maxime U Garcia <[email protected]> * Update subworkflows/nf-core/bam_ngscheckmate/main.nf --------- Co-authored-by: SPearce <[email protected]> Co-authored-by: Maxime U Garcia <[email protected]> Co-authored-by: Maxime U Garcia <[email protected]>
- Loading branch information
1 parent
aa90540
commit 3cfd245
Showing
11 changed files
with
217 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
include { BCFTOOLS_MPILEUP } from '../../../modules/nf-core/bcftools/mpileup/main' | ||
include { NGSCHECKMATE_NCM } from '../../../modules/nf-core/ngscheckmate/ncm/main.nf' | ||
|
||
workflow BAM_NGSCHECKMATE { | ||
|
||
take: | ||
ch_bam // channel: [ val(meta), bam ] | ||
ch_bed // channel: [ bed ] | ||
ch_fasta // channel: [ fasta ] | ||
|
||
main: | ||
|
||
ch_versions = Channel.empty() | ||
|
||
ch_bam_bed = ch_bam.combine(ch_bed) | ||
|
||
BCFTOOLS_MPILEUP (ch_bam_bed, ch_fasta.collect(), false) | ||
ch_versions = ch_versions.mix(BCFTOOLS_MPILEUP.out.versions) | ||
|
||
BCFTOOLS_MPILEUP | ||
.out | ||
.vcf | ||
.map{meta, vcf -> vcf} | ||
.collect() | ||
.set {ch_flat_vcfs} | ||
|
||
NGSCHECKMATE_NCM (ch_flat_vcfs, ch_bed, ch_fasta) | ||
ch_versions = ch_versions.mix(NGSCHECKMATE_NCM.out.versions) | ||
|
||
emit: | ||
pdf = NGSCHECKMATE_NCM.out.pdf // channel: [ pdf ] | ||
corr_matrix = NGSCHECKMATE_NCM.out.corr_matrix // channel: [ corr_matrix ] | ||
matched = NGSCHECKMATE_NCM.out.matched // channel: [ matched ] | ||
all = NGSCHECKMATE_NCM.out.all // channel: [ all ] | ||
vcf = BCFTOOLS_MPILEUP.out.vcf // channel: [ meta, vcf ] | ||
versions = ch_versions // channel: [ versions.yml ] | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: "bam_ngscheckmate" | ||
description: Take a set of bam files and run NGSCheckMate to determine whether samples match with each other, using a set of SNPs. | ||
keywords: | ||
- ngscheckmate | ||
- qc | ||
modules: | ||
- bcftools/mpileup | ||
- ngscheckmate/ncm | ||
input: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. [ id:'test' ] | ||
- bam: | ||
type: file | ||
description: BAM files for each sample | ||
pattern: "*.{bam}" | ||
- snp_bed: | ||
type: file | ||
description: BED file containing the SNPs to analyse. NGSCheckMate provides some default ones for hg19/hg38. | ||
pattern: "*.{bed}" | ||
|
||
- fasta: | ||
type: file | ||
description: fasta file for the genome | ||
pattern: "*.{fasta}" | ||
|
||
output: | ||
- pdf: | ||
type: file | ||
description: A pdf containing a dendrogram showing how the samples match up | ||
pattern: "*.{pdf}" | ||
- corr_matrix: | ||
type: file | ||
description: A text file containing the correlation matrix between each sample | ||
pattern: "*corr_matrix.txt" | ||
- matched: | ||
type: file | ||
description: A txt file containing only the samples that match with each other | ||
pattern: "*matched.txt" | ||
- all: | ||
type: file | ||
description: A txt file containing all the sample comparisons, whether they match or not | ||
pattern: "*all.txt" | ||
- vcf: | ||
type: file | ||
description: vcf files for each sample giving the SNP calls | ||
pattern: "*.vcf" | ||
- versions: | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
authors: | ||
- "@SPPearce" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,44 @@ | ||
- name: ngscheckmate ncm test_ngscheckmate_ncm_bam | ||
command: nextflow run ./tests/modules/nf-core/ngscheckmate/ncm -entry test_ngscheckmate_ncm_bam -c ./tests/config/nextflow.config | ||
command: nextflow run ./tests/modules/nf-core/ngscheckmate/ncm -entry test_ngscheckmate_ncm_bam -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/ngscheckmate/ncm/nextflow.config | ||
tags: | ||
- ngscheckmate/ncm | ||
- ngscheckmate | ||
files: | ||
- path: output/bedtools/test_split.bed | ||
md5sum: 5058157987313b598f1c260e6965d6f7 | ||
- path: output/bedtools/versions.yml | ||
- path: output/ngscheckmate/output.pdf | ||
- path: output/ngscheckmate/output_all.txt | ||
md5sum: f71a712c3f6ecf64dd526365212f1b7c | ||
- path: output/ngscheckmate/output_corr_matrix.txt | ||
md5sum: 6777377aa9ae3d57f841b12896318db0 | ||
- path: output/ngscheckmate/output_matched.txt | ||
md5sum: f71a712c3f6ecf64dd526365212f1b7c | ||
- path: output/ngscheckmate/test.paired_end.methylated.sorted.vcf | ||
- path: output/ngscheckmate/test.paired_end.sorted.vcf | ||
- path: output/ngscheckmate/versions.yml | ||
md5sum: fbb2bebd65b4f4e1e93c6bf5c08a6829 | ||
|
||
- name: ngscheckmate ncm test_ngscheckmate_ncm_vcf | ||
command: nextflow run ./tests/modules/nf-core/ngscheckmate/ncm -entry test_ngscheckmate_ncm_vcf -c ./tests/config/nextflow.config | ||
command: nextflow run ./tests/modules/nf-core/ngscheckmate/ncm -entry test_ngscheckmate_ncm_vcf -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/ngscheckmate/ncm/nextflow.config | ||
tags: | ||
- ngscheckmate/ncm | ||
- ngscheckmate | ||
files: | ||
- path: output/bcftools/test1.bcftools_stats.txt | ||
- path: output/bcftools/test1.vcf.gz | ||
- path: output/bcftools/test1.vcf.gz.tbi | ||
- path: output/bcftools/test2.bcftools_stats.txt | ||
- path: output/bcftools/test2.vcf.gz | ||
- path: output/bcftools/test2.vcf.gz.tbi | ||
- path: output/bcftools/versions.yml | ||
- path: output/bedtools/test_split.bed | ||
md5sum: 5058157987313b598f1c260e6965d6f7 | ||
- path: output/bedtools/versions.yml | ||
- path: output/ngscheckmate/output.pdf | ||
- path: output/ngscheckmate/output_all.txt | ||
md5sum: fd74956dcac279b6f58e82ea73e344f8 | ||
- path: output/ngscheckmate/output_corr_matrix.txt | ||
md5sum: 0c86bdad2721c470fe6be119f291c8e5 | ||
- path: output/ngscheckmate/output_matched.txt | ||
md5sum: fd74956dcac279b6f58e82ea73e344f8 | ||
- path: output/ngscheckmate/versions.yml | ||
md5sum: f06910b83dde194a47870c553cefe193 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env nextflow | ||
|
||
nextflow.enable.dsl = 2 | ||
|
||
include { BAM_NGSCHECKMATE } from '../../../../subworkflows/nf-core/bam_ngscheckmate/main.nf' | ||
include { BEDTOOLS_MAKEWINDOWS } from '../../../../modules/nf-core/bedtools/makewindows/main.nf' | ||
|
||
workflow test_bam_ngscheckmate { | ||
|
||
inputBed = [ [ id:'test_bed'], | ||
file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true)] | ||
|
||
BEDTOOLS_MAKEWINDOWS(Channel.of(inputBed)) | ||
snp_bed = BEDTOOLS_MAKEWINDOWS.out.bed | ||
|
||
input = [[ | ||
[ id:'test1' ], // meta map | ||
file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) | ||
],[ | ||
[ id:'test2' ], // meta map | ||
file(params.test_data['sarscov2']['illumina']['test_paired_end_methylated_sorted_bam'], checkIfExists: true) | ||
] | ||
] | ||
|
||
fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) | ||
|
||
ch_input = Channel.fromList(input) | ||
ch_snp_bed = BEDTOOLS_MAKEWINDOWS.out.bed.map{it[1]} | ||
ch_fasta = Channel.of(fasta) | ||
|
||
BAM_NGSCHECKMATE( ch_input, ch_snp_bed , ch_fasta) | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
tests/subworkflows/nf-core/bam_ngscheckmate/nextflow.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
process { | ||
|
||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } | ||
|
||
withName: BEDTOOLS_MAKEWINDOWS { | ||
ext.args = '-w 1' | ||
ext.prefix = 'test_split' | ||
} | ||
|
||
withName: ".*BAM_NGSCHECKMATE:BCFTOOLS_MPILEUP" { | ||
ext.args2 = '--no-version --ploidy 1 -c' | ||
ext.args3 = '--no-version' | ||
} | ||
|
||
withName: ".*BAM_NGSCHECKMATE:NGSCHECKMATE_NCM" { | ||
ext.args = '-V' | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
- name: bam_ngscheckmate test_bam_ngscheckmate | ||
command: nextflow run ./tests/subworkflows/nf-core/bam_ngscheckmate -entry test_bam_ngscheckmate -c ./tests/config/nextflow.config | ||
tags: | ||
- bcftools | ||
- bcftools/mpileup | ||
- ngscheckmate | ||
- ngscheckmate/ncm | ||
- subworkflows | ||
- subworkflows/bam_ngscheckmate | ||
files: | ||
- path: output/bcftools/test1.bcftools_stats.txt | ||
- path: output/bcftools/test1.vcf.gz | ||
- path: output/bcftools/test1.vcf.gz.tbi | ||
- path: output/bcftools/test2.bcftools_stats.txt | ||
- path: output/bcftools/test2.vcf.gz | ||
- path: output/bcftools/test2.vcf.gz.tbi | ||
- path: output/bedtools/test_split.bed | ||
md5sum: 5058157987313b598f1c260e6965d6f7 | ||
- path: output/ngscheckmate/output.pdf | ||
- path: output/ngscheckmate/output_all.txt | ||
md5sum: efdecd402fb7f1425d96624a73ba33b2 | ||
- path: output/ngscheckmate/output_corr_matrix.txt | ||
md5sum: 8b8acb28a3a2bc7c450a15eed397d8d8 | ||
- path: output/ngscheckmate/output_matched.txt | ||
md5sum: efdecd402fb7f1425d96624a73ba33b2 |