Skip to content

Commit

Permalink
Merge pull request #90 from c-mertes/conda_package
Browse files Browse the repository at this point in the history
Conda packaging
  • Loading branch information
mumichae committed Jul 12, 2020
2 parents 7a68cb1 + 26abc2d commit 614e5cd
Show file tree
Hide file tree
Showing 6 changed files with 137 additions and 152 deletions.
88 changes: 30 additions & 58 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,68 +1,40 @@
language: python
sudo: required
dist: xenial

cache:
- directories:
- $HOME/R/Library
- /usr/bin/R
- $HOME/miniconda
- $HOME/htslib
- $HOME/bcftools

env:
global:
- DROP_DIR=$(pwd)
- PROJECT_DIR="$HOME/project"
- MINICONDA_DIR="$HOME/miniconda"
- CONDA_SCRIPT="$MINICONDA_DIR/etc/profile.d/conda.sh"
- R_LIBS_USER="$HOME/R/Library"
- TAR="/bin/tar"
#cache:
# - directories:
# - $HOME/miniconda

python:
- "3.6.7"
- "3.7"

addons:
apt:
packages:
- r-base
- libxml2-dev
- libcurl4-openssl-dev
- libssl-dev
- libblas-dev
- liblapack-dev
- gfortran
- graphviz
- pandoc
- tabix
sources:
- sourceline: 'deb https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/'
key_url: 'http://keyserver.ubuntu.com:11371/pks/lookup?op=get&search=0xe298a3a825c0d65dfd57cbb651716619e084dab9'
update: true

install:
- cd $DROP_DIR
# - R -e "if ('FRASER' %in% rownames(installed.packages())) remove.packages('FRASER')"
# - R -e "if ('tMAE' %in% rownames(installed.packages())) remove.packages('tMAE')"
- Rscript travis/installRPackages.R drop/requirementsR.txt
- bash travis/install_bcftools.sh
- export PATH="$HOME/bcftools:$PATH"
- bcftools --version
- bash travis/install_conda.sh
- source $CONDA_SCRIPT
- conda activate drop_env
- pip install .
# Install Anaconda
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh
- bash /tmp/miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda

- conda config --add channels bioconda
- conda config --add channels conda-forge

before_script:
- mkdir -p $PROJECT_DIR
- cd $PROJECT_DIR
- drop demo
# build package with cond
- conda install conda-build
- conda build conda.recipe --output-folder=$HOME/build
- conda config --add channels "file://${HOME}/build"

# test package
- source $HOME/miniconda/etc/profile.d/conda.sh
- conda create -q -n drop drop
- conda activate drop

script:
- cd $PROJECT_DIR
- snakemake -n
- snakemake aberrantExpression --cores 2
- snakemake aberrantSplicing --cores 2
- snakemake mae --cores 2
- snakemake --cores 2
- snakemake exportCounts --cores 2
- conda list
- java -version
- gatk --help
- samtools --version
- bcftools --version
- drop --version
- python --version
106 changes: 106 additions & 0 deletions conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
{% set name = "drop" %}
{% set version = "0.9.0" %}

package:
name: "{{ name|lower }}"
version: "{{ version }}"

source:
path: ..

build:
number: 0
script:
- "{{ PYTHON }} -m pip install -vv git+https://github.com/gagneurlab/wbuild.git#egg=wbuild"
- "${R} -e 'BiocManager::install(\"mumichae/tMAE\", dependencies=FALSE, update=FALSE, ask=FALSE)'"
- "{{ PYTHON }} -m pip install . -vv"
rpaths:
- lib/R/lib/
- lib/

requirements:
build:
- {{ compiler('c') }}

host:
- python
- pip

# wbuild requirements
- pyyaml>=4.2b1
- pytest-runner

# tMAE requirements
- r-base>=4.0.0
- r-devtools
- r-biocmanager
- r-data.table
- r-ggplot2
- r-dplyr
- bioconductor-DESeq2
- bioconductor-GenomicScores

run:
- python
- pandas
- Click>=7.0
- click-log
- python-dateutil

# snakemake/wbuild
- snakemake=>5.5.2
- pandoc
- graphviz
- pyyaml>=4.2b1

# command line tools
- tabix
- samtools>=1.7
- bcftools>=1.7
- gatk4>=4.0.4
- star>=2.7

# R dependencies
- r-base>=4.0.0
- r-rmarkdown
- r-knitr
- r-ggplot2
- r-ggthemes
- r-cowplot
- r-data.table
- r-dplyr
- r-tidyr
- r-magrittr
- r-devtools

# bioconductor packages
- bioconductor-deseq2
- bioconductor-GenomicScores
- bioconductor-outrider
- bioconductor-fraser
- bioconductor-variantannotation
- bioconductor-bsgenome.hsapiens.ucsc.hg19
#- bioconductor-mafdb.gnomad.r2.1.hs37d5
#- bioconductor-mafdb.gnomad.r2.1.grch38

test:
imports:
- drop
- wbuild
commands:
- ${R} -e "library(tMAE)"
- wbuild --version
- drop --version

about:
home: "https://gagneurlab-drop.readthedocs.io"
license: MIT
license_family: MIT
license_file: ../LICENSE
summary: "Detection of RNA Outliers Pipeline"
doc_url:
dev_url:

extra:
recipe-maintainers:
- mumichae
10 changes: 1 addition & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@
with open("README.md", "r") as fh:
long_description = fh.read()

requirements = [
'wbuild @ git+https://github.com/gagneurlab/wBuild.git@master#egg=wbuild',
#'wbuild',
'snakemake==5.5.2',
'pandas',
]

extra_files = []
for (path, directories, filenames) in os.walk('drop/'):
directories[:] = [d for d in directories if not (d.startswith('.') or d == 'Data')]
Expand All @@ -32,8 +25,7 @@
packages=setuptools.find_packages(include=["drop"]),
entry_points={'console_scripts': ['drop=drop.cli:main']},
package_data={'drop': extra_files},
include_package_data=True,
install_requires=requirements
include_package_data=True
)


48 changes: 0 additions & 48 deletions travis/installRPackages.R

This file was deleted.

12 changes: 0 additions & 12 deletions travis/install_bcftools.sh

This file was deleted.

25 changes: 0 additions & 25 deletions travis/install_conda.sh

This file was deleted.

0 comments on commit 614e5cd

Please sign in to comment.