forked from BimberLab/DiscvrLabKeyModules
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGatherVcfsCloudWrapper.java
More file actions
54 lines (45 loc) · 1.45 KB
/
GatherVcfsCloudWrapper.java
File metadata and controls
54 lines (45 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package org.labkey.sequenceanalysis.run.variant;
import org.apache.logging.log4j.Logger;
import org.labkey.api.pipeline.PipelineJobException;
import org.labkey.api.sequenceanalysis.SequenceAnalysisService;
import org.labkey.api.sequenceanalysis.run.AbstractGatk4Wrapper;
import org.labkey.api.writer.PrintWriters;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
public class GatherVcfsCloudWrapper extends AbstractGatk4Wrapper
{
public GatherVcfsCloudWrapper(Logger log)
{
super(log);
}
public void gatherVcfs(File output, List<File> inputVcfs) throws PipelineJobException
{
List<String> args = new ArrayList<>(getBaseArgs("GatherVcfsCloud"));
args.add("-O");
args.add(output.getPath());
File argFile = new File(output.getParentFile(), "inputs.list");
try (PrintWriter writer = PrintWriters.getPrintWriter(argFile))
{
inputVcfs.forEach(f -> writer.println(f.getPath()));
}
catch (IOException e)
{
throw new PipelineJobException(e);
}
args.add("-I");
args.add(argFile.getPath());
execute(args);
argFile.delete();
try
{
SequenceAnalysisService.get().ensureVcfIndex(output, getLogger());
}
catch (IOException e)
{
throw new PipelineJobException(e);
}
}
}