From a2bc3056cbc17e74fe4529cdaf7aa842ec2c7491 Mon Sep 17 00:00:00 2001 From: Carine <carine.rey@ens-lyon.fr> Date: Wed, 19 Mar 2025 15:17:43 +0100 Subject: [PATCH] version uengs2024 --- Dockerfile | 44 ++++++++++++++++++++++----------------- bashrc_ext.txt | 14 +++++++++++++ conda_clean_base.sh | 16 +++++++------- environment_rnaseq.yml | 4 ---- environment_uengs.yml | 11 ++++++++++ install.R | 47 ++++++++++++++++++++++++++---------------- install_miniforge.sh | 13 ++++-------- 7 files changed, 91 insertions(+), 58 deletions(-) create mode 100644 bashrc_ext.txt create mode 100644 environment_uengs.yml diff --git a/Dockerfile b/Dockerfile index ad3dbd2..ffef332 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,7 +25,7 @@ RUN if [ -f "install.R" ]; then \ WORKDIR /opt ##UCSC tools -RUN rsync -aP rsync://hgdownload.soe.ucsc.edu/genome/admin/exe/linux.x86_64/*[wW]ig* /usr/local/bin/ +#RUN rsync -aP rsync://hgdownload.soe.ucsc.edu/genome/admin/exe/linux.x86_64/*[wW]ig* /usr/local/bin/ # Trinity: #https://github.com/trinityrnaseq/trinityrnaseq @@ -53,8 +53,8 @@ RUN rsync -aP rsync://hgdownload.soe.ucsc.edu/genome/admin/exe/linux.x86_64/*[wW #install space ranger #WORKDIR /opt -#RUN wget -O spaceranger-2.1.0.tar.gz "https://cf.10xgenomics.com/releases/spatial-exp/spaceranger-2.1.0.tar.gz?Expires=1693974326&Key-Pair-Id=APKAI7S6A5RYOXBWRPDA&Signature=BEWx4GOU0Rbc~3N2-m5qvUbVUxT2i8q4PRco1rqrHh-C3U2KIHwJ9oQX5SxmYApDM-~ENtciSD80BPkJRDzY95sg8SZVzbpjDB9b-q1TrXvfZuKb8LT-7rryktZr1brEFacCxgFxKDotbEDsYJwVfqP0WOS~rWYfAPBM6Wkq-iZe1A0a8OtOC5VCI5vE1CRqNZOwRaDb9p06E-R7TLgcB9VFthdKIDd1jn2rTBj6ZocXJNJo9diQEDoZQ9P1ysU6c3drdQYC5Z1rpXvVUBiEa8dQUqF8JfN16z7DdyUwzoH~i0exNJtY2gJ44EmVNz6zw8keyOIpuPWfTV-1-MR0xg__" && \ -# tar -xzvf spaceranger-2.1.0.tar.gz +#RUN wget -O spaceranger-3.1.0.tar.gz "https://cf.10xgenomics.com/releases/spatial-exp/spaceranger-3.1.0.tar.gz?Expires=1725492623&Key-Pair-Id=APKAI7S6A5RYOXBWRPDA&Signature=Ur3tKIQ6v3wWbt287~eVW2CaKHgCasRKB7FIuq1lPrk9eVA7icpNdbVyR~LuWEml9UdNdwlg78rmRhH6k5EaMfcuTvN0-GHvgARdW2ZWvlu2jkV2LufN8sr9EmqAESHUABg253J1~9jpr8BJQgf92rEfNXu1b~mZM~zAMB19UkT44bNgxyX5M~99uhAnCVEfZoFv-Y-lQMB7bf2RAiLVfOu51BuT1jmdhmcK9by3tRRrCM1NtQOHU4xJWrblQQCHwPJ4TZXUhcmIxzAhIx1sV~UVST~OPgMLYDmBvu7Sjl6RqEXk~ZAfcKPKiZFfUhfORv0IiE0FFM1WsrhTF21T6g__" && \ +# tar -xzvf spaceranger-3.1.0.tar.gz #ENV PATH=/opt/spaceranger-2.1.0/:"$PATH" @@ -70,31 +70,37 @@ RUN rsync -aP rsync://hgdownload.soe.ucsc.edu/genome/admin/exe/linux.x86_64/*[wW ENV PATH=/usr/games/:/home/rstudio/bin/:"$PATH" ## Install tools via conda +USER rstudio +WORKDIR /home/rstudio + +SHELL ["/bin/bash", "-c"] -# install miniforge -COPY install_miniforge.sh conda_clean_base.sh /opt/docker/bin/ -RUN bash /opt/docker/bin/install_miniforge.sh && \ - bash /opt/docker/bin/conda_clean_base.sh +RUN wget -O /tmp/Miniforge3.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh" +RUN bash /tmp/Miniforge3.sh -b -p /home/rstudio/conda && \ + rm /tmp/Miniforge3.sh && \ + source /home/rstudio/conda/etc/profile.d/conda.sh && \ + conda update -n base -c conda-forge conda && \ + conda clean -a -y ### Install conda env for user 'rstudio' -USER rstudio -WORKDIR /home/rstudio -##COPY --chown=rstudio environment_ngs.yml /opt/environment_ngs.yml -COPY --chown=rstudio environment_rnaseq.yml /opt/environment_rnaseq.yml -## +COPY environment_uengs.yml /opt/environment_uengs.yml ## -RUN /opt/conda/bin/conda env create -f /opt/environment_rnaseq.yml && \ - /opt/conda/bin/conda clean -a -y -###RUN conda env create -f /opt/environment_ngs.yml && \ -### conda clean -a -y -## -RUN echo "conda activate rnaseq" >> /home/rstudio/.bashrc -###RUN echo "conda activate ngs" >> /home/rstudio/.bashrc +RUN source /home/rstudio/conda/etc/profile.d/conda.sh &&\ + conda env create -f /opt/environment_uengs.yml && \ + conda clean -a -y + + +COPY bashrc_ext.txt /tmp/bashrc_ext.txt +RUN cat /tmp/bashrc_ext.txt >> /home/rstudio/.bashrc + ## ## ## Required for s6-supervise exec at container runtime init USER root + +RUN ln -s /home/rstudio/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh + ## ### Optional WORKDIR /root/app-recipe \ No newline at end of file diff --git a/bashrc_ext.txt b/bashrc_ext.txt new file mode 100644 index 0000000..d8a0b99 --- /dev/null +++ b/bashrc_ext.txt @@ -0,0 +1,14 @@ + +#clone conda envs +conda activate base + + +if [ ! -f /home/rstudio/.conda/clone_ok ]; then + + (conda create -p /home/rstudio/conda/envs/spatial --clone /home/rstudio/ifbdata/ueens_lyon_ngs24/.conda/envs/spatial_init > /home/rstudio/.conda/clone_spatial.log && \ + conda create -p /home/rstudio/conda/envs/meso --clone /home/rstudio/ifbdata/ueens_lyon_ngs24/.conda/envs/meso_init > /home/rstudio/.conda/clone_meso.log && \ + conda create -p /home/rstudio/conda/envs/chipseq --clone /home/rstudio/ifbdata/ueens_lyon_ngs24/.conda/envs/chipseq_init > /home/rstudio/.conda/clone_chipseq.log && \ + conda create -p /home/rstudio/conda/envs/scrnaseq --clone /home/rstudio/ifbdata/ueens_lyon_ngs24/.conda/envs/scrnaseq_init > /home/rstudio/.conda/clone_scrnaseq.log &) + + touch /home/rstudio/.conda/clone_ok +fi diff --git a/conda_clean_base.sh b/conda_clean_base.sh index 62b30db..1440486 100644 --- a/conda_clean_base.sh +++ b/conda_clean_base.sh @@ -1,11 +1,11 @@ #!/usr/bin/bash -eu # clean default conda environment (only keep the bare minimum) -find /opt/conda/ -name '*.a' -delete && \ -find /opt/conda/ -name '__pycache__' -type d -exec rm -rf '{}' '+' && \ -find /opt/conda/ -mindepth 1 -maxdepth 1 -type d \( -name "bin" -o -name "lib" -o -name "etc" \) -prune -o -exec rm -rf '{}' '+' && \ -find /opt/conda/bin -type f -size +100k ! -name "python3.10" -delete && \ -find /opt/conda/lib/ -mindepth 1 -maxdepth 1 -type d ! -name "python3.10" -exec rm -rf '{}' '+' && \ -rm -rf /opt/conda/lib/python3.10/site-packages/pip /opt/conda/lib/python3.10/idlelib /opt/conda/lib/python3.10/ensurepip && \ -find /opt/conda/lib/python3.10/site-packages -name '*.pyx' -delete && \ -rm -rf /opt/conda/lib/python3.10/site-packages/uvloop/loop.c +find /home/rstudio/.conda/ -name '*.a' -delete && \ +find /home/rstudio/.conda/ -name '__pycache__' -type d -exec rm -rf '{}' '+' && \ +find /home/rstudio/.conda/ -mindepth 1 -maxdepth 1 -type d \( -name "bin" -o -name "lib" -o -name "etc" \) -prune -o -exec rm -rf '{}' '+' && \ +find /home/rstudio/.conda/bin -type f -size +100k ! -name "python3.10" -delete && \ +find /home/rstudio/.conda/lib/ -mindepth 1 -maxdepth 1 -type d ! -name "python3.10" -exec rm -rf '{}' '+' && \ +rm -rf /home/rstudio/.conda/lib/python3.10/site-packages/pip /home/rstudio/.conda/lib/python3.10/idlelib /home/rstudio/.conda/lib/python3.10/ensurepip && \ +find /home/rstudio/.conda/lib/python3.10/site-packages -name '*.pyx' -delete && \ +rm -rf /home/rstudio/.conda/lib/python3.10/site-packages/uvloop/loop.c diff --git a/environment_rnaseq.yml b/environment_rnaseq.yml index 41e43c8..b2932f1 100644 --- a/environment_rnaseq.yml +++ b/environment_rnaseq.yml @@ -4,14 +4,10 @@ channels: - bioconda dependencies: - seqtk - - bioawk - - sra-tools - - parallel-fastq-dump=0.6.7 - fastp=0.23.4 - salmon=1.10.3 - star=2.7.11b - htseq=2.0.5 - - subread=2.0.6 - blast=2.16.0 - fastqc=0.12.1 - multiqc=1.24 diff --git a/environment_uengs.yml b/environment_uengs.yml new file mode 100644 index 0000000..91a0a22 --- /dev/null +++ b/environment_uengs.yml @@ -0,0 +1,11 @@ +name: uengs +channels: + - conda-forge + - bioconda +dependencies: + - fastqc=0.12.1 + - multiqc=1.24 + - fastp + - cutadapt + - datamash + - seqtk diff --git a/install.R b/install.R index eeb1146..88a1d82 100644 --- a/install.R +++ b/install.R @@ -1,29 +1,40 @@ options(Ncpus = parallel::detectCores()) +options(repos = c(CRAN = "https://cran.rstudio.com")) # Installation of standard R packages -install.packages(c('remotes', - 'Seurat', - 'mvoutlier', - 'gprofiler2', - 'preseqR')) +install.packages(c("remotes", + "Seurat", + "mvoutlier", + "preseqR")) # Installation of packages with BiocManager -install.packages('BiocManager') +install.packages("BiocManager") BiocManager::install( - c('tximport', - 'biomaRt', - 'clusterProfiler', - 'ComplexHeatmap', - 'DESeq2', - 'EnhancedVolcano', - 'ggpubr', - 'apeglm', - 'scater', - 'rhdf5', - 'idr' - ), ask = FALSE) + c("biomaRt", + "clusterProfiler", + "apeglm", + "scater", + "rhdf5", + "idr" + ), ask = FALSE) + + +BiocManager::install(c("eisaR", + "BSgenome", + "fishpond", + "GenomicFeatures")) +install.packages("devtools") + +devtools::install_github("COMBINE-lab/roe") # Install R package from GitHub #remotes::install_github("satijalab/seurat-data", "seurat5", quiet = TRUE) #remotes::install_github("satijalab/azimuth", "seurat5", quiet = TRUE) #remotes::install_github("satijalab/seurat-wrappers", "seurat5", quiet = TRUE) + +#Serat Wrapper +install.packages(c("hwriter", + "RcppParallel", + "latticeExtra")) + +BiocManager::install("dada2") \ No newline at end of file diff --git a/install_miniforge.sh b/install_miniforge.sh index 1f3d55e..4ecbc36 100644 --- a/install_miniforge.sh +++ b/install_miniforge.sh @@ -13,14 +13,14 @@ export condapkg="https://github.com/conda-forge/miniforge/releases/download/${mi # Install the latest miniforge with Python3 curl -s -L $condapkg > miniforge.sh -bash miniforge.sh -b -p /opt/conda +bash miniforge.sh -b -p /home/rstudio/conda/ rm -f miniforge.sh # Work around TLS issues while updating conda's python and retrieving channel notices export CONDA_NUMBER_CHANNEL_NOTICES="0" -touch /opt/conda/conda-meta/pinned -ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh -source /opt/conda/etc/profile.d/conda.sh +touch /home/rstudio/.conda/conda-meta/pinned +ln -s /home/rstudio/.conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh +source /home/rstudio/.conda/etc/profile.d/conda.sh conda activate conda config --set show_channel_urls True conda config --set channel_priority strict @@ -33,8 +33,3 @@ mamba update --yes --all # Clean to reduce image size conda clean -aftipy conda deactivate - -# custom user gets permission to write in the conda dir -if id "rstudio" >/dev/null 2>&1; then - chown -R rstudio:rstudio /opt/conda -fi -- GitLab