Sign inSign up

plachta11b/mcat

By plachta11b

•Updated about 6 years ago

(unofficial) MCAT: Motif Combining and Association Tool

Image
0

191

plachta11b/mcat repository overview

⁠MCAT

⁠Cite source

website: https://github.com/yanshen43/MCAT⁠

MCAT: Motif combining and association tool DOI: 10.1089/cmb.2018.0113⁠

⁠Info

Part of plachta11b diploma. Compatible with rootless singularity using readonly filesystem.

⁠Contact

In case of bugs or questions do not hesitate to write mail⁠ (short and simple)

⁠Dockerfile - base 0.1

FROM alpine/git AS repository-builder

# clone repo https://github.com/yanshen43/MCAT.git
RUN mkdir /source \
	&& cd /source \
	&& git clone https://github.com/yanshen43/MCAT.git \
	&& git -C /source/MCAT checkout 5f007764a22193e7af4fb2f18bf875b12039af5b

# remove files unnecessary for project to run
RUN rm -r /source/MCAT/.git \
	&& rm -r /source/MCAT/meme/32bit/ \
	&& rm -r /source/MCAT/meme/64bit/doc/ \
	&& rm -r /source/MCAT/Papers/ \
	&& rm /source/MCAT/weblogo/ghostscript*.tar.gz

FROM ubuntu:20.04 AS ghostscript-builder

# RUN apt-get update && apt-get install -y --no-install-recommends \
# 	build-essential \
# 	gcc \
# 	g++ \
# 	&& rm -rf /var/lib/apt/lists/*

# # install ghostscript
# RUN mkdir /source/ghostscript/ \
# 	&& cd /source/ghostscript/ \
# 	&& tar -zxf /source/MCAT/weblogo/ghostscript*.tar.gz \
# 	&& rm /source/MCAT/weblogo/ghostscript*.tar.gz \
# 	&& cd ghostscript-* \
# 	&& ./configure \
# 	&& make install \
# 	&& rm -r /source/ghostscript/ghostscript-*

# # copy ghostscript bins
# RUN mkdir /source/ghostscript/bin \
# 	&& /bin/sh -c 'for f in \
# 	gsbj gsdj gsdj500 gslj gslp gsnd \
# 	bdftops dvipdf eps2eps font2c \
# 	pdf2dsc pdf2ps pf2afm pfbtopfa pphs printafm \
# 	ps2ascii ps2epsi ps2pdf ps2pdf12 ps2pdf13 ps2pdf14 ps2pdfwr ps2ps ps2ps2 \
# 	wftopfa fixmswrd.pl lprsetup.sh pj-gs.sh pv.sh sysvlp.sh unix-lpr.sh ;\
# 	do if ( test -f /usr/local/bin/$f ); then \
# 	cp /usr/local/bin/$f /source/ghostscript/bin/$f; \
# 	fi; \
# 	done'

FROM ubuntu:20.04 AS perl-builder

# wget http://www.cpan.org/src/5.0/perl-5.16.3.tar.gz
# ADD ./perl-5.16.3.tar.gz /source/perl
# RUN apt-get update && apt-get install -y \
# 	libc6-dev-amd64 \
# 	gcc \
# 	g++ \
# 	setsid \
# 	&& rm -rf /var/lib/apt/lists/* \
#   && /source/perl/perl-5.16.3/Configure -des -Dmksymlinks -Dprefix=/packages/perl \
# 	&& make \
# 	&& make test \
# 	&& make install


FROM python:2.7-slim AS python-builder

