if (!Globals.isHeadless()) {
String introText = "An index file for " + samFile.getAbsolutePath() + " could not " +
"be located. An index is required to view SAM files in IGV. " +
"Click \"Go\" to create one now.";
IndexCreatorDialog dialog = IndexCreatorDialog.createShowDialog(IGV.getMainFrame(), samFile, newIdxFile, introText);
return (FeatureIndex) dialog.getIndex();
} else {
AlignmentIndexer indexer = AlignmentIndexer.getInstance(samFile, null, null);
FeatureIndex index = null;
try {
log.info("Creating index " + newIdxFile.getAbsolutePath());