Skip to content

Commit

Permalink
Setup using requirements.txt and cython code compiled on setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ikerreyes committed Mar 24, 2017
1 parent 25eba7f commit 71af105
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 43 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ example/output
*.egg-info/
dist/

# Cython compiled code
build/*
*.so
*.c

*.pickle.gz
example/cds
example/cdsOriginal
Expand Down
5 changes: 5 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Files to be included in the distribution
include MANIFEST.in
include requirements.txt
include optional-requirements.txt
global-exclude *.c *.so
27 changes: 27 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
.. _readme:

OncodriveFML
============

Recent years saw the development of methods to detect signals of positive selection in the pattern of somatic mutations in genes across cohorts of tumors, and the discovery of hundreds of driver genes. The next major challenge in tumor genomics is the identification of non-coding regions which may also drive tumorigenesis. We present OncodriveFML, a method that estimates the accumulated functional impact bias of somatic mutations in any genomic region of interest based on a local simulation of the mutational process affecting it. It may be applied to all genomic elements to detect likely drivers amongst them. OncodriveFML can discover signals of positive selection when only a small fraction of the genome, like a panel of genes, has been sequenced.

.. _readme license:

License
-------
OncodriveFML is made available to the general public subject to certain conditions described in its `LICENSE <LICENSE>`_. For the avoidance of doubt, you may use the software and any data accessed through UPF software for academic, non-commercial and personal use only, and you may not copy, distribute, transmit, duplicate, reduce or alter in any way for commercial purposes, or for the purpose of redistribution, without a license from the Universitat Pompeu Fabra (UPF). Requests for information regarding a license for commercial use or redistribution of OncodriveFML may be sent via e-mail to [email protected].

.. _readme install:

Installation
------------

Expand All @@ -25,9 +31,30 @@ Finally, you can get the latest code from the repository and install with ``pip`
$ cd oncodrivefml
$ pip install .

.. note::

OncodriveFML has a set up dependency with `Cython <http://cython.org/>`_,
which is required to compile the :file:`*.pyx` files.


The first time that you run OncodriveFML it will download the genome reference from our servers.
By default the downloaded datasets go to ``~/.bgdata`` if you want to move this datasets to another folder you have to define the system environment variable BGDATA_LOCAL with an export command.

The following command will show you the command help::

$ oncodrivefml --help

.. _readme docs:

Documentation
-------------

Find OncodriveFML documentation in ReadTheDocs.
.. TODO link
You can also compile the documentation yourself using `Sphinx <http://www.sphinx-doc.org/en/stable/>`_.
To do so, intall the optional packages in :file:`optional-requirements.txt` and build the
documentation in the docs folder::

$ cd docs
$ make html
14 changes: 0 additions & 14 deletions docs/source/requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion oncodrivefml/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__logger_name__ = 'oncodrivefml'
__version__ = "1.2.1"
__version__ = "2.0.0"
5 changes: 1 addition & 4 deletions oncodrivefml/walker.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import numpy as np
import pyximport

from oncodrivefml.stats import STATISTIC_TESTS

pyximport.install()
from oncodrivefml.walker_cython import walker_sampling


Expand Down Expand Up @@ -103,4 +100,4 @@ def compute_sampling_cython(samples, muts, obs_val, scores, probs):

s = time.time()
obs, neg_obs = compute_sampling_cython(samples, muts, obs_val, scores, probs)
print("Cython time: {} Obs:{} Neg_obs:{}".format(time.time() - s, obs, neg_obs))
print("Cython time: {} Obs:{} Neg_obs:{}".format(time.time() - s, obs, neg_obs))
3 changes: 3 additions & 0 deletions optional-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This packages are required to build the documentation
sphinx>=1.5.1
sphinx_rtd_theme>=0.1.9
17 changes: 17 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
bgconfig>=0.5
numpy>=1.11.2
scipy>=0.18
statsmodels>=0.8
pytabix>=0.1
bokeh>=0.12
pandas>=0.19
matplotlib>=1.5.3
intervaltree>=2.1
bgqmap>=1.0
bgdata>=1.0
itab>=0.9
bgreference>=0.1
click>=6.7
bgparsers>=0.1
#bgcache>=0.1
cython>=0.25.2
38 changes: 14 additions & 24 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import sys
from setuptools import setup, find_packages

from os import path

from setuptools import Extension
from setuptools import setup, find_packages
from oncodrivefml import __version__

if sys.hexversion < 0x03000000:
raise RuntimeError('This package requires Python 3.0 or later.')

directory = path.dirname(path.abspath(__file__))
with open(path.join(directory, 'requirements.txt')) as f:
required = f.read().splitlines()

setup(
name='oncodrivefml',
Expand All @@ -14,28 +18,14 @@
url="https://bitbucket.org/bbglab/oncodrivefml",
download_url="https://bitbucket.org/bbglab/oncodrivefml/get/"+__version__+".tar.gz",
license='UPF Free Source Code',
author='Biomedical Genomics Group',
author_email='[email protected]',
author='BBGLab (Barcelona Biomedical Genomics Lab)',
author_email='[email protected]',
description='',
install_requires=[
'bgconfig >= 0.5.0',
'numpy >= 1.9.0',
'scipy >= 0.14.0',
'statsmodels >= 0.6.1',
'pytabix >= 0.1',
'bokeh >= 0.12',
'pandas >= 0.15.2',
'matplotlib >= 1.4.0',
'intervaltree >= 2.1.0',
'bgqmap >= 1.0.0',
'bgdata >= 0.6.0',
'itab >= 0.3.0',
'bgreference >= 0.1.1',
'click >= 5.0',
'bgparsers>=0.1',
'bgcache>=0.1'
setup_requires=[
'cython',
],

install_requires=required,
ext_modules=[Extension('oncodrivefml.walker_cython', ['oncodrivefml/walker_cython.pyx'])],
entry_points={
'console_scripts': [
'oncodrivefml = oncodrivefml.main:cmdline'
Expand Down

0 comments on commit 71af105

Please sign in to comment.