annotate_cds_by_site | R Documentation |
Annotate the sites of your CDS with feature data based on coordinate overlap.
annotate_cds_by_site(
cds,
feature_data,
verbose = FALSE,
maxgap = 0,
all = FALSE,
header = FALSE
)
cds |
A CDS object. |
feature_data |
Data frame, or a character path to a file of
feature data. If a path, the file should be tab separated. Default assumes
no header, if your file has a header, set |
verbose |
Logical, should progress messages be printed? |
maxgap |
The maximum number of base pairs allowed between the peak and
the feature for the feature and peak to be considered overlapping.
Default = 0 (overlapping). Details in
|
all |
Logical, should all overlapping intervals be reported? If all is FALSE, the largest overlap is reported. |
header |
Logical, if reading a file, is there a header? |
annotate_cds_by_site
will add columns to the fData
table of a CDS object based on the overlap of peaks with features in a
data frame or file. An "overlap" column will be added, along with any
columns beyond the three required columns in the feature data. The
"overlap" column is the number of base pairs overlapping the fData
site. When maxgap is used, the true overlap is still calculated (overlap
will be 0 if the two features only overlap because of maxgap) NA
means that there was no overlapping feature. If a peak overlaps multiple
data intervals and all is FALSE, the largest overlapping interval will be
chosen (in a tie, the first entry is taken), otherwise all intervals will
be chosen and annotations will be collapsed using a comma as a separator.
A CDS object with updated fData
table.
data("cicero_data")
input_cds <- make_atac_cds(cicero_data, binarize = TRUE)
feat <- data.frame(chr = c("chr18", "chr18", "chr18", "chr18"),
bp1 = c(10000, 10800, 50000, 100000),
bp2 = c(10700, 11000, 60000, 110000),
type = c("Acetylated", "Methylated", "Acetylated",
"Methylated"))
input_cds <- annotate_cds_by_site(input_cds, feat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.