getDepth: Get Read Depth

Description Usage Arguments Value 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.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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 documentation built on Jan. 11, 2022, 11:21 a.m.