Skip to content

Commit

Permalink
Merge pull request #117 from nf-core/fromSamplesheet
Browse files Browse the repository at this point in the history
Use fromSamplesheet
  • Loading branch information
edmundmiller committed Aug 25, 2023
2 parents 1b86d34 + 243b4dd commit 024d7b7
Show file tree
Hide file tree
Showing 9 changed files with 214 additions and 509 deletions.
10 changes: 7 additions & 3 deletions assets/schema_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,26 @@
"sample": {
"type": "string",
"pattern": "^\\S+$",
"errorMessage": "Sample name must be provided and cannot contain spaces"
"errorMessage": "Sample name must be provided and cannot contain spaces",
"meta": ["id"]
},
"fastq_1": {
"type": "string",
"format": "file-path",
"exists": true,
"pattern": "^\\S+\\.f(ast)?q\\.gz$",
"errorMessage": "FastQ file for reads 1 must be provided, cannot contain spaces and must have extension '.fq.gz' or '.fastq.gz'"
},
"fastq_2": {
"errorMessage": "FastQ file for reads 2 cannot contain spaces and must have extension '.fq.gz' or '.fastq.gz'",
"type": "string",
"format": "file-path",
"exists": true,
"anyOf": [
{
"type": "string",
"pattern": "^\\S+\\.f(ast)?q\\.gz$"
},
{
"type": "string",
"maxLength": 0
}
]
Expand Down
259 changes: 0 additions & 259 deletions bin/check_samplesheet.py

This file was deleted.

21 changes: 21 additions & 0 deletions lib/WorkflowNascent.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,27 @@ class WorkflowNascent {
}
}

//
// Function to validate channels from input samplesheet
//
public static ArrayList validateInput(input) {
def (metas, fastqs) = input[1..2]

// Check that multiple runs of the same sample are of the same strandedness
def strandedness_ok = metas.collect{ it.strandedness }.unique().size == 1
if (!strandedness_ok) {
Nextflow.error("Please check input samplesheet -> Multiple runs of a sample must have the same strandedness!: ${metas[0].id}")
}

// Check that multiple runs of the same sample are of the same datatype i.e. single-end / paired-end
def endedness_ok = metas.collect{ it.single_end }.unique().size == 1
if (!endedness_ok) {
Nextflow.error("Please check input samplesheet -> Multiple runs of a sample must be of the same datatype i.e. single-end or paired-end: ${metas[0].id}")
}

return [ metas[0], fastqs ]
}

//
// Get workflow summary for MultiQC
//
Expand Down
31 changes: 0 additions & 31 deletions modules/local/samplesheet_check.nf

This file was deleted.

1 change: 1 addition & 0 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"format": "file-path",
"exists": true,
"mimetype": "text/csv",
"schema": "assets/schema_input.json",
"pattern": "^\\S+\\.csv$",
"description": "Path to comma-separated file containing information about the samples in the experiment.",
"help_text": "You will need to create a design file with information about the samples in your experiment before running the pipeline. Use this parameter to specify its location. It has to be a comma-separated file with 3 columns, and a header row. See [usage docs](https://nf-co.re/nascent/usage#samplesheet-input).",
Expand Down

0 comments on commit 024d7b7

Please sign in to comment.