MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / getLogScore_

Method getLogScore_

src/openms/source/ANALYSIS/DECHARGING/ILPDCWrapper.cpp:479–516  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

477 } // !compute_slice
478
479 double ILPDCWrapper::getLogScore_(const PairsType::value_type& pair, const FeatureMap& fm) const
480 {
481 double score;
482 String e;
483 if (getenv("M") != nullptr)
484 e = String(getenv("M"));
485 if (e.empty())
486 {
487 //std::cout << "1";
488 score = pair.getCompomer().getLogP();
489 /*double charge_enhance = 0;
490
491 if (pairs[i].getCharge(0) == fm[pairs[i].getElementIndex(0)].getCharge())
492 charge_enhance += log(0.9); else charge_enhance += log(0.1);
493
494 if (pairs[i].getCharge(1) == fm[pairs[i].getElementIndex(1)].getCharge())
495 charge_enhance += log(0.9); else charge_enhance += log(0.1);
496
497 score += charge_enhance;
498 */
499
500 }
501 else
502 {
503 //std::cout << "2";
504 double rt_diff = fabs(fm[pair.getElementIndex(0)].getRT() - fm[pair.getElementIndex(1)].getRT());
505 // enhance correct charge
506 double charge_enhance = ((pair.getCharge(0) == fm[pair.getElementIndex(0)].getCharge())
507 &&
508 (pair.getCharge(1) == fm[pair.getElementIndex(1)].getCharge()))
509 ? 100 : 1;
510 score = charge_enhance * (1 / (pair.getMassDiff() + 1) + 1 / (rt_diff + 1));
511 }
512
513 //std::cout << "logscore: " << score << "\n";
514
515 return score;
516 }
517
518}

Callers

nothing calls this directly

Calls 6

getElementIndexMethod · 0.80
StringClass · 0.50
emptyMethod · 0.45
getRTMethod · 0.45
getChargeMethod · 0.45
getMassDiffMethod · 0.45

Tested by

no test coverage detected