Skip to content

Rescaling the Form-Factor Quality - #484

Merged
comcon1 merged 9 commits into
mainfrom
rescale-ff-quality
Apr 25, 2026
Merged

Rescaling the Form-Factor Quality#484
comcon1 merged 9 commits into
mainfrom
rescale-ff-quality

Conversation

@comcon1

@comcon1 comcon1 commented Apr 6, 2026

Copy link
Copy Markdown
Member

FormFactor will be rescaled in this PR as we already discussed between collaborators. We will use the same probability estimate as for order parameters; it requires us to define the error of the position of the first minimum.

After it is done, we can issue a combined quality measure (will NOT BE DONE in this PR).

  • add testing function for estimate_error_of_min
  • implement estimate_error_of_min
  • add documentation piece for the updated FF quality measure
  • plug new quality evaluator to the fmdl_evaluate_quality

As a small useful bonus, fmdl_evaluate_quality now supports --ff-only and --op-only. Default behavior (used in CI pipelines) was not changed.

Comment thread src/fairmd/lipids/analib/formfactor.py Outdated
min_q_distance = 0.01 # Min distance btw peaks (in Q)
mqd_n = int(np.ceil(min_q_distance / delta_q)) # same in num frames
peak_ind = scipy.signal.find_peaks(-filtered, distance=mqd_n)
peak_prominence = (filtered.max() - filtered.min()) * 0.1

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How did you choose this criteria for peak prominence?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Now I made it smaller. Such that to pass the tests. We may add some more tests, but these are quite aggressive already. I use more intensive noise in the tests that we really have.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

changed in 8c8743f

idxPlusErr = ffdata[:, 0].searchsorted(m1pos + maxXerr)
idxMinusErr = ffdata[:, 0].searchsorted(m1pos - maxXerr)
popt, pcov = scipy.optimize.curve_fit(
lambda x, a, b, c: a * x**2 + b * x + c,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Did you visually check any of the fits? Or test other function forms? Does it make a difference at this region of fitting?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fits are almost the same. Square function fitting of near-minimum vicinity is done to estimate position uncertainty from data uncertainty.

@mdondrup mdondrup left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I cannot assess the validity of the formula.

@mdondrup

Copy link
Copy Markdown
Collaborator

Does this affect the ranking of the quality score? From better < to better > ?

@comcon1

comcon1 commented Apr 11, 2026 via email

Copy link
Copy Markdown
Member Author

@mdondrup

Copy link
Copy Markdown
Collaborator

I hope we can merge this soon @comcon1 . Once it is merged, I need to change the 'Best' ranking in the UI. Also, we need to bump python module in pip.

@comcon1

comcon1 commented Apr 17, 2026

Copy link
Copy Markdown
Member Author

I hope we can merge this soon @comcon1 . Once it is merged, I need to change the 'Best' ranking in the UI. Also, we need to bump python module in pip.

@hsantila checked me and had some questions. I found a mistake while answering, and sent again. She checked again (not here), I answered (not here). Now waiting for approval.

@comcon1
comcon1 marked this pull request as ready for review April 17, 2026 21:56
@comcon1
comcon1 requested a review from hsantila April 17, 2026 21:56
@comcon1
comcon1 merged commit a25c891 into main Apr 25, 2026
9 of 11 checks passed
@comcon1
comcon1 deleted the rescale-ff-quality branch May 24, 2026 14:54
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