本文整理汇总了Java中cern.jet.random.Poisson.setMean方法的典型用法代码示例。如果您正苦于以下问题:Java Poisson.setMean方法的具体用法?Java Poisson.setMean怎么用?Java Poisson.setMean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cern.jet.random.Poisson
的用法示例。
在下文中一共展示了Poisson.setMean方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: calcCountThreshold
import cern.jet.random.Poisson; //导入方法依赖的package包/类
protected int calcCountThreshold(){
int countThres=0;
DRand re = new DRand();
Poisson P = new Poisson(0, re);
lambda = (totalReads*binWidth)/(regionLength*mappableRegion);
P.setMean(lambda);
double l=1;
for(int b=1; l>confThreshold; b++){
l=1-P.cdf(b);
countThres=b;
}
return(Math.max(1,countThres));
}
示例2: calcCountThreshold
import cern.jet.random.Poisson; //导入方法依赖的package包/类
protected int calcCountThreshold(){
int countThres=0;
DRand re = new DRand();
Poisson P = new Poisson(0, re);
lambda = (totalReads*(readLength/binStep + binWidth/binStep))/(regionLength*mappableRegion/binStep);
P.setMean(lambda);
double l=1;
for(int b=1; l>confThreshold; b++){
l=1-P.cdf(b);
countThres=b;
}
return(Math.max(1,countThres));
}
示例3: calcHitCount_per_BP
import cern.jet.random.Poisson; //导入方法依赖的package包/类
private int calcHitCount_per_BP(double totalReads, double threshold){
int countThres=0;
DRand re = new DRand();
Poisson P = new Poisson(0, re);
double lambda = totalReads/config.mappable_genome_length;
P.setMean(lambda);
double l=1;
for(int b=1; l>threshold; b++){
l=1-P.cdf(b); //p-value as the tail of Poisson
countThres=b;
}
return Math.max(1,countThres);
}
示例4: calcHitCount_per_BP
import cern.jet.random.Poisson; //导入方法依赖的package包/类
protected int calcHitCount_per_BP(double totalReads, double threshold){
int countThres=0;
DRand re = new DRand();
Poisson P = new Poisson(0, re);
double lambda = totalReads/mappable_genome_length;
P.setMean(lambda);
double l=1;
for(int b=1; l>threshold; b++){
l=1-P.cdf(b); //p-value as the tail of Poisson
countThres=b;
}
return Math.max(1,countThres);
}
示例5: calcExpectedHitCount
import cern.jet.random.Poisson; //导入方法依赖的package包/类
private int calcExpectedHitCount(double totalReads, double threshold, int regionWidth){
int countThres=0;
DRand re = new DRand();
Poisson P = new Poisson(0, re);
double lambda = totalReads*regionWidth /config.mappable_genome_length;
P.setMean(lambda);
double l=1;
for(int b=1; l>threshold; b++){
l=1-P.cdf(b); //p-value as the tail of Poisson
countThres=b;
}
return Math.max(1,countThres);
}
示例6: capPerBaseCountWithPoissonGaussianFilter
import cern.jet.random.Poisson; //导入方法依赖的package包/类
/**
* Reset duplicate reads that pass Poisson threshold.
* The Poisson lambda parameter is calculated by an Gaussian average
* that puts more weight for nearby bases (same chrom, same strand)
*/
private void capPerBaseCountWithPoissonGaussianFilter(double threshold, int width){
double g[] = new double[width*4+1];
NormalDistribution gaussianDist = new NormalDistribution(0, width*width);
for (int i=0;i<g.length;i++)
g[i]=gaussianDist.calcProbability((double)i);
DRand re = new DRand();
Poisson P = new Poisson(0, re);
for(int i = 0; i < fivePrimeCounts.length; i++)
for(int j = 0; j < fivePrimeCounts[i].length; j++){
float counts[] = fivePrimeCounts[i][j];
int pos[] = fivePrimePos[i][j];
if(counts!=null){
for(int k = 0; k < counts.length; k++){
int posK = pos[k];
double sum = 0;
for (int x=1;x<=width*4;x++){ // at most extend out 250 idx
if (k+x>=counts.length|| pos[k+x]-posK>width*4)
break;
sum += counts[k+x]*g[pos[k+x]-posK];
}
for (int x=1;x<=width*4;x++){ // at most extend out 250 idx
if (k-x<0 || posK-pos[k-x]>width*4)
break;
sum += counts[k-x]*g[posK-pos[k-x]];
}
sum = sum/(1-g[0]); // exclude this position for evaluation
double countThres=0;
P.setMean(sum);
double pvalue=1;
for(int b=1; pvalue>threshold; b++){
pvalue=1-P.cdf(b); //p-value as the tail of Poisson
countThres=b;
}
if (counts[k] > Math.max(1,countThres))
counts[k] = (float) Math.max(1,countThres);
}
}
}
}
示例7: capPerBaseCountWithPoissonGaussianFilter
import cern.jet.random.Poisson; //导入方法依赖的package包/类
/**
* Reset duplicate reads that pass Poisson threshold.
* The Poisson lambda parameter is calculated by an Gaussian average
* that puts more weight for nearby bases (same chrom, same strand)
*/
public void capPerBaseCountWithPoissonGaussianFilter(double threshold, int width){
double g[] = new double[width*4+1];
NormalDistribution gaussianDist = new NormalDistribution(0, width*width);
for (int i=0;i<g.length;i++)
g[i]=gaussianDist.calcProbability((double)i);
DRand re = new DRand();
Poisson P = new Poisson(0, re);
for(int i = 0; i < fivePrimeCounts.length; i++)
for(int j = 0; j < fivePrimeCounts[i].length; j++){
float counts[] = fivePrimeCounts[i][j];
int pos[] = fivePrimePos[i][j];
if(counts!=null){
for(int k = 0; k < counts.length; k++){
int posK = pos[k];
double sum = 0;
for (int x=1;x<=width*4;x++){ // at most extend out 250 idx
if (k+x>=counts.length|| pos[k+x]-posK>width*4)
break;
sum += counts[k+x]*g[pos[k+x]-posK];
}
for (int x=1;x<=width*4;x++){ // at most extend out 250 idx
if (k-x<0 || posK-pos[k-x]>width*4)
break;
sum += counts[k-x]*g[posK-pos[k-x]];
}
sum = sum/(1-g[0]); // exclude this position for evaluation
double countThres=0;
P.setMean(sum);
double pvalue=1;
for(int b=1; pvalue>threshold; b++){
pvalue=1-P.cdf(b); //p-value as the tail of Poisson
countThres=b;
}
if (counts[k] > Math.max(1,countThres))
counts[k] = (float) Math.max(1,countThres);
}
}
}
updateTotalHits();
}
示例8: applyPoissonGaussianFilter
import cern.jet.random.Poisson; //导入方法依赖的package包/类
/**
* Reset duplicate reads that pass Poisson threshold.
* The Poisson lambda parameter is calculated by an Gaussian average
* that puts more weight for nearby bases (same chrom, same strand)
*/
public void applyPoissonGaussianFilter(double threshold, int width){
//init the Guassian kernel prob. for smoothing the read profile of called events
double g[] = new double[width*4+1];
NormalDistribution gaussianDist = new NormalDistribution(0, width*width);
for (int i=0;i<g.length;i++)
g[i]=gaussianDist.calcProbability((double)i);
DRand re = new DRand();
Poisson P = new Poisson(0, re);
for(int i = 0; i < hitCounts.length; i++)
for(int j = 0; j < hitCounts[i].length; j++){
float counts[] = hitCounts[i][j];
int pos[] = fivePrimes[i][j];
for(int k = 0; k < counts.length; k++){
int posK = pos[k];
double sum = 0;
for (int x=1;x<=width*4;x++){ // at most extend out 250 idx
if (k+x>=counts.length|| pos[k+x]-posK>width*4)
break;
sum += counts[k+x]*g[pos[k+x]-posK];
}
for (int x=1;x<=width*4;x++){ // at most extend out 250 idx
if (k-x<0 || posK-pos[k-x]>width*4)
break;
sum += counts[k-x]*g[posK-pos[k-x]];
}
sum = sum/(1-g[0]); // exclude this position for evaluation
double countThres=0;
P.setMean(sum);
double pvalue=1;
for(int b=1; pvalue>threshold; b++){
pvalue=1-P.cdf(b); //p-value as the tail of Poisson
countThres=b;
}
// System.out.println(String.format("%s%d\t%.1f\t%.1f\t%.3f", (j==0?"+":"-"), posK, counts[k], countThres, sum));
if (counts[k] > Math.max(1,countThres))
counts[k] = (float) Math.max(1,countThres);
}
}
updateTotalHits();
}