Skip to content

Feature/msstats - #3485

Merged
hroest merged 142 commits into
OpenMS:developfrom
timosachsenberg:feature/msstats
May 30, 2018
Merged

hroest merged 142 commits into
OpenMS:developfrom
timosachsenberg:feature/msstats

Conversation

@timosachsenberg

Copy link
Copy Markdown
Contributor

No description provided.

lukaszimmermann and others added 30 commits March 30, 2018 11:33
…esign TSV

The BioReplicate column for MSstats is currently missing
@hroest

hroest commented May 29, 2018

Copy link
Copy Markdown
Contributor

Ok I trimmed it down to 6 mb... hope thats fine

in general it still seems large but in this case it compresses to < 500 kb which I am fine with. It would be nice to have more tractable testcases as well, generally it is better to have well-reasoned test cases that cover edge cases than just some random file from an experiment. If something goes wrong, it is hard to reason what went wrong and why

Comment thread src/utils/MSstatsConverter.cpp Outdated
String _condition,
String _bioreplicate,
String _run,
String _fraction

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can you make all these const String& ?

SampleSection(
std::vector< std::vector < String > > content,
std::map< unsigned, Size > sample_to_rowindex,
std::map< String, Size > columnname_to_columnindex

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

make all of these const-ref?


/// return if each fraction number is associated with the same number of runs
bool sameNrOfRunsPerFraction() const;
ExperimentalDesign(MSFileSection msfile_section, SampleSection sample_section);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

make const-ref?

@hroest hroest left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I assume this replaces #3339 and #3332

can you add tests to the pyOpenMS test file: https://github.com/OpenMS/OpenMS/blob/develop/src/pyOpenMS/tests/unittests/test000.py ?

@timosachsenberg @lukaszimmermann are you ready to merge?

some (small) changes, including test that the Experimental Design can be accessed from pyOpenMS are required and then we are ready.

@timosachsenberg

Copy link
Copy Markdown
Contributor Author

I'll add the pyOpenMS tests.
quick question: is it intended that def testString(): has no @report ?

@timosachsenberg
timosachsenberg force-pushed the feature/msstats branch 2 times, most recently from e837814 to e07b576 Compare May 30, 2018 08:03
@timosachsenberg

Copy link
Copy Markdown
Contributor Author

@hroest stupid question but where does the test file need to go?

@hroest

hroest commented May 30, 2018

Copy link
Copy Markdown
Contributor

@hroest stupid question but where does the test file need to go?

probably src/pyOpenMS/tests/unittests and then do this

dirname = os.path.dirname(os.path.abspath(__file__))
self.filename = os.path.join(dirname, "test.TraML").encode()

@hroest

hroest commented May 30, 2018

Copy link
Copy Markdown
Contributor

great, looks ready to merge from my end 👍

@hroest
hroest merged commit ab6cf7e into OpenMS:develop May 30, 2018
@timosachsenberg
timosachsenberg deleted the feature/msstats branch July 19, 2018 09:26
timosachsenberg added a commit that referenced this pull request Aug 9, 2026
…rting on an unidentifiable input

fatalErrorIf_ took its exit code as an `int` and threw it, while main_ catches
`const ExitCodes&`. C++ exception matching does not convert an int to an enum, and
TOPPBase has no catch-all, so the throw escaped main() and the process died:

  $ MSstatsConverter -in unidentifiable.dat -in_design design.tsv -out out.csv
  Warning: Could not determine format of input file 'unidentifiable.dat'!
  MSstatsConverter.cpp(198): FATAL: Input type is not consensusXML!
  terminate called after throwing an instance of 'int'
  Aborted (core dumped)          # exit 134

Changing the parameter to ExitCodes makes the thrown object match the existing handler;
the tool now returns ILLEGAL_PARAMETERS (6). Verified: exit 134 -> exit 6.

This is not a regression. It has been on develop since the tool was merged in #3485
(ab6cf7e, 2018-05-30), introduced two months earlier by 04e4be8, which changed
`catch(int)` to `catch(const ExitCodes&)` while making the helper take and throw an int --
the pre-merge feature-branch version, with `catch(int)` matching `throw 1`, was correct
and is the only version that ever worked.

It went unnoticed because the path is narrow, not because it was unreachable: TOPPBase
has warned rather than refused on an undeterminable input type since ~2008, but
FileHandler::getType sniffs content as well as extension, so a recognized-but-wrong file
(.mzML, .tsv) is rejected cleanly before main_ runs, and a misnamed but valid consensusXML
is identified by content and processed normally. Only a file unidentifiable by BOTH
extension and content reaches fatalErrorIf_.

Regression test: TOPP_MSstatsConverter_unknown_input_type asserts the EXACT exit code via
a new check_exit_code.cmake helper. ctest's WILL_FAIL cannot express this -- it treats a
crash and a clean error alike, so it would have passed on the bug -- and
PASS_REGULAR_EXPRESSION ignores the exit code entirely (the FATAL line is printed in both
cases). Confirmed to fail on purpose: with the int restored the test reports
"Expected exit code 6, got 'Subprocess aborted'".

TriqlerConverter had the identical copy-paste defect; it is removed in #9898. A repo-wide
sweep found no other TOPP tool throwing a numeric type without a matching handler
(MSFraggerAdapter throws ints but catches them).

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01S7QNzj4dhRnX5htcHZFmDm
timosachsenberg added a commit that referenced this pull request Aug 10, 2026
…rting on an unidentifiable input (#9901)

fatalErrorIf_ took its exit code as an `int` and threw it, while main_ catches
`const ExitCodes&`. C++ exception matching does not convert an int to an enum, and
TOPPBase has no catch-all, so the throw escaped main() and the process died:

  $ MSstatsConverter -in unidentifiable.dat -in_design design.tsv -out out.csv
  Warning: Could not determine format of input file 'unidentifiable.dat'!
  MSstatsConverter.cpp(198): FATAL: Input type is not consensusXML!
  terminate called after throwing an instance of 'int'
  Aborted (core dumped)          # exit 134

Changing the parameter to ExitCodes makes the thrown object match the existing handler;
the tool now returns ILLEGAL_PARAMETERS (6). Verified: exit 134 -> exit 6.

This is not a regression. It has been on develop since the tool was merged in #3485
(ab6cf7e, 2018-05-30), introduced two months earlier by 04e4be8, which changed
`catch(int)` to `catch(const ExitCodes&)` while making the helper take and throw an int --
the pre-merge feature-branch version, with `catch(int)` matching `throw 1`, was correct
and is the only version that ever worked.

It went unnoticed because the path is narrow, not because it was unreachable: TOPPBase
has warned rather than refused on an undeterminable input type since ~2008, but
FileHandler::getType sniffs content as well as extension, so a recognized-but-wrong file
(.mzML, .tsv) is rejected cleanly before main_ runs, and a misnamed but valid consensusXML
is identified by content and processed normally. Only a file unidentifiable by BOTH
extension and content reaches fatalErrorIf_.

Regression test: TOPP_MSstatsConverter_unknown_input_type asserts the EXACT exit code via
a new check_exit_code.cmake helper. ctest's WILL_FAIL cannot express this -- it treats a
crash and a clean error alike, so it would have passed on the bug -- and
PASS_REGULAR_EXPRESSION ignores the exit code entirely (the FATAL line is printed in both
cases). Confirmed to fail on purpose: with the int restored the test reports
"Expected exit code 6, got 'Subprocess aborted'".

TriqlerConverter had the identical copy-paste defect; it is removed in #9898. A repo-wide
sweep found no other TOPP tool throwing a numeric type without a matching handler
(MSFraggerAdapter throws ints but catches them).


Claude-Session: https://claude.ai/code/session_01S7QNzj4dhRnX5htcHZFmDm

Co-authored-by: Claude Opus 5 (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.

3 participants