use of com.hartwig.batch.api.LocalLocations 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");
}
use of com.hartwig.batch.api.LocalLocations in project pipeline5 by hartwigmedical.
the class GripssGermline method execute.
@Override
public VirtualMachineJobDefinition execute(final InputBundle inputs, final RuntimeBucket runtimeBucket, final BashStartupScript startupScript, final RuntimeFiles executionFlags) {
InputFileDescriptor descriptor = inputs.get();
final String sampleId = descriptor.inputValue();
final ResourceFiles resourceFiles = ResourceFilesFactory.buildResourceFiles(RefGenomeVersion.V37);
final LocalLocations inputFileFactory = new LocalLocations(new RemoteLocationsApi(descriptor.billedProject(), sampleId));
final String referenceId = inputFileFactory.getReference();
final String inputVcf = inputFileFactory.getStructuralVariantsGridss();
startupScript.addCommand(() -> format("gsutil -u hmf-crunch cp %s/%s/%s %s", BATCH_TOOLS_BUCKET, GRIPSS_DIR, GRIPSS_JAR, VmDirectories.TOOLS));
startupScript.addCommands(inputFileFactory.generateDownloadCommands());
// run GRIPSS
final String outputVcf1 = String.format("%s/%s.gripss.vcf.gz", VmDirectories.OUTPUT, referenceId);
final StringJoiner gripssArgs = new StringJoiner(" ");
gripssArgs.add(String.format("-tumor %s", referenceId));
gripssArgs.add(String.format("-ref_genome %s", resourceFiles.refGenomeFile()));
gripssArgs.add(String.format("-breakpoint_hotspot %s", resourceFiles.knownFusionPairBedpe()));
gripssArgs.add(String.format("-breakend_pon %s", resourceFiles.gridssBreakendPon()));
gripssArgs.add(String.format("-breakpoint_pon %s", resourceFiles.gridssBreakpointPon()));
gripssArgs.add(String.format("-pon_distance %d", 4));
gripssArgs.add(String.format("-min_qual_break_end %d", 400));
gripssArgs.add(String.format("-min_qual_rescue_mobile_element_insertion %d", 400));
gripssArgs.add(String.format("-min_qual_break_point %d", 250));
gripssArgs.add(String.format("-input_vcf %s", inputVcf));
gripssArgs.add(String.format("-output_vcf %s", outputVcf1));
startupScript.addCommand(() -> format("java -Xmx%s -cp %s/%s com.hartwig.hmftools.gripsskt.GripssApplicationKt %s", MAX_HEAP, VmDirectories.TOOLS, GRIPSS_JAR, gripssArgs.toString()));
final String outputVcf2 = String.format("%s/%s.gripss.filtered.vcf.gz", VmDirectories.OUTPUT, referenceId);
final StringJoiner gripss2Args = new StringJoiner(" ");
gripss2Args.add(String.format("-input_vcf %s", outputVcf1));
gripss2Args.add(String.format("-output_vcf %s", outputVcf2));
startupScript.addCommand(() -> format("java -Xmx%s -cp %s/%s com.hartwig.hmftools.gripsskt.GripssHardFilterApplicationKt %s", MAX_HEAP, VmDirectories.TOOLS, GRIPSS_JAR, gripss2Args.toString()));
// upload output
startupScript.addCommand(new OutputUpload(GoogleStorageLocation.of(runtimeBucket.name(), "gripss"), executionFlags));
return ImmutableVirtualMachineJobDefinition.builder().name("gripss").startupCommand(startupScript).performanceProfile(custom(8, 30)).namespacedResults(ResultsDirectory.defaultDirectory()).build();
}
Aggregations