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

Add command to propagate annotations #89

Merged
merged 4 commits into from
Nov 22, 2024
Merged

Add command to propagate annotations #89

merged 4 commits into from
Nov 22, 2024

Conversation

dkhofer
Copy link
Collaborator

@dkhofer dkhofer commented Nov 12, 2024

No description provided.

@dkhofer dkhofer force-pushed the annotation-commands branch from cff4620 to e6af10d Compare November 14, 2024 19:36
@dkhofer dkhofer requested a review from Chris7 November 14, 2024 19:37
@dkhofer dkhofer force-pushed the annotation-commands branch from 3669223 to 83aca0b Compare November 15, 2024 16:50

let mut path_mappings_by_name = HashMap::new();
for (name, target_path) in target_paths_by_name.iter() {
let source_path = source_paths_by_name.get(name).unwrap();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we assume the 2 sample groups need the same paths?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The paths are associated with block group name (eg "chr22"). I just changed the variable names to make that clearer (eg source_paths_by_name -> source_paths_by_bg_name). So the two associated paths are the latest paths for block groups with the same name. Those pairs of paths are what we propagate annotations on. Let me know if I can do more to clarify that

// Replaced (15, 25) with a 2 bp sequence
// New gene annotation is (5, 15)
assert_eq!(record.start().get(), 5);
assert_eq!(record.end().get(), 15);
Copy link
Collaborator

@Chris7 Chris7 Nov 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens if we throw an insert into a gene? wondering if we split it up or just extend it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We "bridge" the annotation across the split up parts. The first check is on a region-wide annotation and confirms it still spans the region across a replaced part. I edited the comments to make that clearer. If you want a check on a gene annotation specifically, I can put one in

Copy link
Collaborator

@Chris7 Chris7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only question is about requiring paths to match. I think that lookup can be on-demand cache in an anonymous function.

@dkhofer dkhofer force-pushed the annotation-commands branch from 83aca0b to 433276e Compare November 22, 2024 22:37
@dkhofer dkhofer merged commit ffad377 into main Nov 22, 2024
1 check passed
@dkhofer dkhofer deleted the annotation-commands branch November 22, 2024 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants