use of com.hartwig.pipeline.execution.vm.BashCommand in project pipeline5 by hartwigmedical.
the class GermlineCaller method commands.
@Override
public List<BashCommand> commands(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();
}
use of com.hartwig.pipeline.execution.vm.BashCommand 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;
}
use of com.hartwig.pipeline.execution.vm.BashCommand in project pipeline5 by hartwigmedical.
the class LocalLocationsTest method testSelectFileAfterDownload.
@Test(expected = IllegalStateException.class)
public void testSelectFileAfterDownload() {
LocalLocations local = new LocalLocations(remoteLocations);
List<BashCommand> commands = local.generateDownloadCommands();
String alignment = local.getTumorAlignment();
}
use of com.hartwig.pipeline.execution.vm.BashCommand in project pipeline5 by hartwigmedical.
the class PurpleRerunTest method testCommands.
@Test
public void testCommands() {
RemoteLocations locations = new RemoteLocationsTestImpl();
List<BashCommand> commands = victim.bashCommands(locations);
assertEquals(commands.get(0).asBash(), "mkdir -p /data/input/amber");
assertEquals(commands.get(1).asBash(), inputDownload("cp -r -n gs://amber/171006_COLO829/* /data/input/amber/"));
assertEquals(commands.get(2).asBash(), "mkdir -p /data/input/cobalt");
assertEquals(commands.get(3).asBash(), inputDownload("cp -r -n gs://cobalt/171006_COLO829/* /data/input/cobalt/"));
assertEquals(commands.get(4).asBash(), inputDownload("cp -r -n gs://sage/171006_COLO829/COLO929v003T.sage.somatic.vcf.gz /data/input/COLO929v003T.sage.somatic.vcf.gz"));
assertEquals(commands.get(5).asBash(), inputDownload("cp -r -n gs://sage/171006_COLO829/COLO929v003T.sage.germline.vcf.gz /data/input/COLO929v003T.sage.germline.vcf.gz"));
assertEquals(commands.get(6).asBash(), inputDownload("cp -r -n gs://gripss/171006_COLO829/COLO929v003T.gripss.somatic.filtered.vcf.gz /data/input/COLO929v003T.gripss.somatic.filtered.vcf.gz"));
assertEquals(commands.get(7).asBash(), inputDownload("cp -r -n gs://gripss/171006_COLO829/COLO929v003T.gripss.somatic.vcf.gz /data/input/COLO929v003T.gripss.somatic.vcf.gz"));
assertEquals(commands.get(8).asBash(), inputDownload("cp -r -n gs://gripss/171006_COLO829/COLO929v003T.gripss.somatic.vcf.gz.tbi /data/input/COLO929v003T.gripss.somatic.vcf.gz.tbi"));
assertEquals(commands.get(9).asBash().substring(0, 36), "java -Xmx12G -jar /opt/tools/purple/");
}
use of com.hartwig.pipeline.execution.vm.BashCommand in project pipeline5 by hartwigmedical.
the class SageCreatePonData method cramToBam.
private 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);
}
Aggregations