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
3 changes: 3 additions & 0 deletions config/softwares.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ process {
withLabel: 'agat' {
container = 'quay.io/biocontainers/agat:1.4.2--pl5321hdfd78af_0'
}
withLabel: 'bash' {
container = 'ubuntu:24.04'
}
withLabel: 'bamutil' {
container = 'quay.io/biocontainers/bamutil:1.0.15--h43eeafb_4'
}
Expand Down
12 changes: 4 additions & 8 deletions docker/reditools2/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
FROM condaforge/miniforge3:24.7.1-2

# Auto-activating Conda setup for Python 2.7
RUN conda config --add channels bioconda \
&& conda config --add channels conda-forge \
&& conda create -n myenv \
&& echo "conda activate myenv" >> ~/.bashrc

# Tool-specific dependencies
COPY env_reditools2.yml .
RUN conda env update -n myenv --file env_reditools2.yml \
&& conda clean --all -f -y
RUN conda env create -n myenv --file env_reditools2.yml \
&& conda clean --all -f -y \
&& echo "conda activate myenv" >> ~/.bashrc # Auto-activating Conda setup for Python 2.7


# Get and install tools
RUN git clone --depth=1 https://github.com/BioinfoUNIBA/REDItools2.git reditools2
Expand Down
56 changes: 28 additions & 28 deletions docker/reditools2/env_reditools2.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: myenv

channels:
- bioconda
- conda-forge
Expand All @@ -6,8 +8,8 @@ dependencies:
- _openmp_mutex=4.5=2_gnu
- attr=2.5.1=h166bdaf_1
- bzip2=1.0.8=h4bc722e_7
- c-ares=1.34.4=hb9d3cd8_0
- ca-certificates=2025.1.31=hbcca054_0
- c-ares=1.34.5=hb9d3cd8_0
- ca-certificates=2025.4.26=hbd8a1cb_0
- certifi=2019.11.28=py27h8c360ce_1
- htslib=1.17=h6bc39ce_1
- icu=73.2=h59595ed_0
Expand All @@ -16,55 +18,53 @@ dependencies:
- ld_impl_linux-64=2.43=h712a8e2_4
- libcap=2.71=h39aace5_0
- libcurl=7.87.0=h6312ad2_0
- libdeflate=1.23=h4ddbbb0_0
- libedit=3.1.20250104=pl5321h7949ede_0
- libdeflate=1.24=h86f0d12_0
- libedit=3.1.20191231=he28a2e2_2
- libev=4.33=hd590300_2
- libfabric=2.0.0=ha770c72_1
- libfabric1=2.0.0=h14e6f36_1
- libfabric=2.1.0=ha770c72_0
- libfabric1=2.1.0=h14e6f36_0
- libffi=3.2.1=he1b5a44_1007
- libgcc=14.2.0=h767d61c_2
- libgcc-ng=14.2.0=h69a702a_2
- libgcrypt-lib=1.11.0=hb9d3cd8_2
- libgfortran=14.2.0=h69a702a_2
- libgfortran5=14.2.0=hf1ad2bd_2
- libgomp=14.2.0=h767d61c_2
- libgpg-error=1.51=hbd13f7d_1
- libgcc=15.1.0=h767d61c_2
- libgcc-ng=15.1.0=h69a702a_2
- libgcrypt-lib=1.11.1=hb9d3cd8_0
- libgfortran=15.1.0=h69a702a_2
- libgfortran5=15.1.0=hcea5267_2
- libgomp=15.1.0=h767d61c_2
- libgpg-error=1.55=h3f2d84a_0
- libhwloc=2.11.2=default_he43201b_1000
- libiconv=1.18=h4ce23a2_1
- liblzma=5.6.4=hb9d3cd8_0
- libnghttp2=1.51.0=hdcd2b5c_0
- libnl=3.11.0=hb9d3cd8_0
- libsqlite=3.46.0=hde9e2c9_0
- libssh2=1.10.0=haa6b8db_3
- libstdcxx=14.2.0=h8f9b012_2
- libstdcxx-ng=14.2.0=h4852527_2
- libsystemd0=257.3=h3dc2cb9_0
- libudev1=257.3=h9a4d06a_0
- libstdcxx=15.1.0=h8f9b012_2
- libstdcxx-ng=15.1.0=h4852527_2
- libsystemd0=256.9=h2774228_0
- libudev1=257.4=h9a4d06a_0
- libxml2=2.12.7=hc051c1a_1
- libzlib=1.2.13=h4ab18f5_6
- lz4-c=1.10.0=h5888daf_1
- lz4-c=1.9.4=hcb278e6_0
- mpi=1.0.1=mpich
- mpi4py=3.0.3=py27hf423c55_1
- mpich=4.3.0=h1a8bee6_100
- ncurses=6.5=h2d0b736_3
- netifaces=0.10.9=py27hdf8410d_1002
- ncurses=6.2=h58526e2_4
- netifaces=0.10.4=py27_1
- openssl=1.1.1w=hd590300_0
- pip=20.1.1=pyh9f0ad1d_0
- psutil=5.7.0=py27hdf8410d_1
- pysam=0.20.0=py27h7835474_0
- python=2.7.15=h5a48372_1011_cpython
- python_abi=2.7=1_cp27mu
- rdma-core=56.0=h5888daf_0
- readline=8.2=h8c095d6_2
- samtools=1.18=hd87286a_0
- rdma-core=55.0=h5888daf_0
- readline=8.1=h46c0cb4_0
- samtools=1.12=h9aed4be_1
- setuptools=44.0.0=py27_0
- sortedcontainers=2.4.0=pyhd8ed1ab_0
- sqlite=3.46.0=h6d4b2fc_0
- sqlite=3.37.0=h9cd32fc_0
- tabix=1.11=hdfd78af_0
- tk=8.6.13=noxft_h4845f30_101
- ucx=1.18.0=hfd9a62f_1
- ucx=1.18.0=hfd9a62f_3
- wheel=0.37.1=pyhd8ed1ab_0
- xz=5.2.6=h166bdaf_0
- zlib=1.2.13=h4ab18f5_6
- zstd=1.5.6=ha6fb4c9_0

24 changes: 24 additions & 0 deletions lib/Rain_utilities.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// dedicated to the utility functions
class Rain_utilities {

// Function to chek if we
public static Boolean is_url(file) {

// check if the file is a URL
if (file =~ /^(http|https|ftp|s3|az|gs):\/\/.*/) {
return true
} else {
return false
}
}
// Function to chek if we
public static Boolean is_fastq(file) {

// check if the file is a URL
if (file =~ /.*(fq|fastq|fq.gz|fastq.gz)$/) {
return true
} else {
return false
}
}
}
2 changes: 1 addition & 1 deletion modules/aline.nf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ process AliNe {
profile,
config,
reads,
"--genome ${genome}",
"--reference ${genome}",
read_type,
aligner,
library_type,
Expand Down
13 changes: 7 additions & 6 deletions modules/bamutil.nf
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
process bamutil_clipoverlap {
label 'bamutil'
tag "$sample_id"
tag "${meta.id}"
publishDir "${params.outdir}/bamutil_clipoverlap", mode: 'copy'

input:
tuple val(sample_id), path(bam)
tuple val(meta), path(bam)

output:
tuple val(sample_id), path ("*clipoverlap.bam"), emit: tuple_sample_clipoverbam
tuple val(meta), path ("*clipoverlap.bam"), emit: tuple_sample_clipoverbam
path ("*_bamutil_clipoverlap.log"), emit: log

script:
"""
bam clipOverlap --storeOrig CG --poolSize 50000000 --in ${bam} --out ${bam}_clipoverlap.bam --stats > ${sample_id}_bamutil_clipoverlap.log
"""

"""
bam clipOverlap --storeOrig CG --poolSize 50000000 --in ${bam} --out ${bam}_clipoverlap.bam --stats > ${meta.id}_bamutil_clipoverlap.log
"""

}
21 changes: 21 additions & 0 deletions modules/bash.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
Here are described all processes related to bash
*/

// A process to compute the mean read length of a FASTQ
process extract_libtype {
label 'bash'
tag "$id"

input:
tuple val(id), path(samlmon_json)

output:
tuple val(id), env(LIBTYPE), emit: tuple_id_libtype

script:
"""
LIBTYPE=\$(grep expected_format ${samlmon_json} | awk '{print \$2}' | tr -d '",\n')
"""

}
38 changes: 23 additions & 15 deletions modules/fastp.nf
Original file line number Diff line number Diff line change
@@ -1,49 +1,57 @@
process fastp {
label 'fastp'
publishDir "${params.output}/${id}/qc", mode: 'copy'
tag "${meta.id}"
publishDir "${params.output}/${meta.id}/qc", mode: 'copy'

input:
tuple val(id), path(illumina)
tuple val(meta), path(illumina)
val(phred_type)

output:
tuple val(id), path("*_R?_clean.fastq")
path("${id}_fastp_report.html")
tuple val(meta), path("*_R?_clean.fastq")
path("${meta.id}_fastp_report.html")

script:
"""
if [ "${phred_type}" == "64" ]
then
fastp -i ${illumina[0]} -I ${illumina[1]} \
-o ${id}_R1_clean.fastq -O ${id}_R2_clean.fastq \
-o ${meta.id}_R1_clean.fastq -O ${meta.id}_R2_clean.fastq \
--phred64 \
--detect_adapter_for_pe --html ${id}_fastp_report.html
--detect_adapter_for_pe --html ${meta.id}_fastp_report.html
else
fastp -i ${illumina[0]} -I ${illumina[1]} \
-o ${id}_R1_clean.fastq -O ${id}_R2_clean.fastq \
--detect_adapter_for_pe --html ${id}_fastp_report.html
-o ${meta.id}_R1_clean.fastq -O ${meta.id}_R2_clean.fastq \
--detect_adapter_for_pe --html ${meta.id}_fastp_report.html
fi
"""
}

process fastp_hybrid {
label 'fastp'
tag "${meta.id}"
publishDir "${params.output}/${id}/qc", mode: 'copy'

input:
tuple val(id), path(illuminaR1), path(illuminaR2), path(ont)
tuple val(meta), path(illuminaR1), path(illuminaR2), path(ont)
val(phred_type)

output:
tuple val(id), path("${id}_R1_clean.fastq"),path("${id}_R2_clean.fastq"), path(ont), emit: trimmed_hybrid
path("${id}_fastp_report.html")
tuple val(meta), path("${meta.id}_R1_clean.fastq"),path("${meta.id}_R2_clean.fastq"), path(ont), emit: trimmed_hybrid
path("${meta.id}_fastp_report.html")

script:
"""
if [ "${phred_type}" == "64" ]
then
fastp -i ${illuminaR1} -I ${illuminaR2} \
-o ${id}_R1_clean.fastq -O ${id}_R2_clean.fastq \
-o ${meta.id}_R1_clean.fastq -O ${meta.id}_R2_clean.fastq \
--phred64 \
--detect_adapter_for_pe --html ${id}_fastp_report.html
--detect_adapter_for_pe --html ${meta.id}_fastp_report.html
else
fastp -i ${illuminaR1} -I ${illuminaR2} \
-o ${id}_R1_clean.fastq -O ${id}_R2_clean.fastq \
--detect_adapter_for_pe --html ${id}_fastp_report.html
-o ${meta.id}_R1_clean.fastq -O ${meta.id}_R2_clean.fastq \
--detect_adapter_for_pe --html ${meta.id}_fastp_report.html
fi
"""
}
16 changes: 8 additions & 8 deletions modules/fastqc.nf
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
process fastqc {
label 'fastqc'
tag "$sample_id"
tag "${meta.id}"
publishDir "${params.outdir}/FastQC", mode: 'copy'

input:
tuple val(sample_id), path(reads)
val (suffix)
tuple val(meta), path(reads)
val (suffix)

output:
path ("fastqc_${sample_id}_logs_${suffix}")
path ("fastqc_${meta.id}_logs_${suffix}")

script:
"""
mkdir fastqc_${sample_id}_logs_${suffix}
fastqc -t ${task.cpus} -o fastqc_${sample_id}_logs_${suffix} -q ${reads}
"""
"""
mkdir fastqc_${meta.id}_logs_${suffix}
fastqc -t ${task.cpus} -o fastqc_${meta.id}_logs_${suffix} -q ${reads}
"""

}
22 changes: 11 additions & 11 deletions modules/gatk.nf
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
process gatk_markduplicates {
label 'gatk'
tag "$sample_id"
tag "${meta.id}"
publishDir "${params.outdir}/gatk_markduplicates", mode: 'copy'

input:
tuple val(sample_id), path(bam)
tuple val(meta), path(bam)

output:
tuple val(sample_id), path ("*_marked_duplicates.bam"), emit: tuple_sample_dedupbam
path ("*_marked_dup_metrics.txt") , emit: log
tuple val(meta), path ("*_marked_duplicates.bam"), emit: tuple_sample_dedupbam
path ("*_marked_dup_metrics.txt") , emit: log

script:
"""
gatk MarkDuplicates \
-I ${bam} \
-O ${bam.baseName}_marked_duplicates.bam \
-M ${bam.baseName}_marked_dup_metrics.txt \
--REMOVE_DUPLICATES
"""

"""
gatk MarkDuplicates \
-I ${bam} \
-O ${bam.baseName}_marked_duplicates.bam \
-M ${bam.baseName}_marked_dup_metrics.txt \
--REMOVE_DUPLICATES
"""
}
17 changes: 9 additions & 8 deletions modules/jacusa2.nf
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
process jacusa2 {
label "jacusa2"
tag "${meta.id}"
publishDir("${params.outdir}/jacusa2", mode: "copy")

input:
tuple(val(sample), path(bam), path(bamindex))
tuple(path(genome), path(fastaindex))
tuple(val(meta), path(bam), path(bamindex))
tuple(path(genome), path(fastaindex))

output:
path("*.txt")
path("*.filtered")
// tuple(sample, path("filtered_output.txt", emit: tuple_sample_jacusa2_table))
path("*.txt")
path("*.filtered")
// tuple(sample, path("filtered_output.txt", emit: tuple_sample_jacusa2_table))

script:
"""
java -Xmx${task.memory.toMega()}M -jar /usr/local/bin/JACUSA_v2.0.4.jar call-1 -a D -f V -p ${task.cpus} -r jacusa_out.txt -c 1 -s -R ${genome} ${bam}
"""
"""
java -Xmx${task.memory.toMega()}M -jar /usr/local/bin/JACUSA_v2.0.4.jar call-1 -a D -f V -p ${task.cpus} -r jacusa_out.txt -c 1 -s -R ${genome} ${bam}
"""
}
14 changes: 7 additions & 7 deletions modules/multiqc.nf
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ process multiqc {
publishDir "${params.outdir}/MultiQC", mode: 'copy'

input:
path log_files
path multiqc_config
path log_files
path multiqc_config

output:
path "*multiqc_report.html"
path "*_data"
path "*multiqc_report.html"
path "*_data"

script:
"""
multiqc -p . -c ${multiqc_config}
"""
"""
multiqc -p . -c ${multiqc_config}
"""
}
Loading