use of org.broadinstitute.hellbender.tools.spark.sv.ContainsKmerReadFilterSpark 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.ContainsKmerReadFilterSpark in project gatk by broadinstitute.
the class ContainsKmerReadFilterTest method testTest.
@Test(dataProvider = "sequenceStrings")
public void testTest(final String bases_in, final Boolean test_out) throws Exception {
final JavaSparkContext ctx = SparkContextFactory.getTestSparkContext();
final ContainsKmerReadFilterSpark filter = new ContainsKmerReadFilterSpark(ctx.broadcast(kmerSet), kSize);
final byte[] quals = bases_in.getBytes().clone();
Arrays.fill(quals, (byte) 'I');
SAMUtils.fastqToPhred(quals);
GATKRead read_in = ArtificialReadUtils.createArtificialRead(bases_in.getBytes(), quals, "*");
final Boolean test_i = filter.call(read_in);
Assert.assertEquals(test_out, test_i);
}
Aggregations