Skip to content

Expose more gtars functionality via python#241

Merged
nsheff merged 5 commits intodevfrom
overlaps-updates
Mar 10, 2026
Merged

Expose more gtars functionality via python#241
nsheff merged 5 commits intodevfrom
overlaps-updates

Conversation

@nsheff
Copy link
Copy Markdown
Member

@nsheff nsheff commented Mar 6, 2026

Working on improving performance of bedshift; need some work on gtars guts to python.

@nsheff nsheff requested a review from nleroy917 March 6, 2026 22:44
@nsheff nsheff marked this pull request as ready for review March 6, 2026 22:44
Copy link
Copy Markdown
Member

@nleroy917 nleroy917 left a comment

Choose a reason for hiding this comment

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

Just really a small question inside MultiChromOverlapper

/// **Note:** All operations produce regions with `rest: None`. Metadata from
/// the `rest` field of input regions is not preserved — operations like `reduce()`
/// merge multiple regions, so there is no unambiguous `rest` to carry forward.
pub trait IntervalRanges {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just curious what the motivation was to make this a trait? Is it implemented elsewhere?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I didn't make the trait... this PR isn't introducing the trait, it was there.

Looks like @sanghoonio created the IntervalRanges trait in commit 6f465f2 on Feb 18, with the initial 5 GenomicRanges operations, and followed up with a second commit on Feb 20

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I believe it doesn't make sense for this to be a trait, at this point, but I'll let @sanghoonio respond.

return RegionSet::from(Vec::<Region>::new());
}

let index = other.clone().into_multi_chrom_overlapper(OverlapperType::AIList);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just a thought... this operation can be expensive since you're building the index. Does it make more sense for this function to take as input a MultiChromOverlapper? That way if you are performing many intersect calls, you can build the index once and pass in by reference?

I guess just proposing to decouple the indexing building from the intersection?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yeah this is a legitimate concern. but it points at something more fundamental. we need to re-evaluate the whole trait/regionset/MCO relationships, which I can't really tackle at this point. So will address this in the future.

@nsheff nsheff merged commit 76753b7 into dev Mar 10, 2026
@nsheff nsheff deleted the overlaps-updates branch March 10, 2026 16:12
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