Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using mamba to install packages in BacDock and parameter option "-fksSL" in curl snpEff #4

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
310 changes: 131 additions & 179 deletions BacDock
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
FROM ubuntu:xenial
FROM quay.io/cybozu/ubuntu:20.04

RUN apt-get update --fix-missing -qq && apt-get install -y -q \
aufs-tools \
automake \
build-essential \
bowtie2 \
cmake \
curl \
g++ \
Expand All @@ -23,149 +22,88 @@ RUN apt-get update --fix-missing -qq && apt-get install -y -q \
default-jre \
git-core \
bc \
python3 \
python3-pip \
python-pip \
unzip \
wget \
wget \
rename \
xutils-dev \
python3 \
python3-pip \
bowtie2 \
meson \
perl \
&& apt-get clean \
&& apt-get purge

RUN apt-get update --fix-missing -qq && apt-get install -y -q \
software-properties-common

RUN pip install --upgrade pip
RUN pip install numpy
RUN pip install scipy
RUN pip install biopython
RUN pip install git+https://github.com/katholt/srst2
RUN pip install RSeQC
RUN pip install multiqc
RUN pip install venn
RUN pip install pandas

# install Picard Tools
RUN curl -fksSL https://github.com/broadinstitute/picard/releases/download/2.9.0/picard.jar > /usr/local/bin/picard.jar && \
chmod +x /usr/local/bin/picard.jar

# install VCFtools
RUN curl -fksSL https://github.com/vcftools/vcftools/releases/download/v0.1.14/vcftools-0.1.14.tar.gz | tar xz && \
cd vcftools-0.1.14 && \
./configure; make; make insta

