本文整理了Java中htsjdk.samtools.util.Histogram.divideByHistogram()
方法的一些代码示例,展示了Histogram.divideByHistogram()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Histogram.divideByHistogram()
方法的具体详情如下:
包路径:htsjdk.samtools.util.Histogram
类名称:Histogram
方法名:divideByHistogram
[英]Immutable method that divides the current Histogram by an input Histogram and generates a new one Throws an exception if the bins don't match up exactly
[中]
代码示例来源: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;
}
内容来源于网络,如有侵权,请联系作者删除!