-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #587 from nf-core/new-module-ctat-splicing
New module ctat splicing
- Loading branch information
Showing
17 changed files
with
536 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
process CTATSPLICING_STARTOCANCERINTRONS { | ||
tag "$meta.id" | ||
label 'process_single' | ||
|
||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://data.broadinstitute.org/Trinity/CTAT_SINGULARITY/CTAT-SPLICING/ctat_splicing.v0.0.2.simg' : | ||
'docker.io/trinityctat/ctat_splicing:0.0.2' }" | ||
|
||
input: | ||
tuple val(meta), path(split_junction), path(junction), path(bam), path(bai) | ||
tuple val(meta2), path(genome_lib) | ||
|
||
output: | ||
tuple val(meta), path("*.cancer_intron_reads.sorted.bam") , emit: cancer_introns_sorted_bam | ||
tuple val(meta), path("*.cancer_intron_reads.sorted.bam.bai") , emit: cancer_introns_sorted_bai | ||
tuple val(meta), path("*.gene_reads.sorted.sifted.bam") , emit: gene_reads_sorted_bam | ||
tuple val(meta), path("*.gene_reads.sorted.sifted.bam.bai") , emit: gene_reads_sorted_bai | ||
tuple val(meta), path("*.cancer.introns") , emit: cancer_introns | ||
tuple val(meta), path("*.cancer.introns.prelim") , emit: cancer_introns_prelim | ||
tuple val(meta), path("*${prefix}.introns") , emit: introns | ||
tuple val(meta), path("*.introns.for_IGV.bed") , emit: introns_igv_bed, optional: true | ||
tuple val(meta), path("*.ctat-splicing.igv.html") , emit: igv_html, optional: true | ||
tuple val(meta), path("*.igv.tracks") , emit: igv_tracks, optional: true | ||
tuple val(meta), path("*.chckpts") , emit: chckpts | ||
path "versions.yml" , emit: versions | ||
|
||
script: | ||
def args = task.ext.args ?: '' | ||
prefix = task.ext.prefix ?: "${meta.id}" | ||
def bam_arg = bam ? "--bam_file ${bam}" : "" | ||
def VERSION = '0.0.2' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. | ||
def create_index = bam && !bai ? "samtools index ${bam}" : "" | ||
""" | ||
${create_index} | ||
/usr/local/src/CTAT-SPLICING/STAR_to_cancer_introns.py \\ | ||
--SJ_tab_file ${split_junction} \\ | ||
--chimJ_file ${junction} \\ | ||
${bam_arg} \\ | ||
--output_prefix ${prefix} \\ | ||
--ctat_genome_lib ${genome_lib} \\ | ||
${args} | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
ctat-splicing: $VERSION | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def args = task.ext.args ?: '' | ||
prefix = task.ext.prefix ?: "${meta.id}" | ||
def VERSION = '0.0.2' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. | ||
def create_igv_files = args.contains("--vis") ? "touch ${prefix}.introns.for_IGV.bed && touch ${prefix}.ctat-splicing.igv.html && touch ${prefix}.igv.tracks" : "" | ||
""" | ||
${create_igv_files} | ||
touch ${prefix}.cancer_intron_reads.sorted.bam | ||
touch ${prefix}.cancer_intron_reads.sorted.bam.bai | ||
touch ${prefix}.gene_reads.sorted.sifted.bam | ||
touch ${prefix}.gene_reads.sorted.sifted.bam.bai | ||
touch ${prefix}.cancer.introns | ||
touch ${prefix}.cancer.introns.prelim | ||
touch ${prefix}.introns | ||
touch ${prefix}.chckpts | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
ctat-splicing: $VERSION | ||
END_VERSIONS | ||
""" | ||
} |
69 changes: 69 additions & 0 deletions
69
modules/local/ctatsplicing/startocancerintrons/tests/main.nf.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
nextflow_process { | ||
|
||
name "Test Process CTATSPLICING_STARTOCANCERINTRONS" | ||
script "../main.nf" | ||
process "CTATSPLICING_STARTOCANCERINTRONS" | ||
options "-stub" | ||
|
||
test("test without BAM") { | ||
|
||
when { | ||
params { | ||
outdir = "tests/results" | ||
} | ||
process { | ||
""" | ||
input[0] = [ | ||
[id:"test"], | ||
file("test.SJ.out.tab"), | ||
file("test.Chimeric.out.junctions"), | ||
[], | ||
[] | ||
] | ||
input[1] = [ | ||
[id:"reference"], | ||
file("ctat_genome_lib") | ||
] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out.findAll { key, value -> !key.isNumber() }).match() } | ||
) | ||
} | ||
} | ||
|
||
test("test with BAM") { | ||
|
||
when { | ||
params { | ||
outdir = "tests/results" | ||
} | ||
process { | ||
""" | ||
input[0] = [ | ||
[id:"test"], | ||
file("test.SJ.out.tab"), | ||
file("test.Chimeric.out.junctions"), | ||
file("test.Aligned.sortedByCoord.out.bam"), | ||
[] | ||
] | ||
input[1] = [ | ||
[id:"reference"], | ||
file("ctat_genome_lib") | ||
] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out.findAll { key, value -> !key.isNumber() }).match() } | ||
) | ||
} | ||
} | ||
} |
Oops, something went wrong.