-
Notifications
You must be signed in to change notification settings - Fork 602
Delete a bunch of unused methods #6107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
8e2e88f
dc86ebb
7603824
f0cd435
578c7d5
a4f74cb
ade8fe5
50b6f71
bbc1a1c
791c450
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,9 @@ | |
import org.apache.commons.math3.linear.Array2DRowRealMatrix; | ||
import org.apache.commons.math3.linear.DefaultRealMatrixChangingVisitor; | ||
import org.apache.commons.math3.linear.RealMatrix; | ||
import org.apache.commons.math3.stat.descriptive.moment.Variance; | ||
import org.broadinstitute.hellbender.GATKBaseTest; | ||
import org.broadinstitute.hellbender.utils.MathUtils; | ||
import org.broadinstitute.hellbender.utils.Utils; | ||
import org.testng.Assert; | ||
import org.testng.annotations.Test; | ||
|
||
|
@@ -61,8 +62,11 @@ public void testGCCorrection() { | |
// | ||
final RealMatrix correctedCoverage = readCounts.copy(); | ||
GCBiasCorrector.correctGCBias(correctedCoverage, intervalGCContent); | ||
final double[] correctedNoiseBySample = MathUtils.rowStdDevs(correctedCoverage); | ||
Arrays.stream(correctedNoiseBySample).forEach(x -> Assert.assertTrue(x < NON_GC_BIAS_NOISE_LEVEL * MEAN_READ_DEPTH)); | ||
Utils.nonNull(correctedCoverage); | ||
final Variance varianceEvaluator = new Variance(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably should just use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
final double[] stdDevsBySample = IntStream.range(0, correctedCoverage.getRowDimension()) | ||
.mapToDouble(r -> Math.sqrt(varianceEvaluator.evaluate(correctedCoverage.getRow(r)))).toArray(); | ||
Arrays.stream(stdDevsBySample).forEach(x -> Assert.assertTrue(x < NON_GC_BIAS_NOISE_LEVEL * MEAN_READ_DEPTH)); | ||
|
||
//check that GC-bias correction is approximately idempotent -- if you correct again, very little should happen | ||
final RealMatrix recorrectedCoverage = correctedCoverage.copy(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -218,9 +218,8 @@ public void testBases(){ | |
} | ||
|
||
public void checkResults(final int[] results, final int n, final int m) { | ||
final double[] dresults = MathUtils.promote(results); | ||
final double mean = MathUtils.mean(dresults, 0, dresults.length); | ||
final double std = new StandardDeviation().evaluate(dresults); | ||
final double mean = Arrays.stream(results).average().getAsDouble(); | ||
final double std = new StandardDeviation().evaluate(Arrays.stream(results).mapToDouble(i->i).toArray()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just curious, is there some reason we don't typically use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No good reason. |
||
final double expectedMean = (n*m)/4.0; | ||
final double s = std; // not really because it's the population not the sample dtd but it'll do | ||
Assert.assertTrue(mean < expectedMean + 2 * s / Math.sqrt(n * m), "unexpected mean:" + mean); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
isValidProbability
andisValidLog10Probability
are probably better names for these methods, but I'll leave it up to you.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done