annotateGRLfromGRL | R Documentation |
Annotate GRangesList from GRangesList objects
annotateGRLfromGRL(
GRL1,
GRL2,
annoName1 = "name",
annoName2 = "name",
grlOL = NULL,
add_grl_name = FALSE,
returnType = c("GRL", "GR"),
splitColname = annoName1,
verbose = FALSE,
...
)
GRL1 |
GRangesList query |
GRL2 |
GRangesList subject, used to add annotations to |
annoName1 |
character value indicating either the colname of
|
annoName2 |
character value indicating either the colname of
|
grlOL |
overlap result (optional) from |
add_grl_name |
logical indicating whether to add the names of each GRangesList object to the output object, useful for tracking the annotations to the source data. |
returnType |
character value indicating whether to return GRangesList "GRL" or GRange "GR" object. |
splitColname |
character value used internally to indicate how
to split the resulting GRanges annotated data back to GRangesList.
Almost always, this value should be identical to |
verbose |
logical indicating whether to print verbose output. |
... |
additional arguments are passed to |
This function extends annotateGRfromGR()
for the special case
of GRangesList objects. It requires both GRangesList objects have
identical length, and assumes both are in equivalent order.
It then restricts all overlapping annotations to those where the
query and subject are the same original GRangesList index.
This function is particularly useful following an operation on
a GRangesList object that otherwise removes all annotations in
values(GRL1)
, for example GenomicRanges::reduce()
or
GenomicRanges::flank()
. This function can be used to re-annotate
the resulting features using the original GRangesList object.
Note that annotations are added at the level of individual GRanges
entries, equivalent to values(GRL1@unlistData)
. This function does
not currently apply annotations at the GRangesList level, thus
it does not use values(GRL2)
if they exist.
GRangesList object with the same length and lengths as
the input GRL1
, with annotation columns added from GRL2
.
Other jam GRanges functions:
addGRLgaps()
,
addGRgaps()
,
annotateGRfromGR()
,
assignGRLexonNames()
,
closestExonToJunctions()
,
combineGRcoverage()
,
exoncov2polygon()
,
findOverlapsGRL()
,
flattenExonsBy()
,
getFirstStrandedFromGRL()
,
getGRLgaps()
,
getGRcoverageFromBw()
,
getGRgaps()
,
grl2df()
,
jam_isDisjoint()
,
make_ref2compressed()
,
sortGRL()
,
spliceGR2junctionDF()
,
stackJunctions()
gr12 <- GenomicRanges::GRanges(
seqnames=rep(c("chr1", "chr2", "chr1"), c(3,3,3)),
ranges=IRanges::IRanges(
start=c(100, 200, 400, 500, 300, 100, 200, 400, 600),
width=c(100,150,50, 50,50,100, 50,200,50)
),
strand=rep(c("+", "-", "+"), c(3,3,3)),
gene_name=rep(c("GeneA", "GeneB", "GeneC"), each=3)
)
# Now split into GRangesList
grl1 <- GenomicRanges::split(gr12[,0],
GenomicRanges::values(gr12)$gene_name);
grl2 <- GenomicRanges::split(gr12,
GenomicRanges::values(gr12)$gene_name);
# The first object is a GRangesList with no annotations
grl1;
# The second object is a GRangesList with annotation,
# assumed to be in the same order
grl2;
annotateGRLfromGRL(grl1, grl2);
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.