void H5Writer::init(const std::string& fname, int num_bootstrap, uint compression,
    size_t index_version, const std::string& shell_call,
    const std::string& start_time)
{
  primed_ = true;
  num_bootstrap_ = num_bootstrap;
  compression_ = compression;
  file_id_ = H5Fcreate(fname.c_str(), H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
  root_ = H5Gopen(file_id_, "/", H5P_DEFAULT);
  aux_ = H5Gcreate(file_id_, "/aux", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
  if (num_bootstrap_ > 0) {
    bs_ = H5Gcreate(file_id_, "/bootstrap", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
  }
  std::vector<int> n_bs {num_bootstrap};
  vector_to_h5(n_bs, aux_, "num_bootstrap", false, compression_);

  // info about run
  std::vector<std::string> kal_version{ KALLISTO_VERSION };
  vector_to_h5(kal_version, aux_, "kallisto_version", true, compression_);

  std::vector<int> idx_version{ static_cast<int>(index_version) };
  vector_to_h5(idx_version, aux_, "index_version", false, compression_);

  std::vector<std::string> call{ shell_call };
  vector_to_h5(call, aux_, "call", true, compression_);

  std::vector<std::string> s_time{ start_time };
  vector_to_h5(s_time, aux_, "start_time", true, compression_);
}
示例#2
0
void H5Writer::write_main(const EMAlgorithm& em,
    const std::vector<std::string>& targ_ids,
    const std::vector<int>& lengths) {
  vector_to_h5(em.alpha_, root_, "est_counts", false, compression_);

  vector_to_h5(targ_ids, aux_, "ids", true, compression_);
  vector_to_h5(em.eff_lens_, aux_, "eff_lengths", false, compression_);
  vector_to_h5(lengths, aux_, "lengths", false, compression_);
}
示例#3
0
void H5Writer::write_bootstrap(const EMAlgorithm& em, int bs_id) {
  std::string bs_id_str("bs" + std::to_string( bs_id ));
  vector_to_h5(em.alpha_, bs_, bs_id_str.c_str(), false, compression_);
}