Skip to content

Fixed state interpolation bug

Raza, Zamaan requested to merge intensity_nan_3 into develop

Resolves #108 (closed), #98 (closed), #84 (closed).

  • Cases where we either attempt to interpolate i) between the same frame ii) frames beyond the dataset, are now handled correctly by throwing exceptions.
  • Important changes in InstrumentStateList.cpp and Qs2Events.cpp
  • Added handling for exceptions generated by bad interpolation
  • Replaced duplicated filter functionality in ShapeLibrary with PeakFilter
  • Changed tests to reflect fewer peaks available after interpolation

I suggest some discussion with the developers as to the correctness of these changes. They do not significantly change the number of peaks found, even after filtering, but they affect every part of the code in which there is InstrumentState interpolation, namely any reciprocal space transformation, including (but not limited to) coordinate transformations and corrected intensity calculations. Here is a result comparison between this branch and develop for trypsin.

The quality metrics and peak counts are minimally affected. There are some peaks with intensity NaN remaining (30/102), but these are not a result of the interpolation bug.

  1. This branch:
2020-Sep-22 07:43:32 1 PeakCollection::checkCollection: peak collection autoindexing contains: 
2020-Sep-22 07:43:32 1 640 peaks 
2020-Sep-22 07:43:32 1 0 peaks with intensity NaN 
2020-Sep-22 07:43:32 1 0 peaks with intensity zero 
2020-Sep-22 07:43:32 1 PeakCollection::checkCollection: peak collection filtered contains: 
2020-Sep-22 07:43:32 1 7720 peaks 
2020-Sep-22 07:43:32 1 0 peaks with intensity NaN 
2020-Sep-22 07:43:32 1 0 peaks with intensity zero 
2020-Sep-22 07:43:32 1 PeakCollection::checkCollection: peak collection fit contains: 
2020-Sep-22 07:43:32 1 7720 peaks 
2020-Sep-22 07:43:32 1 0 peaks with intensity NaN 
2020-Sep-22 07:43:32 1 0 peaks with intensity zero 
2020-Sep-22 07:43:32 1 PeakCollection::checkCollection: peak collection peaks contains: 
2020-Sep-22 07:43:32 1 9913 peaks 
2020-Sep-22 07:43:32 1 102 peaks with intensity NaN 
2020-Sep-22 07:43:32 1 1272 peaks with intensity zero 
2020-Sep-22 07:43:32 1 PeakCollection::checkCollection: peak collection predicted contains: 
2020-Sep-22 07:43:32 1 51081 peaks 
2020-Sep-22 07:43:32 1 0 peaks with intensity NaN 
2020-Sep-22 07:43:32 1 0 peaks with intensity zero 
2020-Sep-22 07:43:32 1 Data quality metrics (overall):
    Rmer   eRmer    Rmea   eRmea    Rpim   eRpim  CChalf   Cstar
  0.1610  0.0197  0.2163  0.0269  0.1428  0.0181  0.8994  0.9732 
2020-Sep-22 07:43:32 1 Data quality metrics (per resolution shell):
    dmin    dmax    Rmer   eRmer    Rmea   eRmea    Rpim   eRpim  CChalf   Cstar
  3.2314 50.0000  0.1548  0.0170  0.2039  0.0227  0.1305  0.0149  0.9155  0.9777
  2.5649  3.2314  0.1867  0.0280  0.2588  0.0390  0.1783  0.0271  0.7709  0.9331
  2.2407  2.5649  0.1647  0.0335  0.2311  0.0472  0.1619  0.0333  0.6684  0.8951
  2.0358  2.2407  0.1566  0.0338  0.2182  0.0476  0.1517  0.0335  0.4660  0.7974
  1.8899  2.0358  0.1839  0.0326  0.2542  0.0457  0.1748  0.0320  0.4120  0.7639
  1.7784  1.8899  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000
  1.6894  1.7784  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000
  1.6158  1.6894  0.1984  0.0499  0.2806  0.0705  0.1984  0.0499    -nan    -nan
  1.5536  1.6158  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000
  1.5000  1.5536  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000 
  1. develop:
2020-Sep-22 07:46:15 1 PeakCollection::checkCollection: peak collection autoindexing contains: 
2020-Sep-22 07:46:15 1 640 peaks 
2020-Sep-22 07:46:15 1 0 peaks with intensity NaN 
2020-Sep-22 07:46:15 1 0 peaks with intensity zero 
2020-Sep-22 07:46:15 1 PeakCollection::checkCollection: peak collection filtered contains: 
2020-Sep-22 07:46:15 1 7751 peaks 
2020-Sep-22 07:46:15 1 0 peaks with intensity NaN 
2020-Sep-22 07:46:15 1 0 peaks with intensity zero 
2020-Sep-22 07:46:15 1 PeakCollection::checkCollection: peak collection peaks contains: 
2020-Sep-22 07:46:15 1 9913 peaks 
2020-Sep-22 07:46:15 1 30 peaks with intensity NaN 
2020-Sep-22 07:46:15 1 1287 peaks with intensity zero 
2020-Sep-22 07:46:15 1 PeakCollection::checkCollection: peak collection predicted contains: 
2020-Sep-22 07:46:15 1 51205 peaks 
2020-Sep-22 07:46:15 1 0 peaks with intensity NaN 
2020-Sep-22 07:46:15 1 0 peaks with intensity zero 
2020-Sep-22 07:46:15 1 Data quality metrics (overall):
    Rmer   eRmer    Rmea   eRmea    Rpim   eRpim  CChalf   Cstar
  0.1627  0.0198  0.2188  0.0270  0.1446  0.0182  0.8910  0.9708 
2020-Sep-22 07:46:15 1 Data quality metrics (per resolution shell):
    dmin    dmax    Rmer   eRmer    Rmea   eRmea    Rpim   eRpim  CChalf   Cstar
  3.2314 50.0000  0.1714  0.0172  0.2248  0.0229  0.1428  0.0149  0.9054  0.9749
  2.5649  3.2314  0.2376  0.0294  0.3275  0.0409  0.2239  0.0283  0.7428  0.9233
  2.2407  2.5649  0.3047  0.0365  0.4268  0.0514  0.2983  0.0362  0.4658  0.7972
  2.0358  2.2407  0.4430  0.0381  0.6198  0.0535  0.4326  0.0376  0.0469  0.2993
  1.8899  2.0358  0.4532  0.0371  0.6268  0.0518  0.4314  0.0361  0.1636  0.5303
  1.7784  1.8899  1.0000  0.0443  1.4142  0.0627  1.0000  0.0443    -nan    -nan
  1.6894  1.7784  1.0000  0.0702  1.4142  0.0993  1.0000  0.0702    -nan    -nan
  1.6158  1.6894  0.4698  0.0560  0.6644  0.0792  0.4698  0.0560  1.0000  1.0000
  1.5536  1.6158  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000  0.0000
  1.5000  1.5536  0.3332  0.1924  0.4712  0.2721  0.3332  0.1924    -nan    -nan 
Edited by Raza, Zamaan

Merge request reports