use of org.broadinstitute.hellbender.tools.spark.bwa.BwaSparkEngine in project gatk by broadinstitute.
the class PathSeqFilterSpark method doHostBWA.
private JavaRDD<GATKRead> doHostBWA(final JavaSparkContext ctx, final SAMFileHeader readsHeader, final JavaRDD<GATKRead> reads) {
final BwaSparkEngine engine = new BwaSparkEngine(ctx, indexImageFile, getHeaderForReads(), getReferenceSequenceDictionary());
// null if we have no api key
final GCSOptions gcsOptions = getAuthenticatedGCSOptions();
final ReferenceMultiSource hostReference = new ReferenceMultiSource(gcsOptions, HOST_REF_PATH, getReferenceWindowFunction());
final SAMSequenceDictionary hostRefDict = hostReference.getReferenceSequenceDictionary(header.getSequenceDictionary());
readsHeader.setSequenceDictionary(hostRefDict);
return engine.align(reads);
}
use of org.broadinstitute.hellbender.tools.spark.bwa.BwaSparkEngine in project gatk by broadinstitute.
the class BwaAndMarkDuplicatesPipelineSpark method runTool.
@Override
protected void runTool(final JavaSparkContext ctx) {
try (final BwaSparkEngine engine = new BwaSparkEngine(ctx, indexImageFile, getHeaderForReads(), getReferenceSequenceDictionary())) {
final JavaRDD<GATKRead> alignedReads = engine.align(getReads());
final JavaRDD<GATKRead> markedReadsWithOD = MarkDuplicatesSpark.mark(alignedReads, engine.getHeader(), duplicatesScoringStrategy, new OpticalDuplicateFinder(), getRecommendedNumReducers());
final JavaRDD<GATKRead> markedReads = MarkDuplicatesSpark.cleanupTemporaryAttributes(markedReadsWithOD);
try {
ReadsSparkSink.writeReads(ctx, output, referenceArguments.getReferenceFile().getAbsolutePath(), markedReads, engine.getHeader(), shardedOutput ? ReadsWriteFormat.SHARDED : ReadsWriteFormat.SINGLE, getRecommendedNumReducers());
} catch (IOException e) {
throw new GATKException("unable to write bam: " + e);
}
}
}
Aggregations