use of org.broadinstitute.hellbender.tools.spark.sv.SVKmer in project gatk by broadinstitute.
the class ContainsKmerReadFilterTest method before.
@BeforeMethod
public void before() {
final String kmerRef = "ATCGAGCGCTAGCGATGGCGCGCGATCGCGCTAGCGCGCTAGC";
final SVKmerizer kmerizer = new SVKmerizer(kmerRef.getBytes(), kSize, new SVKmerShort(kSize));
final ArrayList<SVKmer> kmerList = new ArrayList<>();
while (kmerizer.hasNext()) {
kmerList.add(kmerizer.next());
}
kmerSet = new HopscotchSet<>(kmerList);
}
use of org.broadinstitute.hellbender.tools.spark.sv.SVKmer in project gatk by broadinstitute.
the class PathSeqFilterSpark method doKmerFiltering.
@SuppressWarnings("unchecked")
private JavaRDD<GATKRead> doKmerFiltering(final JavaSparkContext ctx, final JavaRDD<GATKRead> reads) {
final PipelineOptions options = getAuthenticatedGCSOptions();
Input input = new Input(BucketUtils.openFile(KMER_LIB_PATH));
Kryo kryo = new Kryo();
kryo.setReferences(false);
Set<SVKmer> kmerLibSet = (HopscotchSet<SVKmer>) kryo.readClassAndObject(input);
return reads.filter(new ContainsKmerReadFilterSpark(ctx.broadcast(kmerLibSet), KMER_SIZE));
}
use of org.broadinstitute.hellbender.tools.spark.sv.SVKmer in project gatk by broadinstitute.
the class PathSeqKmerSparkIntegrationTest method test.
@SuppressWarnings("unchecked")
@Test(groups = "spark")
public void test() throws Exception {
final File expectedFile = getTestFile("kmer.hss");
final File ref = getTestFile("hg19mini.fasta");
final File output = createTempFile("test", ".hss");
if (!output.delete()) {
Assert.fail();
}
final ArgumentsBuilder args = new ArgumentsBuilder();
args.addFileArgument("reference", ref);
args.addOutput(output);
this.runCommandLine(args.getArgsArray());
Input input_expected = new Input(FileUtils.openInputStream(expectedFile));
Input input_test = new Input(FileUtils.openInputStream(output));
Kryo kryo = new Kryo();
kryo.setReferences(false);
Set<SVKmer> expectedKmerLib = (HopscotchSet<SVKmer>) kryo.readClassAndObject(input_expected);
Set<SVKmer> testKmerLib = (HopscotchSet<SVKmer>) kryo.readClassAndObject(input_test);
Assert.assertEquals(expectedKmerLib, testKmerLib);
}
Aggregations