Skip to content

Commit 2394605

Browse files
authored
Merge pull request #109 from Joon-Klaps/102-autodetect-paired-end
102 autodetect paired end
2 parents 93e6b94 + 9c7f783 commit 2394605

File tree

4 files changed

+17
-20
lines changed

4 files changed

+17
-20
lines changed

assets/samplesheets/samplesheet.csv

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
sample,single_end,fastq_1,fastq_2
2-
SRR11140744,False,https://raw.githubusercontent.com/nf-core/test-datasets/viralrecon/illumina/sispa/SRR11140744_R1.fastq.gz,https://raw.githubusercontent.com/nf-core/test-datasets/viralrecon/illumina/sispa/SRR11140744_R2.fastq.gz
3-
SRR11140748,False,https://raw.githubusercontent.com/nf-core/test-datasets/viralrecon/illumina/sispa/SRR11140748_R1.fastq.gz,https://raw.githubusercontent.com/nf-core/test-datasets/viralrecon/illumina/sispa/SRR11140748_R2.fastq.gz
1+
sample,fastq_1,fastq_2
2+
SRR11140744,https://raw.githubusercontent.com/nf-core/test-datasets/viralrecon/illumina/sispa/SRR11140744_R1.fastq.gz,https://raw.githubusercontent.com/nf-core/test-datasets/viralrecon/illumina/sispa/SRR11140744_R2.fastq.gz
3+
SRR11140748,https://raw.githubusercontent.com/nf-core/test-datasets/viralrecon/illumina/sispa/SRR11140748_R1.fastq.gz,https://raw.githubusercontent.com/nf-core/test-datasets/viralrecon/illumina/sispa/SRR11140748_R2.fastq.gz

assets/schemas/input.json

-5
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@
1313
"errorMessage": "Sample name must be provided and cannot contain spaces or special characters",
1414
"meta": ["id", "sample"]
1515
},
16-
"single_end": {
17-
"type": "boolean",
18-
"errorMessage": "Single end must be a boolean value (true/false)",
19-
"meta": ["single_end"]
20-
},
2116
"fastq_1": {
2217
"type": "string",
2318
"pattern": "^\\S+\\.f(ast)?q\\.gz$",

subworkflows/local/fasta_blast_refsel.nf

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ workflow FASTA_BLAST_REFSEL {
2828
.set { ch_blast_txt }
2929

3030
// Throw an warning if no hits are found
31-
ch_blast_txt
32-
.hits
33-
.collect()
34-
.ifEmpty{ log.warn "No blast hits were found in any samples of the given BLAST database. Consider updating the search parameters or the database: \n ${params.reference_pool} "}
31+
// ch_blast_txt
32+
// .hits
33+
// .collect()
34+
// .ifEmpty{ log.warn "No blast hits were found in any samples of the given BLAST database. Consider updating the search parameters or the database: \n ${params.reference_pool} "}
3535

3636
// Make a table of samples that did not have any blast hits
3737
ch_no_blast_hits = Channel.empty()

workflows/viralgenie.nf

+10-8
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,14 @@ workflow VIRALGENIE {
129129
'input'
130130
).map{
131131
meta, read1, read2 ->
132-
[meta + [sample: meta.id] , [read1, read2]]
132+
single_end = read1 && !read2
133+
if (single_end) {
134+
return [meta + [sample: meta.id, single_end: single_end] , [read1]]
133135
}
136+
else {
137+
return [meta + [sample: meta.id, single_end: single_end] , [read1, read2]]
138+
}
139+
}
134140

135141
// Prepare Databases
136142
ch_db = Channel.empty()
@@ -176,19 +182,15 @@ workflow VIRALGENIE {
176182
ch_ref_pool = Channel.empty()
177183
ch_blast_refdb = Channel.empty()
178184
ch_blast_annodb = Channel.empty()
179-
if ( !params.skip_consensus_qc || (!params.skip_assembly && !params.skip_polishing) ){
180-
ch_blastdb_in = Channel.empty()
181185

186+
if ( (!params.skip_assembly && !params.skip_polishing) || (!params.skip_consensus_qc && !params.skip_blast_qc)){
187+
ch_blastdb_in = Channel.empty()
182188
// see issue #56
183189
SEQKIT_REPLACE (ch_ref_pool_raw)
184190
ch_versions = ch_versions.mix(SEQKIT_REPLACE.out.versions)
185191
ch_ref_pool = SEQKIT_REPLACE.out.fastx
186192
ch_blastdb_in = ch_blastdb_in.mix(ch_ref_pool)
187193

188-
// if ( !params.skip_annotation){
189-
// ch_blastdb_in = ch_blastdb_in.mix(ch_annotation_db)
190-
// }
191-
192194
BLAST_MAKEBLASTDB ( ch_blastdb_in )
193195
BLAST_MAKEBLASTDB
194196
.out
@@ -201,7 +203,6 @@ workflow VIRALGENIE {
201203
}.
202204
set{ch_blastdb_out}
203205
ch_blast_refdb = ch_blastdb_out.reference.collect{it[1]}.ifEmpty([]).map{it -> [[id: 'reference'], it]}
204-
// ch_blast_annodb = ch_blastdb_out.annotation.collect{it[1]}.ifEmpty([]).map{it -> [[id: 'annotation'], it]}
205206
ch_versions = ch_versions.mix(BLAST_MAKEBLASTDB.out.versions)
206207
}
207208

@@ -271,6 +272,7 @@ workflow VIRALGENIE {
271272

272273
ch_multiqc_files = ch_multiqc_files.mix(no_contigs.ifEmpty([]))
273274

275+
274276
if (!params.skip_polishing){
275277
// blast contigs against reference & identify clusters of (contigs & references)
276278
ch_contigs

0 commit comments

Comments
 (0)