Description Usage Arguments Details Author(s) References See Also Examples
Write the coverage values calculated using the cov.interval
function into a WIG format file
1 2 | ## S4 method for signature 'numeric'
export.wig(cov,outfile=NULL)
|
cov |
Numeric vector containing the coverage values generated by the function |
outfile |
Where to write the |
This method is used to write the coverage values calculated by the cov.interval
function into a WIG format file.
Ernesto Lowy <ernestolowy@gmail.com>
WIG format specification: https://genome.ucsc.edu/FAQ/FAQformat.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #get treatment and control test files
treat1file<-system.file("extdata","treat.bam",package="CoverageView")
control1file<-system.file("extdata","ctrl.bam",package="CoverageView")
#create two CoverageBamFile objects representing single-end alignments
trm1<-CoverageBamFile(treat1file,run_type="single")
ctl1<-CoverageBamFile(control1file,run_type="single")
#calculate the ratio of the coverages for the defined genomic interval using a bin_width equal to 10 nts
cov1=cov.interval(trm1,ctl1,chr="chrI",start=1,end=100,bin_width=10,do="ratio")
#create a WIG file with the obtained vector with the ratios
outfolder=system.file("extdata",package="CoverageView")
an_outfile1=paste(outfolder,"out.wig",sep="/")
export.wig(cov1,outfile=an_outfile1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.