Giter Site home page Giter Site logo

Comments (5)

brentp avatar brentp commented on July 28, 2024

still thinking about this. But once you have str(self), you can just test for equality, no need to hash.
So you could just have

def __hash__(self):
    return str(self)

in which case, all you really need is to test if str(self) == str(other) in __richcmp__

all that said, i kinda like the idea of 2 intervals being equal if their starts and stops are the same.

from pybedtools.

daler avatar daler commented on July 28, 2024

good points. str(self) == str(other) is easy to do if you want it, but testing chrom/start/stop is more annoying, and therefore better encapsulated in __richcmp__.

two somewhat trickier questions though: 1) should strand continue to be ignored, and 2) should > and < have any meaning?

from pybedtools.

brentp avatar brentp commented on July 28, 2024
  1. seems intuitive that strand should be taken into account.

  2. maybe:
    <: strictly to the left of (not touching)
    >: strictly to the right of (not touching)
    <=: not >
    >=: not <

from pybedtools.

daler avatar daler commented on July 28, 2024

sounds good. i guess as long as it's well documented, there shouldn't be any surprises.

from pybedtools.

daler avatar daler commented on July 28, 2024

This has been implemented for a while now, using "profiles" of feature1/feature2 start/stop comparisons -- see
http://packages.python.org/pybedtools/topical-comparisons.html

Strand still isn't considered . . . just haven't needed it yet. Also, the semantics are currently different than what you suggest because I wasn't thinking about your comment when I was writing the code. That is, slightly overlapping features are both <= as well as <. But with the "profiles" this should be easy to change if needed -- see

# Keys are tuples of start/start, stop/stop, start/stop, stop/start.
.

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.