Codebase list minexpert2 / 34640db
Fixed bug in the filtering of the monomer mass differences. Filippo Rusconi (Debian Maintainer) 14 years ago
1 changed file(s) with 11 addition(s) and 20 deletion(s). Raw diff Collapse all Expand all
16341634 QStringList *
16351635 PolChemDef::differenceBetweenMonomers(double threshold, int monoOrAvg)
16361636 {
1637 // qDebug() << __FILE__ << __LINE__
1638 // << "threshold" << threshold;
1639
16371640 QStringList *list = new QStringList(); ;
16381641
16391642 // We iterate in the list of monomers and compute a difference of
16861689 // At this point, make sure that diff is within the
16871690 // threshold. Note that to avoid duplicates, we remove all
16881691 // values that are negative.
1689
1690 if (abs(diff) <= threshold)
1692
1693 if (diff >= 0 && diff <= threshold)
16911694 {
1692 if (diff < 0)
1693 {
1694 // QString line = QString("---%1 - %2 = %3")
1695 // .arg(monomer2->name())
1696 // .arg(monomer1->name())
1697 // .arg(diff);
1698
1699 // list->append(line);
1700 }
1701 else
1702 {
1703 QString line = QString("%1 - %2 = %3")
1704 .arg(monomer2->name())
1705 .arg(monomer1->name())
1706 .arg(diff);
1707
1708 list->append(line);
1709 }
1695 QString line = QString("%1 - %2 = %3")
1696 .arg(monomer2->name())
1697 .arg(monomer1->name())
1698 .arg(diff);
1699
1700 list->append(line);
17101701 }
17111702 }
17121703 // End of