as_tibble | R Documentation |
Convert multiple Genomic objects to tibbles
## S3 method for class 'DataFrame'
as_tibble(x, rangeAsChar = TRUE, ...)
## S3 method for class 'GenomicRanges'
as_tibble(x, rangeAsChar = TRUE, name = "range", ...)
## S3 method for class 'Seqinfo'
as_tibble(x, ...)
## S3 method for class 'GInteractions'
as_tibble(x, rangeAsChar = TRUE, suffix = c(".x", ".y"), ...)
## S3 method for class 'SummarizedExperiment'
as_tibble(x, rangeAsChar = TRUE, ...)
## S3 method for class 'TopTags'
as_tibble(x, ...)
x |
A Genomic Ranges or DataFrame object |
rangeAsChar |
Convert any GRanges element to a character vector |
... |
Passed to |
name |
Name of column to use for ranges. Ignored if rangeAsChar =
|
suffix |
Suffix appended to column names for anchor1 and anchor2 of a GInteractions object. Only used if specifying rangeAsChar = FALSE |
Quick and dirty conversion into a tibble.
By default, GenomicRanges will be returned with the range as a character
column called range
and all mcols parsed as the remaining columns.
Seqinfo information will be lost during coercion.
Given that names for ranges are considered as rownames in the mcols element,
these can be simply parsed by setting rownames = "id"
in the call to
as_tibble()
When coercing a DataFrame, any Compressed/SimpleList columns will be coerced to S3 list columns. Any GRanges columns will be returned as a character column, losing any additional mcols from these secondary ranges
Coercion of SummarizedExperiment objects will be performed on the
rowRanges()
element, whilst for a GInteractions
object, both anchors will returned with the default suffixes .x
and .y
Defined as an S3 method for consistency with existing tidy methods
A tibble
gr <- GRanges("chr1:1-10")
gr$p_value <- runif(1)
names(gr) <- "range1"
gr
as_tibble(gr)
as_tibble(gr, rownames = "id")
as_tibble(mcols(gr))
as_tibble(seqinfo(gr))
hic <- InteractionSet::GInteractions(gr, GRanges("chr1:201-210"))
hic$id <- "interaction1"
as_tibble(hic)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.