Commit 40448f9c authored by oma219's avatar oma219 Committed by Li Song
Browse files

updated parameters for logit function; add inverse logit when printing summary

parent aaa0a809
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ struct MappingParameters {
  double cache_update_param = 0.01;
  int cache_size = 4000003;
  bool debug_cache = false;
  std::string frip_est_params = "0.2809;0.8921;7.490e-06;-1.893e-05;-2.178e-05";
  std::string frip_est_params = "0.2771;0.9153;6.0499e-06;-6.1495e-05;-5.8978e-05";
  bool output_num_uniq_cache_slots = true;
  int k_for_minhash = 250;

+10 −5
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@

#include <stdio.h>
#include <stdint.h>
#include <cmath>

#include "khash.h"
#include "utils.h"
@@ -43,6 +44,10 @@ class SummaryMetadata {
    kh_destroy(k64_barcode_metadata, barcode_metadata_);
  }

  inline double inverse_logit(double frip) {
    return (1.0/(1.0 + std::exp(-frip)));
  }

  inline void OutputCounts(const char *barcode, const int *counts, FILE *fp, std::vector<double> frip_est_coeffs, bool output_num_cache_slots_info)
  {
    // define variables to store values
@@ -59,11 +64,11 @@ class SummaryMetadata {
    size_t num_cache_slots = counts[SUMMARY_METADATA_CARDINALITY];

    // compute the estimated frip
    double est_frip = (fric != 0.0) ? frip_est_coeffs[0] + /* constant */
    double est_frip = (fric != 0.0) ? inverse_logit(frip_est_coeffs[0] + /* constant */
                                           (frip_est_coeffs[1] * fric) +
                                           (frip_est_coeffs[2] * num_dup) +
                                           (frip_est_coeffs[3] * num_unmapped)  +
                      (frip_est_coeffs[4] * num_lowmapq) : 0.0;
                                           (frip_est_coeffs[4] * num_lowmapq)) : 0.0;

    // print out data for current barcode
    if (!output_num_cache_slots_info) {