genome.covplot.depth: Generates a genome coverage plot

Description Usage Arguments Details Author(s) See Also Examples

Description

This method generates a plot showing the number of genomic positions reaching a certain read depth

Usage

1
2
3
4
  ## S4 method for signature 'CoverageBamFile'
genome.covplot.depth(data,outfile,max_depth)
  ## S4 method for signature 'list'
genome.covplot.depth(data,outfile,max_depth)

Arguments

data

Either an instance of a CoverageBamFile object or a list of CoverageBamFile objects

outfile

URL of the .png file where the plot will be created

max_depth

Maximum read depth to be displayed in the X-axis

Details

This method receives either a single CoverageBamFile object or a list of CoverageBamFile objects and generates a plot for which the X-axis represents a range of coverage read depths and the Y-axis corresponds to the number of megabases having a specific read coverage value. If a list of CoverageBamFile objects is passed to the function then it will generate a different coloured line for each of the objects

Author(s)

Ernesto Lowy <ernestolowy@gmail.com>

See Also

genome.covplot.cumdepth

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
##draw a coverage plot for a test case BAM file
  
#get a BAM test file
treatBAMfile<-system.file("extdata","treat.bam",package="CoverageView")
  
#create the CoverageBamFile object
trm<-CoverageBamFile(treatBAMfile)
  
#draw the plot
genome.covplot.depth(trm,outfile="test.png")
  
#draw the plot setting the max_depth parameter (70X in this case)
genome.covplot.depth(trm,outfile="test.png",max_depth=70)
  
##draw two overlapping coverage plots for two different test BAM files
  
#get a first BAM test file
treatBAMfile<-system.file("extdata","treat.bam",package="CoverageView")
#create the CoverageBamFile object
trm<-CoverageBamFile(treatBAMfile)
  
#get a second BAM test file
ctrlBAMfile<-system.file("extdata","ctrl.bam",package="CoverageView")
#create the CoverageBamFile object
ctl<-CoverageBamFile(ctrlBAMfile)

#create a list with the two files
input_d=list(trm,ctl)
  
#draw the plot
genome.covplot.depth(input_d,outfile="test.png")

CoverageView documentation built on Nov. 8, 2020, 7:52 p.m.