daler / biomartpy Goto Github PK
View Code? Open in Web Editor NEWSimple interface to BioMart (Python -> rpy2 -> R/BioConductor's biomaRt)
Simple interface to BioMart (Python -> rpy2 -> R/BioConductor's biomaRt)
Hi,
I just installed biomartpy and stumbled across something that looks like a bug. Executing:
mart_name = 'ensembl'
dataset = 'dmelanogaster_gene_ensembl'
attributes = ['flybase_gene_id', 'flybasename_gene', 'description']
filters = ['flybase_gene_id']
values = [['FBgn0031208', 'FBgn0002121', 'FBgn0031209', 'FBgn0051973']]
res = bmp.make_lookup(mart_name = mart_name,
dataset = dataset,
attributes = attributes,
filters = filters,
values = values)
leads to
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-8-1bd03cbc42bb> in <module>()
3 attributes = attributes,
4 filters = filters,
----> 5 values = values)
/Users/nwieder/miniconda3/lib/python3.5/site-packages/biomartpy/__init__.py in make_lookup(mart_name, dataset, attributes, filters, values, unique_rows)
234
235 filter_value_dict = dict(zip(filters, values))
--> 236 _filters, _values = _filter_and_values_to_RList(filter_value_dict)
237 kwargs['filters'] = _filters
238 kwargs['values'] = _values
/Users/nwieder/miniconda3/lib/python3.5/site-packages/biomartpy/__init__.py in _filter_and_values_to_RList(d)
199 # Could use ListVector directly with the dict, but want to guarantee
200 # positional order of filters and values
--> 201 f = robjects.StrVector(d.keys())
202 v = robjects.ListVector(
203 rpy2.rlike.container.TaggedList(
/Users/nwieder/miniconda3/lib/python3.5/site-packages/rpy2-2.7.8-py3.5-macosx-10.5-x86_64.egg/rpy2/robjects/vectors.py in __init__(self, obj)
363 def __init__(self, obj):
364 obj = StrSexpVector(obj)
--> 365 super(StrVector, self).__init__(obj)
366
367 def factor(self):
/Users/nwieder/miniconda3/lib/python3.5/site-packages/rpy2-2.7.8-py3.5-macosx-10.5-x86_64.egg/rpy2/robjects/vectors.py in __init__(self, o)
240 if not isinstance(o, SexpVector):
241 o = conversion.py2ri(o)
--> 242 super(Vector, self).__init__(o)
243 self.ro = VectorOperationsDelegator(self)
244 self.rx = ExtractDelegator(self)
ValueError: Invalid SEXP type '0' (should be 16).
Querying ensembl with a filter dict results in the same error msg, querying without filter and only attributes works flawless. I am not yet very familiar with rpy2, but maybe this is a version issue...
I am using:
This is a great project, keep up the good work!
Installation fails when ez_setup is not installed (see below).
maybe add this as a requirement?
cheers
Mark
Downloading/unpacking biomartpy
Downloading biomartpy-0.1.tar.gz
Running setup.py (path:/Users/u0089478/.virtualenvs/test/build/biomartpy/setup.py) egg_info for package biomartpy
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/Users/u0089478/.virtualenvs/test/build/biomartpy/setup.py", line 1, in <module>
import ez_setup
ImportError: No module named ez_setup
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/Users/u0089478/.virtualenvs/test/build/biomartpy/setup.py", line 1, in <module>
import ez_setup
ImportError: No module named ez_setup
I was trying to get a list of all human genes by calling:
get_bm_lookup ('ensembl', 'hsapiens_gene_ensembl',
attributes=['ensembl_gene_id', 'external_gene_id'])
but it fails with a segfault (!):
Error: attempt to use zero-length variable name
Segmentation fault: 11
Which seems to be coming somewhere from the depths of rpy. If I call the same function with the filter:
{'biotype': ['protein_coding']}
it succeeds.
Is this something that can be fixed?
Thanks, Mark
Hi I am interested to use this tool to lookup gene ids for different vertebrates including humans but also dmelanogaster.
However, I get this error, what could be the reseason?
from biomartpy import make_lookup
NameError Traceback (most recent call last)
in ()
----> 1 df = make_lookup(mart_name, dataset, attributes=attributes)
NameError: name 'make_lookup' is not defined
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.