Solenne Correard
12/04/2025, 9:56 AMsample,gff,fasta
Pb3A,Pb3A_genomic.gff,Pb3A_genomic.fna
PbeH,PbeH_genomic.gff,PbeH_genomic.fna
and here what we would like to do : run GFFread for each sample, knowing that it as to take the gff and fasta from the same row in the sheet (and do it for each row).
GFFREAD (gff,fasta)
If someone could suggest the appropriate code, that would be great
Thanks!Mahesh Binzer-Panchal
12/04/2025, 9:59 AMMahesh Binzer-Panchal
12/04/2025, 10:00 AMNicolas Vannieuwkerke
12/04/2025, 10:21 AMSolenne Correard
12/04/2025, 10:31 AMMahesh Binzer-Panchal
12/04/2025, 10:32 AMNicolas Vannieuwkerke
12/04/2025, 10:34 AMPhil Ewels
12/04/2025, 10:48 AMPhil Ewels
12/04/2025, 10:48 AMPhil Ewels
12/04/2025, 10:48 AMPhil Ewels
12/04/2025, 10:49 AMinclude { samplesheetToList } from 'plugin/nf-schema'
workflow {
ch_input = Channel.fromList(samplesheetToList(params.input, "assets/schema_input.json"))
ch_input.view()
}Phil Ewels
12/04/2025, 10:49 AMPhil Ewels
12/04/2025, 10:50 AMNicolas Vannieuwkerke
12/04/2025, 10:50 AMPhil Ewels
12/04/2025, 10:50 AMNicolas Vannieuwkerke
12/04/2025, 10:51 AMPhil Ewels
12/04/2025, 10:51 AMPhil Ewels
12/04/2025, 10:51 AMPhil Ewels
12/04/2025, 10:51 AMNicolas Vannieuwkerke
12/04/2025, 10:52 AMsamplesheet_json_schema would make more sensePhil Ewels
12/04/2025, 10:52 AMSolenne Correard
12/04/2025, 10:56 AMnf-core pipeline samplesheet function that would guide the user through the creation of their samplesheet, the json schema and would write the parsing code?Phil Ewels
12/04/2025, 11:12 AMPhil Ewels
12/04/2025, 11:13 AMPhil Ewels
12/04/2025, 11:14 AMSolenne Correard
12/04/2025, 12:17 PMMahesh Binzer-Panchal
12/04/2025, 12:21 PMMahesh Binzer-Panchal
12/04/2025, 12:27 PMWrite me an nf-schema for
sample,gff,fasta
Pb3A,Pb3A_genomic.gff,Pb3A_genomic.fna
Output:PbeH,PbeH_genomic.gff,PbeH_genomic.fna
I'll create an nf-schema for your samplesheet. This schema will validate the CSV format with columns for sample, gff, and fasta files.
Created 'nextflow_schema.json' with 35 lines.
{ "$schema": "http://json-schema.org/draft-07/schema", "$id": "https://raw.githubusercontent.com/your-pipeline/master/nextflow_schema.json", "title": "Pipeline schema", "description": "Schema for validating pipeline samplesheet", "type": "object", "definitions": { "in...
Created 'assets/schema_input.json' with 34 lines.
{ "$schema": "http://json-schema.org/draft-07/schema", "$id": "https://raw.githubusercontent.com/your-pipeline/master/assets/schema_input.json", "title": "Pipeline input schema", "description": "Schema for the file provided with params.input", "type": "array", "items": { ...
Perfect! I've created an nf-schema for your samplesheet with the following structure:
Files Created:
1. nextflow_schema.json - Main pipeline schema
• Defines theparameter that points to your CSV samplesheetinput
• References the samplesheet schema inassets/schema_input.json
2. assets/schema_input.json - Samplesheet validation schema
Validates each row in your CSV with:
• sample: Required, no spaces allowed
• gff: Required, must end withextension and file must exist.gff
• fasta: Required, must end with,.fasta, or.faextension and file must exist.fna
How to Use:
1. In your, add:nextflow.config
plugins {
id 'nf-schema@2.0.0'
}
1. In your, validate the input:<http://main.nf|main.nf>
include { validateParameters; paramsSummaryLog; samplesheetToList } from 'plugin/nf-schema'
// Validate input parameters
*validateParameters*()
// Create channel from samplesheet
ch_input = Channel.*fromList*(*samplesheetToList*(params.input, "assets/schema_input.json"))
.map { meta, gff, fasta ->
[ meta, *file*(gff), *file*(fasta) ]
}
The schema will automatically validate that your CSV has the correct format and that all referenced files exist!(There are
expand buttons on the schema's to give the full schema.)