@@ -0,0 +1,751 @@
+package com.github.sparkcaller.preprocessing;%0A%0Aimport htsjdk.samtools.BAMIndexer;%0Aimport htsjdk.samtools.SamReader;%0Aimport htsjdk.samtools.SamReaderFactory;%0Aimport org.apache.spark.api.java.function.Function;%0A%0Aimport java.io.File;%0A%0Apublic class BamIndexer implements Function%3CFile, File%3E %7B%0A    // Create an index (.bai) file for the given BAM file.%0A    public File call(File bamFile) throws Exception %7B%0A        final SamReader bamReader = SamReaderFactory.makeDefault()%0A                                              .enable(SamReaderFactory.Option.INCLUDE_SOURCE_IN_RECORDS)%0A                                              .open(bamFile);%0A        BAMIndexer.createIndex(bamReader, new File(bamFile.getPath() + %22.bai%22));%0A%0A        return bamFile;%0A    %7D%0A%7D%0A

Add a class which is used to generate BAM indexes, as this is required by several of the tools used later in the pipeline.