MCPcopy Create free account
hub / github.com/BirolLab/RNA-Bloom / getKmers

Method getKmers

src/rnabloom/bloom/hash/HashFunction.java:55–85  ·  view source on GitHub ↗
(final String seq, final int numHash, BloomFilterDeBruijnGraph graph)

Source from the content-addressed store, hash-verified

53 }
54
55 public ArrayList<Kmer> getKmers(final String seq, final int numHash, BloomFilterDeBruijnGraph graph) {
56 boolean containsInvalidChar = containsInvalidNucleotides(seq);
57 ArrayList<Kmer> result = new ArrayList<>();
58
59 int seqLength = seq.length();
60
61 if (seqLength >= k) {
62 byte[] bytes = stringToBytes(seq, seqLength);
63
64 NTHashIterator itr = new NTHashIterator(k, numHash);
65 itr.start(seq);
66 long[] hVals = itr.hVals;
67 int i;
68 float c;
69 while (itr.hasNext()) {
70 itr.next();
71 i = itr.getPos();
72
73 if (containsInvalidChar && containsInvalidNucleotides(seq, i, i+k)) {
74 c = 0;
75 }
76 else {
77 c = graph.getCount(hVals);
78 }
79
80 result.add(new Kmer(Arrays.copyOfRange(bytes, i, i+k), c, hVals[0]));
81 }
82 }
83
84 return result;
85 }
86
87 public ArrayList<Kmer> getKmers(final String seq, final int numHash, BloomFilterDeBruijnGraph graph, float minCoverage) {
88 boolean containsInvalidChar = containsInvalidNucleotides(seq);

Callers 11

runMethod · 0.45
runMethod · 0.45
runMethod · 0.45
runMethod · 0.45
polishSequenceMethod · 0.45
reduceRedundancyMethod · 0.45
correctErrorHelper2Method · 0.45
correctInternalErrorsMethod · 0.45
correctErrorHelperMethod · 0.45
correctMismatchesMethod · 0.45
overlapMethod · 0.45

Calls 9

startMethod · 0.95
hasNextMethod · 0.95
nextMethod · 0.95
getPosMethod · 0.95
stringToBytesMethod · 0.80
getCountMethod · 0.65
addMethod · 0.65
sizeMethod · 0.45

Tested by

no test coverage detected