#get a BAM test file
treatBAMfile<-system.file("extdata","treat.bam",package="CoverageView")
#get a BED file with the TSS (transcription start site) coordinates of some genes
bedfile<-system.file("extdata","testTSS.bed",package="CoverageView")
#create the CoverageBamFile object
trm<-CoverageBamFile(treatBAMfile)
#generate the coverage matrix extending 100 nts on each side of the TSS provided
#in the BED file
DF1=cov.matrix(trm,coordfile=bedfile,extend=100)
#write the coverage matrix into the provided file
write.profile(DF1,outfile="DF1.txt")
Run the code above in your browser using DataLab