Skip to content

Commit

Permalink
fixed fastas input channel
Browse files Browse the repository at this point in the history
  • Loading branch information
erinyoung committed Dec 6, 2024
1 parent 5f812b7 commit 29959fe
Showing 1 changed file with 25 additions and 24 deletions.
49 changes: 25 additions & 24 deletions subworkflows/local/initialize.nf
Original file line number Diff line number Diff line change
Expand Up @@ -126,21 +126,6 @@ workflow INITIALIZE {
//
// Create channels for input files
//

//# Ensuring that reads and single_reads are not set to the same directory
if ( params.reads && params.reads == params.single_reads ) {
println('\'params.reads\' and \'params.single_reads\' cannot point to the same directory!')
println('\'params.reads\' is set to ' + params.reads)
println('\'params.single_reads\' is set to ' + params.single_reads)
exit 1
}

if ( params.fastas && params.fastas == params.multifastas ) {
println('\'params.fastas\' and \'params.multifastas\' cannot point to the same directory!')
println('\'params.fastas\' is set to ' + params.fastas)
println('\'params.multifastas\' is set to ' + params.multifastas)
exit 1
}

//# getting input files
if ( params.sample_sheet ) {
Expand Down Expand Up @@ -168,6 +153,22 @@ workflow INITIALIZE {

} else {

//# Ensuring that reads and single_reads are not set to the same directory
if ( params.reads && params.reads == params.single_reads ) {
println('\'params.reads\' and \'params.single_reads\' cannot point to the same directory!')
println('\'params.reads\' is set to ' + params.reads)
println('\'params.single_reads\' is set to ' + params.single_reads)
exit 1
}

if ( params.fastas && params.fastas == params.multifastas ) {
println('\'params.fastas\' and \'params.multifastas\' cannot point to the same directory!')
println('\'params.fastas\' is set to ' + params.fastas)
println('\'params.multifastas\' is set to ' + params.multifastas)
exit 1
}


// looking for paired-end fastq files
if (params.reads) {
Channel
Expand Down Expand Up @@ -238,7 +239,7 @@ workflow INITIALIZE {
.fromPath("${params.fastas}/*{.fa,.fasta,.fna}", type:'file')
.map { it ->
meta = [id:it.simpleName, single_end:null]
tuple( meta, file(it[1][0], checkIfExists: true))
tuple( meta, file(it, checkIfExists: true))
}
.unique()
.ifEmpty{
Expand Down Expand Up @@ -413,14 +414,14 @@ workflow INITIALIZE {
//# Getting the amplicon bedfile
if ( params.aci ) {
if (params.amplicon_bed) {
Channel
.fromPath(params.amplicon_bed, type:'file', checkIfExists: true)
.ifEmpty{
println("A bedfile for amplicons is required. Set with 'params.amplicon_bed'.")
println("Or set params.aci = false to skip this.")
exit 1
}
.set { ch_amplicon_bed }
Channel
.fromPath(params.amplicon_bed, type:'file', checkIfExists: true)
.ifEmpty{
println("A bedfile for amplicons is required. Set with 'params.amplicon_bed'.")
println("Or set params.aci = false to skip this.")
exit 1
}
.set { ch_amplicon_bed }
} else if ( params.primer_set in available_primer_sets ) {
Channel
.fromPath( included_amplicons )
Expand Down

0 comments on commit 29959fe

Please sign in to comment.