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

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

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

Histogram.setBinLabel介绍

暂无

代码示例

代码示例来源:origin: com.github.samtools/htsjdk

/**
 * Outputs validation summary report to out.
 *
 * @param samReader records to validate
 * @param reference if null, NM tag validation is skipped
 * @return boolean  true if there are no validation errors, otherwise false
 */
public boolean validateSamFileSummary(final SamReader samReader, final ReferenceSequenceFile reference) {
  init(reference, samReader.getFileHeader());
  validateSamFile(samReader, out);
  boolean result = errorsByType.isEmpty();
  if (errorsByType.getCount() > 0) {
    // Convert to a histogram with String IDs so that WARNING: or ERROR: can be prepended to the error type.
    final Histogram<String> errorsAndWarningsByType = new Histogram<>("Error Type", "Count");
    for (final Histogram.Bin<Type> bin : errorsByType.values()) {
      errorsAndWarningsByType.increment(bin.getId().getHistogramString(), bin.getValue());
    }
    final MetricsFile<ValidationMetrics, String> metricsFile = new MetricsFile<>();
    errorsByType.setBinLabel("Error Type");
    errorsByType.setValueLabel("Count");
    metricsFile.setHistogram(errorsAndWarningsByType);
    metricsFile.write(out);
  }
  cleanup();
  return result;
}

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

/**
 * Outputs validation summary report to out.
 *
 * @param samReader records to validate
 * @param reference if null, NM tag validation is skipped
 * @return boolean  true if there are no validation errors, otherwise false
 */
public boolean validateSamFileSummary(final SamReader samReader, final ReferenceSequenceFile reference) {
  init(reference, samReader.getFileHeader());
  validateSamFile(samReader, out);
  boolean result = errorsByType.isEmpty();
  if (errorsByType.getCount() > 0) {
    // Convert to a histogram with String IDs so that WARNING: or ERROR: can be prepended to the error type.
    final Histogram<String> errorsAndWarningsByType = new Histogram<>("Error Type", "Count");
    for (final Histogram.Bin<Type> bin : errorsByType.values()) {
      errorsAndWarningsByType.increment(bin.getId().getHistogramString(), bin.getValue());
    }
    final MetricsFile<ValidationMetrics, String> metricsFile = new MetricsFile<>();
    errorsByType.setBinLabel("Error Type");
    errorsByType.setValueLabel("Count");
    metricsFile.setHistogram(errorsAndWarningsByType);
    metricsFile.write(out);
  }
  cleanup();
  return result;
}

代码示例来源:origin: org.seqdoop/htsjdk

/**
 * Outputs validation summary report to out.
 *
 * @param samReader records to validate
 * @param reference if null, NM tag validation is skipped
 * @return boolean  true if there are no validation errors, otherwise false
 */
public boolean validateSamFileSummary(final SAMFileReader samReader, final ReferenceSequenceFile reference) {
  init(reference, samReader.getFileHeader());
  validateSamFile(samReader, out);
  boolean result = errorsByType.isEmpty();
  if (errorsByType.getCount() > 0) {
    // Convert to a histogram with String IDs so that WARNING: or ERROR: can be prepended to the error type.
    final Histogram<String> errorsAndWarningsByType = new Histogram<String>("Error Type", "Count");
    for (final Histogram<SAMValidationError.Type>.Bin bin : errorsByType.values()) {
      errorsAndWarningsByType.increment(bin.getId().getHistogramString(), bin.getValue());
    }
    final MetricsFile<ValidationMetrics, String> metricsFile = new MetricsFile<ValidationMetrics, String>();
    errorsByType.setBinLabel("Error Type");
    errorsByType.setValueLabel("Count");
    metricsFile.setHistogram(errorsAndWarningsByType);
    metricsFile.write(out);
  }
  cleanup();
  return result;
}

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

histo.setBinLabel("small_number");
histo.setValueLabel("big_number");
histo.increment(1, 101);

相关文章