use of com.hartwig.pipeline.execution.vm.BashCommand in project pipeline5 by hartwigmedical.
the class SageCommandBuilder method build.
public List<BashCommand> build(final String outputVcf) {
List<BashCommand> result = Lists.newArrayList();
if (shallowSomaticMode && !somaticMode) {
throw new IllegalStateException("Shallow somatic mode enabled while not in shallow mode");
}
if (tumorBam.isEmpty() && referenceBam.isEmpty()) {
throw new IllegalStateException("Must be at least one tumor or reference");
}
final List<String> arguments = Lists.newArrayList();
final String tumorBamFiles = tumor.length() > 0 ? String.join(",", tumorBam) : "";
final String referenceBamFiles = reference.length() > 0 ? String.join(",", referenceBam) : "";
if (somaticMode) {
arguments.add(String.format("-tumor %s", tumor.toString()));
arguments.add(String.format("-tumor_bam %s", tumorBamFiles));
if (reference.length() > 0) {
arguments.add(String.format("-reference %s", reference.toString()));
arguments.add(String.format("-reference_bam %s", referenceBamFiles));
}
arguments.add(String.format("-hotspots %s", resourceFiles.sageSomaticHotspots()));
arguments.add(String.format("-panel_bed %s", resourceFiles.sageSomaticCodingPanel()));
if (shallowSomaticMode) {
arguments.add("-hotspot_min_tumor_qual 40");
}
} else if (germlineMode) {
arguments.add(String.format("-tumor %s", reference.toString()));
arguments.add(String.format("-tumor_bam %s", referenceBamFiles));
if (tumor.length() > 0) {
arguments.add(String.format("-reference %s", tumor.toString()));
arguments.add(String.format("-reference_bam %s", tumorBamFiles));
}
arguments.add(String.format("-hotspots %s", resourceFiles.sageGermlineHotspots()));
arguments.add(String.format("-panel_bed %s", resourceFiles.sageGermlineCodingPanel()));
arguments.add("-hotspot_min_tumor_qual 50");
arguments.add("-panel_min_tumor_qual 75");
arguments.add("-hotspot_max_germline_vaf 100");
arguments.add("-hotspot_max_germline_rel_raw_base_qual 100");
arguments.add("-panel_max_germline_vaf 100");
arguments.add("-panel_max_germline_rel_raw_base_qual 100");
arguments.add("-mnv_filter_enabled false");
arguments.add("-panel_only");
}
if (coverage) {
if (germlineMode) {
arguments.add(String.format("-coverage_bed %s", resourceFiles.sageGermlineCoveragePanel()));
} else {
arguments.add(String.format("-coverage_bed %s", resourceFiles.sageSomaticCodingPanel()));
}
}
if (targetRegions) {
arguments.add("-hotspot_min_tumor_qual 100");
arguments.add("-panel_min_tumor_qual 200");
arguments.add("-high_confidence_min_tumor_qual 200");
arguments.add("-low_confidence_min_tumor_qual 300");
}
arguments.add(String.format("-high_confidence_bed %s", resourceFiles.giabHighConfidenceBed()));
arguments.add(String.format("-ref_genome %s", resourceFiles.refGenomeFile()));
arguments.add(String.format("-ref_genome_version %s", resourceFiles.version().toString()));
arguments.add(String.format("-ensembl_data_dir %s", resourceFiles.ensemblDataCache()));
arguments.add("-write_bqr_data");
arguments.add("-write_bqr_plot");
arguments.add(String.format("-out %s", outputVcf));
arguments.add(String.format("-threads %s", Bash.allCpus()));
result.add(new JavaJarCommand("sage", Versions.SAGE, "sage.jar", wgsMaxHeap, arguments));
return result;
}
use of com.hartwig.pipeline.execution.vm.BashCommand in project pipeline5 by hartwigmedical.
the class Gridss method gridssCommands.
private List<BashCommand> gridssCommands(final Driver driver, final String sampleName) {
SubStageInputOutput unfilteredVcfOutput = driver.andThen(new RepeatMasker()).andThen(new GridssAnnotation(resourceFiles, false)).apply(SubStageInputOutput.empty(sampleName));
unfilteredVcf = unfilteredVcfOutput.outputFile().path();
List<BashCommand> commands = new ArrayList<>();
commands.add(new ExportPathCommand(new BwaCommand()));
commands.add(new ExportPathCommand(new SamtoolsCommand()));
commands.addAll(unfilteredVcfOutput.bash());
return commands;
}
use of com.hartwig.pipeline.execution.vm.BashCommand in project pipeline5 by hartwigmedical.
the class ExportPathCommandTest method shouldTakePathOfCommand.
@Test
public void shouldTakePathOfCommand() {
BashCommand command = new ExportPathCommand(new BwaCommand());
assertThat(command.asBash()).isEqualTo("export PATH=\"${PATH}:/opt/tools/bwa/0.7.17\"");
}
use of com.hartwig.pipeline.execution.vm.BashCommand in project pipeline5 by hartwigmedical.
the class Gripss method formCommand.
protected List<BashCommand> formCommand(final List<String> arguments) {
List<BashCommand> commands = Lists.newArrayList();
commands.add(new JavaJarCommand("gripss", Versions.GRIPSS, "gripss.jar", "16G", arguments));
return commands;
}
use of com.hartwig.pipeline.execution.vm.BashCommand in project pipeline5 by hartwigmedical.
the class SageGermlinePostProcess 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(sampleName.sampleName(), SAGE_GERMLINE_FILTERED, FileTypes.GZIPPED_VCF);
result.addAll(passFilter.bash(input, finalOutputFile));
return result;
}
Aggregations