Skip to content

Commit 6896cc0

Browse files
committed
Cleanup getters on RefNtSequenceModel so InputStream not opened by Table.update()
1 parent b39cdfa commit 6896cc0

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

SequenceAnalysis/api-src/org/labkey/api/sequenceanalysis/RefNtSequenceModel.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.labkey.api.data.Table;
2727
import org.labkey.api.data.TableInfo;
2828
import org.labkey.api.data.TableSelector;
29+
import org.labkey.api.data.Transient;
2930
import org.labkey.api.exp.api.DataType;
3031
import org.labkey.api.exp.api.ExpData;
3132
import org.labkey.api.exp.api.ExperimentService;
@@ -116,8 +117,8 @@ public void setName(String name)
116117
_name = name;
117118
}
118119

119-
public @Nullable
120-
InputStream getSequenceInputStream() throws IOException
120+
@Nullable @Transient
121+
public InputStream getSequenceInputStream() throws IOException
121122
{
122123
if (_sequenceFile != null)
123124
{
@@ -150,6 +151,7 @@ public String getLegacySequence()
150151
return _sequence;
151152
}
152153

154+
@Transient
153155
public String getSequence()
154156
{
155157
//resolve from cached file
@@ -388,6 +390,7 @@ public void setDisabledby(String disabledby)
388390
_disabledby = disabledby;
389391
}
390392

393+
@Transient
391394
public byte[] getSequenceBases()
392395
{
393396
if (_sequenceBytes == null)

SequenceAnalysis/src/org/labkey/sequenceanalysis/SequenceIntegrationTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -690,12 +690,12 @@ protected static void doCleanup(String projectName)
690690
Container project = ContainerManager.getForPath(projectName);
691691
if (project != null)
692692
{
693-
File _pipelineRoot = PipelineService.get().getPipelineRootSetting(project).getRootPath();
693+
File pipelineRoot = PipelineService.get().getPipelineRootSetting(project).getRootPath();
694694
try
695695
{
696-
if (_pipelineRoot.exists())
696+
if (pipelineRoot.exists())
697697
{
698-
File[] contents = _pipelineRoot.listFiles();
698+
File[] contents = pipelineRoot.listFiles();
699699
for (File f : contents)
700700
{
701701
if (f.exists())

SequenceAnalysis/src/org/labkey/sequenceanalysis/pipeline/ProcessVariantsHandler.java

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -402,22 +402,16 @@ public static File processVCF(File input, Integer libraryId, JobContext ctx, Res
402402
action.addInput(vcfIdx, "Input VCF Index");
403403
}
404404

405-
if (!currentVCF.equals(input))
405+
if (!URIUtil.isDescendant(ctx.getOutputDir().toURI(), currentVCF.toURI()))
406406
{
407-
if (!URIUtil.isDescendant(ctx.getOutputDir().toURI(), currentVCF.toURI()))
408-
{
409-
ctx.getLogger().info("VCF is not a descendent of the output directory, will not add as intermediate file: " + currentVCF.getPath());
410-
}
411-
else
412-
{
413-
resumer.getFileManager().addIntermediateFile(currentVCF);
414-
resumer.getFileManager().addIntermediateFile(vcfIdx);
415-
}
407+
ctx.getLogger().info("VCF is not a descendent of the output directory, will not add as intermediate file: " + currentVCF.getPath());
416408
}
417409
else
418410
{
419-
ctx.getLogger().info("ending VCF same as input, will not add as intermediate file: " + input.getPath());
411+
resumer.getFileManager().addIntermediateFile(currentVCF);
412+
resumer.getFileManager().addIntermediateFile(vcfIdx);
420413
}
414+
421415
ReferenceGenome genome = ctx.getSequenceSupport().getCachedGenome(libraryId);
422416
action.addInput(genome.getSourceFastaFile(), "Reference FASTA");
423417

0 commit comments

Comments
 (0)