-
Notifications
You must be signed in to change notification settings - Fork 2
Apply image shifting by fragment #124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,11 +58,15 @@ def apply_complex_alignment_transformations( | |
| # 1. Make molecules whole (protein + optional ligand) | ||
| transforms = [unwrap(group)] | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How much of a problem is this in practice? |
||
|
|
||
| # 2. Closest image shift for protein chains + ligand (if present) | ||
| 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) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it worth checking for bonds in |
||
| # Pick the largest fragment as the reference | ||
| ref_idx = max(range(len(fragments)), key=lambda i: fragments[i].n_atoms) | ||
| reference = fragments[ref_idx] | ||
| shift_targets = [f for i, f in enumerate(fragments) if i != ref_idx] | ||
| shift_targets += ligands | ||
| if shift_targets: | ||
| transforms.append(ClosestImageShift(chains[0], shift_targets)) | ||
| transforms.append(ClosestImageShift(reference=reference, targets=shift_targets)) | ||
|
|
||
| # 3. Align on protein backbone/atoms | ||
| transforms.append(Aligner(protein)) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you have to avoid doing this if there is no protein, otherwise it'll crash out.
Note: this also shows that we don't have any tests that are solvent only - we should raise an issue to deal with that.