-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Added methods to remove children of disordered Entities #3266
Added methods to remove children of disordered Entities #3266
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3266 +/- ##
==========================================
- Coverage 83.93% 83.93% -0.01%
==========================================
Files 317 317
Lines 51556 51584 +28
==========================================
+ Hits 43275 43297 +22
- Misses 8281 8287 +6
Continue to review full report at Codecov.
|
Are there pre-existing similar methods on the other objects for removing children? How would you remove a normal atom from a chain for example? |
There are. Entity has I used |
I think that in the above example, the calling of altlocs.remove(atom.selected_child) is unnecesary, because altlocs is only a list not stated to be used afterwards. The object tree edition is done in the for cycle. |
I had a tiny typo in the for. The idea was to show how to remove all other altlocs but the primary one, thus the |
Thanks for clarifying the thoughts behind the method naming. That makes sense. I think that's all I can usefully offer for a review - who else would you suggest for a more informed second opinion? Maybe @etal? |
Without wanting to bother him too much (I've been pestering both of you lately with all these PRs...), @jgreener64 would be a good reviewer if @etal is not available! |
I'm not so familiar with the ways to modify entities or the internals of the disorder code, so am not sure I'll be able to thoroughly review this. Seems okay from a quick look though. On a separate note, possibly for another PR, it would be good to add some material to the docs on adding or removing entities to structure objects. |
Thanks @jgreener64 ! Indeed. I was thinking about that this weekend - at some point in the past we discussed moving the tutorials to Jupyter notebooks. I remember @tiagoantao was leading this and indeed, there's a repo. Given the pervasiveness of conda and jupyter notebooks nowadays, I would be tempted to revist this approach to illustrate a bunch of examples (basic and not so basic) of our codebase. @peterjc , there are two folders in Related: the "Going 3D" section of the tutorial could use a little reorganization and update. |
Meanwhile, I will merge this. I tested this branch on a few thousand PDB files (~8000) and there seem to be no outstanding issues. |
I think (without checking the history) that the cookbook folder was superceded by the cookbook category on the then wiki based website: https://biopython.org/wiki/Category:Cookbook - I think |
Thanks. What do you think about moving these (including the recipes on the wiki/website) to a notebook format and storing them in the main source tree? |
Does it have to be the same repository? Could we can run automated continuous integration testing on the notebooks? Static documentation without tests came become out of date surprisingly often (and things like doctests and testing examples in the tutorial often catches gaps in our main test coverage). |
Nope, it can be a separate one. We can run CI on the notebooks, I did exactly the same for another repo of mine. I'll start with Bio.PDB and then we can see how to proceed? Shall I make a repo myself and maybe later transfer it or create one directly under the biopython org? |
If you want to make one under https://github.com/biopython/ that sounds sensible to me, but by all means experiment first on your own repository first if you'd rather. |
Having notebooks in a separate repository would make it easy to test both the latest Biopython master branch and one or more recent releases - that would be a plus. |
👍 Thank you! I'll give it a shot then on my own account first not to pollute the main account :) |
I hereby agree to dual licence this and any previous contributions under both
the Biopython License Agreement AND the BSD 3-Clause License.
I have read the
CONTRIBUTING.rst
file, have runpre-commit
locally,and understand that AppVeyor and TravisCI will be used to confirm the Biopython unit
tests and style checks pass with these changes.
I have added my name to the alphabetical contributors listings in the files
NEWS.rst
andCONTRIB.rst
as part of this pull request, am listedalready, or do not wish to be listed. (This acknowledgement is optional.)
Disordered entities like DisorderedAtom and DisorderedResidues allow adding children to them but not removing. Removing is useful when editing structures. This PR adds methods to allow that to happen and simplifies, for instance, removing altlocs from a structure:
The methods do not remove the disordered entity completely even if it is empty. I thought that would be better left to the user to do it explicitly from the parent. They do change the
__repr__
of the disordered entity to signal that they are empty.