# install STAR
RUN curl -fksSL https://github.com/alexdobin/STAR/archive/2.5.2b.tar.gz | tar xz && \
cp STAR-2.5.2b/bin/Linux_x86_64/* /usr/local/bin


# Install freebayes
#RUN git clone --recursive https://github.com/ekg/freebayes
#RUN cd freebayes && make; make install


# install bwe-mem
RUN git clone https://github.com/lh3/bwa.git && cd bwa; make; cp bwa /usr/local/bin

# Install BCFTools
#RUN git clone git://github.com/samtools/htslib.git; cd htslib && make && make install
#RUN git clone git://github.com/samtools/bcftools.git; cd bcftools; autoheader && autoconf && ./configure --enable-libgsl --enable-perl-filters; make

RUN add-apt-repository ppa:deadsnakes/ppa

# Install SnpEff
#RUN curl -L http://sourceforge.net/projects/snpeff/files/snpEff_latest_core.zip > snpEff_latest_core.zip && unzip snpEff_latest_core.zip
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1

# Install convbioseq
RUN easy_install biopython
RUN easy_install bioscripts.convert
RUN python --version

# Install RAxML
RUN git clone https://github.com/stamatak/standard-RAxML.git && cd standard-RAxML* && \
make -f Makefile.AVX.gcc && \
rm *.o && \
make -f Makefile.AVX.PTHREADS.gcc
RUN python -m pip install --upgrade pip && \
python -m pip install numpy && \
python -m pip install scipy && \
python -m pip install biopython && \
python -m pip install RSeQC && \
python -m pip install multiqc && \
python -m pip install venn && \
python -m pip install pandas && \
# Biopython is pre-requisite
python -m pip install bioscripts.convert

# RUN pip install VCF-kit
# RUN vk setup
RUN curl -fksSL https://github.com/vcftools/vcftools/releases/download/v0.1.14/vcftools-0.1.14.tar.gz | tar xz && \
cd vcftools-0.1.14 && \
./configure; make; make install

## Install R packages for ggplot2
RUN R -e 'install.packages( c("reshape2","optparse", "BiocManager"), repos="http://cloud.r-project.org/");' && \
RUN R -e 'install.packages( c("reshape","optparse", "BiocManager"), repos="http://cloud.r-project.org/");' && \
apt-get update && apt-get install r-cran-ggplot2 -y -q
RUN R -e 'BiocManager::install("dupRadar");'

# Install SRA toolkit
#RUN wget "https://ftp-trace.ncbi.nlm.nih.gov/sra/sdk/2.9.2/sratoolkit.2.9.2-ubuntu64.tar.gz" && \
# tar -xzf sratoolkit.2.9.2-ubuntu64.tar.gz
#ENV PATH "$PATH:/sratoolkit.2.9.2-ubuntu64/bin/:/vcf2fasta/"

# Install trimmomatic

RUN curl -L http://www.usadellab.org/cms/uploads/supplementary/Trimmomatic/Trimmomatic-0.38.zip > Trimmomatic-0.38.zip && unzip Trimmomatic-0.38.zip




################################################################################################
# Install Jellyfish
# Install Jellyfish (a tool for fast, memory-efficient counting of k-mers in DNA)
RUN cd /opt && \
wget https://github.com/gmarcais/Jellyfish/releases/download/v2.2.6/jellyfish-2.2.6.tar.gz && \
tar -xvf jellyfish-2.2.6.tar.gz && \
cd jellyfish-2.2.6 && \
./configure && \
make -j 4 && \
ln -s /opt/jellyfish-2.2.6/bin/jellyfish /usr/bin && \
cd / && \
rm /opt/jellyfish-2.2.6.tar.gz


# Install kSNP3 and dependencies
RUN cd /opt && \
apt-get install -y tcsh && \
rm -rf /var/lib/apt/lists/* && \
cd /opt && \
git clone https://github.com/cdeanj/kSNP3.git && \
mv kSNP3 /usr/local && \
cd /

# Install ResistomeAnalyzer
RUN cd /opt && \
git clone https://github.com/cdeanj/resistomeanalyzer.git && \
cd resistomeanalyzer && \
make && \
ln -s /opt/resistomeanalyzer/resistome /usr/bin && \
cd /
wget https://github.com/gmarcais/Jellyfish/releases/download/v2.2.6/jellyfish-2.2.6.tar.gz && \
tar -xvf jellyfish-2.2.6.tar.gz && \
cd jellyfish-2.2.6 && \
./configure && \
make -j 4 && \
ln -s /opt/jellyfish-2.2.6/bin/jellyfish /usr/bin && \
cd / && \
rm /opt/jellyfish-2.2.6.tar.gz

# Install CoverageSampler
RUN cd /opt && \
git clone https://github.com/cdeanj/coverage_sampler.git && \
cd coverage_sampler && \
make && \
ln -s /opt/coverage_sampler/csa /usr/bin && \
cd /

git clone https://github.com/cdeanj/coverage_sampler.git && \
cd coverage_sampler && \
make && \
ln -s /opt/coverage_sampler/csa /usr/bin && \
cd /

# CD-HIT
RUN git clone https://github.com/weizhongli/cdhit.git && \
cd cdhit &&\
make MAX_SEQ=10000000 && \
cd

cd cdhit &&\
make MAX_SEQ=10000000 && \
cd

# FastQC
ENV DST=/tmp
ENV URL=https://github.com/agordon/libgtextutils/releases/download/0.7/

RUN wget $URL/libgtextutils-0.7.tar.gz -O $DST/libgtextutils-0.7.tar.gz && \

tar -xvf $DST/libgtextutils-0.7.tar.gz -C $DST && \
rm $DST/libgtextutils-0.7.tar.gz && \
cd $DST/libgtextutils-0.7 && \
./configure && \
make && \
make install && \
cd / && \
rm -rf $DST/libgtextutils-0.7


WORKDIR /
tar -xvzf $DST/libgtextutils-0.7.tar.gz -C $DST && \
rm $DST/libgtextutils-0.7.tar.gz && \
cd $DST/libgtextutils-0.7 && \
sed -i '47s/input_stream/static_cast<bool>(input_stream)/' src/gtextutils/text_line_reader.cpp && \
./configure && \
make && \
make install && \
cd / && \
rm -rf $DST/libgtextutils-0.7

WORKDIR /opt/

ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV PATH /opt/conda/bin:$PATH
Expand All @@ -174,76 +112,90 @@ RUN apt-get update --fix-missing && apt-get install -y wget bzip2 ca-certificate
libglib2.0-0 libxext6 libsm6 libxrender1 \
git mercurial subversion

RUN wget --quiet https://repo.anaconda.com/archive/Anaconda3-5.3.0-Linux-x86_64.sh -O ~/anaconda.sh && \
/bin/bash ~/anaconda.sh -b -p /opt/conda && \
rm ~/anaconda.sh && \
# Install miniconda
RUN mkdir -p ~/miniconda3
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh && \
/bin/bash ~/miniconda3/miniconda.sh -b -u -p /opt/conda && \
rm -rf ~/miniconda3/miniconda.sh && \
ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \
echo "conda activate base" >> ~/.bashrc

RUN apt-get install -y curl grep sed dpkg && \
TINI_VERSION=`curl https://github.com/krallin/tini/releases/latest | grep -o "/v.*\"" | sed 's:^..\(.*\).$:\1:'` && \
curl -L "https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini_${TINI_VERSION}.deb" > tini.deb && \
dpkg -i tini.deb && \
rm tini.deb && \
apt-get clean


RUN conda install -c bioconda fastqc
RUN conda install -c bioconda picard=2.18.27
RUN conda install -c bioconda conda-forge::r-data.table=1.12.0
RUN conda install -c bioconda conda-forge::r-gplots=3.0.1.1
RUN conda install -c bioconda conda-forge::r-markdown=0.9
RUN conda install -c bioconda csvtk=0.17.0
RUN conda install -c conda-forge gsl
RUN conda install -c bioconda snpeff
RUN conda install -c bioconda trim-galore
RUN conda install -c bioconda cutadapt
RUN conda install -c bioconda fastx_toolkit
RUN conda install -c bioconda gffread=0.9.12
RUN conda install -c bioconda deeptools=3.2.0
RUN conda install -c bioconda sra-tools
RUN conda install -c bioconda bioconductor-dupradar=1.12.1
RUN conda install -c bioconda samtools

# Alignment
RUN conda install -c bioconda clustalo
RUN conda install -c bioconda muscle
RUN conda install -c bioconda mafft

# Phylogenetics
RUN conda install -c bioconda freebayes
RUN conda install -c bioconda beast
RUN conda install -c bioconda phyml

# Clustering


RUN curl -O -L https://sourceforge.net/projects/samtools/files/samtools/0.1.18/samtools-0.1.18.tar.bz2 && tar xvfj samtools-0.1.18.tar.bz2 && cd samtools-0.1.18 && make


# Visualisation
RUN conda install -c bioconda circos


# Install Figtree
RUN cd /opt && \
git clone https://github.com/cdeanj/figtree.git && \
chmod u+x figtree/lib/figtree.jar && \
cd ~


# Install vcf2fasta
RUN git clone https://github.com/jambler24/vcf2fasta.git && cd vcf2fasta && chmod a+x process_samples.py && chmod a+x vcf2fasta.py
RUN ln -s /vcf2fasta/vcf2fasta.py /usr/local/bin/vcf2fasta.py
RUN ln -s /vcf2fasta/process_samples.py /usr/local/bin/process_samples.py
RUN git clone https://github.com/egeza/vcf2fasta.git && \
cd vcf2fasta && \
chmod a+x process_samples.py && \
chmod a+x vcf2fasta.py && \
ln -s /vcf2fasta/vcf2fasta.py /usr/local/bin/vcf2fasta.py && \
ln -s /vcf2fasta/process_samples.py /usr/local/bin/process_samples.py

#Install mamba so that we can install conda packages with mamba
RUN conda install mamba -n base -c conda-forge && \
mamba clean -i

#Install conda packages using mamba
RUN mamba install -c hcc resistomeanalyzer
RUN mamba install -c conda-forge -c bioconda python=3.9 \
cutadapt \
fastqc \
picard=2.18.27 \
deeptools \
gsl \
xorg-libxtst \
r-data.table \
r-gplots \
r-markdown \
tini \
trimmomatic \
snpeff \
fastx_toolkit \
raxml \
gffread=0.9.12

RUN wget https://github.com/ComputationalSystemsBiology/EoulsanDockerFiles/raw/master/TrimAdapt/trim_galore_v0.4.1.zip && \
unzip trim_galore_v0.4.1.zip -d . && \
ln -s /opt/trim_galore_zip/trim_galore /usr/local/bin/

# figtree requires xorg-libxtst. Some errors especially
RUN mamba install -c conda-forge -c bioconda sra-tools \
samtools \
tbb=2020.2 \
star \
bwa \
# CSV/TSV toolkit
csvtk=0.17.0 \
bcftools \
# Alignment
clustalo \
muscle \
mafft \
# Phylogenetics
freebayes \
beast \
circos \
figtree \
bioconductor-deseq2 \
phyml

# ksnp keeps updating and unfortunately with no tracks of older versions
RUN wget https://sourceforge.net/projects/ksnp/files/kSNP4%20Linux%20package.zip/download && \
mv download download.zip && \
unzip download.zip && \
#mv kSNP4\ Linux\ package/kSNP4pkg/ /usr/local/bin/
mv kSNP4\ Linux\ package/ kSNP4_Linux_package && \
ln /opt/kSNP4_Linux_package/kSNP4pkg/kSNP4 /usr/local/bin/

RUN groupadd -r -g 1000 ubuntu && useradd -r -g ubuntu -u 1000 -m ubuntu
USER ubuntu

ENV PATH /usr/local/envs/bacterial_genomics/bin/:$PATH

# Build this image
#docker build -t bacterial_genomics -f BacDock .
#docker build --network=host -t bacterial_variant_calling_v1 -f BacDock

# To build sing image
#docker run -v /var/run/docker.sock:/var/run/docker.sock -v /Volumes/External/bac_genomics:/output --privileged -t --rm singularityware/docker2singularity:v2.6 -m "/shared_fs /custom_mountpoint2" bacterial_genomics:latest
#docker run -v /var/run/docker.sock:/var/run/docker.sock -v /vol1/ephie/output --privileged -t --rm \
#singularityware/docker2singularity:v2.6 -m "/shared_fs /custom_mountpoint2" bacterial_variant_calling_v1:latest

# To SCP
# scp /Volumes/External/bac_genomics/<image> [email protected]:/cbio/users/jambler/images/

# scp /vol1/ephie/output/<image> [email protected]:/cbio/users/ephie/images/
Loading