View source: R/preprocess-utils.R
duplicatedGAlignmentPairs | R Documentation |
GAlignmentPairs
object are duplicates of a row with a smaller subscriptGiven a GAlignmentPairs
object, duplicatedGAlignmentPairs
returns a logical vector with one element for each row.
duplicatedGAlignmentPairs(galp)
galp |
a |
a logical vector corresponding to each row in the GAlignmentPairs
object
library(Rsamtools)
library(svbams)
library(GenomicAlignments)
bam_path <- system.file("extdata", package="svbams", mustWork=TRUE)
bamfile <- file.path(bam_path, "cgov10t.bam")
data(bins, package='svbams')
param1 <- ScanBamParam(flag=scanBamFlag(isDuplicate=FALSE,
isSecondaryAlignment=FALSE),
which=bins)
param1b <- ScanBamParam(flag=scanBamFlag(isDuplicate=FALSE,
isSecondaryAlignment=FALSE))
## Not run:
galp1 <- readGAlignmentPairs(bamfile, param=param1)
galp1 <- galp1[do.call(order, as.data.frame(galp1))]
galp1b <- readGAlignmentPairs(bamfile, param=param1b)
galp1b <- subsetByOverlaps(galp1b, bins, ignore.strand=TRUE)
galp1b <- galp1b[do.call(order, as.data.frame(galp1b))]
identical(galp1, galp1b) ## FALSE because galp1 has duplicates
galp1 <- galp1[!duplicatedGAlignmentPairs(galp1)]
identical(galp1, galp1b)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.