Search in sources :

Example 16 with BashCommand

use of com.hartwig.pipeline.execution.vm.BashCommand in project pipeline5 by hartwigmedical.

the class SageSomaticPostProcess method bash.

@Override
public List<BashCommand> bash(final OutputFile input, final OutputFile output) {
    final List<BashCommand> result = Lists.newArrayList();
    SubStage passFilter = new PassFilter();
    OutputFile finalOutputFile = OutputFile.of(tumorSampleName.sampleName(), SAGE_SOMATIC_FILTERED, FileTypes.GZIPPED_VCF);
    result.addAll(passFilter.bash(input, finalOutputFile));
    return result;
}
Also used : OutputFile(com.hartwig.pipeline.execution.vm.OutputFile) SubStage(com.hartwig.pipeline.stages.SubStage) BashCommand(com.hartwig.pipeline.execution.vm.BashCommand)

Example 17 with BashCommand

use of com.hartwig.pipeline.execution.vm.BashCommand in project pipeline5 by hartwigmedical.

the class BcfToolsCommandListBuilder method bcfCommand.

@VisibleForTesting
BashCommand bcfCommand() {
    if (currentArguments == null) {
        throw new IllegalStateException("No bcftools command added.");
    }
    final List<BashCommand> finalCommands = Lists.newArrayList(pipedCommands);
    final BashCommand finalCommand = new BcfToolsCommand(currentArguments, "-O", "z", "-o", outputVcf);
    finalCommands.add(finalCommand);
    return new PipeCommands(finalCommands.toArray(new BashCommand[0]));
}
Also used : PipeCommands(com.hartwig.pipeline.execution.vm.unix.PipeCommands) BashCommand(com.hartwig.pipeline.execution.vm.BashCommand) VisibleForTesting(com.google.common.annotations.VisibleForTesting)

Example 18 with BashCommand

use of com.hartwig.pipeline.execution.vm.BashCommand in project pipeline5 by hartwigmedical.

the class GermlineCaller method germlineCallerCommands.

public List<BashCommand> germlineCallerCommands(final SingleSampleRunMetadata metadata) {
    String referenceFasta = resourceFiles.refGenomeFile();
    SubStageInputOutput callerOutput = new GatkGermlineCaller(bamDownload.getLocalTargetPath(), referenceFasta).andThen(new GenotypeGVCFs(referenceFasta)).apply(SubStageInputOutput.empty(metadata.sampleName()));
    SubStageInputOutput snpFilterOutput = new SelectVariants("snp", Lists.newArrayList("SNP", "NO_VARIATION"), referenceFasta).andThen(new VariantFiltration("snp", SNP_FILTER_EXPRESSION, referenceFasta)).apply(callerOutput);
    SubStageInputOutput indelFilterOutput = new SelectVariants("indels", Lists.newArrayList("INDEL", "MIXED"), referenceFasta).andThen(new VariantFiltration("indels", INDEL_FILTER_EXPRESSION, referenceFasta)).apply(SubStageInputOutput.of(metadata.sampleName(), callerOutput.outputFile(), Collections.emptyList()));
    SubStageInputOutput combinedFilters = snpFilterOutput.combine(indelFilterOutput);
    SubStageInputOutput finalOutput = new CombineFilteredVariants(indelFilterOutput.outputFile().path(), referenceFasta).andThen(new GermlineZipIndex()).apply(combinedFilters);
    return ImmutableList.<BashCommand>builder().addAll(finalOutput.bash()).add(new MvCommand(finalOutput.outputFile().path(), outputFile.path())).add(new MvCommand(finalOutput.outputFile().path() + ".tbi", outputFile.path() + ".tbi")).build();
}
Also used : BashCommand(com.hartwig.pipeline.execution.vm.BashCommand) SubStageInputOutput(com.hartwig.pipeline.stages.SubStageInputOutput) MvCommand(com.hartwig.pipeline.execution.vm.unix.MvCommand)

Example 19 with BashCommand

use of com.hartwig.pipeline.execution.vm.BashCommand in project pipeline5 by hartwigmedical.

the class LocalLocationsTest method testDownloadTumorAlignmentIndex.

@Test
public void testDownloadTumorAlignmentIndex() {
    LocalLocations local = new LocalLocations(remoteLocations);
    String alignment = local.getTumorAlignment();
    List<BashCommand> commands = local.generateDownloadCommands();
    assertEquals(commands.get(0).asBash(), PREFIX + "gs://alignment/171006_COLO829/COLO929v003T.cram /data/input/COLO929v003T.cram");
    assertEquals(commands.get(1).asBash(), PREFIX + "gs://alignment/171006_COLO829/COLO929v003T.crai /data/input/COLO929v003T.crai");
}
Also used : LocalLocations(com.hartwig.batch.api.LocalLocations) BashCommand(com.hartwig.pipeline.execution.vm.BashCommand) Test(org.junit.Test)

Example 20 with BashCommand

use of com.hartwig.pipeline.execution.vm.BashCommand in project pipeline5 by hartwigmedical.

the class LocalLocationsTest method testDownloadReferenceAlignmentIndex.

@Test
public void testDownloadReferenceAlignmentIndex() {
    LocalLocations local = new LocalLocations(remoteLocations);
    String alignment = local.getReferenceAlignment();
    List<BashCommand> commands = local.generateDownloadCommands();
    assertEquals(commands.get(0).asBash(), PREFIX + "gs://alignment/171006_COLO829/COLO929v003R.cram /data/input/COLO929v003R.cram");
    assertEquals(commands.get(1).asBash(), PREFIX + "gs://alignment/171006_COLO829/COLO929v003R.crai /data/input/COLO929v003R.crai");
}
Also used : LocalLocations(com.hartwig.batch.api.LocalLocations) BashCommand(com.hartwig.pipeline.execution.vm.BashCommand) Test(org.junit.Test)

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