plyranges icon indicating copy to clipboard operation
plyranges copied to clipboard

`read_bam()` return value

Open lawremi opened this issue 7 years ago • 5 comments

Current read_bam() returns a GAlignments or GAlignmentsList. I think we want to hide that data structure from the user. It could instead return a GRanges (GroupedGRanges for a GAlignmentsList) with fields from the GAlignments as metadata columns. There then needs to be a way to do the equivalent of grglist(ga), i.e., chop the ranges (into a GroupedGRanges) by introns or any gap. Maybe chop_by_introns() and chop_by_gaps() (both N's and D's).

lawremi avatar Dec 03 '17 17:12 lawremi

For paired end data, is there an easy way to extract the first and second ends as GRanges? It looks like the user gets a GAlignmentsList (I guess eventually a GroupedGRanges), so there would need to be an obvious way of getting the first (or second) member of each group. I guess after the user has already explicitly dropped the unpaired reads (singleton groups).

lawremi avatar Dec 03 '17 17:12 lawremi

I think in the original API spec there was a split_alignments function, which I haven’t got around to implementing yet.


From: Michael Lawrence [email protected] Sent: Monday, 4 December 2017 4:27:21 AM To: sa-lee/plyranges Cc: Subscribed Subject: Re: [sa-lee/plyranges] read_bam() return value (#15)

For paired end data, is there an easy way to extract the first and second ends as GRanges? It looks like the user gets a GAlignmentsList (I guess eventually a GroupedGRanges), so there would need to be an obvious way of getting the first (or second) member of each group. I guess after the user has already explicitly dropped the unpaired reads (singleton groups).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/sa-lee/plyranges/issues/15#issuecomment-348799231, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AHqWQTJZ65GsgfmhjRYcWOjxdf3jgGO-ks5s8tn3gaJpZM4QzzH-.

sa-lee avatar Dec 03 '17 20:12 sa-lee

Yea, but I was thinking chop_ might be a better verb. Just because "split" already has a meaning in R. And mentioning introns makes the meaning more obvious.

lawremi avatar Dec 03 '17 21:12 lawremi

@lawremi i've implmented chop in https://github.com/sa-lee/plyranges/blob/operators-class/R/ranges-chop.R is that what you meant?

sa-lee avatar May 09 '18 06:05 sa-lee

No, what I mean is the behaivor of calling grglist() on a GAlignments, except instead of returning a GRangesList, we return a grouped GRanges. This is going to break ranges up into smaller pieces, leaving out the introns and optionally deletions.

lawremi avatar May 09 '18 13:05 lawremi