Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation is opaque on 0 vs 1 indexing, and whether regions are right-inclusive or not. #226

Closed
vsbuffalo opened this issue Jan 26, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@vsbuffalo
Copy link

Thank you for writing noodles! Really exciting to have great Rust interfaces to so many bioinformatic formats.

I've noticed is it's currently hard to figure out from docs whether

  1. If all readers convert to a common position/range system (i.e. 1-indexed, right-inclusive), or whether this is for the user to do (e.g. for 1-based, right-inclusive formats like GFF/GTF need different downstream processing than 0-based, right-exclusive formats like BED).
  2. Relatedly, can we count on core::Position and core:Region to have this standardized?

I would be happy to help contribute to documentation on this issue, if helpful.

@zaeleus
Copy link
Owner

zaeleus commented Jan 26, 2024

I believe the type system resolves any coordinate system ambiguity.

All positions in noodles are normalized to be 1-based, wrapped by, as you mentioned, core::Position. The 1-based coordinate system, by definition, uses closed (or inferred unbounded) intervals. This is noted in core::region::Interval.

The documentation shows the return types of positional values. In your examples, gff::Record::start and bed::Record::start_position define positions as 1-based.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants