gatb / pygatb Goto Github PK
View Code? Open in Web Editor NEWPython3 wrapper for GATB-Core.
License: GNU Affero General Public License v3.0
Python3 wrapper for GATB-Core.
License: GNU Affero General Public License v3.0
Consider the following ipython session:
$ ipython3
Python 3.6.0 (default, Feb 8 2017, 15:44:49)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from gatb import Bank
In [2]: b = Bank("this_file/does_not/exist")
terminate called after throwing an instance of 'gatb::core::system::Exception'
Aborted (core dumped)
Would it be possible to have an exception raised instead of a crash, or would this severely affect performances ?
Hello,
I was running setup.py and an error raised in test_graph.py, any advices ? Below the result from setup.py :
~/pyGATB/build$ python3 setup.py test
running pytest
Searching for pytest
Best match: pytest 3.5.0
Processing pytest-3.5.0-py3.5.egg
Using /home/jeanjean/pyGATB/build/.eggs/pytest-3.5.0-py3.5.egg
Searching for py>=1.5.0
Best match: py 1.5.3
Processing py-1.5.3-py3.5.egg
Using /home/jeanjean/pyGATB/build/.eggs/py-1.5.3-py3.5.egg
Searching for pluggy<0.7,>=0.5
Best match: pluggy 0.6.0
Processing pluggy-0.6.0-py3.5.egg
Using /home/jeanjean/pyGATB/build/.eggs/pluggy-0.6.0-py3.5.egg
Searching for more-itertools>=4.0.0
Best match: more-itertools 4.1.0
Processing more_itertools-4.1.0-py3.5.egg
Using /home/jeanjean/pyGATB/build/.eggs/more_itertools-4.1.0-py3.5.egg
Searching for attrs>=17.4.0
Best match: attrs 17.4.0
Processing attrs-17.4.0-py3.5.egg
Using /home/jeanjean/pyGATB/build/.eggs/attrs-17.4.0-py3.5.egg
running egg_info
creating pyGATB.egg-info
writing pyGATB.egg-info/PKG-INFO
writing dependency_links to pyGATB.egg-info/dependency_links.txt
writing top-level names to pyGATB.egg-info/top_level.txt
writing requirements to pyGATB.egg-info/requires.txt
writing manifest file 'pyGATB.egg-info/SOURCES.txt'
reading manifest file 'pyGATB.egg-info/SOURCES.txt'
writing manifest file 'pyGATB.egg-info/SOURCES.txt'
running build_ext
============================== test session starts =====================
platform linux -- Python 3.5.2, pytest-3.5.0, py-1.5.3, pluggy-0.6.0
rootdir: /home/jeanjean/pyGATB/build, inifile: setup.cfg
collected 17 items
src/tests/test_bank.py ....... [ 41%]
src/tests/test_graph.py .Aborted (core dumped)
Then trying to load h5 in ipython to test Graph module i got the same error :
Python 3.5.2 (default, Nov 23 2017, 16:37:01)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.3.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from gatb import Graph
In [2]: graph=Graph('-in ../thirdparty/gatb-core/gatb-core/test/db/celegans_reads.h5')
Input is h5 or _gatb/ (we assume that kmer counting has already been done), we will complete it into a graph if necessary.
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Aborted (core dumped)
I just tried the fasta parsing feature of pyGATB, and I find surprizing results. See the following ipython3 session:
In [1]: from gatb import Bank
In [2]: sum(len(seq.sequence) for seq in Bank("/Genomes/C_elegans/Caenorhabditis_elegans/Ensembl/WBcel235/Sequence/WholeGenomeFasta/genome.fa"))
Out[2]: 102932909
In [3]: sum((len(line.strip()) for line in open("/Genomes/C_elegans/Caenorhabditis_elegans/Ensembl/WBcel235/Sequence/WholeGenomeFasta/genome.fa") if line[0] != ">"))
Out[3]: 100286401
What could explain the differences ?
Edit: Same issue with the provided example:
In [1]: from gatb import Bank
In [2]: sum(len(seq.sequence) for seq in Bank("/home/bli/src/pyGATB/thirdparty/gatb-core/gatb-core/test/db/query.fa"))
Out[2]: 40428
In [3]: sum((len(line.strip()) for line in open("/home/bli/src/pyGATB/thirdparty/gatb-core/gatb-core/test/db/query.fa") if line[0] != ">"))
Out[3]: 39699
Hello, I installed pyGATB using pip and python v3.5.6 on our cluster. I was playing around with the data and while I could reproduce the sample code for the Bank module, the code kept causing a segmentation fault when I tried to read the data into Graph (whether it was a h5 or fastq file):
~/gatbTest$ python
Python 3.5.6 |Anaconda, Inc.| (default, Aug 26 2018, 21:41:56)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from gatb import Graph
>>> graph = Graph('-in ./celegans_reads.h5')
Input is h5 or _gatb/ (we assume that kmer counting has already been done), we will complete it into a graph if necessary.
Segmentation fault
~/gatbTest$ python
Python 3.5.6 |Anaconda, Inc.| (default, Aug 26 2018, 21:41:56)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from gatb import Graph
>>> graph = Graph('-in ./colombaTestBig_R2.fq')
Segmentation fault
On OSX, I did:
cd <some_fresh_dir>
git clone https://github.com/GATB/pyGATB.git
mkdir build ; cd build;
cmake -DCMAKE_BUILD_TYPE=Release ..
While checking at the CMale working trace, I saw this:
-- Found PythonInterp: /Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4 (found version "3.4.4")
-- Found Cython: /Library/Frameworks/Python.framework/Versions/3.4/bin/cython
-- Found PythonLibs: /usr/lib/libpython2.7.dylib (found version "2.7.10")
Where there is the problem: PythonInterp 3.4.4 vs. PythonLibs 2.7.10.
How can we fix that?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.