thinProperPairs: Thin proper read pairs to reduce overplotting

View source: R/alignment-utils.R

thinProperPairsR Documentation

Thin proper read pairs to reduce overplotting

Description

This function provides a simple interface to subsample a GRanges object of properly paired reads to reduce overplotting.

Usage

thinProperPairs(gr, thin = 10)

Arguments

gr

a GRanges object instantiated from a GAlignmentPairs object

thin

integer indicating how much to thin the properly paired reads.

Details

Setting the parameter thin to 10 (default) will return a GRanges object with 1/10 the original number of properly paired reads in gr.

Value

A GRanges object

Examples

library(svbams)
path <- system.file("extdata", package="svbams")
bam.file <- file.path(path, "cgov10t.bam")
prp <- getProperAlignmentPairs(bam.file, build="hg19")
pgr <- ga2gr(prp, is.improper=FALSE)
length(pgr)
pgr2 <- thinProperPairs(pgr, 100)
length(pgr2)

cancer-genomics/trellis documentation built on Aug. 20, 2024, 5:48 p.m.