Skip to content

Commit

Permalink
run with docker
Browse files Browse the repository at this point in the history
  • Loading branch information
satoken committed Mar 1, 2023
1 parent 03f5fe8 commit aa1f2ac
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 39 deletions.
55 changes: 21 additions & 34 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,44 +1,31 @@
# From ubuntu:18.04
#FROM debian:10
FROM continuumio/miniconda3

ENV DEBIAN_FRONTEND=noninteractive
FROM alpine:latest AS builder

WORKDIR /workspaces

RUN apt-get update \
# Install C++ tools
&& apt-get -y install build-essential cmake cppcheck valgrind \
libglpk-dev libgsl-dev libgmp-dev libltdl-dev libmpfr-dev pkg-config \
# Clean up
&& rm -f *.deb \
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*

# Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND=dialog

# install ViennaRNA package from bioconda
RUN conda config --add channels conda-forge && \
conda config --add channels bioconda && \
conda update --all && \
conda install viennarna && \
conda clean -afy
ENV PKG_CONFIG_PATH /opt/conda/lib/pkgconfig:$PKG_CONFIG_PATH

RUN apk add --no-cache musl-dev gcc g++ cmake make ninja git pkgconfig zlib-static

# HiGHS
RUN git clone https://github.com/ERGO-Code/HiGHS \
&& cd HiGHS \
&& cmake -DFAST_BUILD=ON -DCMAKE_BUILD_TYPE=Release -G Ninja -B build \
&& cmake --build build \
&& cmake --install build --strip \
&& cd ..

# ViennaRNA
COPY --from=satoken/viennarna:latest /usr/local/ /usr/local/
# build from the source
# RUN wget -q https://www.tbi.univie.ac.at/RNA/download/sourcecode/2_4_x/ViennaRNA-2.4.17.tar.gz \
# && tar zxvf ViennaRNA-2.4.17.tar.gz \
# && cd ViennaRNA-2.4.17 \
# && ./configure --without-perl --without-python --without-python3 --without-forester --without-rnalocmin \
# && ./configure --without-perl --without-python --without-python2 --without-forester --without-rnalocmin \
# && make && make install \
# && cd .. && rm -rf ViennaRNA-2.4.17 ViennaRNA-2.4.17.tar.gz

COPY . .
# IPknot
COPY . .
RUN cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_HIGHS=ON -DSTATIC_BUILD=ON -G Ninja -B build \
&& cmake --build build \
&& cmake --install build --strip

RUN rm -rf build && mkdir build \
&& cd build \
&& cmake -DCMAKE_BUILD_TYPE=Release .. \
#&& cmake -DCMAKE_BUILD_TYPE=Release -DSTATIC_BUILD=ON .. \
&& make && make install
FROM alpine:latest
COPY --from=builder /usr/local/bin/ipknot /usr/local/bin/ipknot
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ IPknot for predicting RNA pseudoknot structures using integer programming
Requirements
------------

* C++17 compatible compiler (tested on Apple clang version 14.0.0 and GCC version 10.2.1)
* cmake (>= 3.8)
* pkg-config
* [Vienna RNA package](https://www.tbi.univie.ac.at/RNA/) (>= 2.2.0)
* [GNU Linear Programming Kit](http://www.gnu.org/software/glpk/) (>=4.41),
[Gurobi Optimizer](http://www.gurobi.com/) (>=8.0),
or [ILOG CPLEX](https://www.ibm.com/products/ilog-cplex-optimization-studio) (>=12.0)
or [SCIP](https://scipopt.org/) (>= 8.0.3)
or [HiGHS](https://highs.dev/) (>= 1.5.0)
* one of these MIP solvers
* [GNU Linear Programming Kit](http://www.gnu.org/software/glpk/) (>=4.41)
* [Gurobi Optimizer](http://www.gurobi.com/) (>=8.0)
* [ILOG CPLEX](https://www.ibm.com/products/ilog-cplex-optimization-studio) (>=12.0)
* [SCIP](https://scipopt.org/) (>= 8.0.3)
* [HiGHS](https://highs.dev/) (>= 1.5.0)

Install
-------
Expand Down Expand Up @@ -100,6 +104,16 @@ IPknot can fold a given sequence or alignment with some constraints. The constra

This example shows folding with constraints that 16th base and 100th base are paired, 41st and 42nd bases are unpaired.

### Run with Docker

docker build . -t ipknot
docker run -it --rm -v $(pwd):$(pwd) -w $(pwd) ipknot ipknot examples/RF00005.fa

### Run with the web server

The IPknot web server is available at http://ws.sato-lab.org/rtips/ipknot++/.


References
----------

Expand Down
1 change: 1 addition & 0 deletions src/ip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ class IPimpl
: model_()
{
highs_.setOptionValue("output_flag", false);
highs_.setOptionValue("threads", n_th);
switch (dir)
{
default:
Expand Down

0 comments on commit aa1f2ac

Please sign in to comment.