getDepth {vasp} | R Documentation

## Get Read Depth

### Description

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

### Usage

    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

    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')

[Package vasp version 1.0.0 Index]