本文整理了Java中htsjdk.samtools.util.Histogram.getStandardDeviationBinSize()
方法的一些代码示例,展示了Histogram.getStandardDeviationBinSize()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Histogram.getStandardDeviationBinSize()
方法的具体详情如下:
包路径:htsjdk.samtools.util.Histogram
类名称:Histogram
方法名:getStandardDeviationBinSize
[英]Calculates the standard deviation of the bin size
[中]计算料仓尺寸的标准偏差
代码示例来源:origin: broadinstitute/picard
private void onComplete() {
final double meanClustersPerTile = tileToClusterHistogram.getMeanBinSize();
metrics.MEAN_CLUSTERS_PER_TILE = Math.round(meanClustersPerTile);
metrics.SD_CLUSTERS_PER_TILE = Math.round(tileToClusterHistogram.getStandardDeviationBinSize(meanClustersPerTile));
final double meanPfClustersPerTile = tileToPfClusterHistogram.getMeanBinSize();
metrics.MEAN_PF_CLUSTERS_PER_TILE = Math.round(meanPfClustersPerTile);
metrics.SD_PF_CLUSTERS_PER_TILE = Math.round(tileToPfClusterHistogram.getStandardDeviationBinSize(meanPfClustersPerTile));
final DecimalFormat decFormat = new DecimalFormat("#.##");
final Histogram<Integer> laneToPctPfClusterHistogram = tileToPfClusterHistogram.divideByHistogram(tileToClusterHistogram);
final double meanPctPfClustersPerTile = laneToPctPfClusterHistogram.getMeanBinSize();
metrics.MEAN_PCT_PF_CLUSTERS_PER_TILE = (Double.isNaN(meanPctPfClustersPerTile) ? 0 : Double.valueOf(decFormat.format(meanPctPfClustersPerTile * 100)));
metrics.SD_PCT_PF_CLUSTERS_PER_TILE = Double.valueOf(decFormat.format(laneToPctPfClusterHistogram.getStandardDeviationBinSize(meanPctPfClustersPerTile) * 100));
metrics.TOTAL_CLUSTERS = (long) this.tileToClusterHistogram.getSumOfValues();
metrics.PF_CLUSTERS = (long) this.tileToPfClusterHistogram.getSumOfValues();
final ReadStructure readStructure = new ReadStructure(READ_STRUCTURE);
int templateBaseCountPerCluster = 0;
for (int i = 0; i < readStructure.templates.length(); i++) {
templateBaseCountPerCluster += readStructure.templates.get(i).length;
}
metrics.TOTAL_READS = metrics.TOTAL_CLUSTERS * readStructure.templates.length();
metrics.PF_READS = metrics.PF_CLUSTERS * readStructure.templates.length();
metrics.TOTAL_BASES = metrics.TOTAL_CLUSTERS * templateBaseCountPerCluster;
metrics.PF_BASES = metrics.PF_CLUSTERS * templateBaseCountPerCluster;
}
代码示例来源:origin: com.github.broadinstitute/picard
private void onComplete() {
final double meanClustersPerTile = tileToClusterHistogram.getMeanBinSize();
metrics.MEAN_CLUSTERS_PER_TILE = Math.round(meanClustersPerTile);
metrics.SD_CLUSTERS_PER_TILE = Math.round(tileToClusterHistogram.getStandardDeviationBinSize(meanClustersPerTile));
final double meanPfClustersPerTile = tileToPfClusterHistogram.getMeanBinSize();
metrics.MEAN_PF_CLUSTERS_PER_TILE = Math.round(meanPfClustersPerTile);
metrics.SD_PF_CLUSTERS_PER_TILE = Math.round(tileToPfClusterHistogram.getStandardDeviationBinSize(meanPfClustersPerTile));
final DecimalFormat decFormat = new DecimalFormat("#.##");
final Histogram<Integer> laneToPctPfClusterHistogram = tileToPfClusterHistogram.divideByHistogram(tileToClusterHistogram);
final double meanPctPfClustersPerTile = laneToPctPfClusterHistogram.getMeanBinSize();
metrics.MEAN_PCT_PF_CLUSTERS_PER_TILE = (Double.isNaN(meanPctPfClustersPerTile) ? 0 : Double.valueOf(decFormat.format(meanPctPfClustersPerTile * 100)));
metrics.SD_PCT_PF_CLUSTERS_PER_TILE = Double.valueOf(decFormat.format(laneToPctPfClusterHistogram.getStandardDeviationBinSize(meanPctPfClustersPerTile) * 100));
metrics.TOTAL_CLUSTERS = (long) this.tileToClusterHistogram.getSumOfValues();
metrics.PF_CLUSTERS = (long) this.tileToPfClusterHistogram.getSumOfValues();
final ReadStructure readStructure = new ReadStructure(READ_STRUCTURE);
int templateBaseCountPerCluster = 0;
for (int i = 0; i < readStructure.templates.length(); i++) {
templateBaseCountPerCluster += readStructure.templates.get(i).length;
}
metrics.TOTAL_READS = metrics.TOTAL_CLUSTERS * readStructure.templates.length();
metrics.PF_READS = metrics.PF_CLUSTERS * readStructure.templates.length();
metrics.TOTAL_BASES = metrics.TOTAL_CLUSTERS * templateBaseCountPerCluster;
metrics.PF_BASES = metrics.PF_CLUSTERS * templateBaseCountPerCluster;
}
代码示例来源:origin: samtools/htsjdk
@Test
public void testGetStandardDeviationBinSize() {
final int[] is = {4,4,5,5,5};
final Histogram<Integer> histo = new Histogram<>();
for (final int i : is) histo.increment(i);
final double std = Math.sqrt((pow(2.0-2.5, 2)+pow(3.0-2.5, 2.0))); //sample variance so dividing by 1
Assert.assertEquals(histo.getStandardDeviationBinSize(histo.getMeanBinSize()), std, 0.000001);
}
内容来源于网络,如有侵权,请联系作者删除!