htsjdk.samtools.util.Histogram.getMedianBinSize()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(141)

本文整理了Java中htsjdk.samtools.util.Histogram.getMedianBinSize()方法的一些代码示例,展示了Histogram.getMedianBinSize()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Histogram.getMedianBinSize()方法的具体详情如下:
包路径:htsjdk.samtools.util.Histogram
类名称:Histogram
方法名:getMedianBinSize

Histogram.getMedianBinSize介绍

[英]Calculates the median bin size
[中]计算中间存储箱大小

代码示例

代码示例来源:origin: broadinstitute/picard

public void finish() {
  cytoConversionRate = nCytoTotal == 0 ? 0 : nCytoConverted / (double)nCytoTotal;
  nCpgSeen = (int)cpgTotal.getSumOfValues();
  nCpgConverted = (int)cpgConverted.getSumOfValues();
  cpgConversionRate = nCpgSeen == 0 ? 0 : nCpgConverted / (double)nCpgSeen;
  coverageMean = cpgTotal.getMeanBinSize();
  coverageMedian = (int)cpgTotal.getMedianBinSize();
}

代码示例来源:origin: com.github.broadinstitute/picard

public void finish() {
  cytoConversionRate = nCytoTotal == 0 ? 0 : nCytoConverted / (double)nCytoTotal;
  nCpgSeen = (int)cpgTotal.getSumOfValues();
  nCpgConverted = (int)cpgConverted.getSumOfValues();
  cpgConversionRate = nCpgSeen == 0 ? 0 : nCpgConverted / (double)nCpgSeen;
  coverageMean = cpgTotal.getMeanBinSize();
  coverageMedian = (int)cpgTotal.getMedianBinSize();
}

代码示例来源:origin: samtools/htsjdk

@Test
public void testGetMedianBinSize() {
  final int[] is = {4,4,5,5,5,6,6,6,6};
  final Histogram<Integer> histo = new Histogram<>();
  Assert.assertEquals(histo.getMedianBinSize(), 0, 0.000001); //empty
  for (final int i : is) histo.increment(i);
  Assert.assertEquals(histo.getMedianBinSize(), 3, 0.000001); //three fives
}

代码示例来源:origin: samtools/htsjdk

@Test
public void testGetMedianBinSize_Even() {
  final int[] is = {4,4,5,5,5};
  final Histogram<Integer> histo = new Histogram<>();
  Assert.assertEquals(histo.getMedianBinSize(), 0, 0.000001); //empty
  for (final int i : is) histo.increment(i);
  Assert.assertEquals(histo.getMedianBinSize(), (2+3)/2.0, 0.000001); //even split
}

相关文章