Skip to content

Commit

Permalink
checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
rbouckaert committed May 4, 2015
1 parent 841f4cb commit cc059e6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/snap/Data.java
Original file line number Diff line number Diff line change
Expand Up @@ -500,4 +500,20 @@ protected boolean isEqual(int iSite1, int iSite2) {
public int[] getPatternLineagCounts(int id) {
return m_nPatternLineageCounts[id];
}

public double getProportionZeros() {
int zeroCount = 0;
int oneCount = 0;
for (int i = 0; i < sitePatterns.length; i++) {
int [] p = getPattern(i);
int [] n = getPatternLineagCounts(i);
int w = getPatternWeight(i);
for (int j = 0; j < p.length; j++) {
oneCount += w * p[j];
zeroCount += w * (n[j] - p[j]);
}
}
return (double) zeroCount / ((double) zeroCount + oneCount);
}

}

0 comments on commit cc059e6

Please sign in to comment.