use of com.hartwig.pipeline.execution.vm.BashCommand in project pipeline5 by hartwigmedical.
the class SageCreatePon method execute.
@Override
public VirtualMachineJobDefinition execute(final InputBundle inputs, final RuntimeBucket runtimeBucket, final BashStartupScript startupScript, final RuntimeFiles executionFlags) {
final String output = String.format("%s/SAGE.pon.vcf.gz", VmDirectories.OUTPUT);
final BashCommand sageCommand = new SageCommand("com.hartwig.hmftools.sage.pon.PonApplication", "100G", "-in", VmDirectories.INPUT, "-out", output, "-threads", Bash.allCpus());
// Download required resources
// startupScript.addCommand(() -> format("gsutil -u hmf-crunch cp %s %s",
// "gs://batch-sage-validation/resources/sage.jar",
// "/opt/tools/sage/" + Versions.SAGE + "/sage.jar"));
// Download germline VCFS (and indexes)
startupScript.addCommand(() -> format("gsutil -u hmf-crunch -m cp %s %s", "gs://batch-sage/*/sage/*.sage.somatic.vcf.gz", VmDirectories.INPUT));
startupScript.addCommand(() -> format("gsutil -u hmf-crunch -m cp %s %s", "gs://batch-sage/*/sage/*.sage.somatic.vcf.gz.tbi", VmDirectories.INPUT));
// Run Pon Generator
startupScript.addCommand(sageCommand);
// Store output
startupScript.addCommand(new OutputUpload(GoogleStorageLocation.of(runtimeBucket.name(), "sage"), executionFlags));
return VirtualMachineJobDefinition.sageSomaticCalling(startupScript, ResultsDirectory.defaultDirectory());
}
use of com.hartwig.pipeline.execution.vm.BashCommand in project pipeline5 by hartwigmedical.
the class PurpleGermline method bashCommands.
public List<BashCommand> bashCommands(final InputBundle inputs) {
final List<BashCommand> commands = Lists.newArrayList();
final ResourceFiles resourceFiles = ResourceFilesFactory.buildResourceFiles(RefGenomeVersion.V37);
final String set = inputs.get("set").inputValue();
final String tumorSampleName = inputs.get("tumor_sample").inputValue();
final String referenceSampleName = inputs.get("ref_sample").inputValue();
final GoogleStorageLocation sageVcfStorage = sageSomaticFilteredFile(set, tumorSampleName);
final GoogleStorageLocation sageIndexStorage = index(sageVcfStorage);
// gripssSomaticFilteredFile(set, tumorSampleName);
final GoogleStorageLocation gripssVcfStorage = null;
// index(gripssVcfStorage);
final GoogleStorageLocation gripssVcfIndexStorage = null;
// gripssRecoveryFile(set, tumorSampleName);
final GoogleStorageLocation gripssRecoveryVcfStorage = null;
final GoogleStorageLocation gripssRecoveryVcfIndexStorage = index(gripssRecoveryVcfStorage);
final String amberInputDir = VmDirectories.INPUT + "/amber";
final String cobaltInputDir = VmDirectories.INPUT + "/cobalt";
final InputDownload amberLocation = new InputDownload(amberArchiveDirectory(set), amberInputDir);
final InputDownload cobaltLocation = new InputDownload(cobaltArchiveDirectory(set), cobaltInputDir);
final InputDownload sageLocation = new InputDownload(sageVcfStorage);
final InputDownload sageLocationIndex = new InputDownload(sageIndexStorage);
final InputDownload gripssLocation = new InputDownload(gripssVcfStorage);
final InputDownload gripssLocationIndex = new InputDownload(gripssVcfIndexStorage);
final InputDownload gripssRecoveryLocation = new InputDownload(gripssRecoveryVcfStorage);
final InputDownload gripssRecoveryLocationIndex = new InputDownload(gripssRecoveryVcfIndexStorage);
final String germlineVcf = VmDirectories.INPUT + "/" + tumorSampleName + ".sage.germline.filtered.vcf.gz";
// gsutil ls gs://batch-sage-germline/*/sage/WIDE01010012T*germline.filtered.vcf.gz*
commands.add(() -> String.format("gsutil -m cp gs://batch-sage-germline/*/sage/%s*germline.filtered.vcf.gz* %s/", tumorSampleName, VmDirectories.INPUT));
commands.add(() -> "mkdir -p " + amberInputDir);
commands.add(() -> "mkdir -p " + cobaltInputDir);
// commands.add(downloadExperimentalVersion());
commands.add(amberLocation);
commands.add(cobaltLocation);
commands.add(sageLocation);
commands.add(sageLocationIndex);
commands.add(gripssLocation);
commands.add(gripssLocationIndex);
commands.add(gripssRecoveryLocation);
commands.add(gripssRecoveryLocationIndex);
BashCommand purpleCommand = new PurpleCommandBuilder(resourceFiles, amberLocation.getLocalTargetPath(), cobaltLocation.getLocalTargetPath(), tumorSampleName, gripssLocation.getLocalTargetPath(), gripssRecoveryLocation.getLocalTargetPath(), sageLocation.getLocalTargetPath()).addGermline(germlineVcf).build();
commands.add(purpleCommand);
return commands;
}
Aggregations