Commit 3a15e8cc authored by Vermaat's avatar Vermaat
Browse files

Merge pull request #6 from mutalyzer/pypi

PyPI installable
parents f270ef10 951a1f6f
_extractor.so
build/
dist/
extractor.egg-info/
description_extractor.egg-info/
extractor/extractor.py
extractor/extractor_wrap.cpp
extractor/extractor_wrap.cxx
......
# Extractor
# HGVS variant description extractor
Unambiguous sequence variant descriptions are important in reporting
the outcome of clinical diagnostic DNA tests. The standard
......@@ -16,9 +16,27 @@ computation time and its resulting descriptions are relatively small.
Additional applications include updating of gene variant database
contents and reference sequence liftovers.
>>> from extractor import describe_dna
>>> print describe_dna('TAACAATGGAAC', 'TAAACAATTGAA')
[3dup;8G>T;12del]
## Implementation
The core algorithm is implemented in C++ with a Python wrapper providing a
developer friendly interface.
## Installation
### C++ Library only
### Python package
You need [SWIG](http://www.swig.org/) installed. Then:
pip install description-extractor
### C++ library only
Run `make`.
......@@ -28,33 +46,18 @@ For direct use within a C/C++ environment just
`#include "extractor.h"` and add `extractor.cc` to your project's
source files.
### Within Mutalyzer
Todo
## Examples
```
Variant_List extract(char_t const* const reference,
size_t const reference_length,
char_t const* const sample,
size_t const sample_length,
int const type = TYPE_DNA,
char_t const* const codon_string = 0)
```
## Testing
There are some unit tests for the Python interface. After installing the
Python package, run them using [http://pytest.org/](pytest):
Python package, run them using [pytest](http://pytest.org/):
pip install pytest
python setup.py develop
py.test
Alternatively, use [https://tox.readthedocs.org/](tox) to automatically run
Alternatively, use [tox](https://tox.readthedocs.org/) to automatically run
the tests on all supported versions of Python:
pip install tox
tox
......@@ -21,7 +21,7 @@ __version_info__ = tuple(extractor.VERSION.split('.'))
__version__ = extractor.VERSION
__author__ = 'LUMC, Jonathan K. Vis'
__contact__ = 'jvis@liacs.nl'
__homepage__ = 'https://github.com/LUMC/extractor'
__homepage__ = 'https://github.com/mutalyzer/description-extractor'
describe_dna = describe.describe_dna
......
......@@ -24,9 +24,6 @@ from distutils.core import Extension
if sys.version_info < (2, 6):
raise Exception('extractor requires Python 2.6 or higher.')
# Todo: How does this play with pip freeze requirement files?
requires = []
# This is quite the hack, but we don't want to import our package from here
# since that's recipe for disaster (it might have some uninstalled
# dependencies, or we might import another already installed version).
......@@ -42,7 +39,8 @@ for line in open(os.path.join('extractor', '__init__.py')):
# The __version__ value is actually defined in extractor.h.
for line in open(os.path.join('extractor', 'extractor.h')):
if ' VERSION = ' in line:
version = line.split('=')[-1].strip('\'"; ')
version = line.split('=')[-1].replace(';', '').replace('"', '') \
.replace("'", '').strip()
distmeta['__version__'] = version
distmeta['__version_info__'] = tuple(version.split('.'))
break
......@@ -54,12 +52,11 @@ except IOError:
long_description = 'See ' + distmeta['__homepage__']
setup(
name='extractor',
name='description-extractor',
ext_modules=[Extension('_extractor', ['extractor/extractor.i',
'extractor/extractor.cc'], swig_opts=['-c++'])],
py_modules=['extractor.extractor'],
version=distmeta['__version__'],
description='Extract a list of differences between two sequences',
description='HGVS variant description extractor',
long_description=long_description,
author=distmeta['__author__'],
author_email=distmeta['__contact__'],
......@@ -67,11 +64,6 @@ setup(
license='MIT License',
platforms=['any'],
packages=['extractor'],
install_requires=requires,
entry_points = {
'console_scripts': [
]
},
classifiers = [
'Development Status :: 3 - Alpha',
'Intended Audience :: Science/Research',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment