[BioC] [devteam-bioc] Depth of Coverage and Base counts from BAM file
Hervé Pagès
hpages at fhcrc.org
Tue Sep 3 21:01:05 CEST 2013
Hi Chandu,
Alternatively, you can use a combination of
readGAlignmentsFromBam/sequenceLayer/consensusMatrix,
to generate one consensus matrix per chromosome.
See ?sequenceLayer in the Rsamtools package for an example
of how to do this.
H.
On 08/29/2013 01:10 AM, Maintainer wrote:
>
>
> 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-0bNBQ1PAWB4BXFe83j6qeQ at public.gmane.org
>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
>>
>
>
> ________________________________________________________________________
> devteam-bioc mailing list
> To unsubscribe from this mailing list send a blank email to
> devteam-bioc-leave at lists.fhcrc.org
> You can also unsubscribe or change your personal options at
> https://lists.fhcrc.org/mailman/listinfo/devteam-bioc
>
--
Hervé Pagès
Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024
E-mail: hpages at fhcrc.org
Phone: (206) 667-5791
Fax: (206) 667-1319
More information about the Bioconductor
mailing list