Allow open-ended intervals in loadIndexedBam #1196

Closed
ryan-williams opened this Issue Oct 4, 2016 · 1 comment

Comments

Projects
3 participants
@ryan-williams
Member

ryan-williams commented Oct 4, 2016

Intervals' start and end has to be specified in a ReferenceRegion before being passed to loadIndexedBam.

It would be nice to allow intervals of the form [N,∞) without resorting to making callers use Long.MaxValue or the like.

The right model would be a sort of ReferenceRegion-precursor, shaped like (String, Long, Option[Long]), that basically only exists ephemerally in the course of loading subsets of indexed BAMs.

Guacamole has some code that does basically this here, allowing open-ended intervals, whole contigs, and "all" and "none" keywords, then resolving things into concrete ReferenceRegions once contig-lengths are available, after parsing a BAM header.

@heuermh

This comment has been minimized.

Show comment
Hide comment
@heuermh

heuermh Oct 4, 2016

Member

I've suggested before using Range from Guava, which handles bounded and unbounded ranges. It is well-designed and well-tested.

I abuse it for genomics here https://github.com/heuermh/dishevelled-bio/tree/master/range/src/main/java/org/dishevelled/bio/range

Member

heuermh commented Oct 4, 2016

I've suggested before using Range from Guava, which handles bounded and unbounded ranges. It is well-designed and well-tested.

I abuse it for genomics here https://github.com/heuermh/dishevelled-bio/tree/master/range/src/main/java/org/dishevelled/bio/range

@fnothaft fnothaft added this to the 0.21.0 milestone Nov 8, 2016

@fnothaft fnothaft self-assigned this Nov 8, 2016

fnothaft added a commit to fnothaft/adam that referenced this issue Nov 8, 2016

@heuermh heuermh closed this in #1252 Nov 10, 2016

heuermh added a commit that referenced this issue Nov 10, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment