I am trying to convert BAM files into BigWig files. I have used the following code:
path = '/Volumes/hannah/hannah'
readPairedEndBam = function(path, scan_bam_what = NULL, remove.strandness = TRUE){
cat('Processing ',path,':','\n')
require(rtracklayer)
require(IRanges)
require(GenomicRanges)
alignsPE = readGapped
AlignmentPairs(path)
name = gsub('.bam','',path)
createBigWig(alignsPE,name=name)
cat(name,' finished.','\n')
}
createBigWig = function(aligns,name){
cov = coverage(aligns)
export(cov,paste(name,".bw",sep=''), format="bigWig")
}
readPairedEndBam('CO115_R1.bam')
..but get the following error, even though the GenomicRanges library has been loaded:
Error in readPairedEndBam("CO115_R1.bam") :
could not find function "readGAlignmentPairs"
path = '/Volumes/hannah/hannah'
readPairedEndBam = function(path, scan_bam_what = NULL, remove.strandness = TRUE){
cat('Processing ',path,':','\n')
require(rtracklayer)
require(IRanges)
require(GenomicRanges)
alignsPE = readGapped
AlignmentPairs(path)
name = gsub('.bam','',path)
createBigWig(alignsPE,name=name)
cat(name,' finished.','\n')
}
createBigWig = function(aligns,name){
cov = coverage(aligns)
export(cov,paste(name,".bw",sep=''), format="bigWig")
}
readPairedEndBam('CO115_R1.bam')
..but get the following error, even though the GenomicRanges library has been loaded:
Error in readPairedEndBam("CO115_R1.bam") :
could not find function "readGAlignmentPairs"
Comment