diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 21b7ae020..599fd53af 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -201,6 +201,10 @@ jobs: - name: METAGENOMIC Run the basic pipeline but with unmapped reads going into Kraken run: | nextflow run ${GITHUB_WORKSPACE} -profile test_tsv_kraken,docker --run_bam_filtering --bam_unmapped_type 'fastq' + - name: SNPCAPTURE Run the basic pipeline with the bam input profile, generating statistics with a SNP capture bed + run: | + wget https://github.com/nf-core/test-datasets/raw/eager/reference/Human/1240K.pos.list_hs37d5.0based.bed.gz && gunzip 1240K.pos.list_hs37d5.0based.bed.gz + nextflow run ${GITHUB_WORKSPACE} -profile test_tsv_humanbam,docker --skip_fastqc --skip_adapterremoval --skip_deduplication --snpcapture_bed 1240K.pos.list_hs37d5.0based.bed - name: SEXDETERMINATION Run the basic pipeline with the bam input profile, but don't convert BAM, skip everything but sex determination run: | nextflow run ${GITHUB_WORKSPACE} -profile test_tsv_humanbam,docker --skip_fastqc --skip_adapterremoval --skip_deduplication --skip_qualimap --run_sexdeterrmine diff --git a/CHANGELOG.md b/CHANGELOG.md index a0b308b4c..0d55a2f8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### `Fixed` +- [#838] Fix --snpcapture_bed files not being picked up by Nextflow +- Fix PMDtools reference mask not being picked up by Nextflow, and it's use being evaluated against --snpcapture_bed rather than --pmdtools_reference_mask + ### `Dependencies` ### `Deprecated` diff --git a/main.nf b/main.nf index 6f89cd0fa..7125feb2e 100644 --- a/main.nf +++ b/main.nf @@ -245,6 +245,17 @@ if ( !params.clip_adapters_list ) { .set {ch_adapterlist} } +if ( params.snpcapture_bed ) { + Channel.fromPath(params.snpcapture_bed, checkIfExists: true).into { ch_snpcapture_bed; ch_snpcapture_bed_pmd } +} else { + Channel.fromPath("$projectDir/assets/nf-core_eager_dummy.txt").into { ch_snpcapture_bed; ch_snpcapture_bed_pmd } +} + +if ( params.pmdtools_reference_mask ) { + ch_pmdtoolsmask = Channel.fromPath(params.pmdtools_reference_mask, checkIfExists: true) +} else { + ch_pmdtoolsmask = Channel.fromPath("$projectDir/assets/nf-core_eager_dummy2.txt") +} // SexDetermination channel set up and bedfile validation if (!params.sexdeterrmine_bedfile) { @@ -2137,6 +2148,8 @@ process pmdtools { input: tuple samplename, libraryid, lane, seqtype, organism, strandedness, udg, path(bam), path(bai) from ch_rmdup_for_pmdtools file fasta from ch_fasta_for_pmdtools.collect() + path snpcapture_bed from ch_snpcapture_bed_pmd + path pmdtools_reference_mask from ch_pmdtoolsmask output: tuple samplename, libraryid, lane, seqtype, organism, strandedness, udg, path("*.pmd.bam"), path("*.pmd.bam.{bai,csi}") into ch_output_from_pmdtools @@ -2145,12 +2158,8 @@ process pmdtools { script: //Check which treatment for the libraries was used def treatment = udg ? (udg == 'half' ? '--UDGhalf' : '--CpG') : '--UDGminus' - if(params.snpcapture_bed){ - snpcap = (params.pmdtools_reference_mask) ? "--refseq ${params.pmdtools_reference_mask}" : '' - log.info"######No reference mask specified for PMDtools, therefore ignoring that for downstream analysis!" - } else { - snpcap = '' - } + def snpcap = snpcapture_bed.getName() != 'nf-core_eager_dummy.txt' ? "--refseq ${pmdtools_reference_mask} --basecomposition" : '' + if ( snpcapture_bed.getName() != 'nf-core_eager_dummy.txt' && !params.pmdtools_reference_mask ) { log.info "[nf-core/eager] warn: No reference mask specified for PMDtools, therefore ignoring that for downstream analysis!" } def size = params.large_ref ? '-c' : '' def platypus = params.pmdtools_platypus ? '--platypus' : '' """ @@ -2281,12 +2290,13 @@ process qualimap { input: tuple samplename, libraryid, lane, seqtype, organism, strandedness, udg, path(bam), path(bai) from ch_addlibmerge_for_qualimap file fasta from ch_fasta_for_qualimap.collect() + path snpcapture_bed from ch_snpcapture_bed output: tuple samplename, libraryid, lane, seqtype, organism, strandedness, udg, path("*") into ch_qualimap_results script: - def snpcap = params.snpcapture_bed ? "-gff ${params.snpcapture_bed}" : '' + def snpcap = snpcapture_bed.getName() != 'nf-core_eager_dummy.txt' ? "-gff ${snpcapture_bed}" : '' """ qualimap bamqc -bam $bam -nt ${task.cpus} -outdir . -outformat "HTML" ${snpcap} --java-mem-size=${task.memory.toGiga()}G """