From 816d181cd6aa0da60c96767b07d63f8e1859dc41 Mon Sep 17 00:00:00 2001 From: Toni Hermoso Pulido Date: Fri, 11 Oct 2024 18:37:43 +0200 Subject: [PATCH] upgrade modules and moving to different containers --- TODO.md | 7 +++-- bin/B0_generate_IPA_prot_aln.pl | 2 +- docker/Dockerfile | 43 -------------------------- docker/Rscript/Dockerfile | 2 +- docker/Rscript/deps.R | 4 +-- docker/aligners/Dockerfile | 16 ++++++++++ modules/local/exorthist/align_pairs.nf | 2 +- nextflow.config | 16 +++++----- 8 files changed, 34 insertions(+), 58 deletions(-) delete mode 100644 docker/Dockerfile create mode 100644 docker/aligners/Dockerfile diff --git a/TODO.md b/TODO.md index 0962a6e..0341f7e 100644 --- a/TODO.md +++ b/TODO.md @@ -1,6 +1,7 @@ - Moving modules into modules folder - Adding nextflow_schema.json - Review container - -* Testing new DSL2 version against old one -* Move parts into subworkflows for clarity if possible +- Testing new DSL2 version against old one +- Move parts into subworkflows for clarity if possible +- Convert params.config to params.yaml +- Include colors into the terminal messages diff --git a/bin/B0_generate_IPA_prot_aln.pl b/bin/B0_generate_IPA_prot_aln.pl index b4cf8e5..33602e7 100755 --- a/bin/B0_generate_IPA_prot_aln.pl +++ b/bin/B0_generate_IPA_prot_aln.pl @@ -17,7 +17,7 @@ ### with clustal if ($aligner=~/clustal/i){ - system "clustalw2 $exint -output=gde"; + system "clustalw $exint -output=gde"; } elsif ($aligner=~/MAFFT/i){ system "mafft --auto --thread $cpus --quiet $exint | sed 's/>/%/g' > $root.gde"; diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index 7111bb5..0000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,43 +0,0 @@ -FROM biocorecrg/centos-perlbrew-pyenv3-java:centos7 - -# File Author / Maintainer -MAINTAINER Luca Cozzuto - -ARG R_VERSION=3.6.0 -ARG MAFFT_VERSION=7.429 - -#upgrade pip -RUN pip install --upgrade pip - -#Installing MAFFT -RUN bash -c 'curl -k -L https://mafft.cbrc.jp/alignment/software/mafft-${MAFFT_VERSION}-with-extensions-src.tgz > mafft.tgz' -RUN tar -zvxf mafft.tgz -RUN cd mafft-${MAFFT_VERSION}-with-extensions/core;make clean; make; make install; cd ../../; rm mafft.tgz - -#Installing R -RUN yum install -y epel-release libxml2-devel libcurl-devel -RUN yum install R-${R_VERSION} -y -RUN mkdir -p /usr/share/doc/R-${R_VERSION}/html -RUN Rscript -e "install.packages(c('igraph'), repos='http://cran.us.r-project.org')" -RUN Rscript -e "install.packages(c('ggplot2'), repos='http://cran.us.r-project.org')" -RUN yum install -y NLopt-devel.x86_64 -RUN Rscript -e "install.packages(c('nloptr'), repos='http://cran.us.r-project.org')" -RUN Rscript -e "install.packages(c('pbkrtest', 'lme4', 'pbkrtest', 'lme4'), repos='http://cran.us.r-project.org')" - -RUN Rscript -e "install.packages(c('ggpubr', 'cowplot'), repos='http://cran.us.r-project.org')" -RUN Rscript -e "install.packages(c('devtools','reshape2'), repos='http://cran.us.r-project.org')" -RUN Rscript -e "devtools::install_github('nathan-russell/hashmap')" - -#Installing python modules -RUN yum install -y openssl -RUN pip install --upgrade virtualenv -RUN pip install pandas - -# Clean cache -RUN yum clean all - -#cleaning -RUN rm -fr *.tar.gz; rm -fr *.bz2 -RUN rm -rf /var/cache/yum -ENV LC_ALL=en_US.utf8 -ENV LANG=en_US.utf8 diff --git a/docker/Rscript/Dockerfile b/docker/Rscript/Dockerfile index 15d6390..3d9ca3e 100644 --- a/docker/Rscript/Dockerfile +++ b/docker/Rscript/Dockerfile @@ -1,6 +1,6 @@ FROM rocker/r-ver:3.6.3 -RUN apt-get -y update && apt-get install -y libnlopt-dev \ +RUN apt-get -y update && apt-get install -y libnlopt-dev libxml2-dev libcurl4-openssl-dev \ && rm -rf /var/lib/apt/lists/* COPY deps.R /tmp diff --git a/docker/Rscript/deps.R b/docker/Rscript/deps.R index eee3ac2..31d0314 100644 --- a/docker/Rscript/deps.R +++ b/docker/Rscript/deps.R @@ -1,8 +1,8 @@ install.packages('devtools', dependencies=TRUE, repos='cran.rstudio.com/'); +require(devtools) install.packages(c('igraph'), repos='http://cran.us.r-project.org'); install.packages(c('ggplot2'), repos='http://cran.us.r-project.org'); install.packages(c('nloptr'), repos='http://cran.us.r-project.org'); install.packages(c('pbkrtest', 'lme4', 'pbkrtest', 'lme4'), repos='http://cran.us.r-project.org'); install.packages(c('ggpubr', 'cowplot'), repos='http://cran.us.r-project.org'); -install.packages(c('hashmap'), repos='http://cran.us.r-project.org'); - +devtools::install_github('nathan-russell/hashmap') diff --git a/docker/aligners/Dockerfile b/docker/aligners/Dockerfile new file mode 100644 index 0000000..faa1e16 --- /dev/null +++ b/docker/aligners/Dockerfile @@ -0,0 +1,16 @@ +FROM perl:5.24-threaded-buster + +ARG MAFFT_VERSION=7.429 + +RUN apt-get update -y && apt-get install -y build-essential clustalw && rm -rf /var/lib/apt/lists/* + +#Installing MAFFT +WORKDIR /tmp +RUN curl -k -L https://mafft.cbrc.jp/alignment/software/mafft-${MAFFT_VERSION}-with-extensions-src.tgz > mafft.tgz +RUN tar -zvxf mafft.tgz +RUN cd mafft-${MAFFT_VERSION}-with-extensions/core;make clean; make; make install; cd ../../; rm mafft.tgz + +WORKDIR / + +# ENV LC_ALL=en_US.UTF8 +# ENV LANG=en_US.UTF8 diff --git a/modules/local/exorthist/align_pairs.nf b/modules/local/exorthist/align_pairs.nf index 05315a8..afadeb5 100644 --- a/modules/local/exorthist/align_pairs.nf +++ b/modules/local/exorthist/align_pairs.nf @@ -1,6 +1,6 @@ process PARSE_IPA_PROT_ALN { tag { cls_part_file.name } - label 'big_cpus' + label 'aligners' input: path blosumfile diff --git a/nextflow.config b/nextflow.config index 175fecc..60120ed 100644 --- a/nextflow.config +++ b/nextflow.config @@ -25,11 +25,6 @@ process { scratch = false containerOptions = { workflow.containerEngine == "docker" ? '-u $(id -u):$(id -g)': null} - withLabel: big_cpus { - cpus = 2 - memory = '5G' - } - withLabel: incr_time_cpus { errorStrategy = 'retry' memory = '5G' @@ -52,14 +47,21 @@ process { container = 'quay.io/biocontainers/pandas:1.5.2' } + withLabel: aligners { + cpus = 2 + memory = '5G' + container = 'biocorecrg/exorthist_aligners:2.0.0' + } + withLabel: rscript { - container = 'rocker/r-ver:3.6.3' + container = 'biocorecrg/exorthist_rscript:2.0.0' } } -process.container = 'biocorecrg/exon_intron_pipe:0.2' +// process.container = 'biocorecrg/exon_intron_pipe:0.2' +process.container = 'perl:5.24-threaded-buster' //singularity.enabled = true singularity.cacheDir = "$baseDir/singularity"