Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test dev #616

Draft
wants to merge 5 commits into
base: dev
Choose a base branch
from
Draft
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
8 changes: 2 additions & 6 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ process {
}

withName: 'FUSIONREPORT' {
ext.when = { !params.skip_vis }
ext.args = { {params.no_cosmic} ? "--no-cosmic" : "" }
ext.args2 = "--export csv"
publishDir = [
Expand Down Expand Up @@ -211,7 +210,7 @@ process {

withName: 'SALMON_INDEX' {
publishDir = [
path: { "${params.genomes_base}/salmon" },
path: { "${params.genomes_base}" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename },
]
Expand Down Expand Up @@ -360,7 +359,7 @@ process {
]
}

withName: 'NFCORE_RNAFUSION:BUILD_REFERENCES:STARFUSION_BUILD' {
withName: 'NFCORE_RNAFUSION:RNAFUSION:BUILD_REFERENCES:STARFUSION_BUILD' {
cpus = { 24 * task.attempt }
memory = { 100.GB * task.attempt }
time = { 2.d * task.attempt }
Expand All @@ -385,7 +384,4 @@ process {
ext.when = { {!params.fusioninspector_only} && {!params.skip_vcf} }
}

withName: '.*' {
ext.when = { !params.references_only || task.process.contains('BUILD_REFERENCES') }
}
}
5 changes: 1 addition & 4 deletions modules/local/fusioncatcher/build/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ process FUSIONCATCHER_BUILD {
tag "fusioncatcher_build"
label 'process_medium'

conda "${projectDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/d5/d53f36e9e01d14a0ae8e15f8046f52b2883c970c27fe43fdfbd9440a55f5403f/data' :
'community.wave.seqera.io/library/fusioncatcher:1.33--4733482b637ef92f' }"
container "docker.io/clinicalgenomics/fusioncatcher:1.33"

input:
val genome_gencode_version
Expand Down
5 changes: 1 addition & 4 deletions modules/local/fusioncatcher/detect/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ process FUSIONCATCHER_DETECT {
tag "$meta.id"
label 'process_high'

conda "${projectDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/d5/d53f36e9e01d14a0ae8e15f8046f52b2883c970c27fe43fdfbd9440a55f5403f/data' :
'community.wave.seqera.io/library/fusioncatcher:1.33--4733482b637ef92f' }"
container "docker.io/clinicalgenomics/fusioncatcher:1.33"

input:
tuple val(meta), path(fastqs, stageAs: "input/*")
Expand Down
4 changes: 2 additions & 2 deletions modules/local/gencode_download/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ process GENCODE_DOWNLOAD {

stub:
"""
touch Homo_sapiens.${genome}.${genome_gencode_version}_dna_primary_assembly.fa
touch Homo_sapiens.${genome}.${genome_gencode_version}.gtf
touch Homo_sapiens_${genome}_${genome_gencode_version}_dna_primary_assembly.fa
touch Homo_sapiens_${genome}_${genome_gencode_version}.gtf

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
7 changes: 4 additions & 3 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ params {

// Input options
input = 'https://raw.githubusercontent.com/nf-core/test-datasets/rnafusion/testdata/human/samplesheet_valid.csv'
outdir = null
references_only = false
cosmic_username = null
cosmic_passwd = null
Expand Down Expand Up @@ -77,7 +78,7 @@ params {
fai = "${params.genomes_base}/gencode/Homo_sapiens_${params.genome}_${params.genome_gencode_version}_dna_primary_assembly.fa.fai"
gtf = "${params.genomes_base}/gencode/Homo_sapiens_${params.genome}_${params.genome_gencode_version}.gtf"
refflat = "${params.genomes_base}/gencode/Homo_sapiens_${params.genome}_${params.genome_gencode_version}.gtf.refflat"
rrna_intervals = "${params.genomes_base}/gencode/Homo_sapiens_${params.genome}_${params.genome_gencode_version}.interval_list"
rrna_intervals = "${params.genomes_base}/gencode/Homo_sapiens_${params.genome}_${params.genome_gencode_version}.gtf.interval_list"
gencode_ref = "${params.genomes_base}/gencode"
no_cosmic = false
arriba_ref_blacklist = "${params.genomes_base}/arriba/blacklist_hg38_GRCh38_v2.4.0.tsv.gz"
Expand All @@ -87,14 +88,14 @@ params {
fusioncatcher_ref = "${params.genomes_base}/fusioncatcher/human_v${params.genome_gencode_version}"
hgnc_ref = "${params.genomes_base}/hgnc/hgnc_complete_set.txt"
hgnc_date = "${params.genomes_base}/hgnc/HGNC-DB-timestamp.txt"
salmon_index = "${params.genomes_base}/salmon/salmon"
salmon_index = "${params.genomes_base}/salmon"
starfusion_ref = "${params.genomes_base}/starfusion/ctat_genome_lib_build_dir"
starindex_ref = "${params.genomes_base}/star"
fusionreport_ref = "${params.genomes_base}/fusion_report_db"


// Internal file presence checks
salmon_index_stub_check = "${params.genomes_base}/salmon/salmon/complete_ref_lens.bin"
salmon_index_stub_check = "${params.genomes_base}/salmon/complete_ref_lens.bin"
starindex_ref_stub_check = "${params.genomes_base}/star/star/Genome"
fusionreport_ref_stub_check = "${params.genomes_base}/fusion_report_db/mitelman.db"
fusioncatcher_ref_stub_check = "${params.genomes_base}/fusioncatcher/human_v${params.genome_gencode_version}/ensembl_fully_overlapping_genes.txt"
Expand Down
4 changes: 2 additions & 2 deletions subworkflows/local/build_references.nf
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ workflow BUILD_REFERENCES {
}

if (!file(params.salmon_index).exists() || file(params.salmon_index).isEmpty() ||
!file(params.salmon_index_stub_check).exists() || file(params.salmon_index_stub_check).isEmpty()){ // add condition for qc
!file(params.salmon_index_stub_check).exists() || file(params.salmon_index_stub_check).isEmpty()){
GFFREAD(ch_gtf, ch_fasta.map{ it -> it[1] })
ch_versions = ch_versions.mix(GFFREAD.out.versions)
SALMON_INDEX(ch_fasta.map{ it -> it[1] }, GFFREAD.out.gffread_fasta.map{ it -> it[1] })
Expand Down Expand Up @@ -149,7 +149,7 @@ workflow BUILD_REFERENCES {
}


if ((params.fusionreport || params.all) &&
if ((params.fusionreport || params.all || params.fusioncatcher || params.arriba || params.starfusion) &&
(!file(params.fusionreport_ref).exists() || file(params.fusionreport_ref).isEmpty() ||
!file(params.fusionreport_ref_stub_check).exists() || file(params.fusionreport_ref_stub_check).isEmpty())) {
if (!params.no_cosmic && (!params.cosmic_username || !params.cosmic_passwd)) { exit 1, 'COSMIC username and/or password missing' }
Expand Down
4 changes: 2 additions & 2 deletions subworkflows/local/fusioncatcher_workflow/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ workflow FUSIONCATCHER_WORKFLOW {
take:
reads // channel [ meta, [ fastqs ] ]
fusioncatcher_ref // channel [ meta, path ]
run_fusioncatcher // boolean
fusioncatcher // boolean
all // boolean
fusioninspector_only // boolean
fusioncatcher_fusions // path, string
Expand All @@ -18,7 +18,7 @@ workflow FUSIONCATCHER_WORKFLOW {
ch_versions = Channel.empty()
ch_dummy_file = file("$baseDir/assets/dummy_file_fusioncatcher.txt", checkIfExists: true)

if (( run_fusioncatcher || all) && !fusioninspector_only ) {
if (( fusioncatcher || all) && !fusioninspector_only ) {
if (fusioncatcher_fusions){

ch_fusioncatcher_fusions = reads.combine(Channel.value(file(fusioncatcher_fusions, checkIfExists:true)))
Expand Down
1 change: 0 additions & 1 deletion subworkflows/local/fusionreport_workflow/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ workflow FUSIONREPORT_WORKFLOW {
ch_versions = Channel.empty()
ch_report = Channel.empty()
ch_csv = Channel.empty()

if (!params.fusioninspector_only) {
reads_fusions = reads
.join(arriba_fusions, failOnMismatch:true, failOnDuplicate:true)
Expand Down
99 changes: 50 additions & 49 deletions workflows/rnafusion.nf
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ workflow RNAFUSION {
BUILD_REFERENCES()
ch_versions = ch_versions.mix(BUILD_REFERENCES.out.versions)

if (!params.references_only) { // TODO: Remove this temporary parameter when we have a full-working GitHub nf-test
if (!params.references_only) {

//
// QC from FASTQ files
Expand Down Expand Up @@ -118,16 +118,16 @@ workflow RNAFUSION {



//Run fusioncatcher
FUSIONCATCHER_WORKFLOW (
ch_reads,
BUILD_REFERENCES.out.ch_fusioncatcher_ref, // channel [ meta, path ]
params.run_fusioncatcher,
params.all,
params.fusioninspector_only,
params.fusioncatcher_fusions
)
ch_versions = ch_versions.mix(FUSIONCATCHER_WORKFLOW.out.versions)
//Run fusioncatcher
FUSIONCATCHER_WORKFLOW (
ch_reads,
BUILD_REFERENCES.out.ch_fusioncatcher_ref, // channel [ meta, path ]
params.fusioncatcher,
params.all,
params.fusioninspector_only,
params.fusioncatcher_fusions
)
ch_versions = ch_versions.mix(FUSIONCATCHER_WORKFLOW.out.versions)


//Run stringtie
Expand All @@ -139,31 +139,35 @@ workflow RNAFUSION {


//Run fusion-report
FUSIONREPORT_WORKFLOW (
ch_reads,
BUILD_REFERENCES.out.ch_fusionreport_ref,
ARRIBA_WORKFLOW.out.fusions,
STARFUSION_WORKFLOW.out.fusions,
FUSIONCATCHER_WORKFLOW.out.fusions
)
ch_versions = ch_versions.mix(FUSIONREPORT_WORKFLOW.out.versions)
if (params.fusioncatcher || params.starfusion || params.arriba || params.all) {
FUSIONREPORT_WORKFLOW (
ch_reads,
BUILD_REFERENCES.out.ch_fusionreport_ref,
ARRIBA_WORKFLOW.out.fusions,
STARFUSION_WORKFLOW.out.fusions,
FUSIONCATCHER_WORKFLOW.out.fusions
)
ch_versions = ch_versions.mix(FUSIONREPORT_WORKFLOW.out.versions)
}

//Run fusionInpector
FUSIONINSPECTOR_WORKFLOW (
ch_reads,
FUSIONREPORT_WORKFLOW.out.fusion_list,
FUSIONREPORT_WORKFLOW.out.fusion_list_filtered,
FUSIONREPORT_WORKFLOW.out.report,
FUSIONREPORT_WORKFLOW.out.csv,
STARFUSION_WORKFLOW.out.ch_bam_sorted_indexed,
BUILD_REFERENCES.out.ch_gtf,
BUILD_REFERENCES.out.ch_arriba_ref_protein_domains,
BUILD_REFERENCES.out.ch_arriba_ref_cytobands,
BUILD_REFERENCES.out.ch_hgnc_ref,
BUILD_REFERENCES.out.ch_hgnc_date
)
ch_versions = ch_versions.mix(FUSIONINSPECTOR_WORKFLOW.out.versions)

if (params.fusioncatcher || params.starfusion || params.arriba || params.all) {
FUSIONINSPECTOR_WORKFLOW (
ch_reads,
FUSIONREPORT_WORKFLOW.out.fusion_list,
FUSIONREPORT_WORKFLOW.out.fusion_list_filtered,
FUSIONREPORT_WORKFLOW.out.report,
FUSIONREPORT_WORKFLOW.out.csv,
STARFUSION_WORKFLOW.out.ch_bam_sorted_indexed,
BUILD_REFERENCES.out.ch_gtf,
BUILD_REFERENCES.out.ch_arriba_ref_protein_domains,
BUILD_REFERENCES.out.ch_arriba_ref_cytobands,
BUILD_REFERENCES.out.ch_hgnc_ref,
BUILD_REFERENCES.out.ch_hgnc_date
)
ch_multiqc_files = ch_multiqc_files.mix(FUSIONINSPECTOR_WORKFLOW.out.ch_arriba_visualisation.collect{it[1]}.ifEmpty([]))
ch_versions = ch_versions.mix(FUSIONINSPECTOR_WORKFLOW.out.versions)
}

//QC
QC_WORKFLOW (
Expand All @@ -175,7 +179,19 @@ workflow RNAFUSION {
)
ch_versions = ch_versions.mix(QC_WORKFLOW.out.versions)


ch_multiqc_files = ch_multiqc_files.mix(FASTQC.out.zip.collect{it[1]}.ifEmpty([]))
ch_multiqc_files = ch_multiqc_files.mix(TRIM_WORKFLOW.out.ch_fastp_html.collect{it[1]}.ifEmpty([]))
ch_multiqc_files = ch_multiqc_files.mix(TRIM_WORKFLOW.out.ch_fastp_json.collect{it[1]}.ifEmpty([]))
ch_multiqc_files = ch_multiqc_files.mix(TRIM_WORKFLOW.out.ch_fastqc_trimmed.collect{it[1]}.ifEmpty([]))
ch_multiqc_files = ch_multiqc_files.mix(STARFUSION_WORKFLOW.out.star_stats.collect{it[1]}.ifEmpty([]))
ch_multiqc_files = ch_multiqc_files.mix(STARFUSION_WORKFLOW.out.star_gene_count.collect{it[1]}.ifEmpty([]))
ch_multiqc_files = ch_multiqc_files.mix(QC_WORKFLOW.out.rnaseq_metrics.collect{it[1]}.ifEmpty([]))
ch_multiqc_files = ch_multiqc_files.mix(QC_WORKFLOW.out.duplicate_metrics.collect{it[1]}.ifEmpty([]))
ch_multiqc_files = ch_multiqc_files.mix(QC_WORKFLOW.out.insertsize_metrics.collect{it[1]}.ifEmpty([]))

}

//
// Collate and save software versions
//
Expand Down Expand Up @@ -219,19 +235,6 @@ workflow RNAFUSION {
)
)

if (!params.references_only) { // TODO: Remove this temporary parameter when we have a full-working GitHub nf-test
ch_multiqc_files = ch_multiqc_files.mix(FASTQC.out.zip.collect{it[1]}.ifEmpty([]))
ch_multiqc_files = ch_multiqc_files.mix(TRIM_WORKFLOW.out.ch_fastp_html.collect{it[1]}.ifEmpty([]))
ch_multiqc_files = ch_multiqc_files.mix(TRIM_WORKFLOW.out.ch_fastp_json.collect{it[1]}.ifEmpty([]))
ch_multiqc_files = ch_multiqc_files.mix(TRIM_WORKFLOW.out.ch_fastqc_trimmed.collect{it[1]}.ifEmpty([]))
ch_multiqc_files = ch_multiqc_files.mix(STARFUSION_WORKFLOW.out.star_stats.collect{it[1]}.ifEmpty([]))
ch_multiqc_files = ch_multiqc_files.mix(STARFUSION_WORKFLOW.out.star_gene_count.collect{it[1]}.ifEmpty([]))
ch_multiqc_files = ch_multiqc_files.mix(QC_WORKFLOW.out.rnaseq_metrics.collect{it[1]}.ifEmpty([]))
ch_multiqc_files = ch_multiqc_files.mix(QC_WORKFLOW.out.duplicate_metrics.collect{it[1]}.ifEmpty([]))
ch_multiqc_files = ch_multiqc_files.mix(QC_WORKFLOW.out.insertsize_metrics.collect{it[1]}.ifEmpty([]))
ch_multiqc_files = ch_multiqc_files.mix(FUSIONINSPECTOR_WORKFLOW.out.ch_arriba_visualisation.collect{it[1]}.ifEmpty([]))
}

MULTIQC (
ch_multiqc_files.collect(),
ch_multiqc_config.toList(),
Expand All @@ -241,8 +244,6 @@ workflow RNAFUSION {
[]
)



emit:
multiqc_report = MULTIQC.out.report.toList() // channel: /path/to/multiqc_report.html
versions = ch_versions // channel: [ path(versions.yml) ]
Expand Down
Loading