Search
Question: Feature request: syntax for dropping unused seqlevels in GRanges objects
0
gravatar for Charles Plessy
6 months ago by
Japan
Charles Plessy30 wrote:

Hello,

it would be great if one could write things such as gr <- droplevels(gr) or gr <- gr[seqnames(gr) = foo, drop = TRUE], where gr would be a GRanges object.

Search engines report that it has already been discussed at least once in the past, and no roadblock was mentioned.

My use case is that I am making coverage analysis with commands such as GRanges(coverage(gr)) ; gr <- gr[score(gr) > 0], and it fails with the following error if the gr object has unused seqlevels because it was filtered before.

Error in .normargSeqlengths(value, seqnames(x)) :
  length of supplied 'seqlengths' must equal the number of sequences
ADD COMMENTlink modified 6 months ago by Hervé Pagès ♦♦ 13k • written 6 months ago by Charles Plessy30
2
gravatar for Hervé Pagès
6 months ago by
Hervé Pagès ♦♦ 13k
United States
Hervé Pagès ♦♦ 13k wrote:

Hi,

See the examples in ?seqlevels. The "A. MODIFY THE SEQLEVELS OF A GRanges OBJECT" section has an example that shows you exactly how to drop all unused seqlevels.

Cheers,

H.

PS: This post your refer to is from 2010 and from the Bioc-sig-seq mailing list. Note that this list was shut down many years ago. The Bioconductor software has changed/improved a lot since then.

ADD COMMENTlink modified 6 months ago • written 6 months ago by Hervé Pagès ♦♦ 13k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 126 users visited in the last hour