Giter Site home page Giter Site logo

Example failed about pybedtools HOT 6 CLOSED

daler avatar daler commented on July 28, 2024
Example failed

from pybedtools.

Comments (6)

daler avatar daler commented on July 28, 2024

Hmm. Are you able to run other tools, or is this specific to genome_coverage? For example, does this work:

   a.intersect(a)

from pybedtools.

xapple avatar xapple commented on July 28, 2024

Same for a.intersect(a)


NotImplementedError                       Traceback (most recent call last)
/home/sinclair/<ipython-input-4-bbdb221e5a4c> in <module>()
----> 1 a.intersect(a)

/usr/local/lib/python2.7/dist-packages/pybedtools-0.6.2-py2.7-linux-x86_64.egg/pybedtools/bedtool.pyc in decorated(self, *args, **kwargs)
    621             # this calls the actual method in the first place; *result* is

    622             # whatever you get back

--> 623             result = method(self, *args, **kwargs)
    624 
    625             # add appropriate tags


/usr/local/lib/python2.7/dist-packages/pybedtools-0.6.2-py2.7-linux-x86_64.egg/pybedtools/bedtool.pyc in not_implemented_func(*args, **kwargs)
    139         if not_implemented:
    140             def not_implemented_func(*args, **kwargs):
--> 141                 raise NotImplementedError(help_str)
    142             return not_implemented_func
    143 

NotImplementedError: "intersectBed" does not appear to be installed or on the path, so this method is disabled.  Please install a more recent version of BEDTools and re-import to use this method.

from pybedtools.

daler avatar daler commented on July 28, 2024

Ah, it looks like the bedtools package you get through apt-get is an old version (2.14.3-1). Not sure who is maintaining that package, but there have been a lot of improvements and bug fixes since then. The calling syntax for BEDTools programs changed in 2.15, and pybedtools only supports the new version in part to prevent users from using out-of-date versions of BEDTools . . .

I would strongly suggest installing the latest version (see http://bedtools.readthedocs.org/en/latest/content/installation.html). After installing the latest (currently 2.17.0), do you still get this problem?

from pybedtools.

xapple avatar xapple commented on July 28, 2024

So it was indeed the version that was too old. However the error message did not suggest this at all. I would advise that if your library doesn't work with the current ubuntu distribution; you should check for it and instruct the user.

However, the example still doesn't work:

In [6]: a.genome_coverage()
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
/home/sinclair/OD1/raw/<ipython-input-6-bfb19364e87a> in <module>()
----> 1 a.genome_coverage()

/usr/local/lib/python2.7/dist-packages/pybedtools-0.6.2-py2.7-linux-x86_64.egg/pybedtools/bedtool.pyc in decorated(self, *args, **kwargs)
    621             # this calls the actual method in the first place; *result* is

    622             # whatever you get back

--> 623             result = method(self, *args, **kwargs)
    624 
    625             # add appropriate tags


/usr/local/lib/python2.7/dist-packages/pybedtools-0.6.2-py2.7-linux-x86_64.egg/pybedtools/bedtool.pyc in wrapped(self, *args, **kwargs)
    174                             check_for_genome = True
    175             if check_for_genome:
--> 176                 kwargs = self.check_genome(**kwargs)
    177 
    178             # Add the implicit values to kwargs.  If the current BedTool is


/usr/local/lib/python2.7/dist-packages/pybedtools-0.6.2-py2.7-linux-x86_64.egg/pybedtools/bedtool.pyc in check_genome(self, **kwargs)
   1176                 kwargs['g'] = self.chromsizes
   1177             else:
-> 1178                 raise ValueError('No genome specified. Use the "g" or '
   1179                                  '"genome" kwargs, or use the '
   1180                                  '.set_chromsizes() method')

If you use a BED file you need to specify a genome, but this is not the case for a BAM file. See http://bedtools.readthedocs.org/en/latest/content/tools/genomecov.html

from pybedtools.

daler avatar daler commented on July 28, 2024

Thanks for pointing this out. As of 79dd4dc, I re-added support for older versions, including the 2.14.3 from Ubuntu repository. After thinking about this, I decided it's not nice for pybedtools to force a user into any particular BEDTools version, and I'm sure you're not the only one using the outdated Ubuntu package.

I also fixed genome_coverage (and associated tests) so that a genome is not required for BAM file input.

Can you confirm that this works?

from pybedtools.

xapple avatar xapple commented on July 28, 2024

Nice, it works like a charm now. There I was with my snarky comments about how your library didn't work on my first try and you fixed it in a day. Props to you !

from pybedtools.

Related Issues (20)

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.