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

Updated samshee #240

Merged
merged 11 commits into from
Aug 12, 2024
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#216](https://github.com/nf-core/demultiplex/pull/216) List fastq reports for R1 and R2 separately in multiqc report.
- [#219](https://github.com/nf-core/demultiplex/pull/219) Modified workflow to store samplesheet in results folder.
- [#217](https://github.com/nf-core/demultiplex/pull/217) Update all nf-core modules and tests.
- [#240](https://github.com/nf-core/demultiplex/pull/240) Updated samshee, stub script and error strategy

### `Fixed`

Expand Down
4 changes: 4 additions & 0 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ process {
mode: params.publish_dir_mode
]
}
//Samshee should fail the entire pipeline immediately as it validated the illumina samplesheet to be valid before the pipeline runs. As such, it should not be running more than once & if it fails should stop the pipeline
apeltzer marked this conversation as resolved.
Show resolved Hide resolved
withName: SAMSHEE {
errorStrategy = "terminate"
}

}

80 changes: 0 additions & 80 deletions modules/local/samshee/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -45,90 +45,10 @@ process SAMSHEE {

stub:
"""
#Generate minimal samplesheet
cat <<-END_SAMPLE_SHEET > minimal_samplesheet.csv
[Header]
FileFormatVersion,2
RunName,Run_001
Instrument Type,NextSeq 1000
InstrumentPlatform,NextSeq 1000

[Reads]
Read1Cycles,150
Read2Cycles,150
Index1Cycles,8
Index2Cycles,8

[Settings]

[Data]
Sample_ID,Sample_Name,Description,Sample_Project
Sample1,Sample1,,
END_SAMPLE_SHEET


#Generate minimal schema validator file
cat <<-END_SCHEMA > minimal_schema.json
{
"type": "object",
"properties": {
"Header": {
"type": "object",
"properties": {
"FileFormatVersion": { "type": "integer" },
"RunName": { "type": "string" },
"Instrument Type": { "type": "string" },
"InstrumentPlatform": { "type": "string" }
},
"required": ["FileFormatVersion", "RunName", "Instrument Type", "InstrumentPlatform"]
},
"Reads": {
"type": "object",
"properties": {
"Read1Cycles": { "type": "integer" },
"Read2Cycles": { "type": "integer" },
"Index1Cycles": { "type": "integer" },
"Index2Cycles": { "type": "integer" }
},
"required": ["Read1Cycles", "Read2Cycles", "Index1Cycles", "Index2Cycles"]
},
"Settings": {
"type": "object"
},
"Data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"Sample_ID": { "type": "string" },
"Sample_Name": { "type": "string" },
"Description": { "type": "string" },
"Sample_Project": { "type": "string" }
},
"required": ["Sample_ID", "Sample_Name", "Description", "Sample_Project"]
}
}
},
"required": ["Header", "Reads", "Settings", "Data"]
}
END_SCHEMA

# Run validation command and capture output
output=\$(validate_samplesheet.py minimal_samplesheet.csv minimal_schema.json 2>&1)
status=\$?
# Check if validation failed
if echo "\$output" | grep -q "Validation failed:"; then
echo "\$output" # Print output for debugging
exit 1 # Fail the process if validation failed
fi

cat <<-END_VERSIONS > versions.yml
"${task.process}":
samshee: \$( python -m pip show --version samshee | grep "Version" | sed -e "s/Version: //g" )
python: \$( python --version | sed -e "s/Python //g" )
END_VERSIONS

# If no validation errors, process exits with status 0
exit \$status
"""
}
50 changes: 25 additions & 25 deletions tests/pipeline/skip_tools.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.3"
"nextflow": "24.04.4"
},
"timestamp": "2024-07-25T20:38:35.033660203"
"timestamp": "2024-08-12T17:10:00.298491082"
},
"skip_fastqc": {
"content": [
Expand All @@ -30,10 +30,10 @@
]
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "23.10.1"
"nf-test": "0.8.4",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-07T15:11:46.12688"
"timestamp": "2024-08-12T17:13:45.68600951"
},
"skip_fastp": {
"content": [
Expand All @@ -56,10 +56,10 @@
]
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "23.10.1"
"nf-test": "0.8.4",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-07T15:09:48.227109"
"timestamp": "2024-08-12T17:11:10.977146544"
},
"skip_multiqc": {
"content": [
Expand All @@ -82,10 +82,10 @@
]
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "23.10.1"
"nf-test": "0.8.4",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-07T15:14:47.991287"
"timestamp": "2024-08-12T17:16:50.422490047"
},
"skip_fastp_fastqc": {
"content": [
Expand All @@ -108,50 +108,50 @@
]
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "23.10.1"
"nf-test": "0.8.4",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-07T15:13:01.794999"
"timestamp": "2024-08-12T17:15:14.973440084"
},
"software_versions_skip_fastqc": {
"content": [
"{BCLCONVERT={bclconvert=4.3.6}, FALCO={falco=1.2.1}, FASTP={fastp=0.23.4}, MD5SUM={md5sum=8.3}, Workflow={nf-core/demultiplex=v1.5.0dev}}"
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.3"
"nextflow": "24.04.4"
},
"timestamp": "2024-07-25T20:40:12.591107775"
"timestamp": "2024-08-12T17:13:40.000621044"
},
"software_versions_skip_fastp_fastqc": {
"content": [
"{BCLCONVERT={bclconvert=4.3.6}, FALCO={falco=1.2.1}, MD5SUM={md5sum=8.3}, Workflow={nf-core/demultiplex=v1.5.0dev}}"
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.3"
"nextflow": "24.04.4"
},
"timestamp": "2024-07-25T20:40:52.373539308"
"timestamp": "2024-08-12T17:15:06.589630757"
},
"software_versions_skip_multiqc": {
"content": [
"{BCLCONVERT={bclconvert=4.3.6}, FALCO={falco=1.2.1}, FASTP={fastp=0.23.4}, MD5SUM={md5sum=8.3}, Workflow={nf-core/demultiplex=v1.5.0dev}}"
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.3"
"nextflow": "24.04.4"
},
"timestamp": "2024-07-25T20:41:53.704450617"
"timestamp": "2024-08-12T17:16:39.766616774"
},
"software_versions_skip_fastp": {
"content": [
"{BCLCONVERT={bclconvert=4.3.6}, FALCO={falco=1.2.1}, MD5SUM={md5sum=8.3}, Workflow={nf-core/demultiplex=v1.5.0dev}}"
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.3"
"nextflow": "24.04.4"
},
"timestamp": "2024-07-25T20:39:04.450501154"
"timestamp": "2024-08-12T17:11:08.013153743"
},
"skip_trimming": {
"content": [
Expand All @@ -174,9 +174,9 @@
]
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "23.10.1"
"nf-test": "0.8.4",
apeltzer marked this conversation as resolved.
Show resolved Hide resolved
"nextflow": "24.04.4"
},
"timestamp": "2024-08-07T15:08:34.10467"
"timestamp": "2024-08-12T17:10:00.32545302"
}
}
Loading