Apply image shifting by fragment - #124
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #124 +/- ##
==========================================
+ Coverage 98.35% 98.38% +0.02%
==========================================
Files 10 10
Lines 487 496 +9
==========================================
+ Hits 479 488 +9
Misses 8 8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| @@ -58,11 +58,15 @@ def apply_complex_alignment_transformations( | |||
| # 1. Make molecules whole (protein + optional ligand) | |||
| transforms = [unwrap(group)] | |||
There was a problem hiding this comment.
This now makes the alignment very very slow. Unwrap loops over the fragments and before (when there was no bond information), there were a lot of fragments that were very small.
There was a problem hiding this comment.
How much of a problem is this in practice?
There was a problem hiding this comment.
@IAlibay I just checked the timing, for a single lambda windows, 51 frames, the applying of the transformations took ~16 sec, but since this happens multiple times, each time for each analysis, this is x4.
I just switched it to doing the applying the alignments first and storing it in memory, no it's faster. It will still be a considerable cost for e.g. ABFE with the many lambda windows though.
IAlibay
left a comment
There was a problem hiding this comment.
One thing to fix, one question, and a missing news entry.
Otherwise it looks great to me!
| @@ -58,11 +58,15 @@ def apply_complex_alignment_transformations( | |||
| # 1. Make molecules whole (protein + optional ligand) | |||
| transforms = [unwrap(group)] | |||
There was a problem hiding this comment.
How much of a problem is this in practice?
| chains = [seg.atoms for seg in protein.segments] | ||
| shift_targets = chains[1:] + ligands | ||
| # 2. Closest image shift for protein fragments + ligand (if present) | ||
| fragments = list(protein.fragments) |
There was a problem hiding this comment.
Is it worth checking for bonds in protein before you do this?
There was a problem hiding this comment.
Added a check above.
Co-authored-by: Irfan Alibay <IAlibay@users.noreply.github.com>
…rgy/openfe_analysis into align_fragment_based
…rgy/openfe_analysis into align_fragment_based
When two chains of a protein have the same
segid, the PBC are not handled correctly during alignment since they would appear as one segment. This PR switches to use theprotein.fragmentsinstead. For fragments to be recognized correctly, we first need to guess the bonds in the protein.Having the large fragments now makes
unwrap()very slow which is fragment based.