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

Replicates samplesheet test #476

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions assets/samplesheet_replicates.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
sample,fastq_1,fastq_2,genome
SRR389222,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/SRR389222_sub1.fastq.gz,,
SRR389222,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/SRR389222_sub2.fastq.gz,,
SRR389222,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/SRR389222_sub3.fastq.gz,,
Ecoli_10K_methylated,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/Ecoli_10K_methylated_R1.fastq.gz,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/Ecoli_10K_methylated_R2.fastq.gz,
4 changes: 0 additions & 4 deletions conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,5 @@ process {
memory: '15.GB',
time: '1.h'
]

withName: PRESEQ_LCEXTRAP {
errorStrategy = 'ignore'
}
}

6 changes: 0 additions & 6 deletions conf/test_full.config
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,3 @@ params {
input = "${params.pipelines_testdata_base_path}/samplesheet/samplesheet_full.csv"
genome = 'GRCh38'
}

process {
withName: PRESEQ_LCEXTRAP {
errorStrategy = 'ignore'
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
nextflow_pipeline {

name "Test Workflow main.nf"
script "../main.nf"
config "./nextflow.config"

test("Params: bismark | CAT_FASTQ | skip_trimming | skip_deduplication") {
when {
params {
input = "${projectDir}/assets/samplesheet_replicates.csv"
outdir = "$outputDir"
skip_trimming = true
skip_deduplication = true
}
}

then {
// stable_name: All files + folders in ${params.outdir}/ with a stable name
def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}'])
// stable_path: All files in ${params.outdir}/ with stable content
def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore')
// bam_files: All bam files
def bam_files = getAllFilesFromDir(params.outdir, include: ['**/*.bam'])
assertAll(
{ assert workflow.success},
{ assert snapshot(
// Number of tasks
workflow.trace.succeeded().size(),
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
removeNextflowVersion("$outputDir/pipeline_info/nf_core_pipeline_software_mqc_versions.yml"),
// All stable path name
stable_name,
// All files with stable contents
stable_path,
// All bam files
bam_files.collect{ file -> [ file.getName(), bam(file.toString()).getReadsMD5() ] }
).match() }
)
}
}

}

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions tests/bismark_run_qualimap.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@
"genome_mapping_quality_histogram.png:md5,74776b1e7e8c8876af1cf89d9dbb5f31",
"genome_reads_content_per_read_position.png:md5,c6920dc357411880132c207c7d0aa68d",
"genome_uniq_read_starts_histogram.png:md5,8f7549a63eee3d3f022699aaa5bb858d",
"qualimapReport.html:md5,bbc015c0d1f3c41a08c82fb7a6839039",
"qualimapReport.html:md5,e2274cb2b25345dc7b76b89fa7730a04",
"coverage_across_reference.txt:md5,2bb9eb828acfd71ace8f1e6a2ca124b4",
"coverage_histogram.txt:md5,6ee761660a6072e5b6b75b7fe8d2c69e",
"duplication_rate_histogram.txt:md5,d5f25ad3572b98880b6904dcf4b3ed25",
Expand Down Expand Up @@ -601,7 +601,7 @@
"genome_mapping_quality_histogram.png:md5,7ba0db9375d09fd49946b9bca4ba92b4",
"genome_reads_content_per_read_position.png:md5,1a6a7717ea948d2518808f72f58ffdef",
"genome_uniq_read_starts_histogram.png:md5,395413ab1d0e10af72b116fd8cb12685",
"qualimapReport.html:md5,1fe626f663d66a7ce0c6e1e0207d829d",
"qualimapReport.html:md5,e841c7cc3bb8beca037a98e55d3d7a12",
"coverage_across_reference.txt:md5,081ddc3be3349b0c57d9676c03d84803",
"coverage_histogram.txt:md5,47b75803a6925e883e254bb91d6220d2",
"duplication_rate_histogram.txt:md5,3d06b34e40d1fdeb55c4ad19dc6ddad1",
Expand Down Expand Up @@ -643,7 +643,7 @@
"genome_mapping_quality_histogram.png:md5,017451f46bc875ac58e7906bf7979956",
"genome_reads_content_per_read_position.png:md5,fd94ec5bfe5ca4adfa6ebdeaebe25157",
"genome_uniq_read_starts_histogram.png:md5,2f2555ef88c3bda05315469e684f5b19",
"qualimapReport.html:md5,af640b29bd28f80bdc0ab6fe7d9c97f4",
"qualimapReport.html:md5,ef10a67a886f948f244a74506ea96071",
"coverage_across_reference.txt:md5,a76b3da0ebb2f8bd6c36ec1902cf13f2",
"coverage_histogram.txt:md5,ca854c05e9619233b7d95d44051cab80",
"duplication_rate_histogram.txt:md5,530bb05c648d610227e121e1e74f41f8",
Expand Down Expand Up @@ -685,7 +685,7 @@
"genome_mapping_quality_histogram.png:md5,a22ee10fcb9e34a84f607b089855fb92",
"genome_reads_content_per_read_position.png:md5,9fa406f353148448f6b9ac11880bc6de",
"genome_uniq_read_starts_histogram.png:md5,cf2fe3e30e11e7d6eb2db679cd12dc03",
"qualimapReport.html:md5,c8114fbb2a63da68111f0d4cbb8a1973",
"qualimapReport.html:md5,c600f4100ccb57a26ac2132c575f8e3e",
"coverage_across_reference.txt:md5,fb9c989fc6c15d0a8fd0a58b8d3c20ce",
"coverage_histogram.txt:md5,8a3f45461442657433914c6a5ecb1301",
"duplication_rate_histogram.txt:md5,ec9a705fd3a300b126d556afa14c326b",
Expand Down Expand Up @@ -752,6 +752,6 @@
"nf-test": "0.9.2",
"nextflow": "24.10.2"
},
"timestamp": "2024-11-28T09:47:26.992492832"
"timestamp": "2024-11-30T14:38:57.39810446"
}
}
}
30 changes: 24 additions & 6 deletions workflows/methylseq/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ workflow METHYLSEQ {

main:

ch_fastq = Channel.empty()
ch_fastqc_html = Channel.empty()
ch_fastqc_zip = Channel.empty()
ch_reads = Channel.empty()
ch_bam = Channel.empty()
ch_bai = Channel.empty()
ch_qualimap = Channel.empty()
ch_preseq = Channel.empty()
ch_multiqc_files = Channel.empty()

//
Expand Down Expand Up @@ -64,6 +72,8 @@ workflow METHYLSEQ {
FASTQC (
ch_fastq
)
ch_fastqc_html = FASTQC.out.html
ch_fastqc_zip = FASTQC.out.zip
ch_multiqc_files = ch_multiqc_files.mix(FASTQC.out.zip.collect{ meta, zip -> zip })
ch_versions = ch_versions.mix(FASTQC.out.versions.first())

Expand All @@ -74,10 +84,10 @@ workflow METHYLSEQ {
TRIMGALORE(
ch_fastq
)
reads = TRIMGALORE.out.reads
ch_reads = TRIMGALORE.out.reads
ch_versions = ch_versions.mix(TRIMGALORE.out.versions.first())
} else {
reads = ch_fastq
ch_reads = ch_fastq
}

//
Expand All @@ -90,28 +100,30 @@ workflow METHYLSEQ {
// Run Bismark alignment + downstream processing
//
FASTQ_ALIGN_DEDUP_BISMARK (
reads,
ch_reads,
ch_fasta,
ch_bismark_index,
params.skip_deduplication || params.rrbs,
params.cytosine_report || params.nomeseq
)
ch_versions = ch_versions.mix(FASTQ_ALIGN_DEDUP_BISMARK.out.versions.unique{ it.baseName })
ch_bam = FASTQ_ALIGN_DEDUP_BISMARK.out.bam
ch_bam = FASTQ_ALIGN_DEDUP_BISMARK.out.bam
ch_bai = FASTQ_ALIGN_DEDUP_BISMARK.out.bai
ch_aligner_mqc = FASTQ_ALIGN_DEDUP_BISMARK.out.multiqc
}
// Aligner: bwameth
else if ( params.aligner == 'bwameth' ){

FASTQ_ALIGN_DEDUP_BWAMETH (
reads,
ch_reads,
ch_fasta,
ch_fasta_index.map{ index -> [ [:], index ]},
ch_bwameth_index,
params.skip_deduplication || params.rrbs,
)
ch_versions = ch_versions.mix(FASTQ_ALIGN_DEDUP_BWAMETH.out.versions.unique{ it.baseName })
ch_bam = FASTQ_ALIGN_DEDUP_BWAMETH.out.bam
ch_bam = FASTQ_ALIGN_DEDUP_BWAMETH.out.bam
ch_bai = FASTQ_ALIGN_DEDUP_BWAMETH.out.bai
ch_aligner_mqc = FASTQ_ALIGN_DEDUP_BWAMETH.out.multiqc
}

Expand All @@ -124,6 +136,7 @@ workflow METHYLSEQ {
ch_bam,
params.bamqc_regions_file ? Channel.fromPath( params.bamqc_regions_file, checkIfExists: true ).toList() : []
)
ch_qualimap = QUALIMAP_BAMQC.out.results
ch_versions = ch_versions.mix(QUALIMAP_BAMQC.out.versions.first())
}

Expand All @@ -135,6 +148,7 @@ workflow METHYLSEQ {
PRESEQ_LCEXTRAP (
ch_bam
)
ch_preseq = PRESEQ_LCEXTRAP.out.lc_extrap
ch_versions = ch_versions.mix(PRESEQ_LCEXTRAP.out.versions.first())
}

Expand Down Expand Up @@ -199,6 +213,10 @@ workflow METHYLSEQ {
)

emit:
bam = ch_bam // channel: [ path(bam) ]
bai = ch_bai // channel: [ path(bai) ]
qualimap = ch_qualimap // channel: [ path(qualimap) ]
preseq = ch_preseq // channel: [ path(preseq) ]
multiqc_report = MULTIQC.out.report.toList() // channel: [ path(multiqc_report.html ) ]
versions = ch_versions // channel: [ path(versions.yml) ]
}
Expand Down