Skip to content

Commit

Permalink
Merge pull request #38 from yhoogstrate/compat2
Browse files Browse the repository at this point in the history
Pypi compatibility updates
  • Loading branch information
yhoogstrate committed Jan 23, 2017
2 parents 5af7958 + b8b5a4e commit d382a92
Show file tree
Hide file tree
Showing 16 changed files with 61 additions and 257 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ nosetests.xml
#/test_*
#/tests/bak/
output_fuma.txt
/htmlcov/*
.venv
/*.txt
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ python:
# - "3.4"
# - "nightly"
# command to install dependencies
install: "pip install ."
# command to run tests
script: "python setup.py test"
install:
- "virtualenv -p python2 .venv ; source .venv/bin/activate ; apt-get install python-numpy ; pip install HTSeq ; python setup.py install"

script:
- "source .venv/bin/activate ; nosetests -v tests/*.py"

notifications:
email: false
8 changes: 8 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
2016-07-11 Youri Hoogstrate

* Version 3.0.5: Changes in deployment & two fixes in export function

2016-07-11 Youri Hoogstrate

* Version 3.0.4: Changes in deployment

2016-07-08 Youri Hoogstrate

* Version 3.0.3: API Changes, only useful for tools depending on FuMa as lib
Expand Down
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include fuma
include bin
include test
reverse-exclude Distutils*
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Bioinformatics first published online December 10, 2015
- [References](#references)

## Introduction ##
This is the Manual as part of the Supplementary Material that belongs to the manuscript: *FuMa: reporting overlap in RNA-seq detected fusion genes* (under submission). FuMa (Fusion Matcher) matches predicted fusion events (both genomic and transcriptomic) according to chromosomal location and corresponding annotated genes. It is the organisation of the transcriptome (provided by the user) that forms the basis for FuMa to consider fusion genes to be identical or not. The provided gene annotation can be adjusted to define the biological question. For example, if it is desired to only consider fusion events that occur within exons, FuMa can be provided a list of such regions instead of entire genes. Currently FuMa supports input files from:
This is the Manual as part of the Supplementary Material that belongs to the manuscript: *FuMa: reporting overlap in RNA-seq detected fusion genes*. FuMa (Fusion Matcher) matches predicted fusion events (both genomic and transcriptomic) according to chromosomal location and corresponding annotated genes. It is the organisation of the transcriptome (provided by the user) that forms the basis for FuMa to consider fusion genes to be identical or not. The provided gene annotation can be adjusted to define the biological question. For example, if it is desired to only consider fusion events that occur within exons, FuMa can be provided a list of such regions instead of entire genes. Currently FuMa supports input files from:

+ Chimera (Beccuti et al., 2014)
+ ChimeraScan (Iyer et al., 2011)
Expand Down
3 changes: 3 additions & 0 deletions coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

py.test --cov-report html --cov=fuma tests
5 changes: 5 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

#pandoc --reference-links --no-wrap -t rst "README.md" > "README.rst"
#python2 setup.py --long-description | rst2html.py > build/README.html
python2 setup.py sdist upload
4 changes: 2 additions & 2 deletions fuma/ComparisonTriangle.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def log_progress(self,n_total, passed, previous_percentage):
return n_total, passed, previous_percentage

def export_list_fg(self,fusion,fh):
if(self.args.acceptor_donor_order_specific_matching and fusion.acceptor_donor_direction() == AD_DIRECTION_REVERSE):
if(self.args.acceptor_donor_order_specific_matching and fusion.acceptor_donor_direction == AD_DIRECTION_REVERSE):
## A-B should be reported as B-A; chr1:123\tchr1:456 as chr1:456-chr1:123
fh.write(":".join(sorted(list(set([str(gene) for gene in fusion.get_annotated_genes_right2()])))) + "\t")
fh.write(":".join(sorted(list(set([str(gene) for gene in fusion.get_annotated_genes_left2()])))))
Expand All @@ -170,7 +170,7 @@ def export_list_fg(self,fusion,fh):

for location in fusion.locations():
if location['dataset'] == dataset.name:
strdata.append(str(loc['id'])+"=chr"+loc['right'][0]+':'+str(loc['right'][1])+'-chr'+loc['left'][0]+':'+str(loc['left'][1]))
strdata.append(str(location['id'])+"=chr"+location['right'][0]+':'+str(location['right'][1])+'-chr'+location['left'][0]+':'+str(location['left'][1]))

fh.write(",".join(sorted(strdata)))
else:
Expand Down
8 changes: 6 additions & 2 deletions fuma/GeneAnnotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<http://epydoc.sourceforge.net/manual-fields.html#fields-synonyms>
"""

#import gffutils
import HTSeq
import logging

Expand All @@ -33,6 +34,9 @@ class GeneAnnotation:
def __init__(self,name):
self.n = 0
self.name = name

# list(db.region(region=('2L', 9277, 10000), completely_within=True))
#self.gas2 = gffutils.create_db(gtf, dbfn=db_file)
self.gas = HTSeq.GenomicArrayOfSets("auto", stranded=False)

def add_annotation(self,gene,chromosome,start,stop):
Expand Down Expand Up @@ -63,5 +67,5 @@ def __iter__(self):
for gene in list(reduce(lambda s1, s2: s1 | s2, [x[1] for x in self.gas[HTSeq.GenomicInterval(chromosome_name,0,chromosome_obj['.'].iv.end)].steps()])):
yield gene

def show_me(self):
print self.__str__()
#def show_me(self):
# print self.__str__()
24 changes: 12 additions & 12 deletions fuma/OverlapComplex.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@ def add_experiment(self,experiment):
self.dataset_names.append(experiment.name)
self.matches_total[str(len(self.datasets))] = len(experiment)

def create_matrix(self,n):
matrix = []
for dataset in self.datasets:
matrix.append([])

n = len(self.datasets)-1
while(n >= 1):
for i in range(n):
matrix[n].append(i)
n -= 1

return matrix
#def create_matrix(self,n):
# matrix = []
# for dataset in self.datasets:
# matrix.append([])
#
# n = len(self.datasets)-1
# while(n >= 1):
# for i in range(n):
# matrix[n].append(i)
# n -= 1
#
# return matrix

def create_keys(self,combination):
keys = [combination[:-1],combination[-1:],combination]
Expand Down
225 changes: 0 additions & 225 deletions fuma/ParseUCSCTable.py

This file was deleted.

3 changes: 2 additions & 1 deletion fuma/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
<http://epydoc.sourceforge.net/manual-fields.html#fields-synonyms>
"""

__version_info__ = ('3', '0', '3')
__version_info__ = ('3', '0', '5')
__version__ = '.'.join(__version_info__) if (len(__version_info__) == 3) else '.'.join(__version_info__[0:3])+"-"+__version_info__[3]
__author__ = 'Youri Hoogstrate'
__author_email__ = '_@.'
__homepage__ = 'https://github.com/yhoogstrate/fuma'
__license__ = 'GNU General Public License v3 (GPLv3)'
9 changes: 6 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,23 @@

import fuma

from distutils.core import setup
from setuptools import setup, find_packages
from setuptools import setup

setup(name='fuma',
version=fuma.__version__,
description='Fusion Matcher',
long_description="FuMa (Fusion Matcher) matches predicted fusion events (both genomic and transcriptomic) according to chromosomal location and corresponding annotated genes. It is the organisation of the transcriptome (provided by the user) that forms the basis for FuMa to consider fusion genes to be identical or not. The provided gene annotation can be adjusted to define the biological question. For example, if it is desired to only consider fusion events that occur within exons, FuMa can be provided a list of such regions instead of entire genes.",
author=fuma.__author__,
author_email=fuma.__author_email__,
maintainer=fuma.__author__,
license=fuma.__license__,
url=fuma.__homepage__,
scripts=["bin/fuma","bin/defuse-clusters-to-CG",'bin/chimerascan-exclude-transcriptome-events',"bin/fusioncatcher-to-CG","bin/chimerascan-relative-bedpe-to-CG","bin/fuma-list-to-boolean-list","bin/fuma-gencode-gtf-to-bed"],
packages=['fuma'],
test_suite="tests",
install_requires=['HTSeq >= 0.6.1','numpy'],
platforms=['any'],
setup_requires=['numpy'],
install_requires=['numpy','HTSeq >= 0.6.1','nose'],
classifiers=[
'Environment :: Console',
'Intended Audience :: Science/Research',
Expand Down
Loading

0 comments on commit d382a92

Please sign in to comment.