On Fri, Jan 13, 2017 at 03:16:59PM -0800, Irena Fischer-Hwang wrote:
> Hi, I'm trying to index a huge BAM file (~180 GB) in anticipation of
> converting it to SAM. I tried running
> 
> >> samtools index file.bam
> 
> but it got killed, most likely because my computer ran out of RAM.

It's very unlikely it ran out of RAM as index uses a fixed amount of
memory regardless of file size.  It's most likely something else, such
as too much cpu time or going over quota and dieing on a failed
write.

I assume by the nature of your question that you're only converting
portions of this file to SAM, otherwise there is no reason for the
index anyway.  However have you considering doing this on the fly?
This does still need a BAM index though.

Eg  samtools view -h file.bam X:10000000-11000000 | program

Or use a named pipe if it HAS to take a filename (but doesn't do
any seeking).  Decoding BAM is pretty quick and quite possibly it's
faster to decode than to read a 3-4x larger file instead.  You won't
be able to do indexing on the SAM file; well, possibly you can via
tabix, but I'm not sure many tools would support that.

James

-- 
James Bonfield (j...@sanger.ac.uk) | Hora aderat briligi. Nunc et Slythia Tova
                                  | Plurima gyrabant gymbolitare vabo;
  A Staden Package developer:     | Et Borogovorum mimzebant undique formae,
https://sf.net/projects/staden/   | Momiferique omnes exgrabure Rathi. 


-- 
 The Wellcome Trust Sanger Institute is operated by Genome Research 
 Limited, a charity registered in England with number 1021457 and a 
 company registered in England with number 2742969, whose registered 
 office is 215 Euston Road, London, NW1 2BE. 

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Samtools-help mailing list
Samtools-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/samtools-help

Reply via email to