From c02459bdfe159fdb244b9da5a0053eb3b098cb9f Mon Sep 17 00:00:00 2001 From: earx Date: Tue, 10 Jun 2025 16:26:00 +0200 Subject: [PATCH 1/6] replace "uncompress" for "unzip" --- modules/pigz.nf | 4 ++-- rain.nf | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/pigz.nf b/modules/pigz.nf index b18fd9f..453de76 100644 --- a/modules/pigz.nf +++ b/modules/pigz.nf @@ -3,7 +3,7 @@ A parallel implementation of gzip for modern multi-processor, multi-core machines https://zlib.net/pigz/ */ -process fasta_uncompress { +process fasta_unzip { tag "$genome" label 'pigz' @@ -20,7 +20,7 @@ process fasta_uncompress { """ - # DEALING WITH GZIPPED FILES to uncompress if needed + # DEALING WITH GZIPPED FILES to unzip if needed extension=\$(echo ${genome} | awk -F . '{print \$NF}') if [[ \${extension} == "gz" ]];then diff --git a/rain.nf b/rain.nf index 396e24a..e12a2ed 100644 --- a/rain.nf +++ b/rain.nf @@ -139,7 +139,7 @@ include {fastp} from './modules/fastp.nf' include {fastqc as fastqc_raw; fastqc as fastqc_ali; fastqc as fastqc_dup; fastqc as fastqc_clip} from './modules/fastqc.nf' include {gatk_markduplicates } from './modules/gatk.nf' include {multiqc} from './modules/multiqc.nf' -include {fasta_uncompress} from "$baseDir/modules/pigz.nf" +include {fasta_unzip} from "$baseDir/modules/pigz.nf" include {samtools_index; samtools_fasta_index; samtools_sort_bam} from './modules/samtools.nf' include {reditools2} from "./modules/reditools2.nf" include {reditools3} from "./modules/reditools3.nf" @@ -205,9 +205,9 @@ workflow { Channel.fromPath(params.genome, checkIfExists: true) .ifEmpty { exit 1, "Cannot find genome matching ${params.genome}!\n" } .set{genome_raw} - // uncompress it if needed - fasta_uncompress(genome_raw) - fasta_uncompress.out.genomeFa.set{genome_ch} // set genome to the output of fasta_uncompress + // unzip it if needed + fasta_unzip(genome_raw) + fasta_unzip.out.genomeFa.set{genome_ch} // set genome to the output of fasta_unzip // ---------------------------------------------------------------------------- // --- DEAL WITH ANNOTATION --- Channel.empty().set{annotation_ch} From 49080489bcfcf8229994f1cda322128d5167762e Mon Sep 17 00:00:00 2001 From: earx Date: Tue, 10 Jun 2025 16:28:21 +0200 Subject: [PATCH 2/6] change "ressources" to "resources" --- config/{ressources => resources}/base.config | 0 config/{ressources => resources}/base_aline.config | 0 config/{ressources => resources}/custom_aline.config | 0 config/{ressources => resources}/hpc.config | 0 config/{ressources => resources}/local.config | 0 nextflow.config | 10 +++++----- rain.nf | 2 +- 7 files changed, 6 insertions(+), 6 deletions(-) rename config/{ressources => resources}/base.config (100%) rename config/{ressources => resources}/base_aline.config (100%) rename config/{ressources => resources}/custom_aline.config (100%) rename config/{ressources => resources}/hpc.config (100%) rename config/{ressources => resources}/local.config (100%) diff --git a/config/ressources/base.config b/config/resources/base.config similarity index 100% rename from config/ressources/base.config rename to config/resources/base.config diff --git a/config/ressources/base_aline.config b/config/resources/base_aline.config similarity index 100% rename from config/ressources/base_aline.config rename to config/resources/base_aline.config diff --git a/config/ressources/custom_aline.config b/config/resources/custom_aline.config similarity index 100% rename from config/ressources/custom_aline.config rename to config/resources/custom_aline.config diff --git a/config/ressources/hpc.config b/config/resources/hpc.config similarity index 100% rename from config/ressources/hpc.config rename to config/resources/hpc.config diff --git a/config/ressources/local.config b/config/resources/local.config similarity index 100% rename from config/ressources/local.config rename to config/resources/local.config diff --git a/nextflow.config b/nextflow.config index 7d7e971..16370da 100644 --- a/nextflow.config +++ b/nextflow.config @@ -16,7 +16,7 @@ params { } // Include a base config (2 forks of 1 CPU) -includeConfig "$baseDir/config/ressources/base.config" +includeConfig "$baseDir/config/resources/base.config" profiles { @@ -32,7 +32,7 @@ profiles { params.sifPath = "${baseDir}/sif_images" // singularity.envWhitelist = '' // Comma separated list of environment variable names to be included in the container environment. includeConfig "$baseDir/config/softwares.config" - includeConfig "$baseDir/config/ressources/hpc.config" + includeConfig "$baseDir/config/resources/hpc.config" } debug { process.beforeScript = 'env' } @@ -50,10 +50,10 @@ profiles { includeConfig "$baseDir/config/softwares.config" } local { - includeConfig "$baseDir/config/ressources/local.config" + includeConfig "$baseDir/config/resources/local.config" } test { - params.aline_profiles = "${baseDir}/config/ressources/base_aline.config" + params.aline_profiles = "${baseDir}/config/resources/base_aline.config" params.aligner = "STAR" params.reads = "${baseDir}/data/chr21/chr21_small_R1.fastq.gz " params.genome = "${baseDir}/data/chr21/chr21_small.fasta.gz" @@ -62,7 +62,7 @@ profiles { params.read_type = "short_single" } test2 { - params.aline_profiles = "${baseDir}/config/ressources/base_aline.config" + params.aline_profiles = "${baseDir}/config/resources/base_aline.config" params.aligner = "STAR" params.reads = "${baseDir}/data/chr21/" params.genome = "${baseDir}/data/chr21/chr21_small.fasta.gz" diff --git a/rain.nf b/rain.nf index e12a2ed..cf22b4a 100644 --- a/rain.nf +++ b/rain.nf @@ -36,7 +36,7 @@ params.aggregation_mode = "all" aline_profile_allowed = [ 'docker', 'singularity', 'local', 'itrop' ] // Aline ressource config used -params.aline_profiles = "$baseDir/config/ressources/custom_aline.config" // e.g. "docker, singularity,itrop,local" +params.aline_profiles = "$baseDir/config/resources/custom_aline.config" // e.g. "docker, singularity,itrop,local" // Aligner params align_tools = ['hisat2', "STAR"] From 9163cdd7739bf11bc507b55fa1be429680639825 Mon Sep 17 00:00:00 2001 From: earx Date: Tue, 10 Jun 2025 16:29:09 +0200 Subject: [PATCH 3/6] only create fasta index if necessary (it is necessary for jacusa2) --- rain.nf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rain.nf b/rain.nf index cf22b4a..f82ab99 100644 --- a/rain.nf +++ b/rain.nf @@ -459,12 +459,12 @@ workflow rain { samtools_index(tuple_sample_bam_processed) // report with multiqc // multiqc(logs.collect(),params.multiqc_config) - // Create a fasta index file of the reference genome - samtools_fasta_index(genome) // Select site detection tool switch (params.edit_site_tool) { case "jacusa2": + // Create a fasta index file of the reference genome + samtools_fasta_index(genome) jacusa2(samtools_index.out.tuple_sample_bam_bamindex, samtools_fasta_index.out.tuple_fasta_fastaindex) break case "sapin": From ec24d5d9cfc70fba1c459728a607a2bdaf57c716 Mon Sep 17 00:00:00 2001 From: earx Date: Mon, 16 Jun 2025 14:14:02 +0200 Subject: [PATCH 4/6] rename the pig stuff --- modules/pigz.nf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/pigz.nf b/modules/pigz.nf index 453de76..b18fd9f 100644 --- a/modules/pigz.nf +++ b/modules/pigz.nf @@ -3,7 +3,7 @@ A parallel implementation of gzip for modern multi-processor, multi-core machines https://zlib.net/pigz/ */ -process fasta_unzip { +process fasta_uncompress { tag "$genome" label 'pigz' @@ -20,7 +20,7 @@ process fasta_unzip { """ - # DEALING WITH GZIPPED FILES to unzip if needed + # DEALING WITH GZIPPED FILES to uncompress if needed extension=\$(echo ${genome} | awk -F . '{print \$NF}') if [[ \${extension} == "gz" ]];then From 5e5e56486b34c394b762224a191c30535f445d9a Mon Sep 17 00:00:00 2001 From: earx Date: Mon, 16 Jun 2025 14:14:12 +0200 Subject: [PATCH 5/6] rename channels --- rain.nf | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/rain.nf b/rain.nf index f82ab99..1d1743c 100644 --- a/rain.nf +++ b/rain.nf @@ -207,14 +207,14 @@ workflow { .set{genome_raw} // unzip it if needed fasta_unzip(genome_raw) - fasta_unzip.out.genomeFa.set{genome_ch} // set genome to the output of fasta_unzip + fasta_unzip.out.genomeFa.set{genome} // set genome to the output of fasta_unzip // ---------------------------------------------------------------------------- // --- DEAL WITH ANNOTATION --- - Channel.empty().set{annotation_ch} + Channel.empty().set{annotation} if (params.annotation){ Channel.fromPath(params.annotation, checkIfExists: true) .ifEmpty { exit 1, "Cannot find annotation matching ${params.annotation}!\n" } - .set{annotation_ch} + .set{annotation} } // ---------------------------------------------------------------------------- def path_csv = params.csv @@ -368,7 +368,7 @@ workflow { "${workflow.resume?'-resume':''} -profile ${aline_profile}", // workflow opts supplied as params for flexibility "-config ${params.aline_profiles}", "--reads ${path_reads}", - genome_ch, + genome, "--read_type ${params.read_type}", "--aligner ${params.aligner}", "--library_type ${params.library_type}", @@ -390,7 +390,7 @@ workflow { if (params.library_type.contains("auto") ) { log.info "Library type is set to auto, extracting it from salmon output" // GET TUPLE [ID, OUTPUT_SALMON_LIBTYPE] FILES - ALIGNMENT.out.output + aline_alignments_all = ALIGNMENT.out.output .map { dir -> files("$dir/salmon_libtype/*/*.json", checkIfExists: true) // Find BAM files inside the output directory } @@ -404,7 +404,7 @@ workflow { aline_libtype = extract_libtype(aline_libtype) aline_alignments.join(aline_libtype) .map { key, val1, val2 -> tuple(key, val1, val2) } - .set { aline_alignments_all } + } else { log.info "Library type is set to ${params.library_type}, no need to extract it from salmon output" aline_alignments_all = aline_alignments.map { name, bam -> tuple(name, bam, params.library_type) } @@ -418,20 +418,8 @@ workflow { } // call rain - all_bams = aline_alignments_all.mix(sorted_bam) + tuple_sample_sortedbam = aline_alignments_all.mix(sorted_bam) log.info "The following bam file(s) will be processed by RAIN:" - all_bams.view() - rain(all_bams, genome_ch, annotation_ch) -} - -workflow rain { - - take: - tuple_sample_sortedbam - genome - annnotation - - main: // STEP 1 QC with fastp ? Channel.empty().set{logs} @@ -472,12 +460,12 @@ workflow rain { break case "reditools2": reditools2(samtools_index.out.tuple_sample_bam_bamindex, genome, params.region) - normalize_gxf(annnotation) + normalize_gxf(annotation) pluviometer(reditools2.out.tuple_sample_serial_table, normalize_gxf.out.gff, "reditools2") break case "reditools3": reditools3(samtools_index.out.tuple_sample_bam_bamindex, genome) - normalize_gxf(annnotation) + normalize_gxf(annotation) pluviometer(reditools3.out.tuple_sample_serial_table, normalize_gxf.out.gff, "reditools3") break default: From 9d0efec4599699ca933b49f62c7bb897b8ed196c Mon Sep 17 00:00:00 2001 From: earx Date: Tue, 17 Jun 2025 10:31:52 +0200 Subject: [PATCH 6/6] fix module name and missing parens --- modules/pigz.nf | 2 +- rain.nf | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/pigz.nf b/modules/pigz.nf index b18fd9f..6170d50 100644 --- a/modules/pigz.nf +++ b/modules/pigz.nf @@ -3,7 +3,7 @@ A parallel implementation of gzip for modern multi-processor, multi-core machines https://zlib.net/pigz/ */ -process fasta_uncompress { +process fasta_unzip { tag "$genome" label 'pigz' diff --git a/rain.nf b/rain.nf index 0b8b722..43d7de4 100644 --- a/rain.nf +++ b/rain.nf @@ -452,7 +452,7 @@ workflow { switch (params.edit_site_tool) { case "jacusa2": // Create a fasta index file of the reference genome - samtools_fasta_index(genome.collect() + samtools_fasta_index(genome.collect()) jacusa2(samtools_index.out.tuple_sample_bam_bamindex, samtools_fasta_index.out.tuple_fasta_fastaindex.collect()) break case "sapin": @@ -460,7 +460,7 @@ workflow { break case "reditools2": reditools2(samtools_index.out.tuple_sample_bam_bamindex, genome.collect(), params.region) - normalize_gxf(annotation.collec()) + normalize_gxf(annotation.collect()) pluviometer(reditools2.out.tuple_sample_serial_table, normalize_gxf.out.gff.collect(), "reditools2") break case "reditools3": @@ -471,6 +471,7 @@ workflow { default: exit(1, "Wrong edit site tool was passed") } + }