Closed ramonvidal closed 9 years ago
From Bioconductor packages I recommend using GenomicAlignments package to import BAM file to R and rtracklayer package for exporting the reads coverage to BigWig format. This will give you single base resolution track.
The following R code will do the trick:
library(GenomicAlignments)
library(rtracklayer)
bamfile <- system.file("extdata", "ex1.bam", package="Rsamtools", mustWork=TRUE)
show(bamfile)
alignment <- readGAlignments(bamfile)
reads_coverage <- coverage(alignment)
export.bw(reads_coverage, con = "output_BigWig.bw")
Alternatively, you can use command line utilities, for example bedtools genomecov with -ibam option followed by wigToBigWig program
Dear Author, What is the best way? I dont want to create a binned file (I want the maximum resolution). Which tool do you usually use for converting bam files to one of the required in seqplots? Thanks