diff --git a/src/.docker_modules/bedtools/2.30.0/docker_init.sh b/src/.docker_modules/bedtools/2.30.0/docker_init.sh index fa7f1fde2544c47ff928fefbd549f3b786feca8c..b23fa27ee4e668610dca9da740fa53dbdc18e3db 100755 --- a/src/.docker_modules/bedtools/2.30.0/docker_init.sh +++ b/src/.docker_modules/bedtools/2.30.0/docker_init.sh @@ -1,5 +1,4 @@ #!/bin/sh docker pull lbmc/bedtools:2.30.0 -# docker build src/.docker_modules/bedtools/2.30.0 -t 'lbmc/bedtools:2.30.0' -# docker push lbmc/bedtools:2.30.0 -docker buildx build --platform linux/amd64,linux/arm64 -t "lbmc/bedtools:2.30.0" --push src/.docker_modules/bedtools/2.30.0 +docker build src/.docker_modules/bedtools/2.30.0 -t 'lbmc/bedtools:2.30.0' +docker push lbmc/bedtools:2.30.0 diff --git a/src/.docker_modules/cellphonedb/3.0.0/Dockerfile b/src/.docker_modules/cellphonedb/3.0.0/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..18e7cf712d67b5a4cf8998915212d236e38d8491 --- /dev/null +++ b/src/.docker_modules/cellphonedb/3.0.0/Dockerfile @@ -0,0 +1,21 @@ +FROM python:3.7-slim + +ENV RPY2_CFFI_MODE=ABI + +RUN mkdir /app /docker +COPY requirements.txt /app +COPY requirements-web.txt /app +WORKDIR /app + +RUN pip install -r requirements.txt +RUN pip install -r requirements-web.txt +RUN pip install cellphonedb==3.0.0 + + +COPY . /app +COPY ./docker /docker +RUN mkdir -p /var/log/uwsgi +RUN touch /var/log/uwsgi/cellphonedb.log +RUN chmod +x /app + +CMD ["/docker/run-system.sh"] diff --git a/src/.docker_modules/cellphonedb/3.0.0/cellphonedb.ini b/src/.docker_modules/cellphonedb/3.0.0/cellphonedb.ini new file mode 100644 index 0000000000000000000000000000000000000000..ea75bcab10bd3fe4b64250f48715b524b224442e --- /dev/null +++ b/src/.docker_modules/cellphonedb/3.0.0/cellphonedb.ini @@ -0,0 +1,14 @@ +[uwsgi] +module = wsgi:app + +master = true +processes = 4 + + +socket = 0.0.0.0:5000 +chmod-socket = 660 +vacuum = true + +die-on-term = true + +stats = /tmp/stats.socket \ No newline at end of file diff --git a/src/.docker_modules/cellphonedb/3.0.0/docker/postgres/Dockerfile b/src/.docker_modules/cellphonedb/3.0.0/docker/postgres/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..25b936ad249c9f0fd6003c503e7856c3a66e3435 --- /dev/null +++ b/src/.docker_modules/cellphonedb/3.0.0/docker/postgres/Dockerfile @@ -0,0 +1,5 @@ +FROM postgres:9.6 + +ENV POSTGRES_PASSWORD root +ENV POSTGRES_USER root +ENV POSTGRES_DB cellphonedb \ No newline at end of file diff --git a/src/.docker_modules/cellphonedb/3.0.0/docker/run-system.sh b/src/.docker_modules/cellphonedb/3.0.0/docker/run-system.sh new file mode 100755 index 0000000000000000000000000000000000000000..9b8cd443032f5a201190956c9ff1031689931842 --- /dev/null +++ b/src/.docker_modules/cellphonedb/3.0.0/docker/run-system.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +exec uwsgi --ini cellphonedb.ini --log-master diff --git a/src/.docker_modules/cellphonedb/3.0.0/requirements-web.txt b/src/.docker_modules/cellphonedb/3.0.0/requirements-web.txt new file mode 100644 index 0000000000000000000000000000000000000000..fa15fd0b3898ac21f75fa9ed2e1b9c5b0f88a282 --- /dev/null +++ b/src/.docker_modules/cellphonedb/3.0.0/requirements-web.txt @@ -0,0 +1,6 @@ +flask>=1.1,<1.1.99 +Flask-RESTful>=0.3,<0.3.99 +Flask-Testing>=0.8,<0.8.99 +pika>=0.12,<0.12.99 +boto3>=1.7,<1.7.99 +uWSGI>=2.0,<2.0.99 diff --git a/src/.docker_modules/cellphonedb/3.0.0/requirements.txt b/src/.docker_modules/cellphonedb/3.0.0/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..2f7e9961e0a4bd1e3748baaaf151d84bb785b50a --- /dev/null +++ b/src/.docker_modules/cellphonedb/3.0.0/requirements.txt @@ -0,0 +1,18 @@ +click>=7.0,<8.0 +pandas>=1.0.0,<=1.1.4 +numpy>=1.16.5,<=1.19.5 +numpy-groupies +scikit-learn==0.22 +flask>=1.0,<2.0.0 +Flask-RESTful>=0.3 +Flask-Testing>=0.7 +SQLAlchemy>=1.3,<1.4 +PyYAML>=5.4,<6.0 +requests>=2.25,<3.0 +pika>=1.0.0,<2.0 +boto3>=1.15,<2.0 +geosketch==0.3 +rpy2>=3.4.0,<4.0 +tqdm>=4.3,<5.0 +h5py<3.0.0 +anndata>=0.7,<=0.75 diff --git a/src/.docker_modules/htseq/0.13.5/docker_init.sh b/src/.docker_modules/htseq/0.13.5/docker_init.sh index 00ad38fecb0bf776961f550a87610abb40741211..ca03fe9af2bc8f9f2bb9d70efc02a0c01e40cfde 100755 --- a/src/.docker_modules/htseq/0.13.5/docker_init.sh +++ b/src/.docker_modules/htseq/0.13.5/docker_init.sh @@ -1,5 +1,4 @@ #!/bin/sh docker pull lbmc/htseq:0.13.5 -# docker build src/.docker_modules/htseq/0.13.5 -t 'lbmc/htseq:0.13.5' -# docker push lbmc/htseq:0.13.5 -docker buildx build --platform linux/amd64,linux/arm64 -t "lbmc/htseq:0.13.5" --push src/.docker_modules/htseq/0.13.5 +docker build src/.docker_modules/htseq/0.13.5 -t 'lbmc/htseq:0.13.5' +docker push lbmc/htseq:0.13.5 diff --git a/src/.docker_modules/kb/0.26.3/docker_init.sh b/src/.docker_modules/kb/0.26.3/docker_init.sh index 8104fc75e2461863c98782e9c115a42501f624c9..0294274a2518ef8622027bb56b49c4baded4a9d8 100755 --- a/src/.docker_modules/kb/0.26.3/docker_init.sh +++ b/src/.docker_modules/kb/0.26.3/docker_init.sh @@ -1,5 +1,4 @@ #!/bin/sh docker pull lbmc/kb:0.26.3 -# docker build src/.docker_modules/kb/0.26.3 -t 'lbmc/kb:0.26.3' -# docker push lbmc/kb:0.26.3 -docker buildx build --platform linux/amd64,linux/arm64 -t "lbmc/kb:0.26.3" --push src/.docker_modules/kb/0.26.3 +docker build src/.docker_modules/kb/0.26.3 -t 'lbmc/kb:0.26.3' +docker push lbmc/kb:0.26.3 diff --git a/src/.docker_modules/sanity/Dockerfile b/src/.docker_modules/sanity/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..99f9545ea137d6a7450983b9719301c7e7edf578 --- /dev/null +++ b/src/.docker_modules/sanity/Dockerfile @@ -0,0 +1,30 @@ +##### BASE IMAGE ##### +FROM ubuntu:18.04 + +##### METADATA ##### +LABEL base.image="ubuntu:18.04" +LABEL version="1" +LABEL software="Sanity" +LABEL software.version="1.0" +LABEL software.description="Sanity" +LABEL software.website="" +LABEL software.documentation="https://github.com/jmbreda/Sanity" + +##### VARIABLES ##### + +# Use variables for convenient updates/re-usability +ENV SOFTWARE_VERSION 1.0 + +RUN apt-get update \ + && apt-get install -y tzdata \ + && ln -fs /usr/share/zoneinfo/Europe/Berlin /etc/localtime \ + && dpkg-reconfigure --frontend noninteractive tzdata \ + && apt-get install --yes git make g++ libgomp1 \ + && git clone https://github.com/jmbreda/Sanity.git \ + && cd Sanity \ + && cd src \ + && make \ + && cp ../bin/Sanity /usr/bin \ + && cd ../../ \ + && rm -rf Sanity \ + && apt-get remove --purge --yes git make g++ \ diff --git a/src/.docker_modules/sanity/docker_init.sh b/src/.docker_modules/sanity/docker_init.sh new file mode 100755 index 0000000000000000000000000000000000000000..876fecd80a1d5eaf08ce74e8596960b999768480 --- /dev/null +++ b/src/.docker_modules/sanity/docker_init.sh @@ -0,0 +1,4 @@ +#!/bin/sh +docker pull mlepetit/saanity +docker build src/.docker_modules/mlepetit/sanity -t 'lbmc/sanity' +docker push lbmc/sanity diff --git a/src/nf_modules/cellphonedb/main.nf b/src/nf_modules/cellphonedb/main.nf new file mode 100644 index 0000000000000000000000000000000000000000..37fb970082ea2f04a9225f8876b726dd93dee78b --- /dev/null +++ b/src/nf_modules/cellphonedb/main.nf @@ -0,0 +1,118 @@ +version = "3.0.0" +container_url = "mlepetit/cellphonedb:latest" + +params.cellphonedb = "" +params.cellphonedb_out = "" +params.pval="" +params.thres="" +params.iterations="" +params.gene_id="" + + + +workflow cellphone_statistical_analysis { + take: + meta + counts + + main: + +cpdb_methods_stats(meta,counts) +cpdb_plot_dot_plot(cpdb_methods_stats.out.means,cpdb_methods_stats.out.pvalues) +cpdb_plot_heatmap(cpdb_methods_stats.out.pvalues) + + + emit: + means = cpdb_methods_stats.out.means + pvalues = cpdb_methods_stats.out.pvalues + deconvoluted = cpdb_methods_stats.out.deconvoluted + significant_means = cpdb_methods_stats.out.significant_means + dot_plot = cpdb_plot_dot_plot.out.dot_plot + heatmap = cpdb_plot_heatmap.out.heatmap + heatmap_log = cpdb_plot_heatmap.out.heatmap_log + count_network = cpdb_plot_heatmap.out.count_network + interactions_count = cpdb_plot_heatmap.out.interactions_count + + +} + + + + + + + + + + +process cpdb_methods_stats { + container = "${container_url}" + label "big_mem_multi_cpus" + if (params.cellphonedb_out != "") { + publishDir "results/${params.cellphonedb_out}", mode: 'copy' + } + + input: + tuple val(id_mtx), path(meta) + tuple val(id_mtx), path(counts) + + output: + tuple val(id_mtx), path("out/means.txt"), emit: means + tuple val(id_mtx), path("out/pvalues.txt"), emit: pvalues + tuple val(id_mtx), path("out/deconvoluted.txt"), emit: deconvoluted + tuple val(id_mtx), path("out/significant_means.txt"), emit: significant_means + +script: + """ +cellphonedb method statistical_analysis ${params.meta} ${params.counts} --counts-data ${params.gene_id} --threads ${task.cpus} --iterations ${params.iterations} --pvalue ${params.pval} --threshold ${params.thres} + + """ +} + + +process cpdb_plot_dot_plot { + container = "${container_url}" + label "big_mem_mono_cpus" + if (params.cellphonedb_out != "") { + publishDir "results/${params.cellphonedb_out}", mode: 'copy' + } + + input: + tuple val(id_mtx), path(means) + tuple val(id_mtx), path(pvalues) + + output: + tuple val(id_mtx), path("out/plot.pdf"), emit: dot_plot + +script: + """ +mkdir ./out +cellphonedb plot dot_plot --means-path ${means} --pvalues-path ${pvalues} + + """ +} + +process cpdb_plot_heatmap { + container = "${container_url}" + label "big_mem_multi_cpus" + if (params.cellphonedb_out != "") { + publishDir "results/${params.cellphonedb_out}", mode: 'copy' + } + + input: + tuple val(id_mtx), path(pvalues) + + output: + tuple val(id_mtx), path("out/heatmap_count.pdf"), emit: heatmap + tuple val(id_mtx), path("out/heatmap_log_count.pdf"), emit: heatmap_log + tuple val(id_mtx), path("out/count_network.txt"), emit: count_network + tuple val(id_mtx), path("out/interaction_count.txt"), emit: interactions_count + +script: + + """ +mkdir ./out +cellphonedb plot heatmap_plot --pvalues-path ${pvalues} --pvalue ${params.pval} ${params.meta} + + """ +} diff --git a/src/nf_modules/fastp/main.nf b/src/nf_modules/fastp/main.nf index 2593eefecab24037db7d80f213b83db29e0092b4..92ee81fc37f6369e5da2b68dff18f9256f2fca48 100644 --- a/src/nf_modules/fastp/main.nf +++ b/src/nf_modules/fastp/main.nf @@ -151,3 +151,4 @@ process fastp_accel_1splus { --report_title ${file_prefix} """ } + diff --git a/src/nf_modules/kb/main.nf b/src/nf_modules/kb/main.nf index ca4e7552c58fe8ee6118b843d5b0228f2eada860..6edfa13080ac635bf7917b4013eeccad9265d910 100644 --- a/src/nf_modules/kb/main.nf +++ b/src/nf_modules/kb/main.nf @@ -268,7 +268,7 @@ workflow index_fasta_velocity { process index_fasta_velocity_default { container = "${container_url}" - label "big_mem_mono_cpus" + label "big_mem_multi_cpus" tag "$file_id" if (params.index_fasta_out != "") { publishDir "results/${params.index_fasta_out}", mode: 'copy' diff --git a/src/nf_modules/sanity/main.nf b/src/nf_modules/sanity/main.nf new file mode 100644 index 0000000000000000000000000000000000000000..7d9d6236c94230a845abf688699f268e5dff24ef --- /dev/null +++ b/src/nf_modules/sanity/main.nf @@ -0,0 +1,35 @@ +container_url="mlepetit/sanity:latest" + +params.sanity_out="" +params.sanity="" + +process normalization_sanity + { + + container="${container_url}" + label "big_mem_multi_cpus" + if (params.sanity_out != "") { + publishDir "results/${params.sanity_out}", mode: 'copy' + + } +else { + publishDir "results/normalize_matrix/", mode: 'copy' + + } + + input: + + tuple val(id_mtx), path(raw_filtered_mtx) + + + output: + + tuple val(id_mtx),path("log_transcription_quotients.txt"), emit: normalize_filtered_mtx + tuple val(id_mtx), path("ltq_error_bars.txt") ,emit: ltq_error + + script: + + """ + Sanity -f ${raw_filtered_mtx} -n ${task.cpus} ${params.sanity} + """ + }