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

Method NTCardHistogram

src/rnabloom/util/NTCardHistogram.java:35–64  ·  view source on GitHub ↗
(String path)

Source from the content-addressed store, hash-verified

33 public long[] counts = new long[MAX_MULTIPLICITY];
34
35 public NTCardHistogram(String path) throws FileNotFoundException, IOException {
36 boolean f0Found = false;
37 BufferedReader br = getTextFileReader(path);
38 String line;
39 long sum = 0;
40 while ((line = br.readLine()) != null) {
41 if (line.length() > 0) {
42 String[] cols = line.split("\t");
43 if (f0Found) {
44 long count = Long.parseLong(cols[1]);
45 counts[Integer.parseInt(cols[0]) - 1] = count;
46 sum += count;
47 }
48 else if (cols[0].equals("F1")) {
49 numKmers = Long.parseLong(cols[1]);
50 }
51 else if (cols[0].equals("F0")) {
52 numUniqueKmers = Long.parseLong(cols[1]);
53 f0Found = true;
54 if ((numUniqueKmers < 1 && numKmers > 0) ||
55 numKmers < numUniqueKmers) {
56 break;
57 }
58 }
59 }
60 }
61
62 numUniqueOverrepresentedKmers = numUniqueKmers - sum;
63 br.close();
64 }
65
66 public long getNumSingletons() {
67 return counts[0];

Callers

nothing calls this directly

Calls 3

getTextFileReaderMethod · 0.80
closeMethod · 0.65
equalsMethod · 0.45

Tested by

no test coverage detected