Skip to content

Commit

Permalink
Many new classes for comparing Kohli CNV and GATK datasets.
Browse files Browse the repository at this point in the history
  • Loading branch information
u0028003 committed Dec 30, 2024
1 parent 391bc2f commit 68be0b6
Show file tree
Hide file tree
Showing 41 changed files with 4,492 additions and 1,316 deletions.
21 changes: 21 additions & 0 deletions Source/edu/utah/kohli/AccuGenGene.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package edu.utah.kohli;

import java.util.ArrayList;

public class AccuGenGene {

private String geneName;
private ArrayList<AccuGenProbe> probes = new ArrayList<AccuGenProbe>();

public AccuGenGene (String geneName) {
this.geneName = geneName;
}

public double meanZScore(double[] testAFs) {
return 0;
}

public ArrayList<AccuGenProbe> getProbes() {
return probes;
}
}
20 changes: 20 additions & 0 deletions Source/edu/utah/kohli/AccuGenProbe.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package edu.utah.kohli;

import java.util.ArrayList;

import util.gen.Misc;
import util.gen.Num;

public class AccuGenProbe {

Expand All @@ -11,6 +14,9 @@ public class AccuGenProbe {
private String alt;
private String gene;
private boolean ok = true;
private ArrayList<Double> ponAfs = new ArrayList<Double>();
private double ponAfsMean = Double.NaN;
private double ponStdDev = 0;

public AccuGenProbe (String rep) {
//Chr_POS_REF_ALT_GENE
Expand All @@ -22,6 +28,16 @@ public AccuGenProbe (String rep) {
alt = f[3];
gene = f[4];
}

public double calculateZScore (double testAf) {
if (Double.isNaN(ponAfsMean)) {
double[] afs = Num.arrayListToDoubles(ponAfs);
ponAfsMean = Num.mean(afs);
ponStdDev = Num.standardDeviation(afs, ponAfsMean);
}
return (testAf-ponAfsMean)/ponStdDev;
}


public String getOriginalInput() {
return originalInput;
Expand Down Expand Up @@ -51,4 +67,8 @@ public boolean isOk() {
return ok;
}

public ArrayList<Double> getPonAfs() {
return ponAfs;
}

}
25 changes: 24 additions & 1 deletion Source/edu/utah/kohli/AccuGenProbeCounts.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@

public class AccuGenProbeCounts {

private AccuGenProbe probe;
private int refCounts;
private int altCounts;
private double scaledAlleleFraction;


public AccuGenProbeCounts(int refCounts, int altCounts) {
public AccuGenProbeCounts(AccuGenProbe probe, int refCounts, int altCounts) {
this.probe = probe;
this.refCounts = refCounts;
this.altCounts = altCounts;
}
Expand All @@ -25,4 +28,24 @@ public String toString() {
return refCounts+":"+altCounts+":"+getReadDepth()+":"+Num.formatNumber(getAlleleFraction(), 3);
}

public int getRefCounts() {
return refCounts;
}

public int getAltCounts() {
return altCounts;
}

public AccuGenProbe getProbe() {
return probe;
}

public double getScaledAlleleFraction() {
return scaledAlleleFraction;
}

public void setScaledAlleleFraction(double scaledAlleleFraction) {
this.scaledAlleleFraction = scaledAlleleFraction;
}

}
Loading

0 comments on commit 68be0b6

Please sign in to comment.