brentp / python-giggle Goto Github PK
View Code? Open in Web Editor NEWpython (cython) wrapper for https://github.com/ryanlayer/giggle for fast interval searching of huge datasets.
License: Apache License 2.0
python (cython) wrapper for https://github.com/ryanlayer/giggle for fast interval searching of huge datasets.
License: Apache License 2.0
I am performing some queries on a index containing TAD intervals and I noticed sometimes the query returns 2 results where I only expect to see one (because I know all the intervals in the index are non overlapping). When checking the results, I noticed that sometimes they include a result that should not overlap with the query interval. For example:
result = index.query("chr5", 90466028, 90466028)
for hit in result[1]:
print(hit)
print(result.n_hits(1))
returns:
chr5 179080000 179120000 AD, CO, HC, MSC, PA, RV
chr5 90760000 90800000 H1, MES, NPC
2
The first results definitely does not overlap with the single query position and the second result also doe snot seem to overlap. The same is true for the other file in the index:
result = index.query("chr5", 90466028, 90466028)
for hit in result[0]:
print(hit)
print(result.n_hits(0))
returns:
chr5 179062994 179083794 13_Heterochrom/lo
1
I am not sure if this is a bug or the fault lies in my index and/or indexed data or that I am just completely misinterpreting the results?
When trying to create an index using one of the test files (python-giggle\lib\giggle\test\data\1k.sort.bed.gz
) using the following code:
from giggle import Giggle
index = Giggle.create("index", "1k.sort.bed.gz")
I get the following error:
python: offset_index_store: Could not truncate.: Invalid argument
It looks like the error is occurring from offset_index.c
line 170:
if ( ret != 0 )
err(1, "offset_index_store: Could not truncate.");
I have no clue as to why this is happening even with the test data (tried others as well). I am using python 3.6 but got the same error on python 2.7.
I used a fresh miniconda3 python 3.6 environment in which i tried to install python-giggle. I pip installed cython and numpy. However when I run setup.py test
I get the error:
======================================================================
ERROR: <nose.suite.ContextSuite context=test_giggle>
test suite for <module 'test_giggle' from '/home/CODE1/320000451/Software/python-giggle/giggle/tests/test_giggle.py'>
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/CODE1/320000451/Software/python-giggle/.eggs/nose-1.3.7-py3.6.egg/nose/suite.py", line 210, in run
self.setUp()
File "/home/CODE1/320000451/Software/python-giggle/.eggs/nose-1.3.7-py3.6.egg/nose/suite.py", line 293, in setUp
self.setupContext(ancestor)
File "/home/CODE1/320000451/Software/python-giggle/.eggs/nose-1.3.7-py3.6.egg/nose/suite.py", line 316, in setupContext
try_run(context, names)
File "/home/CODE1/320000451/Software/python-giggle/.eggs/nose-1.3.7-py3.6.egg/nose/util.py", line 471, in try_run
return func()
File "/home/CODE1/320000451/Software/python-giggle/giggle/tests/test_giggle.py", line 18, in setup
Giggle.create(INDEX, "lib/giggle/test/data/many/*.bed.gz")
File "giggle/giggle.pyx", line 25, in giggle.giggle.Giggle.create
def create(self, char *path, char *glob):
TypeError: expected bytes, str found
The issue is probably that "lib/giggle/test/data/many/*.bed.gz"
is a unicode string and not a byte string in python3. Is the software only intended for use with python2 or will I be able to just use it with python3? setup.py install
seems to be working fine and in my own code I could make sure to always explicitly convert to byte strings
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.