예제 #1
0
파일: genotype.cpp 프로젝트: einon/dissect
void Genotype::loadList(std::string f)
{
  misc.message << "Reading genotypes from files specified in [ " << f << " ]..." << std::endl;
  misc.message.tab = "  ";

  std::ifstream file;
  misc.checkFileExists(f);
  file.open(f.c_str());
  
  int idx = 0;
  std::string line;
  while(getline(file,line))
  {
    std::istringstream sstemp(line);
    std::string partialFileName;
    sstemp >> partialFileName;
    
    if( idx == 0 )
    {
      this->load(partialFileName);
    }
    else
    {
      misc.setGetElapsedTime("AddGenotype");
      misc.message << "Adding genotype..." << std::endl;
      Genotype partialGenotype = Genotype(partialFileName);
      appendGenotype(&partialGenotype);
      misc.message << "Adding genotype needed " << misc.setGetElapsedTime("AddGenotype", true) << std::endl;
    }
    idx++;
  }

  file.close();
  
  misc.message.tab = "";
  misc.message << "Reading genotype files ended." << std::endl;
}
예제 #2
0
파일: caller.cpp 프로젝트: arrogantrobot/vg
void Caller::call_node_pileup(const NodePileup& pileup) {

    _node = _graph->get_node(pileup.node_id());
    assert(_node != NULL);
    
    _node_calls.clear();
    char def_char = _leave_uncalled ? '.' : '-';
    _node_calls.assign(_node->sequence().length(), Genotype(def_char, def_char));

    // todo: parallelize this loop
    // process each base in pileup individually
    for (int i = 0; i < pileup.base_pileup_size(); ++i) {
        if (pileup.base_pileup(i).num_bases() >= _min_depth &&
            pileup.base_pileup(i).num_bases() <= _max_depth) {
            call_base_pileup(pileup, i);
        }
    }

    // add nodes and edges created when making calls to the output graph
    // (_side_map gets updated)
    create_node_calls(pileup);

    _visited_nodes.insert(_node->id());
}