Commit 437a9b5b authored by Raphael Müller's avatar Raphael Müller
Browse files

added Channel for pbccs input files and added mapping process

parent 018300fb
......@@ -226,23 +226,27 @@ final Map<String, String> LOGFILES = [path: output, mode: 'copy', pattern: '*.{l
*/
if (bamAvailable) {
chIlluminaBamMerge = (illuminaBamsAvailable) ? Channel.from(illuminaBamFiles)
chIlluminaBamMerge = (illuminaBamsAvailable ) ? Channel.from(illuminaBamFiles )
.map { files -> files.split(fileSeparator) }.flatten().map { f -> file(f) } : Channel.empty()
chPacbioBamMerge = (pacbioBamsAvailable) ? Channel.from(pacbioBamFiles )
chPacbioBamMerge = (pacbioBamsAvailable ) ? Channel.from(pacbioBamFiles )
.map { files -> files.split(fileSeparator) }.flatten().map { f -> file(f) } : Channel.empty()
chNanoporeBamMerge = (nanoporeBamsAvailable) ? Channel.from(nanoporeBamFiles)
chPacbioCCSBamMerge = (pacbioCCSBamsAvailable) ? Channel.from(pacbioCCSBamFiles)
.map { files -> files.split(fileSeparator) }.flatten().map { f -> file(f) } : Channel.empty()
chNanoporeBamMerge = (nanoporeBamsAvailable ) ? Channel.from(nanoporeBamFiles )
.map { files -> files.split(fileSeparator) }.flatten().map { f -> file(f) } : Channel.empty()
} else if (assemblyAvailable) { //fi: bamAvailable
chAssembly = Channel.fromPath(assembly).first()
chBwaIndexGenome = (pairedAvailable || unpairedAvailable) ? Channel.fromPath(assembly) : Channel.empty()
chUnpairedReadMapping = (unpairedAvailable) ? Channel.from(singleEnd)
chUnpairedReadMapping = (unpairedAvailable ) ? Channel.from(singleEnd)
.map { files -> files.split(fileSeparator) }.flatten().map { f -> file(f) }.collate(1) : Channel.empty()
chPairedReadMapping = (pairedAvailable ) ? Channel.from(pairedEnd)
chPairedReadMapping = (pairedAvailable ) ? Channel.from(pairedEnd)
.map { files -> files.split(fileSeparator) }.flatten().map { f -> file(f) }.collate(2) : Channel.empty()
chPacbioReadMapping = (pacbioAvailable ) ? Channel.from(pacbio )
chPacbioReadMapping = (pacbioAvailable ) ? Channel.from(pacbio )
.map { files -> files.split(fileSeparator) }.flatten().map { f -> file(f) }.collate(1) : Channel.empty()
chPacbioCCSReadMapping = (pacbioCCSAvailable) ? Channel.from(pacbioCCS)
.map { files -> files.split(fileSeparator) }.flatten().map { f -> file(f) }.collate(1) : Channel.empty()
chNanoporeReadMapping = (nanoporeAvailable) ? Channel.from(nanopore )
chNanoporeReadMapping = (nanoporeAvailable ) ? Channel.from(nanopore )
.map { files -> files.split(fileSeparator) }.flatten().map { f -> file(f) }.collate(1) : Channel.empty()
// Create index files for bwa mapping
......@@ -313,6 +317,23 @@ if (bamAvailable) {
"""
} // process pacbioMapping
// Minimap2 mapping with PacBio CCS reads
process pacbioCCSMapping {
publishDir COPYMODETMP
cpus { PROCESSMAXTHREADS > threads ? threads : PROCESSMAXTHREADS }
input:
file pb from chPacbioCCSReadMapping
file gen from chAssembly
output:
file "${prefix}.pb_ccs${task.index}.bam" into chPacbioCCSBamMerge
file '*.err' into chPacbioCCSMappingLog
script:
"""
minimap2 $minimapPacbioCCSOptions -x asm20 -a -t ${task.cpus} $gen $pb 2> \
${prefix}_minimap_pb${task.index}.err | samtools view -1 -b - > ${prefix}.pb${task.index}.bam
"""
} // process pacbioCCSMapping
// Minimap2 mapping with Nanopore reads
process nanoporeMapping {
publishDir COPYMODETMP
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment