Skip to content

Commit

Permalink
Galaxy python3 (#659)
Browse files Browse the repository at this point in the history
* Do planemo tests in a python 3 environment

* Try again

* Not sure if this will work

* Copy over fix from Björn's PR

* Handle python3 loading of python2 files

* Update tests, do Galaxy in both python 2.7 and 3.6

* Right, can't do both

* last test

* Bump to 2.5.6
  • Loading branch information
dpryan79 authored Jan 28, 2018
1 parent 75e9674 commit db4400d
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 28 deletions.
7 changes: 3 additions & 4 deletions .planemo.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#!/bin/bash
#!/bin/bash
planemo=./foo/bin/planemo
owd=`pwd`
temp_dir=`mktemp -d`
cd $temp_dir
conda config --add channels conda-forge
conda config --add channels bioconda
conda create -y --name gxtest numpy bx-python pysam
conda create -y --name gxtest numpy pysam
source activate gxtest
git clone --depth 1 https://github.com/galaxyproject/galaxy.git
cd galaxy
Expand All @@ -15,8 +14,8 @@ make client
cd ..
# reset what's available in conda
cd $owd
conda install --yes -c conda-forge python=2.7 numpy scipy matplotlib==2.1.0 nose flake8 plotly==2.0.12
conda install --yes -c bioconda -c conda-forge pysam pyBigWig py2bit planemo
conda install --yes -c conda-forge numpy scipy matplotlib==2.1.0 plotly==2.0.12
conda install --yes -c bioconda -c conda-forge pysam pyBigWig py2bit
python setup.py install

#galaxy/wrapper/correctGCBias.xml \
Expand Down
21 changes: 9 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
language: c
env:
- TRAVIS_PYTHON_VERSION=2.7
- TRAVIS_PYTHON_VERSION=3.5
- TRAVIS_PYTHON_VERSION=3.6
os:
- linux
- osx
jobs:
include:
- stage: galaxy
- stage: galaxy36
env:
- TESTGALAXY="1"
- TRAVIS_PYTHON_VERSION=2.7
- TRAVIS_PYTHON_VERSION=3.6

# Setup anaconda
before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_PYTHON_VERSION" == "2.7" ]] ; then pip install virtualenv --user ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_PYTHON_VERSION" == "2.7" ]] ; then virtualenv foo; source foo/bin/activate; pip install planemo ; deactivate ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && ${TESTGALAXY:-"0"} == "1" ]] ; then pip install virtualenv --user ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && ${TESTGALAXY:-"0"} == "1" ]] ; then virtualenv foo; source foo/bin/activate; pip install planemo ; deactivate ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_PYTHON_VERSION" == "2.7" ]] ; then curl https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -o miniconda.sh ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_PYTHON_VERSION" == "3.5" ]] ; then curl https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -o miniconda.sh ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_PYTHON_VERSION" == "3.6" ]] ; then curl https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -o miniconda.sh ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$TRAVIS_PYTHON_VERSION" == "2.7" ]] ; then curl https://repo.continuum.io/miniconda/Miniconda2-latest-MacOSX-x86_64.sh -o miniconda.sh ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$TRAVIS_PYTHON_VERSION" == "3.5" ]] ; then curl https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -o miniconda.sh ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$TRAVIS_PYTHON_VERSION" == "3.6" ]] ; then curl https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -o miniconda.sh ; fi
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
Expand All @@ -41,9 +41,6 @@ script:
- if [[ ${TESTGALAXY:-"2"} == "2" ]] ; then cd ~/ && nosetests --with-doctest -sv deeptools ; fi
- if [[ ${TESTGALAXY:-"2"} == "2" ]] ; then nosetests --with-doctest -sv deeptoolsintervals ; fi
- if [[ ${TESTGALAXY:-"2"} == "2" ]] ; then cd ${owd} ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_PYTHON_VERSION" == "2.7" && ${TESTGALAXY:-"0"} == "1" ]] ; then /home/travis/build/deeptools/deepTools/foo/bin/planemo lint galaxy/wrapper/ ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_PYTHON_VERSION" == "2.7" && ${TESTGALAXY:-"0"} == "1" ]] ; then ./.planemo.sh ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && ${TESTGALAXY:-"0"} == "1" ]] ; then /home/travis/build/deeptools/deepTools/foo/bin/planemo lint galaxy/wrapper/ ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && ${TESTGALAXY:-"0"} == "1" ]] ; then ./.planemo.sh ; fi
sudo: false

services:
- postgresql
4 changes: 4 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2.5.6

* Fixed a bug where deepTools in python3 can't handle npz file labels created under python 2.

2.5.5

* Updated blacklist handling such that an error is thrown on overlapping regions.
Expand Down
2 changes: 1 addition & 1 deletion deeptools/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# This file is originally generated from Git information by running 'setup.py
# version'. Distribution tarballs contain a pre-generated copy of this file.

__version__ = '2.5.5'
__version__ = '2.5.6'
4 changes: 3 additions & 1 deletion deeptools/correlation.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import matplotlib.ticker
import matplotlib.mlab
import matplotlib.markers
from deeptools.utilities import toString


old_settings = np.seterr(all='ignore')

Expand Down Expand Up @@ -83,7 +85,7 @@ def load_matrix(self, matrix_file):

self.matrix = np.ma.compress_rows(np.ma.masked_invalid(self.matrix))

self.labels = _ma['labels']
self.labels = list(map(toString, _ma['labels']))

assert len(self.labels) == self.matrix.shape[1], "ERROR, length of labels is not equal " \
"to length of matrix samples"
Expand Down
4 changes: 2 additions & 2 deletions galaxy/wrapper/deepTools_macros.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<macros>

<token name="@THREADS@">--numberOfProcessors "\${GALAXY_SLOTS:-4}"</token>
<token name="@WRAPPER_VERSION@">2.5.5</token>
<token name="@WRAPPER_VERSION@">2.5.6</token>
<xml name="requirements">
<requirements>
<requirement type="package" version="2.5.5">deeptools</requirement>
<requirement type="package" version="2.5.6">deeptools</requirement>
<yield />
</requirements>
<expand macro="stdio" />
Expand Down
4 changes: 2 additions & 2 deletions galaxy/wrapper/test-data/bamPEFragmentSize_result1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ Sample size: 3
Fragment lengths:
Min.: 241.0
1st Qu.: 241.5
Mean: 244.666666667
Mean: 244.66666666666666
Median: 242.0
3rd Qu.: 246.5
Max.: 251.0
Std: 4.49691252108
Std: 4.496912521077347

Read lengths:
Min.: 251.0
Expand Down
2 changes: 1 addition & 1 deletion galaxy/wrapper/test-data/plotEnrichment_output.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
file featureType percent
bowtie2 test1.bam down 100.00
bowtie2 test1.bam up 100.00
bowtie2 test1.bam down 100.00
bowtie2 test1.bam up 100.00
bowtie2 test1.bam down 100.00
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Sample AUC Synthetic AUC X-intercept Synthetic X-intercept Elbow Point Synthetic Elbow Point JS Distance Synthetic JS Distance % genome enriched diff. enrichment CHANCE divergence
bowtie2 test1.bam 0.00493632029864 0.481650684758 0.984443061605 1.15310443503e-24 0.984940883634 0.523268829811 NA 0.269004498068 NA NA NA
bowtie2 test1.bam 0.00493632029864 0.481650684758 0.984443061605 1.15310443503e-24 0.984940883634 0.523268829811 0.0 0.269004498068 0 0 0
bowtie2 test1.bam 0.00493632029863651 0.481650684757865 0.984443061605476 1.1531044350267195e-24 0.9849408836341008 0.5232688298112538 NA 0.26900449806812143 NA NA NA
bowtie2 test1.bam 0.00493632029863651 0.481650684757865 0.984443061605476 1.1531044350267195e-24 0.9849408836341008 0.5232688298112538 0.0 0.26900449806812143 0 0 0
4 changes: 2 additions & 2 deletions galaxy/wrapper/test-data/plotPCA_result2.tabular
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Component bowtie2-test1.bam bowtie2-test1.bam Eigenvalue
1 -0.707106781187 -0.707106781187 6.0
2 -0.707106781187 0.707106781187 1.23259516441e-32
1 -0.7071067811865476 -0.7071067811865475 6.000000000000001
2 -0.7071067811865475 0.7071067811865476 1.2325951644078315e-32
2 changes: 1 addition & 1 deletion galaxy/wrapper/test-data/profiler_result2.tabular
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
bin labels -0.0Kb 0.0Kb
bins 1 2
bins 1.0 2.0
bamCoverage_result4_bw_0 genes 2477942.875 2610260.125

0 comments on commit db4400d

Please sign in to comment.