hi all:
usually in R, people like to use readGappedAlignments to read
aligned
bam files, it is only for
saving momery? is there any function to read sam files?
for some data, especially for human, the bam file is still very
large
(more than 15 G), do you have some ways to
deal with it partly?
thx
shan gao
[[alternative HTML version deleted]]
On 11/02/2011 01:22 PM, wang peter wrote:
> hi all:
> usually in R, people like to use readGappedAlignments to read
aligned
> bam files, it is only for
> saving momery? is there any function to read sam files?
convert the sam file to bam using Rsamtools::asBam, or use R's scan()
and appropriate 'what=' argument; see ?scan, ?scanBam
> for some data, especially for human, the bam file is still very
large
> (more than 15 G), do you have some ways to
> deal with it partly?
use
param = ScanBamParam(which=GRanges("chr3", IRanges(1, 10000)))
and then
GenomicRanges::readGappedAlignments(bamFile, param=param)
or
Rsamtools::readBamGappedAlignments(bamFile, param=param)
or
Rsamtools::scanBam(bamFile, param=param)
'which' can be any GRanges object.
Martin
> thx
>
> shan gao
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> 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
--
Computational Biology
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109
Location: M1-B861
Telephone: 206 667-2793
On Wed, Nov 2, 2011 at 4:35 PM, wang peter <wng.peter at="" gmail.com="">
wrote:
>
> dear sean:
> sorry, but no one answer me the same question
>
> thank u very much for your kindly reply, but my question is "is
there any
> function to read sam files"?
Sam files are text files, so read.table can do so. I'd suggest
following Martin's advice in his answer.
> and is there some way to read bam files partly?
I think Martin just answered this question. Give it a try and let us
know if you have problems by including the code you tried, any errors,
and the output of sessionInfo().
Sean