Ejemplo n.º 1
0
EludeCaller::~EludeCaller() {
  if (train_features_table_) {
    DataManager::CleanUpTable(train_psms_, train_features_table_);
    train_features_table_ = NULL;
  }
  if (test_features_table_) {
    DataManager::CleanUpTable(test_psms_, test_features_table_);
    test_features_table_ = NULL;
  }
  if (rt_model_) {
    delete rt_model_;
    rt_model_ = NULL;
  }
  if (lts != NULL) {
    delete lts;
  }
  std::vector<PSMDescription*>::iterator it = train_psms_.begin();
  for ( ; it != train_psms_.end(); ++it) {
    PSMDescription::deletePtr(*it);
  }
  it = test_psms_.begin();
  for ( ; it != test_psms_.end(); ++it) {
    PSMDescription::deletePtr(*it);
  }
  DeleteRTModels();
}
Ejemplo n.º 2
0
EludeCaller::~EludeCaller() {
  if (train_features_table_) {
    DataManager::CleanUpTable(train_psms_, train_features_table_);
    train_features_table_ = NULL;
  }
  if (test_features_table_) {
    DataManager::CleanUpTable(test_psms_, test_features_table_);
    test_features_table_ = NULL;
  }
  if (rt_model_) {
    delete rt_model_;
    rt_model_ = NULL;
  }
  if (lts != NULL) {
    delete lts;
  }
  DeleteRTModels();
}
Ejemplo n.º 3
0
int EludeCaller::SelectTestModel(std::vector<PSMDescription*> &calibration_psms,
         std::vector<PSMDescription*> &test_psms) {

  train_psms_ = calibration_psms;
  test_psms_ = test_psms;
  train_aa_alphabet_ = GetAAAlphabet(calibration_psms);
  test_aa_alphabet_ = GetAAAlphabet(test_psms);

  AllocateRTFeatures(train_psms_);
  AllocateRTFeatures(test_psms_);

  pair<int, double> best_model = AutomaticModelSelection();
  int index = best_model.first;

  if (index < 0) {
    cerr << "Error: No model available to predict rt. " << endl;
    return 1;
  }

  rt_models_[index]->PredictRT(test_aa_alphabet_, false, "test psms", test_psms_);
  rt_models_[index]->PredictRT(train_aa_alphabet_, false, "calibration psms",
      train_psms_);
  pair<vector<double> , vector<double> > rts = GetRTs(train_psms_);
  lts = new LTSRegression();
  lts->setData(rts.first, rts.second);
  lts->runLTS();
  AdjustLinearly(test_psms_);

  calibration_psms = train_psms_;
  test_psms = test_psms_;

  // clean up the models
  delete lts;
  lts = NULL;
  DeleteRTModels();

  return 0;
}