vadimzalunin/crammer — Issue #9: ViewSam2 is not using index
Author: vadimzalunin
Created: 2012-01-20 11:23:36+00:00
State: open

Suggested fix:

in the class net.sf.picard.sam.ViewSam2

replace:
final SAMFileReader in = new SAMFileReader(INPUT);

with:
File index = new File(INPUT + ".bai");
if (!index.exists())
index = new File(INPUT + ".crai");
if (!index.exists()) index = null ;

final SAMFileReader in = new SAMFileReader(INPUT, index);