RUN apt-get update && apt-get install -y --no-install-recommends \
	build-essential \
	gcc \
	g++ \
	libfreetype6-dev \
	&& rm -rf /var/lib/apt/lists/*

ADD ./requirements.txt /requirements.txt

RUN pip install --no-cache-dir virtualenv

# NumPy==1.12.1 have to be installed first (DO NOT MOVE INTO requirements.txt)
RUN python -m virtualenv /opt/venv \
	&& . /opt/venv/bin/activate \
	&& pip install --no-cache-dir NumPy==1.12.1 \
	&& pip install --no-cache-dir -r requirements.txt

FROM python:2.7-slim

# libc6:i386 for ./BioProspector/32bit/genomebg
# screen, perl, ghostscript for MCAT
ENV DEBIAN_FRONTEND "noninteractive"
RUN dpkg --add-architecture i386 \
	&& apt-get update && apt-get install -y --no-install-recommends \
	libc6:i386 \
	screen \
	ghostscript \
	perl \
	&& rm -rf /var/lib/apt/lists/*

# tools necessary for output generation
RUN apt-get update && apt-get install -y --no-install-recommends \
	imagemagick \
	bsdmainutils \
	&& rm -rf /var/lib/apt/lists/*

RUN apt-get --assume-no autoremove libc6:i386 2>/dev/null | grep "disk space" || true \
	&& apt-get --assume-no autoremove screen 2>/dev/null | grep "disk space" || true \
	&& apt-get --assume-no autoremove ghostscript 2>/dev/null | grep "disk space" || true \
	&& apt-get --assume-no autoremove perl 2>/dev/null | grep "disk space" || true \
	&& apt-get --assume-no autoremove imagemagick 2>/dev/null | grep "disk space" || true \
	&& apt-get --assume-no autoremove bsdmainutils 2>/dev/null | grep "disk space" || true \
	&& apt-get --assume-no autoremove libc6:i386 screen ghostscript perl bsdmainutils imagemagick 2>/dev/null | grep "disk space" || true
# After this operation, 12.0 MB disk space will be freed.
# After this operation, 1061 kB disk space will be freed.
# After this operation, 42.0 MB disk space will be freed.
# After this operation, 46.9 MB disk space will be freed.
# After this operation, 73.4 MB disk space will be freed.
# After this operation, 184 MB disk space will be freed.

# add bins
COPY --from=repository-builder /source /packages
COPY --from=python-builder /opt/venv /opt/venv

# wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u252-b09/OpenJDK8U-jre_x64_linux_hotspot_8u252b09.tar.gz
ADD ./OpenJDK8U-jre_x64_linux_hotspot_8u252b09.tar.gz /packages/java/

WORKDIR /packages/MCAT
RUN ln -s /usr/local/bin/python /usr/bin/python
ENV PATH /opt/venv/bin:/packages/java/jdk8u252-b09-jre/bin/:/packages/MCAT:$PATH
RUN rm /usr/bin/python && ln -s /opt/venv/bin/python /usr/bin/python # what is this?

# BioProspector /packages/MCAT/BioProspector/64bit/BioProspector
# CMF /packages/MCAT/cmf/cmf
# DECOD java -jar /packages/MCAT/DECOD/DECOD-20111024.jar -nogui
# MEME /packages/MCAT/meme/64bit/bin/meme
# WEEDER /packages/MCAT/weeder/weeder2
# XXmotif /packages/MCAT/XXmotif/XXmotif

# cat XXmotif/XXmotif | grep convert
RUN sed -i 's/if \[ -z "`which R`" \];/if \[ -z "`which R`" \] \&\& \[ -z "`which convert`" \];/' XXmotif/XXmotif \
	&& cat XXmotif/XXmotif | grep -F "which convert"

# modify this tu run DECOD
# RUN sed -i '/^#.* runDECOD/ s/^#//' orange_pipeline_refine.py \
# 	&& sed -i '/^#.* parseDECOD/ s/^#//' orange_pipeline_refine.py \
# 	&& cat orange_pipeline_refine.py | grep -F "t[2].run = runDECOD"  

RUN sed -i '/config.*WEEDER.*SC/ s/SC/HS/' orange_pipeline_refine.py \
	&& cat orange_pipeline_refine.py | grep -F "HS"

# t[0].run = runCMF
# t[1].run = runWeeder
# t[2].run = runDECOD
# t[3].run = runMEME
# t[4].run = runBioProspector
# t[5].run = runXXmotif
# run only BioProspector by commenting anything else
# RUN sed -i '/t.*run.*runCMF\|t.*run.*runDECOD\|t.*run.*runMEME\|t.*run.*runXXmotif\|t.*run.*runWeeder/ s/^#*/#/' orange_pipeline_refine.py \
# 	&& cat orange_pipeline_refine.py | grep -F ".run = "

# orange_pipeline_refine.py data/variable_sequence/positive_genes/bub1.txt data/variable_sequence/negative_genes/negative_bub1.txt
CMD [ "/packages/MCAT/orange_pipeline_refine.py", "-h" ]

⁠Dockerfile - extension 0.2

FROM plachta11b/mcat:0.1

#RUN sed -i 's#shutil.rmtree(os.getcwd()+"/results")##' orange_pipeline_refine.py

#RUN sed -i '/os.mkdir(/ s/)/, exist_ok=True)/' orange_pipeline_refine.py

RUN sed -i 's#stat/#results/stat/#' orange_pipeline_refine.py
RUN sed -i 's#bp_files#results/bp_files#' orange_pipeline_refine.py
RUN sed -i 's#    makeFolders()#    exec("try: os.mkdir('\''results'\'')\\nexcept: problem=sys.exc_info()"); os.mkdir("results/meme"); os.mkdir("results/stat"); os.mkdir("results/bp_files") #' orange_pipeline_refine.py

RUN sed -i "s|default='stat'|default='results/stat'|" orange_pipeline_refine.py

RUN sed -i 's# pdb.set_trace()# print(tool, sequence, i, pos, pos + len(motif)); continue#' orange_pipeline_refine.py

ENV PIPELINE /packages/MCAT/orange_pipeline_refine.py

RUN sed -i '/^#.* runDECOD/ s/^#//' $PIPELINE
RUN sed -i '/^#.* parseDECOD/ s/^#//' $PIPELINE

#CMD [ "/packages/MCAT/orange_pipeline_refine.py" ]

Tag summary

Content type

Image

Digest

Size

433.9 MB

Last updated

about 6 years ago

docker pull plachta11b/mcat:0.2