bonsai-team / matam

Mapping-Assisted Targeted-Assembly for Metagenomics
GNU Affero General Public License v3.0
19 stars 9 forks source link

Integrate MATAM into bioconda #5

Closed ppericard closed 5 years ago

ppericard commented 7 years ago

Add conda recipe

loic-couderc commented 7 years ago

List shared libraries: libs.txt

loic-couderc commented 7 years ago

For compatibility reasons, anaconda uses gcc 4.8.5. See links below for more details: https://groups.google.com/a/continuum.io/forum/#!topic/anaconda/cB2lmykcxMI https://github.com/bioconda/bioconda-recipes/issues/3224

We need at least the 4.9.0 version. So we can't build our package for bioconda.

I build locally the package with the recipe bellow and sent it to Anaconda Cloud: https://anaconda.org/lcouderc/matam

Unfortunately, i have a compilation error when deploying to a debian7:

conda config --add channels lcouderc
conda config --add channels salford_systems
conda install matam

libc.so.6: version GLIBC_2.14 not found

This error do not append when installing sortmrna from bioconda and they don't do anything particular related to libraries into their recipe.

To adress this issue, i think i have to build the package on an older linux. Maybe this docker image can help with this: https://hub.docker.com/r/bioconda/bioconda-builder/

Recipe: conda build recipe/matam # (works fine)

recipe:

package:
  name: matam
  version: "v0.9.7"

source:
  git_url: https://github.com/bonsai-team/matam.git
  git_tag: v0.9.7

requirements:
  build:
    - gcc-5 # [not osx]
    - zlib
    - google-sparsehash
    - automake
    - make
    - cmake
    - bzip2
    - samtools >0.1.19
    - openjdk
    - python >=3.5

  run:
    - libgcc-5 # [not osx]
    - zlib
    - openjdk
    - python >=3.5

  test:
    - commands:
      - matam_assembly.py -h

about:
  home: https://github.com/bonsai-team/matam
  license: AGPL-3.0
  license_file: LICENSE
#!/bin/bash

# fix zlib error
export CFLAGS="-I$PREFIX/include"
export LDFLAGS="-L$PREFIX/lib"

MATAM_HOME=$PREFIX/opt/matam-$PKG_VERSION

mkdir -p $MATAM_HOME/{bin,scripts}
mkdir -p $PREFIX/bin
mkdir -p $PREFIX/lib

$PYTHON build.py build

# copy matam scripts
cp index_default_ssu_rrna_db.py $MATAM_HOME
cp bin/* $MATAM_HOME/bin
cp scripts/* $MATAM_HOME/scripts

# copy dependencies
COMPONENT_SEARCH=$MATAM_HOME/componentsearch
mkdir $COMPONENT_SEARCH
cp componentsearch/ComponentSearch.jar $COMPONENT_SEARCH

OVGRAPHBUILD=$MATAM_HOME/ovgraphbuild/bin
mkdir -p $OVGRAPHBUILD
cp ovgraphbuild/bin/ovgraphbuild $OVGRAPHBUILD

SGA=$MATAM_HOME/sga/src/SGA/
mkdir -p $SGA
cp sga/src/SGA/sga $SGA

SORTMERNA=$MATAM_HOME/sortmerna
mkdir -p $SORTMERNA
cp sortmerna/{sortmerna,indexdb_rna} $SORTMERNA

SUMACLUST=$MATAM_HOME/sumaclust
mkdir -p $SUMACLUST
cp sumaclust/sumaclust $SUMACLUST

#libs
cp ./lib/bamtools/lib/libbamtools.so.2.4.1 $PREFIX/lib

# symlinks
ln -s $MATAM_HOME/index_default_ssu_rrna_db.py $PREFIX/bin/index_default_ssu_rrna_db.py
ln -s $MATAM_HOME/bin/matam_assembly.py $PREFIX/bin/matam_assembly.py
loic-couderc commented 7 years ago

Build recipe with the following docker image: https://github.com/ContinuumIO/docker-images/tree/master/conda_builder_linux

#start docker container
/home/lcouderc/workspace/docker-images/conda_builder_linux/start_cpp11.sh -v /home/lcouderc/workspace/bioconda-recipes/recipes:/home/dev/recipes

#add channels
conda config --add channels conda-forge
conda config --add channels defaults
conda config --add channels r
conda config --add channels bioconda

#sparsehash
cd /tmp && git clone https://github.com/sparsehash/sparsehash.git && cd sparsehash && ./configure && make && sudo make install && cd

#cmake
 curl -L --remote-name http://www.cmake.org/files/v2.8/cmake-2.8.10.2.tar.gz > cmake-2.8.10.2.tar.gz && tar zxvf cmake-2.8.10.2.tar.gz && cd cmake-2.8.10.2 && ./bootstrap --prefix=/usr && make && sudo make install && cd

#build our recipe
conda build recipes/matam

The recipe have been slightly modified (remove gcc dependence, automake, make, cmake, google-sparsehash)

loic-couderc commented 7 years ago

Testing the package on:

loic-couderc commented 7 years ago

The package is now on the bonsai-team repo: https://anaconda.org/bonsai-team

ppericard commented 7 years ago

Tested today on my machine (Linux Mint 17.3, based on Ubuntu 14.04).

Needed to add libgcc-5 to the dependencies so it would work.

Right now conda info matam gives:

Fetching package metadata ...................

matam v0.9.7 0

file name : matam-v0.9.7-0.tar.bz2 name : matam version : v0.9.7 build string: 0 build number: 0 channel : lcouderc size : 2.1 MB arch : x86_64 has_prefix : False license : AGPL-3.0 md5 : 58aecbba2ab9ffba8bc8a037408a7799 noarch : None platform : linux requires : () subdir : linux-64 url : https://conda.anaconda.org/lcouderc/linux-64/matam-v0.9.7-0.tar.bz2 dependencies: libgcc openjdk python >=3.5 samtools >0.1.19 wget zlib

I think libgcc should be replaced by libgcc-5. samtools > 0.1.19 should be replaced by samtools >= 1.0 (we dont want a 0.1.20 version, but it could happen)

Do we need other dependencies like sparsehash (it is already installed on my computer) ?

ppericard commented 7 years ago

The package can be updated to the new release v1.0.0.

loic-couderc commented 7 years ago

Ok, i replaced libgcc by libgcc-5.

To sum up the conda package building process:

cd /tmp
# clone git repos
git clone git@github.com:ContinuumIO/docker-images.git docker-images
git clone https://github.com/bonsai-team/conda_recipes

# start docker container
cd docker-images && ./conda_builder_linux/start_cpp11.sh -v /tmp/conda_recipes/matam:/home/dev/matam

# add channels
conda config --add channels conda-forge
conda config --add channels defaults
conda config --add channels r
conda config --add channels bioconda
conda config --add channels salford_systems

# sparsehash
cd /tmp && git clone https://github.com/sparsehash/sparsehash.git && cd sparsehash && ./configure && make && sudo make install && cd

# cmake
 curl -L --remote-name http://www.cmake.org/files/v2.8/cmake-2.8.10.2.tar.gz > cmake-2.8.10.2.tar.gz && tar zxvf cmake-2.8.10.2.tar.gz && cd cmake-2.8.10.2 && ./bootstrap --prefix=/usr && make && sudo make install && cd

# build our recipe
conda build matam

# upload package to anaconda.org
anaconda login
anaconda upload --user bonsai-team /opt/miniconda/conda-bld/linux-64/matam-v0.9.9-0.tar.bz2
ppericard commented 5 years ago

We should be able to update the conda recipe now so that MATAM is available in the bioconda channel