Search in sources :

Example 6 with InputDownload

use of com.hartwig.pipeline.execution.vm.InputDownload 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

InputDownload (com.hartwig.pipeline.execution.vm.InputDownload)6 GoogleStorageLocation (com.hartwig.pipeline.storage.GoogleStorageLocation)5 ResourceFiles (com.hartwig.pipeline.resource.ResourceFiles)4 OutputUpload (com.hartwig.pipeline.execution.vm.OutputUpload)3 RemoteLocationsApi (com.hartwig.batch.api.RemoteLocationsApi)2 InputFileDescriptor (com.hartwig.batch.input.InputFileDescriptor)2 SubStageInputOutput (com.hartwig.pipeline.stages.SubStageInputOutput)2 Storage (com.google.cloud.storage.Storage)1 Lane (com.hartwig.patient.Lane)1 Sample (com.hartwig.patient.Sample)1 Arguments (com.hartwig.pipeline.Arguments)1 ResultsDirectory (com.hartwig.pipeline.ResultsDirectory)1 Aligner (com.hartwig.pipeline.alignment.Aligner)1 AlignmentOutput (com.hartwig.pipeline.alignment.AlignmentOutput)1 ImmutableAlignmentOutput (com.hartwig.pipeline.alignment.ImmutableAlignmentOutput)1 SampleSource (com.hartwig.pipeline.alignment.sample.SampleSource)1 BwaCommand (com.hartwig.pipeline.calling.command.BwaCommand)1 SamtoolsCommand (com.hartwig.pipeline.calling.command.SamtoolsCommand)1 Driver (com.hartwig.pipeline.calling.structural.gridss.stage.Driver)1 GridssAnnotation (com.hartwig.pipeline.calling.structural.gridss.stage.GridssAnnotation)1