##draw a cumulative coverage plot for a test case BAM file
#get a BAM test file
treatBAMfile<-system.file("extdata","treat.bam",package="CoverageView")
#create a CoverageBamFile object
trm<-CoverageBamFile(treatBAMfile)
#draw the plot
genome.covplot.cumdepth(trm,outfile="test.png")
#draw the plot setting the max_depth parameter (30X in this case)
genome.covplot.cumdepth(trm,outfile="test.png",max_depth=30)
##draw two overlapping cumulative coverage plots for two different BAM files
#get the first BAM file
treatBAMfile<-system.file("extdata","treat.bam",package="CoverageView")
#create the CoverageBamFile object
trm<-CoverageBamFile(treatBAMfile)
#get the 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.cumdepth(input_d,outfile="test.png")
Run the code above in your browser using DataLab