Search in sources :

Example 6 with BashCommand

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);
}
Also used : BashCommand(com.hartwig.pipeline.execution.vm.BashCommand) VersionedToolCommand(com.hartwig.pipeline.calling.command.VersionedToolCommand)

Example 7 with BashCommand

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;
}
Also used : BashCommand(com.hartwig.pipeline.execution.vm.BashCommand) JavaJarCommand(com.hartwig.pipeline.execution.vm.java.JavaJarCommand)

Example 8 with BashCommand

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;
}
Also used : BashCommand(com.hartwig.pipeline.execution.vm.BashCommand) JavaJarCommand(com.hartwig.pipeline.execution.vm.java.JavaJarCommand)

Example 9 with BashCommand

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);
}
Also used : PipelineStatus(com.hartwig.pipeline.execution.PipelineStatus) StageTrace(com.hartwig.pipeline.trace.StageTrace) BashStartupScript(com.hartwig.pipeline.execution.vm.BashStartupScript) OutputUpload(com.hartwig.pipeline.execution.vm.OutputUpload) BashCommand(com.hartwig.pipeline.execution.vm.BashCommand) RuntimeBucket(com.hartwig.pipeline.storage.RuntimeBucket)

Example 10 with BashCommand

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])));
}
Also used : List(java.util.List) Stream(java.util.stream.Stream) SubStage(com.hartwig.pipeline.stages.SubStage) BashCommand(com.hartwig.pipeline.execution.vm.BashCommand) OutputFile(com.hartwig.pipeline.execution.vm.OutputFile) Collections(java.util.Collections) Collectors(java.util.stream.Collectors) FileTypes(com.hartwig.pipeline.datatypes.FileTypes) GatkCommand(com.hartwig.pipeline.execution.vm.GatkCommand) GatkCommand(com.hartwig.pipeline.execution.vm.GatkCommand)

Aggregations

BashCommand (com.hartwig.pipeline.execution.vm.BashCommand)22 Test (org.junit.Test)5 LocalLocations (com.hartwig.batch.api.LocalLocations)4 JavaJarCommand (com.hartwig.pipeline.execution.vm.java.JavaJarCommand)4 OutputFile (com.hartwig.pipeline.execution.vm.OutputFile)3 SubStage (com.hartwig.pipeline.stages.SubStage)3 SubStageInputOutput (com.hartwig.pipeline.stages.SubStageInputOutput)3 BwaCommand (com.hartwig.pipeline.calling.command.BwaCommand)2 VersionedToolCommand (com.hartwig.pipeline.calling.command.VersionedToolCommand)2 OutputUpload (com.hartwig.pipeline.execution.vm.OutputUpload)2 MvCommand (com.hartwig.pipeline.execution.vm.unix.MvCommand)2 ResourceFiles (com.hartwig.pipeline.resource.ResourceFiles)2 PurpleCommandBuilder (com.hartwig.pipeline.tertiary.purple.PurpleCommandBuilder)2 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 RemoteLocations (com.hartwig.batch.api.RemoteLocations)1 SamtoolsCommand (com.hartwig.pipeline.calling.command.SamtoolsCommand)1 SageCommand (com.hartwig.pipeline.calling.sage.SageCommand)1 GridssAnnotation (com.hartwig.pipeline.calling.structural.gridss.stage.GridssAnnotation)1 RepeatMasker (com.hartwig.pipeline.calling.structural.gridss.stage.RepeatMasker)1 FileTypes (com.hartwig.pipeline.datatypes.FileTypes)1