GithubHelp home page GithubHelp logo

isBigWig segfault about pybigwig HOT 5 CLOSED

deeptools avatar deeptools commented on September 26, 2024
isBigWig segfault

from pybigwig.

Comments (5)

dpryan79 avatar dpryan79 commented on September 26, 2024

I'm not surprised, you're calling object methods directly and giving them numbers instead of an appropriate object. The appropriate syntax is:

import pyBigWig
bw = pyBigWig.open("test.bw")
bw.isBigWig() # or bw.isBigBed()

pyBigWig.pyBigWig doesn't exist, so it can't be exported.

from pybigwig.

clemenshug avatar clemenshug commented on September 26, 2024

I see, I wasn't aware that these are strictly object methods since they are available as functions on the module level.

What I want do to do is simply checking if a variable is a pyBigWig object instance. So far I've used isinstance(var, pyBigWig.pyBigWig). I'm not so sure now if this was intended, but in Python 3 pyBigWig.pyBigWig does point to the pyBigWig.bigWigFile type, so this works nicely.

What would be the suggested way to test this? I guess I could do hasattr(var, 'isBigWig') for now. Thank you for your help!

from pybigwig.

dpryan79 avatar dpryan79 commented on September 26, 2024

I guess I could remove them from the module, it was easier to just leave them in since then the documentation is easier and I didn't have to figure out how else it's all supposed to work in the python C API.

Regarding testing whether an object is a bigWig file, i've never had reason to do that and thus never implemented anything. The bigWigFile is the object that's actually returned by open(), so perhaps checking that with isinstance() works. If not, I can look into implementing something.

from pybigwig.

dpryan79 avatar dpryan79 commented on September 26, 2024

Ah, I found how to fix the documentation so the object methods aren't listed being directly accessible. I also found where I forgot to add the pyBigWig object to the module. I'll try to get a new version released with all of that fixed in the next week.

from pybigwig.

dpryan79 avatar dpryan79 commented on September 26, 2024

I've just pushed out a new version, where the documentation for this is fixed.

from pybigwig.

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.