Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tbg
backmap_workflow
Commits
437a9b5b
Commit
437a9b5b
authored
Mar 01, 2021
by
Raphael Müller
Browse files
added Channel for pbccs input files and added mapping process
parent
018300fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
nextflow/backmap.nf
View file @
437a9b5b
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment