[BioC] Depth of Coverage and Base counts from BAM file
Julian Gehring
julian.gehring at embl.de
Thu Aug 29 10:10:04 CEST 2013
Hi Chandu,
The 'applyPileups' in the 'Rsamtools' packages will help you here:
"An array of dimensions nucleotide x file x position.
The ‘nucleotide’ dimension is length 5, corresponding to ‘A’, ‘C’, ‘G’,
‘T’, and ‘N’ respectively." (Taken from the 'Rsamtools' manual)
The coverage you can then get with a function like 'rowSums'.
Best wishes
Julian
On 08/29/2013 09:58 AM, Chandu [guest] wrote:
>
> Hi ALL,
>
> Given BAM file, I like to get output something like below. Any ideas?
>
>
> Chr Position DepthOfCoverage BaseCounts
> chr1 14112 14 A:0 C:0 G:0 T:14 N:0
> chr1 14113 13 A:0 C:13 G:0 T:0 N:0
> chr1 14114 11 A:0 C:0 G:0 T:11 N:0
> chr1 14115 11 A:10 C:0 G:0 T:1 N:0
>
> Many thanks in advance.
>
> Best Regards
> Chandu
>
> -- output of sessionInfo():
>
> R version 3.0.0 (2013-04-03)
> Platform: x86_64-apple-darwin10.8.0 (64-bit)
>
> locale:
> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
>
> attached base packages:
> [1] stats graphics grDevices utils datasets methods base
>
> --
> Sent via the guest posting facility at bioconductor.org.
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
>
More information about the Bioconductor
mailing list