bam or sam for counting
2
0
Entering edit mode
wang peter ★ 2.0k
@wang-peter-4647
Last seen 10.3 years ago
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]]
• 1.1k views
ADD COMMENT
0
Entering edit mode
@martin-morgan-1513
Last seen 5 months ago
United States
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
ADD COMMENT
0
Entering edit mode
@sean-davis-490
Last seen 4 months ago
United States
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
ADD COMMENT

Login before adding your answer.

Traffic: 516 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6