convert_collapsed_coord: convert_collapsed_coord

Description Usage Arguments Details Value Examples

View source: R/functions_exon_signal.R

Description

(preliminary implementation, sub-optimal)

Usage

1

Arguments

genome_gr

non-contiguous regions to collapse a la collapse_gr

x

numeric, positions within genome_gr to convert to collapsed coordinates.

Details

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.

Value

numeric, positions of every value of x within collapse coordinates. values outside of collapsed regions (an intron or outside range) will be NA.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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))

seqsetvis documentation built on Nov. 8, 2020, 5:57 p.m.