getDepth: Get Read Depth

Description Usage Arguments Value See Also Examples

View source: R/getDepth.R

Description

Get read depth from a BAM file (in bedgraph format)

Usage

1
getDepth(x, chrom, start, end)

Arguments

x

path to a BAM file

chrom

chromosome of a region to be searched

start

start position

end

end position

Value

a data.frame in bedgraph file format which can be used as input for plotBedgraph in the SuShi package.

See Also

splicePlot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
path <- system.file("extdata", package = "vasp")
bam_files <- list.files(path, "bam$")
bam_files

depth <- getDepth(file.path(path, bam_files[1]), "Chr1", start = 1171800, end = 1179400)
head(depth)

library(Sushi)
plotBedgraph(depth, "Chr1", chromstart = 1171800, chromend = 1179400, yaxt = "s")
mtext("Depth", side = 2, line = 2.5, cex = 1.2, font = 2)
labelgenome("Chr1", 1171800, 1179400, side = 1, scipen = 20, n = 5, scale = "Kb")

yuhuihui2011/vasp_test documentation built on March 5, 2020, 12:50 a.m.