Skip to content

Commit 8b97cb2

Browse files
committed
add trim,GRangesList
1 parent c0ace2b commit 8b97cb2

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

R/GRangesList-class.R

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,18 @@ setAs("GenomicRangesList", "SimpleGRangesList",
210210
setAs("SimpleGenomicRangesList", "SimpleGRangesList",
211211
.from_List_to_SimpleGRangesList)
212212

213+
### - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
214+
### Intra-range methods
215+
###
216+
217+
setMethod("trim", "GRangesList",
218+
function(x, use.names=TRUE)
219+
{
220+
## Like seqinfo,GRangesList, assumes that there is a
221+
## single Seqinfo for the entire object. Only guaranteed
222+
## to be true in the compressed case.
223+
relist(trim(unlist(x, use.names=FALSE), use.names=use.names), x)
224+
})
213225

214226
### - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
215227
### Coercion from list-like object to CompressedGRangesList

man/intra-range-methods.Rd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
\alias{trim}
2424
\alias{trim,GenomicRanges-method}
25+
\alias{trim,GRangesList-method}
2526

2627
\title{Intra range transformations of a GRanges or GRangesList object}
2728

0 commit comments

Comments
 (0)