Description Usage Arguments Value See Also Examples
View source: R/intersectWithFeature.R
Intersect the windows with an annotation data frame to get features that overlap with each window
1 2 | intersectWithFeature(windows, annotation, getFeatureInfo = FALSE,
overlapCol = "OverlapFeature", mcolsAnnot, collapse, ...)
|
windows |
data frame containing the strand information of the sliding
windows. Windows can be obtained using the function |
annotation |
a Grange object that you want to intersect with your windows. It can have mcols which contains the information or features that could be able to integrate to the input windows |
getFeatureInfo |
whether to get the information of features in the mcols of annotation data or not. If FALSE the return windows will have an additional column indicating whether a window overlaps with any range of the annotion data. If TRUE the return windows will contain the information of features that overlap each window |
overlapCol |
the columnn name of the return windows indicating whether a window overlaps with any range of the annotion data. |
mcolsAnnot |
the column names of the mcols of the annotation data that you want to get information |
collapse |
character which is used collapse multiple features that overlap with a same window into a string. If missing then we don't collapse them. |
... |
used to pass parameters to GenomicRanges::findOverlaps |
the input windows DataFrame with some additional columns
getStrandFromBamFile
, plotHist
,
plotWin
1 2 3 4 5 6 7 8 9 10 11 12 13 | bamfilein = system.file('extdata','s2.sorted.bam',package = 'strandCheckR')
windows <- getStrandFromBamFile(file = bamfilein)
#add chr before chromosome names to be consistent with the annotation
windows$Seq <- paste0('chr',windows$Seq)
library(TxDb.Hsapiens.UCSC.hg38.knownGene)
annot <- transcripts(TxDb.Hsapiens.UCSC.hg38.knownGene)
# get the transcript names that overlap with each window
windows <- intersectWithFeature(windows,annot,mcolsAnnot='tx_name')
# just want to know whether there's any transcript that
# overlaps with each window
windows <- intersectWithFeature(windows,annot,overlapCol='OverlapTranscript')
plotHist(windows,facets = 'OverlapTranscript')
plotWin(windows,facets = 'OverlapTranscript')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.