Skip to content

Test - #18

Closed
thbake wants to merge 2 commits into
cbielow:QC2018from
thbake:test
Closed

Test#18
thbake wants to merge 2 commits into
cbielow:QC2018from
thbake:test

Conversation

@thbake

@thbake thbake commented Apr 26, 2018

Copy link
Copy Markdown

No description provided.

@cbielow cbielow left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is at the beginning and does not compile.

Please remove unrelated files, i.e. everything containing ~ at the end (temporary files?).

};
}

static double toDouble(const String& this_s);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be removed?

t.header.push_back("ppm after");

// Checks if data came from the InternalCalibration tool.
for (std::vector<std::pair<std::string,CsvFile>>::const_iterator it = cFile_.begin(); it != cFile_.end(); ++it)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not required. The Metric should receive the correct CSV files in the contructor. i.e. the caller must select the correct CSVFiles.
Right now, this metric needs external information, i.e. how does it know "InternalCalibration"? And if it gets the other CSV files, what happens then?

// store data from csv file to row
fl.getRow(d_line,CurrentRow);
// convert Strings to double value
for_each(CurrentRow.begin(), CurrentRow.end(), toDouble);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this probably does not work as intended...

t.header.push_back("sequence");

// not sure about this for loop
for (std::vector<std::pair<String,String>::const_iterator it = ifile_.begin(); it != ifile_.end() it++)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again, the constructor should be receiving a list of idXML filenames (or the IDs themselves). Then this for-loop becomes void.

for (std::vector<String>::const_iterator it = idxmls.begin(), it =! idxmls.end(); it++)
{
// access all PeptideIdentifications of an idXML file
const std::vector<PeptideIdentification>& pep_ids = it->getPeptideIdentifications();

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this cannot work. How is a string supposed to have PeptideIdentifications?
You need to load the idXML file first.

}
// sort i_data
std::sort(t.begin(), t.end(), MassCalibration::Compare_i_data());

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, and now?

You need to combine the information from the CSV and the idXML.

public:

// Constructor
MassCalibration(std::vector<std::pair<OpenMS::String, OpenMS::CsvFile>> files, std::vector<std::pair<OpenMS::String, OpenMS::String>> ifiles):

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

implementation should be in the .cpp, not here


int getResidualsData(MzTab& mz_tab_obj, MassCalibration::Table& t) const;

int getAASequenceData(MzTab&) const;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this signature does not match the implementation

struct Compare_c_data :
std::binary_function<Table, Table, bool>
{
bool operator()(const Table& lhs, const Table& rhs) const

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this?
Comparing two tables based on CSV RT?
This does not work.. for multiple reasons.


double getcRT(Size i) const
{
return c_data[i][0];

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c_data is a vector of StringLists. So c_data[i] returns a stringlist and c_data_[i][0] returns a string, not a double.

@cbielow cbielow closed this May 2, 2018
cbielow pushed a commit that referenced this pull request Mar 11, 2019
cbielow pushed a commit that referenced this pull request Mar 10, 2020
cbielow pushed a commit that referenced this pull request Aug 26, 2026
…MS#9767 audit (OpenMS#9790)

Fixes 14 of the "no-doubt, easy" defects catalogued in the implementation-
consistency audit OpenMS#9767. Each fix is small and localized, ships with a focused
regression test that fails (crash/hang/assert) before and passes after, and
preserves behavior on valid inputs (only the buggy edge cases change). The set
was reviewed with Codex and CodeRabbit; their findings are incorporated below.

Boundary / crash / underflow:
- #4  QTClusterFinder / FeatureGroupingAlgorithmKD: guard the empty mass range so
      feature-empty input maps don't dereference front()/back()/size()-1. The
      guards run before the linking work: KD calls postprocess_() first so per-map
      protein/unassigned-peptide IDs survive; QT returns before the single-partition
      branch, whose setParameters_() otherwise throws on the empty maps' invalid
      max m/z (the <2-maps case is validated by the caller).
- #5  TheoreticalSpectrumGenerator: internal-fragment loop bound underflowed for
      peptides shorter than 4 (l < size-1-2) -> use additive l+3 < size.
- #18 MzTab nextPSMRow (both streams): empty hit list underflowed size()-1 and
      looped forever with export_all_psms -> use current_psm_idx_+1 >= size().
- #30 OMSSACSVFile::load: bound the quote-skipping scan by line.end().

Correctness (wrong field / sentinel / flag):
- #3  IDScoreGetterSetter::addToPeptideScoreMap_: the try_emplace "inserted" flag
      was misused, so a duplicated sequence never kept a later better score. Now
      updates BOTH the score and its target/decoy label, and resolves equal-score
      target/decoy ties to the target (matching getPickedProteinScores_), so the
      peptide-level representative is deterministic and input-order independent.
- #6  MRMFeatureFilter: group retention_time_u %RSD read the _l mean/variance.
- #12 ConsensusFeature range max sentinel minPositive() -> minNegative().
- #35 TIC::Result::operator== now includes relative_intensities.

Serialization round-trip:
- #17 Base64::decodeStrings: keep length-1 segments (dropped single-char strings).
      Also updates the malformed "====" corrupted-input expectation (now decodes
      to one placeholder byte instead of being silently dropped).
- #19 ArrowIOHelpers: parse int meta with stoll -> SignedSize (was 32-bit).
- #20 FeatureMapArrowIO::importPSMsFromArrow: group PSM rows by P_ID value, not by
      row adjacency (matches QPXFile/ConsensusMapArrowIO).

Stale-state on reload / clear:
- #27 QcMLFile::load: also clear derived run_/set_Name_ID_map_.
- #32 CalibrationData::clear: also clear groups_.
- #33 KDTreeFeatureMaps: init num_maps_{0}; clear() also clears rt_ cache.

Not included: #1 (=OpenMS#9488 PROC-23, already in open PR OpenMS#9616); #2 (correct but the
pooled split-charge FDR path has order-dependent side effects that preclude a
clean regression test in isolation); #7 (percentile index -- verified NOT a bug:
the "-1" is part of the double expression, so the negative value truncates to 0,
no underflow); #38 (TOPP-tool aux-array desync, needs a CLI test). Remaining audit
items need an API/deprecate decision.

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants