Skip to content

Commit ff9b213

Browse files
committed
bugfix for local copying of GenomicsDB workspaces
1 parent d66251d commit ff9b213

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

SequenceAnalysis/src/org/labkey/sequenceanalysis/analysis/GenotypeGVCFHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ public static void doCopyGvcfLocally(List<SequenceOutputFile> inputFiles, JobCon
476476
List<File> inputVCFs = new ArrayList<>();
477477
inputFiles.forEach(f -> inputVCFs.add(f.getFile()));
478478

479-
ctx.getLogger().info("making local copies of gVCFs");
479+
ctx.getLogger().info("making local copies of gVCFs/GenomicsDB");
480480
GenotypeGVCFsWrapper.copyVcfsLocally(ctx, inputVCFs, new ArrayList<>(), false);
481481
}
482482

SequenceAnalysis/src/org/labkey/sequenceanalysis/run/util/GenotypeGVCFsWrapper.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,25 @@ else if (inputFile.isDirectory())
8686

8787
public static FileType GVCF = new FileType(Arrays.asList(".g.vcf", ".gvcf"), ".g.vcf", FileType.gzSupportLevel.SUPPORT_GZ);
8888

89+
private static File convertInput(File f)
90+
{
91+
return AbstractGenomicsDBImportHandler.TILE_DB_FILETYPE.isType(f) ? f.getParentFile() : f;
92+
}
93+
8994
public static List<File> copyVcfsLocally(SequenceOutputHandler.JobContext ctx, Collection<File> inputGVCFs, Collection<File> toDelete, boolean isResume) throws PipelineJobException
9095
{
9196
try
9297
{
9398
//Note: because we cannot be certain names are unique, inspect:
9499
HashMap<File, String> inputToDest = new LinkedHashMap<>();
95-
Set<String> uniqueDistNames = new CaseInsensitiveHashSet();
100+
Set<String> uniqueDestNames = new CaseInsensitiveHashSet();
96101

97102
inputGVCFs.forEach(x -> {
103+
x = convertInput(x);
98104
String fn = x.getName();
99105

100106
int i = 1;
101-
while (uniqueDistNames.contains(fn))
107+
while (uniqueDestNames.contains(fn))
102108
{
103109
String basename = SequenceAnalysisService.get().getUnzippedBaseName(x.getName());
104110
String ext = x.getName().replaceAll(SequenceAnalysisService.get().getUnzippedBaseName(x.getName()), "");
@@ -112,7 +118,7 @@ public static List<File> copyVcfsLocally(SequenceOutputHandler.JobContext ctx, C
112118
ctx.getLogger().info("Renaming cached file from: " + x.getName() + " to " + fn);
113119
}
114120

115-
uniqueDistNames.add(fn);
121+
uniqueDestNames.add(fn);
116122
inputToDest.put(x, fn);
117123
});
118124

@@ -138,6 +144,7 @@ public static List<File> copyVcfsLocally(SequenceOutputHandler.JobContext ctx, C
138144
List<File> vcfsToProcess = new ArrayList<>();
139145
for (File f : inputGVCFs)
140146
{
147+
f = convertInput(f);
141148
File destFile = new File(inputToDest.get(f));
142149

143150
File origIdx = null;

0 commit comments

Comments
 (0)