imp
imp copied to clipboard
Cross correlation evaluates to > 1.0
Test and files added in 2e3590ae7e showing CoarseCC.cross_correlation_coefficient()
evaluating to > 1.0.
I see this when adding two cropped maps together and comparing them to the original map.
Failing test is in medium_test_correlation.py
@ichem001 do you have any insight into what's happening here?
I have seen it happened before; it is one of the reason I do not rely on CoarseCC
anymore and developed the new scoring function.
When I saw the behavior, it was caused by numerical instability during normalization. When the ccc
is normalized, this is where instability occurs (probably because of mean and rms). see:
https://github.com/salilab/imp/blob/c1b65da7176e2419f6a6995988a762d3424386d0/modules/em/src/CoarseCC.cpp#L116-L117
Seeing a behavior that may be related:
CoarseCC.cross_correlation_coefficient
for near optimal localization is most always negative. (ccc < 0.).
This is not numerical instability. It's because the EM code caches the RMS and dmean and does not clear this cache when adding two maps together, so incorrect values are used in the CCC calculation. Should be easy to fix though.