View source: R/functions_exon_signal.R
convert_collapsed_coord | R Documentation |
(preliminary implementation, sub-optimal)
convert_collapsed_coord(genome_gr, x)
genome_gr |
non-contiguous regions to collapse a la
|
x |
numeric, positions within genome_gr to convert to collapsed coordinates. |
see collapse_gr
for explanation of intended uses. this function
translates all values of x from original genomic coordinates to new
coordinate space created by collapse_gr
.
numeric, positions of every value of x within collapse coordinates. values outside of collapsed regions (an intron or outside range) will be NA.
library(data.table)
library(GenomicRanges)
dev_dat = data.table(seqnames = "chrTest",
transcript_id = c(1, 1, 2, 2, 3, 3, 3),
start = c(5, 30, 8, 30, 2, 30, 40),
end = c(10, 35, 15, 38, 7, 35, 45),
strand = "+")
genome_gr = GRanges(dev_dat)
convert_collapsed_coord(genome_gr, start(genome_gr))
convert_collapsed_coord(genome_gr, end(genome_gr))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.