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

Consolidate/unify usage of chromosome coordinates #22

Open
suhas-r opened this issue Nov 21, 2024 · 0 comments
Open

Consolidate/unify usage of chromosome coordinates #22

suhas-r opened this issue Nov 21, 2024 · 0 comments
Assignees
Labels
code quality Refactors related to modularization + readability

Comments

@suhas-r
Copy link
Collaborator

suhas-r commented Nov 21, 2024

In various places in the code, we use chromosome coordinates in the form [chr1, pos1, o1]. This has a couple drawbacks:

  • List usage. Despite having a fixed number of arguments, list usage means we're unable to enforce static type-checking on each argument as a result. Prefer shifting to namedtuples
  • We have different "edge" definitions that concatenate these coordinates across multiple intervals, which makes indexing into these edges confusing.
    • ex: adding a discordant edge here in the form [chr1, pos1, o1, chr2, pos2, o2, sr_count, sr_flag, sr_cn, lr_count, reads, cn]. No typing, 12 indices to remember the unique meanings of. Modularizing the coordinates would help greatly, ex:
     class ChromosomeCoordinates(NamedTuple):
       chrom_num: int
       position: int
       orientation:  Literal["+", "-"]
    
     class DiscordantEdge(NamedTuple):
       start_location: ChromosomeCoordinates
       end_location: ChromosomeCoordinates
       ....
    
@suhas-r suhas-r added the code quality Refactors related to modularization + readability label Nov 21, 2024
@suhas-r suhas-r self-assigned this Nov 21, 2024
@suhas-r suhas-r mentioned this issue Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality Refactors related to modularization + readability
Projects
None yet
Development

No branches or pull requests

1 participant