生物信息软件/流程dockerfile打包参考

网友投稿 252 2022-10-19

生物信息软件/流程dockerfile打包参考

目录

​​常见生信软件的docker镜像及其dockerfile​​

​​Bioinformatics Docker Images Project​​​​docker-builds​​​​docker-bio​​​​bioinformatics-toolbox​​

生信软件、流程依赖的东西太多,docker打包镜像一不小心就是上Gb大小。

镜像太大很多缺点:上传、拉取慢;费宽带;占空间。。。

docker已广泛应用在IT,生信只是沾了点光,所以没有专门的优化,在这方面的资料也比较少(尤其是中文)。

这里贴几点资源,供参考。

常见生信软件的docker镜像及其dockerfile

Bioinformatics Docker Images Project

Bioinformatics Docker Images Project​​​https://pegi3s.github.io/dockerfiles/​​​ 由Phenotypic Evolution Group - IBMC/i3S团队维护。 所有镜像可在Docker hub获取:​​https://hub.docker.com/u/pegi3s/​​ 对应的dockerfile可在github获取:​​Public Health Bioinformatics Workgroup(StaPH-B)开发维护。做的比较早,影响力较大,Github标星近百人。工具偏向于人类健康,当然也有很多通用的,多看看他们写的dockerfile。​​​ubuntu:20.04LABEL description="Bioinformatics Docker Container"LABEL maintainer="amoustafa@aucegypt.edu"RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections####################################################################################################################################################################################RUN apt-get update --fix-missing && \apt-get -y upgrade && \apt-get -y install apt-utils dialog software-properties-commonRUN add-apt-repository universe && \add-apt-repository multiverse && \add-apt-repository restricted####################################################################################################################################################################################ARG SETUPDIR=/tmp/bioinformatics-toolbox-setup/RUN mkdir -p $SETUPDIRWORKDIR $SETUPDIR##################################################################################################################################################################################### Prerequisites##############################RUN apt-get -y install vim nano emacs rsync curl wget screen htop parallel gnupg lsof git locate unrar bc aptitude unzip bison flex \build-essential libtool autotools-dev automake autoconf cmake \libboost-dev libboost-all-dev libboost-system-dev libboost-program-options-dev libboost-iostreams-dev libboost-filesystem-dev \gfortran libgfortran5 \default-jre default-jdk ant \python3 python3-dev python3-pip python3-venv \libssl-dev libcurl4-openssl-dev \libxml2-dev \libmagic-dev \hdf5-* libhdf5-* \fuse libfuse-dev \libtbb-dev \liblzma-dev libbz2-dev \libbison-dev \libgmp3-dev \libncurses5-dev libncursesw5-dev \liblzma-dev \caffe-cpu \cargo \ffmpeg \libmagick++-dev \libavfilter-dev \dos2unix \git-lfs##################################################################################################################################################################################### Progamming######################### BioPerl#########RUN apt-get -y install bioperl# Biopython###########RUN pip3 install --no-cache-dir -U biopython numpy pandas matplotlib scipy seaborn statsmodels plotly bokeh scikit-learn tensorflow keras torch theano jupyterlab# R###RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 && \add-apt-repository 'deb focal-cran40/' && \apt-get update && \apt-get -y install r-base r-base-dev && \R -e "install.packages (c('tidyverse', 'tidylog', 'readr', 'dplyr', 'knitr', 'printr', 'rmarkdown', 'shiny', \'ggplot2', 'gplots', 'plotly', 'rbokeh', 'circlize', 'RColorBrewer', 'formattable', \'reshape2', 'data.table', 'readxl', 'devtools', 'cowplot', 'tictoc', 'ggpubr', 'patchwork', 'reticulate', \'rpart', 'rpart.plot', 'randomForest', 'randomForestExplainer', 'randomForestSRC', 'ggRandomForests', 'xgboost', 'gbm', 'iml', \'gganimate', 'gifski', 'av', 'magick', 'ggvis', 'googleVis', \'pheatmap', 'Rtsne', 'vsn', 'vegan', 'BiocManager'))" && \R -e "BiocManager::install(c('DESeq2', 'edgeR', 'dada2', 'phyloseq', 'metagenomeSeq', 'biomaRt'), ask = FALSE, update = TRUE)"####################################################################################################################################################################################RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10##################################################################################################################################################################################### NCBI Tools########################RUN mkdir -p $SETUPDIR/ncbi && cd $SETUPDIR/ncbi && \git clone && \git clone && \git clone && \git clone && \cd $SETUPDIR/ncbi/ncbi-vdb && ./configure && make && make install && \cd $SETUPDIR/ncbi/ngs && ./configure && make && make install && \cd $SETUPDIR/ncbi/ngs/ngs-sdk && ./configure && make && make install && \cd $SETUPDIR/ncbi/ngs/ngs-python && ./configure && make && make install && \cd $SETUPDIR/ncbi/ngs/ngs-java && ./configure && make && make install && \cd $SETUPDIR/ncbi/ngs/ngs-bam && ./configure && make && make install && \cd $SETUPDIR/ncbi/sra-tools && ./configure && make && make install && \cd $SETUPDIR/ncbi/ngs-tools && ./configure && make && make installRUN cd $SETUPDIR/ncbi && \curl -o datasets '&& \chmod +x datasets && \mv datasets /usr/local/bin/##################################################################################################################################################################################### Sequence Processing########################################### FASTX#######RUN cd $SETUPDIR/ && \git clone && cd $SETUPDIR/libgtextutils/ && \./reconf && ./configure && make && make install && \cd $SETUPDIR/ && \git clone && cd $SETUPDIR/fastx_toolkit && \wget -t 0 && \patch -p1 < fastx-toolkit-gcc7-patch.txt && \./reconf && ./configure && make && make install# Trimmomatic#############RUN cd $SETUPDIR/ && \git clone && \cd $SETUPDIR/trimmomatic && \make && make install INSTALL="/usr/local/"# SeqKit########RUN cd $SETUPDIR/ && \wget -t 0 && \tar zxvf seqkit_linux_amd64.tar.gz && \mv seqkit /usr/local/bin/# fastp######## RUN cd $SETUPDIR/ && \# git clone && \# cd $SETUPDIR/fastp && \# make && make installRUN wget && \chmod a+x ./fastp && \mv ./fastp /usr/local/bin/# HTStream##########RUN cd $SETUPDIR/ && \wget -t 0 && \tar zxvf HTStream_v1.3.3.tar.gz && \mv hts_* /usr/local/bin/# fqtrim########RUN cd $SETUPDIR/ && \wget -t 0 && \tar zxvf fqtrim-0.9.7.tar.gz && \cd $SETUPDIR/fqtrim-0.9.7/ && \make && mv fqtrim /usr/local/bin/# seqmagick###########RUN pip3 install --no-cache-dir -U seqmagick# seqtk#######RUN git clone && \cd seqtk && \make && \mv seqtk /usr/local/bin/# Parallel fastq-dump#####################RUN cd $SETUPDIR/ && \git clone && \cd $SETUPDIR/parallel-fastq-dump/ && \mv parallel-fastq-dump /usr/local/bin/##################################################################################################################################################################################### Sequence Search################################### BLAST & HMMER###############RUN apt-get -y install ncbi-blast+ hmmerRUN cd $SETUPDIR/ && wget -t 0 && tar zxvf diamond-linux64.tar.gz && mv diamond /usr/local/bin/# CD-HIT########RUN cd $SETUPDIR/ && \git clone && \cd $SETUPDIR/cdhit && \make && \make install##################################################################################################################################################################################### Alignment Tools################################### JAligner##########RUN apt-get -y install jaligner# MUSCLE########RUN cd $SETUPDIR/ && \wget -t 0 && \tar zxvf muscle3.8.31_src.tar.gz && \cd $SETUPDIR/muscle3.8.31/src && \make && mv muscle /usr/local/bin/# MAFFT#######RUN cd $SETUPDIR/ && \wget -t 0 && \tar zxvf mafft-7.481-with-extensions-src.tgz && \cd $SETUPDIR/mafft-7.481-with-extensions/core && \make clean && make && make install && \cd $SETUPDIR/mafft-7.481-with-extensions/extensions/ && \make clean && make && make install# BWA#####RUN cd $SETUPDIR/ && \git clone && \cd $SETUPDIR/bwa && \make && mv bwa /usr/local/bin/# TopHat######### RUN cd $SETUPDIR/ && \# wget -t 0 && \# tar zxvf tophat-2.1.1.Linux_x86_64.tar.gz && \# cd $SETUPDIR/tophat-2.1.1.Linux_x86_64 && \# mv tophat* /usr/local/bin/# HISAT2########RUN cd $SETUPDIR/ && \git clone && \cd $SETUPDIR/hisat2 && \make && mv hisat2-* /usr/local/bin/ && mv hisat2 /usr/local/bin/# Bowtie2########RUN cd $SETUPDIR/ && \git clone && \cd $SETUPDIR/bowtie2/ && \make && make install# STAR######RUN cd $SETUPDIR/ && \git clone && \cd $SETUPDIR/STAR/source && \make STAR && mv STAR /usr/local/bin/# Salmon########RUN cd $SETUPDIR/ && \wget -t 0 && \tar zxvf salmon-1.4.0_linux_x86_64.tar.gz && \mv $SETUPDIR/salmon-latest_linux_x86_64/bin/* /usr/local/bin/ && \mv $SETUPDIR/salmon-latest_linux_x86_64/lib/* /usr/local/lib/# kallisto##########RUN cd $SETUPDIR/ && \git clone && \cd $SETUPDIR/kallisto/ext/htslib && \autoheader && autoconf && \cd $SETUPDIR/kallisto/ && \mkdir build && \cd $SETUPDIR/kallisto/build && \cmake .. && make && make install && \R -e "BiocManager::install('pachterlab/sleuth', ask = FALSE, update = TRUE)"# BBMap#######RUN cd $SETUPDIR/ && \wget -t 0 && \tar zxvf BBMap_38.90.tar.gz && \mv bbmap/* /usr/local/bin/##################################################################################################################################################################################### BAM Processing################################# HTSlib########RUN cd $SETUPDIR/ && \git clone && \cd $SETUPDIR/htslib && \autoreconf -i ; git submodule update --init --recursive ; ./configure ; make ; make install# Samtools##########RUN cd $SETUPDIR/ && \git clone git://github.com/samtools/samtools.git && \cd $SETUPDIR/samtools && \autoheader ; autoconf ; ./configure ; make ; make install# Bcftools##########RUN cd $SETUPDIR/ && \git clone && \cd $SETUPDIR/bcftools && \autoheader ; autoconf ; ./configure ; make ; make install# Bamtools##########RUN cd $SETUPDIR/ && \git clone git://github.com/pezmaster31/bamtools.git && \cd $SETUPDIR/bamtools && \mkdir build && \cd $SETUPDIR/bamtools/build && \cmake .. ; make ; make install# VCFtools##########RUN cd $SETUPDIR/ && \git clone && \cd $SETUPDIR/vcftools && \./autogen.sh ; ./configure ; make ; make install# Bedtools##########RUN cd $SETUPDIR/ && \git clone && \cd $SETUPDIR/bedtools2 && \make ; make install# deepTools###########RUN cd $SETUPDIR/ && \git clone && \cd $SETUPDIR/deepTools && \python setup.py install# BEDOPS########RUN cd $SETUPDIR/ && \git clone && \cd $SETUPDIR/bedops && \make ; make install ; mv ./bin/* /usr/local/bin/# SAMBAMBA##########RUN cd $SETUPDIR/ && \wget -t 0 && \gzip -d sambamba-0.8.0-linux-amd64-static.gz && \mv sambamba-0.8.0-linux-amd64-static /usr/local/bin/sambamba && \chmod +x /usr/local/bin/sambamba##################################################################################################################################################################################### Assemblers######################### SPAdes########RUN cd $SETUPDIR/ && \wget -t 0 && \tar zxvf SPAdes-3.15.2-Linux.tar.gz && \mv SPAdes-3.15.2-Linux/bin/* /usr/local/bin/ && \mv SPAdes-3.15.2-Linux/share/* /usr/local/share/# ABySS#######RUN cd $SETUPDIR/ && \git clone && \cd $SETUPDIR/sparsehash && \./autogen.sh && ./configure && make && make install && \cd $SETUPDIR/ && \git clone && \cd $SETUPDIR/abyss && \./autogen.sh && ./configure && make && make install# Velvet########RUN cd $SETUPDIR/ && \git clone && \cd $SETUPDIR/velvet/ && \make && mv velvet* /usr/local/bin/# MEGAHIT#########RUN cd $SETUPDIR/ && \git clone && \cd $SETUPDIR/megahit && \git submodule update --init && \mkdir build && \cd $SETUPDIR/megahit/build && \cmake .. -DCMAKE_BUILD_TYPE=Release && make -j4 && make simple_test && make install# MetaVelvet############RUN cd $SETUPDIR/ && \git clone git://github.com/hacchy/MetaVelvet.git && \cd $SETUPDIR/MetaVelvet && \make && mv meta-velvetg /usr/local/bin/##################################################################################################################################################################################### Phylogenetics############################### TreeTime##########RUN pip3 install phylo-treetime# FastTree##########RUN cd $SETUPDIR/ && \wget -t 0 && \gcc -O3 -finline-functions -funroll-loops -Wall -o FastTree FastTree.c -lm && \gcc -DOPENMP -fopenmp -O3 -finline-functions -funroll-loops -Wall -o FastTreeMP FastTree.c -lm && \mv FastTree /usr/local/bin && \mv FastTreeMP /usr/local/bin# RAxML#######RUN cd $SETUPDIR/ && \git clone && \cd $SETUPDIR/standard-RAxML && \rm -fr *.o && make -f Makefile.gcc && cp raxmlHPC /usr/local/bin/ && \rm -fr *.o && make -f Makefile.SSE3.gcc && cp raxmlHPC-SSE3 /usr/local/bin/ && \rm -fr *.o && make -f Makefile.PTHREADS.gcc && cp raxmlHPC-PTHREADS /usr/local/bin/ && \rm -fr *.o && make -f Makefile.SSE3.PTHREADS.gcc && cp raxmlHPC-PTHREADS-SSE3 /usr/local/bin/ && \rm -fr *.o && make -f Makefile.MPI.gcc && cp raxmlHPC-MPI /usr/local/bin/ && \rm -fr *.o && make -f Makefile.SSE3.MPI.gcc && cp raxmlHPC-MPI-SSE3 /usr/local/bin/# RAxML NG##########RUN cd $SETUPDIR/ && \git clone --recursive && \cd $SETUPDIR/raxml-ng && \mkdir build && \cd $SETUPDIR/raxml-ng/build && \cmake .. && make && mv ../bin/raxml-ng /usr/local/bin/ && \cmake -DSTATIC_BUILD=ON -DENABLE_RAXML_SIMD=OFF -DENABLE_PLLMOD_SIMD=OFF .. && make && mv ../bin/raxml-ng-static /usr/local/bin/ && \cmake -DUSE_MPI=ON .. && make && mv ../bin/raxml-ng /usr/local/bin/raxml-ng-mpi# PhyML#######RUN cd $SETUPDIR/ && \git clone && \cd $SETUPDIR/phyml/ && \sh ./autogen.sh && ./configure && make && make install# Pplacer#########RUN cd $SETUPDIR/ && \wget -t 0 && \unzip pplacer-linux-v1.1.alpha19.zip && \cd $SETUPDIR/pplacer-Linux-v1.1.alpha19/ && \mv guppy /usr/local/bin/ && \mv pplacer /usr/local/bin/ && \mv rppr /usr/local/bin/ && \cd $SETUPDIR/pplacer-Linux-v1.1.alpha19/scripts/ && \python setup.py install##################################################################################################################################################################################### Gene Prediction##################################RUN cd $SETUPDIR/ && \wget -t 0 && \mv prodigal.linux /usr/local/bin/prodigal && \chmod +x /usr/local/bin/prodigal# Infernal##########RUN cd $SETUPDIR/ && \wget -t 0 && \tar zxvf infernal-1.1.4.tar.gz && \cd $SETUPDIR/infernal-1.1.4/ && \./configure && make && make install# GECCO#######RUN pip install gecco-tool# DeepBGC#########RUN apt-get update && \apt-get -y install software-properties-common && \add-apt-repository ppa:deadsnakes/ppa && \apt-get -y install python3.7RUN python3.7 -m pip install kiwisolver --forceRUN python3.7 -m pip install deepbgcRUN python3.7 -m pip install deepbgc[hmm]RUN deepbgc download# antiSMASH############ RUN apt-get update && \# apt-get -y install apt-transport-RUN wget -O /etc/apt/sources.list.d/antismash.list && \# wget -q -O- | apt-key add -# RUN apt-get update && \# apt-get -y install hmmer2 hmmer diamond-aligner fasttree prodigal ncbi-blast+ muscle glimmerhmm# RUN cd $SETUPDIR/# RUN wget && tar -zxf antismash-6.0.0.tar.gz# RUN pip install ./antismash-6.0.0# RUN download-antismash-databases##################################################################################################################################################################################### Misc############# Docker########RUN cd $SETUPDIR/ && \wget -t 0 -O docker.sh && \sh docker.sh# Miniconda###########RUN cd $SETUPDIR/ && \wget -t 0 && \sh Miniconda3-latest-Linux-x86_64.sh -b -p /usr/local/miniconda3# Nexflow#########RUN cd $SETUPDIR/ && \wget -qO- | bash && \chmod +x nextflow && \mv nextflow /usr/local/bin/##################################################################################################################################################################################### Variant Calling################################### GATK####### Removing default openjdk because of GATK's requirement for an old version of Java.RUN apt-get -y purge openjdk*# Installing openjdk 8RUN apt-get -y install openjdk-8* antRUN mkdir -p /apps/ && \cd /apps/ && \git clone && \cd /apps/gatk && \./gradlew# IGV#####RUN cd /apps/ && \wget -t 0 && \unzip IGV_Linux_snapshot_WithJava.zip && \mv IGV_Linux_snapshot IGV# VEP#####RUN cd /apps/ && \apt-get -y install cpanminus libtry-tiny-perl libperl4-corelibs-perl && \cpanm autodie && \cpanm Module::Build && \cpanm Bio::DB::HTS::Tabix && \git clone && \cd ensembl-vep && \perl INSTALL.pl --NO_HTSLIB --AUTO alcfp --SPECIES homo_sapiens --ASSEMBLY GRCh38 --PLUGINS all##################################################################################################################################################################################### Finishing####################### Removing /usr/local/lib/libgomp.so.1 (seems to be broken) and use /usr/lib/x86_64-linux-gnu/libgomp.so.1 insteadRUN rm -fr /usr/local/lib/libgomp.so.1RUN cd $SETUPDIR/RUN echo "#!/usr/bin/bash" > $SETUPDIR/init.shRUN echo "export PATH=$PATH:/usr/local/ncbi/sra-tools/bin/:/usr/local/ncbi/ngs-tools/bin/:/usr/local/ncbi/ncbi-vdb/bin:/usr/local/miniconda3/bin:/apps/gatk:/apps/IGV:/apps/ensembl-vep" >> $SETUPDIR/init.shRUN echo "source /etc/profile.d/*" >> $SETUPDIR/init.shRUN echo "echo '*********************************'" >> $SETUPDIR/init.shRUN echo "echo 'Welcome to Bioinformatics Toolbox (v1.2)'" >> $SETUPDIR/init.shRUN echo "echo '*********************************'" >> $SETUPDIR/init.shRUN echo "echo 'Bioinformatics Toolbox is a docker container for bioinformatics'" >> $SETUPDIR/init.shRUN echo "echo " >> $SETUPDIR/init.shRUN echo "echo 'For a list of installed tools, please visit: '" >> $SETUPDIR/init.shRUN echo "echo '>> $SETUPDIR/init.shRUN echo "echo " >> $SETUPDIR/init.shRUN echo "echo 'If you would like to request adding certain tools or report a problem,'" >> $SETUPDIR/init.shRUN echo "echo 'please submit an issue >> $SETUPDIR/init.shRUN echo "echo " >> $SETUPDIR/init.shRUN echo "echo 'If you use Bioinformatics Toolbox in your work, please cite: '" >> $SETUPDIR/init.shRUN echo "echo '10.5281/zenodo.5069735'" >> $SETUPDIR/init.shRUN echo "echo 'Have fun!'" >> $SETUPDIR/init.shRUN echo "echo ''" >> $SETUPDIR/init.shRUN echo "echo ''" >> $SETUPDIR/init.shRUN echo "/usr/bin/bash" >> $SETUPDIR/init.shRUN echo "" >> $SETUPDIR/init.shRUN mv $SETUPDIR/init.sh /etc/bioinformatics-toolbox.shRUN chmod a+x /etc/bioinformatics-toolbox.shWORKDIR /root/ENTRYPOINT ["/etc/bioinformatics-toolbox.sh"]RUN rm -fr $SETUPDIR# Versions##########RUN python --version ; \java -version ; \R --version ; \blastn -version ; \diamond --version ; \muscle -version ; \mafft --version ; \# tophat --version ; \hisat2 --version ; \bowtie2 --version ; \STAR --version ; \salmon --version ; \bbmap.sh --version ; \hts_Stats --version ; \treetime --version ; \# RUN FastTree# RUN phyml --versionraxmlHPC -v ; \raxml-ng --version ; \pplacer --version ; \samtools --version ; \bcftools --version ; \bamtools --version ; \vcftools --version ; \bedtools --version ; \deeptools --version ; \bedops --version ; \spades.py --version ; \megahit --version ; \spades.py --version ; \seqkit version ; \fastp --version ; \fqtrim -V ; \seqmagick --version ; \gecco --version ; \deepbgc info ; \/apps/gatk/gatk --list ; \/apps/IGV/igv.sh --version ; \docker --version ; \/usr/local/miniconda3/bin/conda --version ; \nextflow -version ; \/apps/ensembl-vep/vep####################################################################################################################################################################################

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:阿里云ECS-yum 安装docker
下一篇:使用SpringMVC在redirect重定向的时候携带参数的问题
相关文章

 发表评论

暂时没有评论,来抢沙发吧~