From 4dc89d1a521774fca830c57fad3b90c48646febd Mon Sep 17 00:00:00 2001 From: xgrand <xavier.grand@ens-lyon.fr> Date: Tue, 26 Sep 2023 09:58:30 +0200 Subject: [PATCH] Add pychopper instead porechop not functionnal --- .../pychopper/2.5.0/Dockerfile | 21 +++++++++++++ .../pychopper/2.5.0/docker_init.sh | 10 ++++++ src/bolero.nf | 31 +++++++++++++++++-- src/nf_modules/pychopper/main.nf | 25 +++++++++++++++ 4 files changed, 84 insertions(+), 3 deletions(-) create mode 100644 src/.docker_modules/pychopper/2.5.0/Dockerfile create mode 100755 src/.docker_modules/pychopper/2.5.0/docker_init.sh create mode 100644 src/nf_modules/pychopper/main.nf diff --git a/src/.docker_modules/pychopper/2.5.0/Dockerfile b/src/.docker_modules/pychopper/2.5.0/Dockerfile new file mode 100644 index 0000000..16b78a0 --- /dev/null +++ b/src/.docker_modules/pychopper/2.5.0/Dockerfile @@ -0,0 +1,21 @@ +# SPDX-FileCopyrightText: 2023 Xavier Grand <xavier.grand@inserm.fr> +# +# SPDX-License-Identifier: AGPL-3.0-or-later + +FROM continuumio/miniconda3 +MAINTAINER Xavier Grand + +RUN apt-get update && apt-get install -y procps + +ENV PYCHOPPER_VERSION="2.5.0" +RUN conda init \ +&& conda config --add channels r \ +&& conda config --add channels defaults \ +&& conda config --add channels conda-forge \ +&& conda config --add channels bioconda \ +&& conda create -y -n pychopper +SHELL ["conda", "run", "-n", "pychopper", "/bin/bash", "-c"] +RUN conda install -c nanoporetech -c conda-forge -c bioconda "nanoporetech::pychopper" \ +&& echo "conda activate pychopper" >> /root/.bashrc + +ENV PATH /usr/local/envs/pychopper/bin:/usr/local/condabin:$PATH \ No newline at end of file diff --git a/src/.docker_modules/pychopper/2.5.0/docker_init.sh b/src/.docker_modules/pychopper/2.5.0/docker_init.sh new file mode 100755 index 0000000..b4adae1 --- /dev/null +++ b/src/.docker_modules/pychopper/2.5.0/docker_init.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# docker pull lbmc/pychopper:2.5.0 +# docker build src/.docker_modules/pychopper/2.5.0 -t 'lbmc/pychopper:2.5.0' +# docker push lbmc/pychopper:2.5.0 +# docker buildx build --platform linux/amd64,linux/arm64 -t "lbmc/pychopper:2.5.0" --push src/.docker_modules/pychopper/2.5.0 + +# docker pull xgrand/pychopper:2.5.0 +docker build src/.docker_modules/pychopper/2.5.0 -t 'xgrand/pychopper:2.5.0' +docker push xgrand/pychopper:2.5.0 +# docker buildx build --platform linux/amd64,linux/arm64 -t "xgrand/pychopper:2.5.0" --push src/.docker_modules/pychopper/2.5.0 \ No newline at end of file diff --git a/src/bolero.nf b/src/bolero.nf index 2bb2162..15a06d0 100755 --- a/src/bolero.nf +++ b/src/bolero.nf @@ -84,9 +84,9 @@ params.skipBC = true params.gpu_mode = false params.adapt = "CGACTGGAGCACGAGGACACTGA" // "CGACTGGAGCACGAGGACACTGACATGGACTGAAGGAGTAGAAA" // params.gsp = "TTAGGCAGAGGTGAAAAAGTTG" -params.transcriptome = "./data/202201_Full-length_HBV_GTFv3/20220112_preCore_FL_HBV_XGR_transcripts.fasta" -params.genome = "./data/202201_Full-length_HBV_GTFv3/preCore_XGR.fasta" -params.gtf = "./data/202201_Full-length_HBV_GTFv3/20220112_GTF_preCore_FL_HBV_XGR.gtf" +// params.transcriptome = "./data/202201_Full-length_HBV_GTFv3/20220112_preCore_FL_HBV_XGR_transcripts.fasta" +params.genome = "/home/xavier/Data/Genome/202201_Full-length_HBV_GTFv3/20230516_HBV_FL_preCore_reference.fasta" +params.gtf = "/home/xavier/Data/Genome/202201_Full-length_HBV_GTFv3/20230516_GTF_preCore_FL_HBV_XGR.gtf" params.flowcell = "FLO-MIN106" params.kit = "SQK-PBK004" @@ -188,7 +188,9 @@ include { start_position_individuals } from "./nf_modules/start_positions/main.n include { jwr_checker } from "./nf_modules/nanosplicer/main.nf" include { junctions_nanosplicer } from "./nf_modules/junction_nanosplicer/main.nf" include { rna_count } from "./nf_modules/rna_count/main.nf" + include { porechop } from "./nf_modules/porechop/main.nf" +include { trimmming_pychopper } from "./nf_modules/pychopper/main.nf" /* **************************************************************** @@ -250,9 +252,13 @@ workflow { //Trimming with porechop porechop(seqkit_grep.out.filtered_fastq) + + //Trimming with pychopper + //trimmming_pychopper(seqkit_grep.out.filtered_fastq) //Cut of the 5'RACE sequence cut_5pRACE(porechop.out.porechoped_fastq, params.adapt) + //cut_5pRACE(trimmming_pychopper.out.pychoped_fastq, params.adapt) //cut_5pRACE(seqkit_grep.out.filtered_fastq, params.adapt) //########################## MAPPING ########################## @@ -304,3 +310,22 @@ workflow { rna_count(files_for_rna_count) } + +// End message: + +workflow.onComplete { + + println ( workflow.success ? """ + DUPFinder tools execution summary + --------------------------- + Completed at : ${workflow.complete} + Duration : ${workflow.duration} + Success : ${workflow.success} + workDir : ${workflow.workDir} + exit status : ${workflow.exitStatus} + """ : """ + Failed: ${workflow.errorReport} + exit status : ${workflow.exitStatus} + """ + ) +} diff --git a/src/nf_modules/pychopper/main.nf b/src/nf_modules/pychopper/main.nf new file mode 100644 index 0000000..1102b61 --- /dev/null +++ b/src/nf_modules/pychopper/main.nf @@ -0,0 +1,25 @@ +version = "2.5.0" +container_url = "xgrand/pychopper:${version}" + +params.pychopper_out ="" +process trimmming_pychopper { + container = "${container_url}" + label "big_mem_multi_cpus" + tag "${barcode}" + if (params.pychopper_out != "") { + publishDir "results/${params.pychopper_out}", mode: 'copy' + } + + input: + tuple val(barcode), path(fastq) + + output: + tuple val(barcode), path("${barcode}/${barcode}_merged_pychoped.fastq.gz"), emit: pychoped_fastq + + script: +""" +mkdir ${barcode} +cd ${barcode}/ +pychopper -k ${params.kit} -r ${barcode}_pychopper_report.pdf -S ${barcode}_statistics.tsv -t ${task.cpus} ../${fastq} ${barcode}_merged_pychoped.fastq.gz +""" +} \ No newline at end of file -- GitLab