View source: R/alignment-utils.R
sortByRead1 | R Documentation |
In order to plot the read pairs as position versus read pair index, information on the mates needs to be kept intact and the visualization is more clear if the reads are sorted by the first read in the pair. This function turns the read tag in the 'id' field of the GRanges object to an ordered factor. The levels of the factor are determined by the start position of the first read (R1) in the pair.
sortByRead1(gr)
gr |
a |
a GRanges
object
library(svbams)
library(TxDb.Hsapiens.UCSC.hg19.refGene)
region <- GRanges("chr15", IRanges(63201003, 63209243))
si <- seqinfo(TxDb.Hsapiens.UCSC.hg19.refGene)
seqinfo(region) <- si["chr15", ]
path <-system.file("extdata", package="svbams")
bampath <- list.files(path, pattern="cgov44t_revised.bam$",
full.names=TRUE)
iparams <- improperAlignmentParams(mapqFilter=30)
pparams <- properAlignmentParams(mapqFilter=30)
## Not run:
irp <- getImproperAlignmentPairs(bampath,
iparams, build="hg19")
g.irp <- ga2gr(irp, is.improper=TRUE)
prp <- getProperAlignmentPairs(bampath,
pparams, build="hg19")
g.prp <- ga2gr(prp, is.improper=FALSE)
gr <- c(g.irp, g.prp)
gr <- sortByRead1(gr)
gr
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.