Skip to content

Commit c702ea2

Browse files
committed
Additional support for VCF indexing
1 parent a5a2621 commit c702ea2

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ public static JBrowseSession getGenericGenomeSession(int genomeId)
406406

407407
public JsonFile getTrack(User u, String trackGUID)
408408
{
409-
for (JsonFile jf : getGenomeTracks(u, false))
409+
for (JsonFile jf : getJsonFiles(u, false))
410410
{
411411
if (trackGUID.equalsIgnoreCase(jf.getObjectId()))
412412
{

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

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -929,12 +929,32 @@ public File prepareResource(Logger log, boolean throwIfNotPrepared, boolean forc
929929
}
930930
}
931931

932-
prepareLuceneIndex(log);
932+
if (forceReprocess || !doesLuceneIndexExist())
933+
{
934+
prepareLuceneIndex(log);
935+
}
936+
else
937+
{
938+
log.debug("Existing lucene index found, will not re-create: " + luceneDir.getPath());
939+
}
933940
}
934941

935942
return targetFile;
936943
}
937944

945+
private boolean doesLuceneIndexExist()
946+
{
947+
File luceneDir = getExpectedLocationOfLuceneIndex(false);
948+
if (luceneDir == null)
949+
{
950+
return false;
951+
}
952+
953+
// NOTE: is this the best file to test?
954+
luceneDir = new File(luceneDir, "write.lock");
955+
return luceneDir.exists();
956+
}
957+
938958
private void prepareLuceneIndex(Logger log) throws PipelineJobException
939959
{
940960
log.debug("Generating VCF full text index for file: " + getExpData().getFile().getName());

0 commit comments

Comments
 (0)