refactor: Switch to SRA direct download for samples

This commit is contained in:
Thomas A. Christensen II 2023-10-19 11:38:43 -05:00
parent 9f70b504e2
commit 3e411cc688
Signed by: millironx
GPG key ID: 09335146883990B9
2 changed files with 12 additions and 7 deletions

View file

@ -12,12 +12,12 @@
"pattern": "^\\S+$",
"errorMessage": "Sample name must be provided and cannot contain spaces"
},
"fastq_1": {
"sra": {
"type": "string",
"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'"
"pattern": "^(((SR|ER|DR)[APRSX])|(SAM(N|EA|D))|(PRJ(NA|EB|DB))|(GS[EM])|(syn))(\\d+)$",
"errorMessage": "Please provide a valid SRA, ENA, DDBJ or GEO identifier"
}
},
"required": ["sample", "fastq_1"]
"required": ["sample", "sra"]
}
}

11
main.nf
View file

@ -1,9 +1,10 @@
#!/usr/bin/env nextflow
include { validateParameters } from 'plugin/nf-validation'
include { validateParameters; fromSamplesheet } from 'plugin/nf-validation'
include { CLIQUESNV } from './modules/cliquesnv'
include { EFETCH } from './modules/efetch'
include { FASTERQ_DUMP } from './modules/fasterq_dump'
include { HAPLINK_HAPLOTYPES as HAPLINK_ML_HAPLOTYPES } from './modules/haplink/haplotypes'
include { HAPLINK_HAPLOTYPES as HAPLINK_RAW_HAPLOTYPES } from './modules/haplink/haplotypes'
include { HAPLINK_SEQUENCES } from './modules/haplink/sequences'
@ -20,8 +21,12 @@ workflow {
validateParameters()
Channel
.fromPath("*.fastq.gz")
.map { file -> tuple(file.simpleName, file) }
.fromSamplesheet("input")
.set { ch_sras }
FASTERQ_DUMP( ch_sras )
FASTERQ_DUMP
.out
.set { ch_input }
EFETCH("${params.reference}")