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

Method isLowComplexity

src/rnabloom/util/GraphUtils.java:8674–8695  ·  view source on GitHub ↗
(ArrayList<Kmer> kmers, int k, float maxAllowedFraction)

Source from the content-addressed store, hash-verified

8672 }
8673
8674 public static boolean isLowComplexity(ArrayList<Kmer> kmers, int k, float maxAllowedFraction) {
8675 int numKmers = kmers.size();
8676
8677 if (numKmers == 0) {
8678 return false;
8679 }
8680 else if (numKmers == 1) {
8681 return isLowComplexity2(kmers.get(0).bytes);
8682 }
8683 else if (numKmers < k) {
8684 return isLowComplexity2(kmers.get(0).bytes) || isLowComplexity2(kmers.get(numKmers-1).bytes);
8685 }
8686
8687 int lowComplexityKmers = 0;
8688 for (int i=0; i<numKmers; i+=k) {
8689 if (isLowComplexity2(kmers.get(i).bytes)) {
8690 ++lowComplexityKmers;
8691 }
8692 }
8693
8694 return lowComplexityKmers > maxAllowedFraction * numKmers/k;
8695 }
8696
8697 public static ArrayList<ArrayList<Kmer>> extractNonLowComplexitySegments(ArrayList<Kmer> kmers,
8698 int k, float maxAllowedFraction, int minSeqLength) {

Callers 1

findPathMethod · 0.45

Calls 3

isLowComplexity2Method · 0.80
getMethod · 0.65
sizeMethod · 0.45

Tested by

no test coverage detected