Change "peptide" references in code to "sequence", adding comments

This commit is contained in:
2022-02-21 00:29:34 -06:00
parent 370de79546
commit cb1f7adece
4 changed files with 39 additions and 33 deletions

View File

@@ -8,6 +8,9 @@ public abstract class Equations {
return (int) ((Math.random() * (max - min)) + min);
}
//pValue calculation as described in original pairSEQ paper.
//Included for comparison with original results.
//Not used by BiGpairSEQ for matching.
public static double pValue(Integer w, Integer w_a, Integer w_b, double w_ab_d) {
int w_ab = (int) w_ab_d;
double pv = 0.0;
@@ -18,6 +21,9 @@ public abstract class Equations {
return pv;
}
//Implementation of the (corrected) probability equation from pairSEQ paper.
//Included for comparison with original results.
//Not used by BiGpairSEQ for matching.
private static double probPairedByChance(Integer w, Integer w_a, Integer w_b, Integer w_ab){
BigInteger numer1 = choose(w, w_ab);
BigInteger numer2 = choose(w - w_ab, w_a - w_ab);
@@ -30,10 +36,9 @@ public abstract class Equations {
return prob.doubleValue();
}
/*
* This works because nC(k+1) = nCk * (n-k)/(k+1)
* Since nC0 = 1, can start there and generate all the rest.
*/
//This works because nC(k+1) = nCk * (n-k)/(k+1)
//Since nC0 = 1, can start there and generate all the rest.
public static BigInteger choose(final int N, final int K) {
BigInteger nCk = BigInteger.ONE;
for (int k = 0; k < K; k++) {