use of com.hartwig.pipeline.execution.vm.BashCommand in project pipeline5 by hartwigmedical.
the class SageRerunOld method cramToBam.
static List<BashCommand> cramToBam(String cram) {
final String output = cram.replace("cram", "bam");
final BashCommand toBam = new VersionedToolCommand("samtools", "samtools", Versions.SAMTOOLS, "view", "-o", output, "-O", "bam", "-@", Bash.allCpus(), cram);
final BashCommand index = new VersionedToolCommand("samtools", "samtools", Versions.SAMTOOLS, "index", "-@", Bash.allCpus(), output);
return Lists.newArrayList(toBam, index);
}
use of com.hartwig.pipeline.execution.vm.BashCommand in project pipeline5 by hartwigmedical.
the class Amber method formCommand.
private List<BashCommand> formCommand(final List<String> arguments) {
List<BashCommand> commands = Lists.newArrayList();
commands.add(new JavaJarCommand("amber", Versions.AMBER, "amber.jar", "32G", arguments));
return commands;
}
use of com.hartwig.pipeline.execution.vm.BashCommand in project pipeline5 by hartwigmedical.
the class Cobalt method formCommand.
private List<BashCommand> formCommand(final List<String> arguments) {
List<BashCommand> commands = Lists.newArrayList();
commands.add(new JavaJarCommand("cobalt", Versions.COBALT, "cobalt.jar", "8G", arguments));
return commands;
}
use of com.hartwig.pipeline.execution.vm.BashCommand in project pipeline5 by hartwigmedical.
the class StageRunner method run.
public <T extends StageOutput> T run(final M metadata, final Stage<T, M> stage) {
final List<BashCommand> commands = commands(mode, metadata, stage);
if (stage.shouldRun(arguments) && !commands.isEmpty()) {
if (!startingPoint.usePersisted(stage.namespace())) {
StageTrace trace = new StageTrace(stage.namespace(), metadata.name(), StageTrace.ExecutorType.COMPUTE_ENGINE);
RuntimeBucket bucket = RuntimeBucket.from(storage, stage.namespace(), metadata, arguments, labels);
BashStartupScript bash = BashStartupScript.of(bucket.name());
bash.addCommands(stage.inputs()).addCommands(OverrideReferenceGenomeCommand.overrides(arguments)).addCommands(commands).addCommand(new OutputUpload(GoogleStorageLocation.of(bucket.name(), resultsDirectory.path()), RuntimeFiles.typical()));
PipelineStatus status = Failsafe.with(DefaultBackoffPolicy.of(String.format("[%s] stage [%s]", metadata.name(), stage.namespace()))).get(() -> computeEngine.submit(bucket, stage.vmDefinition(bash, resultsDirectory)));
trace.stop();
return stage.output(metadata, status, bucket, resultsDirectory);
}
return stage.persistedOutput(metadata);
}
return stage.skippedOutput(metadata);
}
use of com.hartwig.pipeline.execution.vm.BashCommand in project pipeline5 by hartwigmedical.
the class SelectVariants method bash.
@Override
public List<BashCommand> bash(final OutputFile input, final OutputFile output) {
List<String> arguments = selectTypes.stream().flatMap(type -> Stream.of("-selectType", type)).collect(Collectors.toList());
arguments.add("-R");
arguments.add(referenceFasta);
arguments.add("-V");
arguments.add(input.path());
arguments.add("-o");
arguments.add(output.path());
return Collections.singletonList(new GatkCommand(GermlineCaller.TOOL_HEAP, "SelectVariants", arguments.toArray(new String[0])));
}
Aggregations