Search in sources :

Example 1 with PurpleCommandBuilder

use of com.hartwig.pipeline.tertiary.purple.PurpleCommandBuilder in project pipeline5 by hartwigmedical.

the class PurpleRerun method bashCommands.

public List<BashCommand> bashCommands(RemoteLocations locations) {
    final LocalLocations batchInput = new LocalLocations(locations);
    final List<BashCommand> commands = Lists.newArrayList();
    final ResourceFiles resourceFiles = ResourceFilesFactory.buildResourceFiles(RefGenomeVersion.V37);
    final String tumorSampleName = batchInput.getTumor();
    final String referenceSampleName = batchInput.getReference();
    final String amberLocation = batchInput.getAmber();
    final String cobaltLocation = batchInput.getCobalt();
    final String sageSomaticLocation = batchInput.getSomaticVariantsSage();
    final String sageGermlineLocation = batchInput.getGermlineVariantsSage();
    final String gripssLocation = batchInput.getStructuralVariantsGripss();
    final String gripssRecoveryLocation = batchInput.getStructuralVariantsGripssRecovery();
    commands.addAll(batchInput.generateDownloadCommands());
    PurpleCommandBuilder builder = new PurpleCommandBuilder(resourceFiles, amberLocation, cobaltLocation, tumorSampleName, gripssLocation, gripssRecoveryLocation, sageSomaticLocation).addGermline(sageGermlineLocation);
    commands.add(builder.build());
    return commands;
}
Also used : ResourceFiles(com.hartwig.pipeline.resource.ResourceFiles) LocalLocations(com.hartwig.batch.api.LocalLocations) BashCommand(com.hartwig.pipeline.execution.vm.BashCommand) PurpleCommandBuilder(com.hartwig.pipeline.tertiary.purple.PurpleCommandBuilder)

Example 2 with PurpleCommandBuilder

use of com.hartwig.pipeline.tertiary.purple.PurpleCommandBuilder 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;
}
Also used : ResourceFiles(com.hartwig.pipeline.resource.ResourceFiles) BashCommand(com.hartwig.pipeline.execution.vm.BashCommand) InputDownload(com.hartwig.pipeline.execution.vm.InputDownload) ImmutableGoogleStorageLocation(com.hartwig.pipeline.storage.ImmutableGoogleStorageLocation) GoogleStorageLocation(com.hartwig.pipeline.storage.GoogleStorageLocation) PurpleCommandBuilder(com.hartwig.pipeline.tertiary.purple.PurpleCommandBuilder)

Aggregations

BashCommand (com.hartwig.pipeline.execution.vm.BashCommand)2 ResourceFiles (com.hartwig.pipeline.resource.ResourceFiles)2 PurpleCommandBuilder (com.hartwig.pipeline.tertiary.purple.PurpleCommandBuilder)2 LocalLocations (com.hartwig.batch.api.LocalLocations)1 InputDownload (com.hartwig.pipeline.execution.vm.InputDownload)1 GoogleStorageLocation (com.hartwig.pipeline.storage.GoogleStorageLocation)1 ImmutableGoogleStorageLocation (com.hartwig.pipeline.storage.ImmutableGoogleStorageLocation)1