Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/nftest_haplotyper' into nftest_h…
Browse files Browse the repository at this point in the history
…aplotyper
  • Loading branch information
FriederikeHanssen committed Jul 31, 2024
2 parents 66a0bb4 + 49d8cfd commit 4e983df
Show file tree
Hide file tree
Showing 109 changed files with 1,659 additions and 1,048 deletions.
2 changes: 1 addition & 1 deletion modules/nf-core/antismash/antismashlite/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ nextflow_process {
"""
input[0] = [
[ id:'test' ],
file(params.test_data['bacteroides_fragilis']['genome']['genome_gbff_gz'], checkIfExists: true)
file(params.modules_testdata_base_path + 'genomics/prokaryotes/bacteroides_fragilis/genome/genome.gbff.gz', checkIfExists: true)
]
"""
}
Expand Down
4 changes: 2 additions & 2 deletions modules/nf-core/bclconvert/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ nextflow_process {
"""
input[0] = [
[ id: 'test', lane:1 ],
file(params.test_data['homo_sapiens']['illumina']['test_flowcell_samplesheet'], checkIfExists: true),
file(params.test_data['homo_sapiens']['illumina']['test_flowcell'], checkIfExists: true)
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bcl/flowcell_samplesheet.csv', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bcl/flowcell.tar.gz', checkIfExists: true)
]
"""
}
Expand Down
4 changes: 2 additions & 2 deletions modules/nf-core/bedops/convert2bed/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ nextflow_process {
"""
input[0] = [
[ id:'test' ], // meta map
file(params.test_data['sarscov2']['genome']['genome_gtf'], checkIfExists: true)
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.gtf', checkIfExists: true)
]
"""
}
Expand All @@ -41,7 +41,7 @@ nextflow_process {
"""
input[0] = [
[ id:'test' ], // meta map
file(params.test_data['sarscov2']['genome']['genome_gtf'], checkIfExists: true)
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.gtf', checkIfExists: true)
]
"""
}
Expand Down
4 changes: 2 additions & 2 deletions modules/nf-core/bedops/gtf2bed/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ nextflow_process {
process {
"""
input[0] = [[ id:'test' ], // meta map
file(params.test_data['homo_sapiens']['genome']['genome_gtf'], checkIfExists: true)
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists: true)
]
"""
}
Expand All @@ -38,7 +38,7 @@ nextflow_process {
process {
"""
input[0] = [[ id:'test' ], // meta map
file(params.test_data['homo_sapiens']['genome']['genome_gtf'], checkIfExists: true)
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists: true)
]
"""
}
Expand Down
8 changes: 4 additions & 4 deletions modules/nf-core/biscuit/align/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ nextflow_process {
script "../../index/main.nf"
process {
"""
input[0] = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
input[0] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
"""
}
}
Expand All @@ -28,7 +28,7 @@ nextflow_process {
"""
input[0] = [
[ id:'test' ], // meta map
[ file(params.test_data['sarscov2']['illumina']['test_methylated_1_fastq_gz'], checkIfExists: true) ]
[ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test.methylated_1.fastq.gz', checkIfExists: true) ]
]
input[1] = BISCUIT_INDEX.out.index
"""
Expand All @@ -52,8 +52,8 @@ nextflow_process {
"""
input[0] = [
[ id:'test' ], // meta map
[ file(params.test_data['sarscov2']['illumina']['test_methylated_1_fastq_gz'], checkIfExists: true),
file(params.test_data['sarscov2']['illumina']['test_methylated_2_fastq_gz'], checkIfExists: true) ]
[ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test.methylated_1.fastq.gz', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test.methylated_2.fastq.gz', checkIfExists: true) ]
]
input[1] = BISCUIT_INDEX.out.index
"""
Expand Down
10 changes: 5 additions & 5 deletions modules/nf-core/biscuit/bsconv/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ nextflow_process {
script "../../index/main.nf"
process {
"""
input[0] = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
input[0] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
"""
}
}
Expand All @@ -27,8 +27,8 @@ nextflow_process {
process {
"""
input[0] = [ [id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['illumina']['test_paired_end_methylated_sorted_bam'], checkIfExists: true),
file(params.test_data['sarscov2']['illumina']['test_paired_end_methylated_sorted_bam_bai'], checkIfExists: true)
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam.bai', checkIfExists: true)
]
input[1] = BISCUIT_INDEX.out.index
Expand All @@ -54,8 +54,8 @@ nextflow_process {
process {
"""
input[0] = [ [id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['illumina']['test_paired_end_methylated_sorted_bam'], checkIfExists: true),
file(params.test_data['sarscov2']['illumina']['test_paired_end_methylated_sorted_bam_bai'], checkIfExists: true)
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam.bai', checkIfExists: true)
]
input[1] = BISCUIT_INDEX.out.index
Expand Down
5 changes: 3 additions & 2 deletions modules/nf-core/checkqc/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ channels:
- defaults
dependencies:
- python=3.8
- numpy=1.26
- pip
- pip: # FIXME https://github.com/nf-core/modules/issues/5814
- checkqc==3.8.0
- interop==1.2.4
- checkqc==4.0.3
- interop==1.3.2
11 changes: 9 additions & 2 deletions modules/nf-core/checkqc/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ process CHECKQC {
tag "$meta.id"
label 'process_single'

container "community.wave.seqera.io/library/python_pip_interop_checkqc:d76c912c8fadc561"
container "community.wave.seqera.io/library/python_numpy_pip_checkqc_interop:b5301d9801b8e66b"

input:
tuple val(meta), path(run_dir)
path(checkqc_config)

output:
tuple val(meta), path("*checkqc_report.json"), emit: report
tuple val(meta), path("*checkqc_log.txt") , emit: log
path "versions.yml" , emit: versions

when:
Expand All @@ -29,7 +30,13 @@ process CHECKQC {
$args \
$config \
--json \
$run_dir > checkqc_report.json
$run_dir > checkqc_report.json 2> checkqc_log.txt || true
# Check if the output JSON file is empty
if [[ ! -s checkqc_report.json ]] ; then
echo "Error: Empty JSON files. Most likely due to missing files in run directory. See checkQC log file for errors."
exit 1
fi
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
4 changes: 4 additions & 0 deletions modules/nf-core/checkqc/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ output:
type: file
description: CheckQC report in json format
pattern: "*checkqc_report.json"
- log:
type: file
description: CheckQC log in txt format
pattern: "*_log.txt"

authors:
- "@matrulda"
76 changes: 75 additions & 1 deletion modules/nf-core/checkqc/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,81 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
{ assert snapshot(process.out).match() },
{ assert process.out.report },
{ assert process.out.report.size() == 1 },
{ assert process.out.report.get(0).get(1) ==~ ".*/checkqc_report.json" },
{ assert path(process.out.report.get(0).get(1)).json.exit_status == 0 },
{ assert process.out.log },
{ assert path(process.out.log.get(0).get(1)).getText().contains("Instrument and reagent version: hiseq2500_rapidhighoutput_v4") }

)
}

}
test("homo_sapiens illumina test_miseq_noRunParameters - Log Error: no File") {
config "./nextflow.config"

setup {
run("UNTAR") {
script "../../untar/main.nf"
process {
"""
input[0] = Channel.of([[id: 'test_no_xml'], file('https://github.com/nf-core/test-datasets/raw/demultiplex/testdata/MiSeq/220422_M11111_0222_000000000-K9H97.tar.gz', checkIfExists: true)])
"""
}
}
}

when {
process {
"""
input[0] = UNTAR.out.untar
input[1] = []
"""
}
}

then {
assertAll(
{ assert process.failed }
)
}

}

test("homo_sapiens illumina test_interop_bcl2fastqstats_flowcell - QC Error") {

setup {
run("UNTAR") {
script "../../untar/main.nf"
process {
"""
input[0] = Channel.of([[id: 'test_no_downgrade_errors'], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/interop_bcl2fastqstats/test_flowcell_stats.tar.gz', checkIfExists: true)])
"""
}
}
}

when {
process {
"""
input[0] = UNTAR.out.untar
input[1] = []
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() },
{ assert process.out.report },
{ assert process.out.report.size() == 1 },
{ assert process.out.report.get(0).get(1) ==~ ".*/checkqc_report.json" },
{ assert path(process.out.report.get(0).get(1)).json.exit_status == 1 },
{ assert process.out.log },
{ assert path(process.out.log.get(0).get(1)).getText().contains("ERROR Fatal QC error") }
)
}

Expand Down
77 changes: 71 additions & 6 deletions modules/nf-core/checkqc/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,53 @@
{
"homo_sapiens illumina test_interop_bcl2fastqstats_flowcell - QC Error": {
"content": [
{
"0": [
[
{
"id": "test_no_downgrade_errors"
},
"checkqc_report.json:md5,c0c5655b8f09d848de97f79073b2eae0"
]
],
"1": [
[
{
"id": "test_no_downgrade_errors"
},
"checkqc_log.txt:md5,687d57a112fda6f56755d45e5c9cd0be"
]
],
"2": [
"versions.yml:md5,7c921c68a4de1cc3345edb1fd88444d1"
],
"log": [
[
{
"id": "test_no_downgrade_errors"
},
"checkqc_log.txt:md5,687d57a112fda6f56755d45e5c9cd0be"
]
],
"report": [
[
{
"id": "test_no_downgrade_errors"
},
"checkqc_report.json:md5,c0c5655b8f09d848de97f79073b2eae0"
]
],
"versions": [
"versions.yml:md5,7c921c68a4de1cc3345edb1fd88444d1"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.3"
},
"timestamp": "2024-07-29T15:12:42.632194365"
},
"homo_sapiens illumina test_interop_bcl2fastqstats_flowcell - QC OK": {
"content": [
{
Expand All @@ -7,29 +56,45 @@
{
"id": "test"
},
"checkqc_report.json:md5,c69cb912a8c5bf53544764bd5bd73ae5"
"checkqc_report.json:md5,7e3ac9ce7163436cbd5f5420ca08ffcd"
]
],
"1": [
"versions.yml:md5,c37381fc450f4ed00da2987430db8177"
[
{
"id": "test"
},
"checkqc_log.txt:md5,3e196f53b93d614580436bc574daea45"
]
],
"2": [
"versions.yml:md5,7c921c68a4de1cc3345edb1fd88444d1"
],
"log": [
[
{
"id": "test"
},
"checkqc_log.txt:md5,3e196f53b93d614580436bc574daea45"
]
],
"report": [
[
{
"id": "test"
},
"checkqc_report.json:md5,c69cb912a8c5bf53544764bd5bd73ae5"
"checkqc_report.json:md5,7e3ac9ce7163436cbd5f5420ca08ffcd"
]
],
"versions": [
"versions.yml:md5,c37381fc450f4ed00da2987430db8177"
"versions.yml:md5,7c921c68a4de1cc3345edb1fd88444d1"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nf-test": "0.9.0",
"nextflow": "24.04.3"
},
"timestamp": "2024-07-17T18:30:52.712542733"
"timestamp": "2024-07-29T15:12:10.423534926"
}
}
Loading

0 comments on commit 4e983df

Please sign in to comment.