Coder Social home page Coder Social logo

query_unmapped fails about noodles HOT 3 CLOSED

drtconway avatar drtconway commented on July 21, 2024
query_unmapped fails

from noodles.

Comments (3)

zaeleus avatar zaeleus commented on July 21, 2024 1

Are you able to update to noodles 0.50.0 / noodles-bam 0.44.0? Reader::query_unmapped now requires the header, which should fix this issue.

  • bam/reader: Require a SAM header when querying for unmapped records (Reader::query_unmapped).

    It's possible for a chunk to include mapped records, which are subsequently filtered out, but they do require the associated header to decode.

from noodles.

zaeleus avatar zaeleus commented on July 21, 2024 1

So by my reading of the spec, I think it is allowable, for an unmapped read, to have RNAME set, but POS as 0.

This is not allowed in by the spec. An unmapped record with no coordinate (i.e., POS = 0) does not have a reference sequence name (i.e., RNAME = *). See ยง 1.4.3 (2022-08-22): "An unmapped segment without coordinate has a * at [RNAME]."

Does the query range allow 0 to be part of the interval?

No, 0 is not a coordinate that can be queried from the index. To query a full region, use an unbounded range, e.g., Region::new("sq0", ..).

from noodles.

drtconway avatar drtconway commented on July 21, 2024

Great! That appears to work, thank you!

While I have your attention, can I ask a related question?

So by my reading of the spec, I think it is allowable, for an unmapped read, to have RNAME set, but POS as 0.

Does the query range allow 0 to be part of the interval? My understanding is that Position starts at 1.

I guess the simplest form of query to achieve my goals, would be to do a query that just iterates over anything with the given RNAME.

from noodles.

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.