Description Usage Arguments Value Examples
Given a peak and a feature, returns the position and distance of the peak relative to the feature. If currentFeature and currentPeak overlap, the distance between them is 0. Otherwise, the distance between them gives how many bases away an endpoint of currentFeature is from an endpoint of currentPeak, using the endpoints closest to each other. Position of the peak relative to the feature is some combination of upstream, downstream, and overlapping. Peaks and features without strand information are assumed to be on the forward strand. Note that this is a helper function intended for use by the mapPeaks function; the user should NOT call this function themselves.
1 | getDistanceToPeak(currentFeature, currentPeak)
|
currentFeature |
A single feature, given as the following 6 fields: chromosome, start position, end position, name, score, and strand (i.e. a single row from a dataframe returned by importBED) |
currentPeak |
A single peak, given as the following 6 fields: chromosome, start position, end position, name, score, and strand (i.e. a single row from a dataframe returned by importBED) |
A vector containing 2 items. The first item describes the position of the peak relative to the feature. This is one of:
"Downstream (no overlap)" - the peak is downstream of the feature but does not overlap it
"Overlap (downstream)" - the peak overlaps with the feature and also extends downstream of the feature, but not upstream
"Overlap (upstream and downstream)" - the feature is contained entirely within the peak
"Overlap (upstream)" - the peak overlaps with the feature and also extends upstream of the feature, but not downstream
"Overlap (within feature only)" - the peak is contained entirely with the feature
"Upstream (no overlap)" - the peak is upstream of the feature but does not overlap it
The second item in the vector gives the distance between the peak and the feature. If the two overlap, this distance is 0. Otherwise, this distance gives how many bases away an endpoint of currentPeak is from an endpoint of currentFeature, using the endpoints that are closest together.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
pathToPeaks <- system.file("extdata",
"H3K27me3Peaks.bed", package = "PeakMapper")
pathToGenes <- system.file("extdata",
"WS263Genes.bed", package = "PeakMapper")
H3K27me3Peaks <- importBED(pathToPeaks)
WS263Genes <- importBED(pathToGenes)
singlePeak <- H3K27me3Peaks[1, ]
singleGene <- WS263Genes[1, ]
positionAndDistance <- getDistanceToPeak(singleGene, singlePeak)
position <- positionAndDistance[1]
distance <- positionAndDistance[2]
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.