mirror of
https://github.com/MillironX/taxprofiler.git
synced 2024-11-22 10:19:54 +00:00
Merge pull request #24 from genomic-medicine-sweden/add_nanopore
Add nanopore reads input
This commit is contained in:
commit
45428c2877
3 changed files with 24 additions and 10 deletions
|
@ -173,7 +173,7 @@ def check_samplesheet(file_in, file_out):
|
||||||
## Auto-detect paired-end/single-end
|
## Auto-detect paired-end/single-end
|
||||||
if sample and fastq_1 and fastq_2: ## Paired-end short reads
|
if sample and fastq_1 and fastq_2: ## Paired-end short reads
|
||||||
sample_info.extend(["0", fastq_1, fastq_2, fasta])
|
sample_info.extend(["0", fastq_1, fastq_2, fasta])
|
||||||
elif sample and fastq_1 and not fastq_2: ## Single-end short reads
|
elif sample and fastq_1 and not fastq_2: ## Single-end short/long fastq reads
|
||||||
sample_info.extend(["1", fastq_1, fastq_2, fasta])
|
sample_info.extend(["1", fastq_1, fastq_2, fasta])
|
||||||
elif (
|
elif (
|
||||||
sample and fasta and not fastq_1 and not fastq_2
|
sample and fasta and not fastq_1 and not fastq_2
|
||||||
|
|
|
@ -44,11 +44,11 @@ TREATMENT_REP3,AEG588A6_S6_L003_R1_001.fastq.gz,
|
||||||
TREATMENT_REP3,AEG588A6_S6_L004_R1_001.fastq.gz,
|
TREATMENT_REP3,AEG588A6_S6_L004_R1_001.fastq.gz,
|
||||||
```
|
```
|
||||||
|
|
||||||
| Column | Description |
|
| Column | Description |
|
||||||
|----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
| --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `sample` | Custom sample name. This entry will be identical for multiple sequencing libraries/runs from the same sample. Spaces in sample names are automatically converted to underscores (`_`). |
|
| `sample` | Custom sample name. This entry will be identical for multiple sequencing libraries/runs from the same sample. Spaces in sample names are automatically converted to underscores (`_`). |
|
||||||
| `fastq_1` | Full path to FastQ file for Illumina short reads 1. File has to be gzipped and have the extension ".fastq.gz" or ".fq.gz". |
|
| `fastq_1` | Full path to FastQ file for Illumina short reads 1 or Nanopore reads. File has to be gzipped and have the extension ".fastq.gz" or ".fq.gz". |
|
||||||
| `fastq_2` | Full path to FastQ file for Illumina short reads 2. File has to be gzipped and have the extension ".fastq.gz" or ".fq.gz". |
|
| `fastq_2` | Full path to FastQ file for Illumina short reads 2. File has to be gzipped and have the extension ".fastq.gz" or ".fq.gz". |
|
||||||
|
|
||||||
An [example samplesheet](../assets/samplesheet.csv) has been provided with the pipeline.
|
An [example samplesheet](../assets/samplesheet.csv) has been provided with the pipeline.
|
||||||
|
|
||||||
|
|
|
@ -15,14 +15,20 @@ workflow INPUT_CHECK {
|
||||||
.dump(tag: "input_split_csv_out")
|
.dump(tag: "input_split_csv_out")
|
||||||
.branch {
|
.branch {
|
||||||
fasta: it['fasta'] != ''
|
fasta: it['fasta'] != ''
|
||||||
|
nanopore: it['instrument_platform'] == 'OXFORD_NANOPORE'
|
||||||
fastq: true
|
fastq: true
|
||||||
}
|
}
|
||||||
|
|
||||||
parsed_samplesheet.fastq
|
parsed_samplesheet.fastq
|
||||||
.map { create_fastq_channels(it) }
|
.map { create_fastq_channel(it) }
|
||||||
.dump(tag: "fastq_channel_init")
|
.dump(tag: "fastq_channel_init")
|
||||||
.set { fastq }
|
.set { fastq }
|
||||||
|
|
||||||
|
parsed_samplesheet.nanopore
|
||||||
|
.map { create_fastq_channel(it) }
|
||||||
|
.dump(tag: "fastq_nanopore_channel_init")
|
||||||
|
.set { nanopore }
|
||||||
|
|
||||||
parsed_samplesheet.fasta
|
parsed_samplesheet.fasta
|
||||||
.map { create_fasta_channels(it) }
|
.map { create_fasta_channels(it) }
|
||||||
.dump(tag: "fasta_channel_init")
|
.dump(tag: "fasta_channel_init")
|
||||||
|
@ -30,6 +36,7 @@ workflow INPUT_CHECK {
|
||||||
|
|
||||||
emit:
|
emit:
|
||||||
fastq // channel: [ val(meta), [ reads ] ]
|
fastq // channel: [ val(meta), [ reads ] ]
|
||||||
|
nanopore // channel: [ val(meta), [ reads ] ]
|
||||||
fasta // channel: [ val(meta), fasta ]
|
fasta // channel: [ val(meta), fasta ]
|
||||||
versions = SAMPLESHEET_CHECK.out.versions // channel: [ versions.yml ]
|
versions = SAMPLESHEET_CHECK.out.versions // channel: [ versions.yml ]
|
||||||
}
|
}
|
||||||
|
@ -51,10 +58,17 @@ def create_fastq_channel(LinkedHashMap row) {
|
||||||
if (meta.single_end) {
|
if (meta.single_end) {
|
||||||
fastq_meta = [ meta, [ file(row.fastq_1) ] ]
|
fastq_meta = [ meta, [ file(row.fastq_1) ] ]
|
||||||
} else {
|
} else {
|
||||||
if (!file(row.fastq_2).exists()) {
|
if (meta.instrument_platform == 'OXFORD_NANOPORE') {
|
||||||
exit 1, "ERROR: Please check input samplesheet -> Read 2 FastQ file does not exist!\n${row.fastq_2}"
|
if (row.fastq_2 != '') {
|
||||||
|
exit 1, "ERROR: Please check input samplesheet -> For Oxford Nanopore reads Read 2 FastQ should be empty!\n${row.fastq_2}"
|
||||||
|
}
|
||||||
|
fastq_meta = [ meta, [ file(row.fastq_1) ] ]
|
||||||
|
} else {
|
||||||
|
if (!file(row.fastq_2).exists()) {
|
||||||
|
exit 1, "ERROR: Please check input samplesheet -> Read 2 FastQ file does not exist!\n${row.fastq_2}"
|
||||||
|
}
|
||||||
|
fastq_meta = [ meta, [ file(row.fastq_1), file(row.fastq_2) ] ]
|
||||||
}
|
}
|
||||||
fastq_meta = [ meta, [ file(row.fastq_1), file(row.fastq_2) ] ]
|
|
||||||
}
|
}
|
||||||
return fastq_meta
|
return fastq_meta
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue