Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ process {
}

withName: BOWTIE_BUILD {
ext.when = { !params.bowtie && params.tools.split(',').contains('mapsplice') }
publishDir = [
path: { "${params.outdir}/1_references/index" },
mode: params.publish_dir_mode,
Expand All @@ -119,7 +118,6 @@ process {
}

withName: BOWTIE2_BUILD {
ext.when = { !params.bowtie2 && params.tools.split(',').contains('find_circ') }
publishDir = [
path: { "${params.outdir}/1_references/index" },
mode: params.publish_dir_mode,
Expand All @@ -128,7 +126,6 @@ process {
}

withName: BWA_INDEX {
ext.when = { !params.bwa && params.tools.split(',').contains('ciriquant') }
publishDir = [
path: { "${params.outdir}/1_references/index" },
mode: params.publish_dir_mode,
Expand All @@ -137,7 +134,6 @@ process {
}

withName: HISAT2_EXTRACTSPLICESITES {
ext.when = { params.tools.split(',').contains('ciriquant') }
publishDir = [
path: { "${params.outdir}/1_references/index/hisat2" },
mode: params.publish_dir_mode,
Expand All @@ -146,7 +142,6 @@ process {
}

withName: HISAT2_BUILD {
ext.when = { params.tools.split(',').contains('ciriquant') }
publishDir = [
path: { "${params.outdir}/1_references/index" },
mode: params.publish_dir_mode,
Expand All @@ -155,7 +150,6 @@ process {
}

withName: STAR_GENOMEGENERATE {
ext.when = { !params.star && (params.tools.split(',').contains('circexplorer2') || params.tools.split(',').contains('dcc') || params.tools.split(',').contains('circrna_finder')) }
ext.args = [
"",
params.sjdboverhang ? "--sjdbOverhang ${params.sjdboverhang}" : '',
Expand Down Expand Up @@ -243,7 +237,6 @@ process {
}

withName: '.*STAR2PASS:PASS_1' {
ext.when = { params.tools.split(',').contains('circexplorer2') || params.tools.split(',').contains('circrna_finder') }
ext.args = [
"",
"--chimOutType Junctions WithinBAM",
Expand Down Expand Up @@ -579,14 +572,14 @@ process {
publishDir = [
path: { "${params.outdir}/3_bsj_detection/samples/${meta.id}" },
mode: params.publish_dir_mode,
saveAs: { filename -> (filename.equals('versions.yml') || filename.endsWith('_mqc.json')) ? null : filename },
saveAs: { filename -> filename.equals('versions.yml') || filename.endsWith('_mqc.json') ? null : filename },
]
}

withName: COMBINEBEDS_READS {
ext.consider_strand = params.consider_strand
ext.prefix = { "${meta.id}_reads" }
publishDir = [
ext.prefix = { "${meta.id}_reads" }
publishDir = [
path: { "${params.outdir}/3_bsj_detection/samples/${meta.id}/reads" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename },
Expand All @@ -606,7 +599,7 @@ process {
publishDir = [
path: { "${params.outdir}/3_bsj_detection/combined" },
mode: params.publish_dir_mode,
saveAs: { filename -> (filename.equals('versions.yml') || filename.endsWith('_mqc.json')) ? null : filename },
saveAs: { filename -> filename.equals('versions.yml') || filename.endsWith('_mqc.json') ? null : filename },
]
}

Expand Down Expand Up @@ -1071,7 +1064,7 @@ process {
}

withName: MULTIQC {
ext.args = { params.multiqc_title ? "--title \"${params.multiqc_title}\"" : '' }
ext.args = { params.multiqc_title ? "--title \"${params.multiqc_title}\"" : '' }
publishDir = [
path: { "${params.outdir}/7_multiqc" },
mode: params.publish_dir_mode,
Expand Down
10 changes: 7 additions & 3 deletions subworkflows/local/bsj_detection.nf
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,21 @@ workflow BSJ_DETECTION {
fasta = ch_fasta.map{_meta, fasta -> fasta}
gtf = ch_gtf.map{_meta, gtf -> gtf}

tools_selected = params.tools.split(',').collect{it.trim().toLowerCase()}

// STAR 2-PASS-MODE
star_ignore_sjdbgtf = true
seq_center = params.seq_center ?: ''
seq_platform = ''
STAR2PASS( reads, star_index, ch_gtf, bsj_reads, star_ignore_sjdbgtf, seq_center, seq_platform )
ch_versions = ch_versions.mix(STAR2PASS.out.versions)

if (tools_selected.intersect(['circexplorer2', 'circrna_finder', 'dcc', 'mapsplice']).size() > 0) {
STAR2PASS( reads, star_index, ch_gtf, bsj_reads, star_ignore_sjdbgtf, seq_center, seq_platform )
ch_versions = ch_versions.mix(STAR2PASS.out.versions)
}

//
// DISCOVERY TOOLS:
//
tools_selected = params.tools.split(',').collect{it.trim().toLowerCase()}

if (tools_selected.size() == 0) {
error 'No tools selected for circRNA discovery.'
Expand Down
52 changes: 30 additions & 22 deletions subworkflows/local/prepare_genome.nf
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,18 @@ include { UCSC_GTFTOGENEPRED } from '../../modules/nf-core/ucsc/gtf
include { GAWK as CIRCEXPLORER2_REFERENCE } from '../../modules/nf-core/gawk'

workflow PREPARE_GENOME {

take:
ch_fasta
ch_gtf

main:
ch_versions = Channel.empty()

detection_tools = params.tools.split(',').collect{it.trim().toLowerCase()}
detection_tools = params.tools.split(',').collect { it.trim().toLowerCase() }

// MapSplice cannot deal with extra field in the fasta headers
// this removes all additional fields in the headers of the input fasta file
if( detection_tools.contains('mapsplice') ) {
if (detection_tools.contains('mapsplice')) {
CLEAN_FASTA(ch_fasta, [], false)
ch_fasta = CLEAN_FASTA.out.output

Expand All @@ -41,45 +40,54 @@ workflow PREPARE_GENOME {
SEQKIT_SPLIT(ch_fasta)
ch_versions = ch_versions.mix(SEQKIT_SPLIT.out.versions)

BOWTIE_BUILD(ch_fasta)
ch_versions = ch_versions.mix(BOWTIE_BUILD.out.versions)
if (!params.bowtie && detection_tools.contains('mapsplice')) {
BOWTIE_BUILD(ch_fasta)
ch_versions = ch_versions.mix(BOWTIE_BUILD.out.versions)
}

BOWTIE2_BUILD(ch_fasta)
ch_versions = ch_versions.mix(BOWTIE2_BUILD.out.versions)
if (!params.bowtie2 && detection_tools.contains('find_circ')) {
BOWTIE2_BUILD(ch_fasta)
ch_versions = ch_versions.mix(BOWTIE2_BUILD.out.versions)
}

BWA_INDEX (ch_fasta)
ch_versions = ch_versions.mix(BWA_INDEX.out.versions)
if (!params.bwa && detection_tools.contains('ciriquant')) {
BWA_INDEX(ch_fasta)
ch_versions = ch_versions.mix(BWA_INDEX.out.versions)
}

HISAT2_EXTRACTSPLICESITES(ch_gtf)
ch_versions = ch_versions.mix(HISAT2_EXTRACTSPLICESITES.out.versions)
if (!params.hisat2 && detection_tools.contains('ciriquant')) {
HISAT2_EXTRACTSPLICESITES(ch_gtf)
ch_versions = ch_versions.mix(HISAT2_EXTRACTSPLICESITES.out.versions)

HISAT2_BUILD(ch_fasta, ch_gtf, HISAT2_EXTRACTSPLICESITES.out.txt)
ch_versions = ch_versions.mix(HISAT2_BUILD.out.versions)
HISAT2_BUILD(ch_fasta, ch_gtf, HISAT2_EXTRACTSPLICESITES.out.txt)
ch_versions = ch_versions.mix(HISAT2_BUILD.out.versions)
}

STAR_GENOMEGENERATE(ch_fasta, ch_gtf)
ch_versions = ch_versions.mix(STAR_GENOMEGENERATE.out.versions)
if (!params.star && detection_tools.intersect(['circexplorer2', 'circrna_finder', 'dcc', 'mapsplice']).size() > 0) {
STAR_GENOMEGENERATE(ch_fasta, ch_gtf)
ch_versions = ch_versions.mix(STAR_GENOMEGENERATE.out.versions)
}

SAMTOOLS_FAIDX(ch_fasta, [[], []])
ch_versions = ch_versions.mix(SAMTOOLS_FAIDX.out.versions)

ch_circexplorer2_reference = Channel.empty()
if (detection_tools.intersect(['circexplorer2', 'mapsplice']).size() > 0) {
CIRCEXPLORER2_REFERENCE(UCSC_GTFTOGENEPRED.out.genepred, [], false)
ch_circexplorer2_reference = CIRCEXPLORER2_REFERENCE.out.output.map{ _meta, file -> file }.collect()
ch_circexplorer2_reference = CIRCEXPLORER2_REFERENCE.out.output.map { _meta, file -> file }.collect()
ch_versions = ch_versions.mix(CIRCEXPLORER2_REFERENCE.out.versions)
}

emit:
gtf = ch_gtf
faidx = SAMTOOLS_FAIDX.out.fai
bowtie = params.bowtie ?: BOWTIE_BUILD.out.index
bowtie2 = params.bowtie2 ? Channel.value([[id: "bowtie2"], file(params.bowtie2, checkIfExists: true)]) : BOWTIE2_BUILD.out.index.collect()
bwa = params.bwa ? Channel.value([[id: "bwa"], file(params.bwa, checkIfExists: true)]) : BWA_INDEX.out.index.collect()
hisat2 = params.hisat2 ? Channel.value([[id: "hisat2"], file(params.hisat2, checkIfExists: true)]) : HISAT2_BUILD.out.index.collect()
star = params.star ? Channel.value([[id: "star"], file(params.star, checkIfExists: true)]) : STAR_GENOMEGENERATE.out.index.collect()
bowtie = params.bowtie ?: BOWTIE_BUILD.out.index
bowtie2 = params.bowtie2 ? Channel.value([[id: "bowtie2"], file(params.bowtie2, checkIfExists: true)]) : BOWTIE2_BUILD.out.index.collect()
bwa = params.bwa ? Channel.value([[id: "bwa"], file(params.bwa, checkIfExists: true)]) : BWA_INDEX.out.index.collect()
hisat2 = params.hisat2 ? Channel.value([[id: "hisat2"], file(params.hisat2, checkIfExists: true)]) : HISAT2_BUILD.out.index.collect()
star = params.star ? Channel.value([[id: "star"], file(params.star, checkIfExists: true)]) : STAR_GENOMEGENERATE.out.index.collect()
circexplorer2 = ch_circexplorer2_reference
chromosomes = SEQKIT_SPLIT.out.split
splice_sites = HISAT2_EXTRACTSPLICESITES.out.txt.collect()

versions = ch_versions
}
Loading