Coder Social home page Coder Social logo

biomartpy's People

Contributors

daler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

biomartpy's Issues

ValueError: Invalid SEXP type '0' (should be 16) in make_lookup()

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:

  • python 3.5
  • rpy2 2.7.8
  • pandas 0.18
  • bioMart 2.26

This is a great project, keep up the good work!

Installation fails - ez_setup is required

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

Cannot call make_lookup without at least one filter defined

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

df = make_lookup(mart_name, dataset, attributes=attributes)

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

ModuleNotFoundError: No module named 'biomartpy'

NameError Traceback (most recent call last)
in ()
----> 1 df = make_lookup(mart_name, dataset, attributes=attributes)

NameError: name 'make_lookup' is not defined

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.