Skip to content

Commit db13d45

Browse files
committed
Do not automatically re-create VCF indexes when reprocessing JBrowse tracks
1 parent 040b043 commit db13d45

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

jbrowse/src/org/labkey/jbrowse/model/JsonFile.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.labkey.jbrowse.model;
22

3+
import htsjdk.samtools.util.FileExtensions;
34
import htsjdk.tribble.bed.BEDCodec;
45
import htsjdk.tribble.gff.Gff3Codec;
56
import htsjdk.tribble.index.Index;
@@ -1098,8 +1099,17 @@ else if (TRACK_TYPES.gff.getFileType().isType(finalLocation) || TRACK_TYPES.gtf.
10981099
SequenceAnalysisService.get().sortGxf(log, finalLocation, null);
10991100
}
11001101

1101-
TabixRunner tabix = new TabixRunner(log);
1102-
tabix.execute(finalLocation);
1102+
// If JBrowse is using an unaltered input file, trust that index:
1103+
File expectedIdx = new File(finalLocation.getPath() + FileExtensions.TABIX_INDEX);
1104+
if (expectedIdx.exists() && getExpData().getFile().equals(finalLocation))
1105+
{
1106+
log.debug("Existing index found, will not re-create: " + expectedIdx.getPath());
1107+
}
1108+
else
1109+
{
1110+
TabixRunner tabix = new TabixRunner(log);
1111+
tabix.execute(finalLocation);
1112+
}
11031113
}
11041114
}
11051115
}

0 commit comments

Comments
 (0)