Automatically write BAM file indices for coordinate-sorted BAMs.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4209 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
hanna 2010-09-03 14:10:44 +00:00
parent 529eecd4dc
commit da11efa1a2
1 changed files with 4 additions and 0 deletions

View File

@ -50,6 +50,10 @@ public class SAMFileWriterStorage implements SAMFileWriter, Storage<SAMFileWrite
public SAMFileWriterStorage( SAMFileWriterStub stub, File file ) {
this.file = file;
SAMFileWriterFactory factory = new SAMFileWriterFactory();
// Enable automatic index creation for pre-sorted BAMs.
if (stub.getFileHeader().getSortOrder().equals(SAMFileHeader.SortOrder.coordinate))
factory.setCreateIndex(true);
// Adjust max records in RAM.
if(stub.getMaxRecordsInRam() != null)
factory.setMaxRecordsInRam(stub.getMaxRecordsInRam());