-
Notifications
You must be signed in to change notification settings - Fork 22
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
Suggestion: Make structural elements mutable #22
Comments
Thanks for trying out the package. I agree that mutable elements would be great. Sadly, it's a little more complex than adding More importantly though, you can't just change properties directly and expect the parent/child relationships to work. For example, if you relabel a chain you would need to modify the chain dictionary in the parent model. I think the right way to do it would be to have setters ( The lowest-hanging fruit would be to do |
Thank you for your response. I suspected it won't be so easy as making the structures mutable, and I was thinking in setters, as you explained. I guess for now I'll try to implement the creation of new elements from existing ones in my code, copying what I want to preserve and modifying the rest. |
Someone else asked about this on Discourse: https://discourse.julialang.org/t/how-can-i-set-a-specific-chain-name-for-a-structure-biostrcuture-package/50211 Making the structs mutable doesn't actually lose any speed, so I'll try and get some setters coded. |
I have the same use case as @amaurypm and have ended up here after going down the same route that he has. Do you want some help on this? |
That would be great, I haven't had time myself. I am happy to help and to review PRs, I would recommend seeing how |
Adds two function for assigning the chainid, chainid!(chain, new_id) and chainid!(residue, new_id). For GitHub issue BioJulia#22.
I took a stab at it. It was a bit more complicated than I thought it would be :) |
* Allow chain id to be assigned with chainid!() Adds two function for assigning the chainid, chainid!(chain, new_id) and chainid!(residue, new_id). For GitHub issue #22. * Create a PDBConsistencyException - Throw PDBConsistencyException when trying to change a chain's ID to an ID that already exists. - Throw PDBConsistencyException when moving a residue to a chain that already has a residue with that number. - Update the model's chain dictionary when changing a chain ID. * Rename PDBConsistencyException to PDBConsistencyError - Added a test for ensuring KeyError thrown when ChainID changed to something else.
Thanks to @gusennan the |
I just was trying to use BioStructures to solve a problem which required making copies of chains, rename them, alter atom serial numbers and other modifications to structural elements. In its current implementation only the atom coordinates can be modified. This package is great, but I think it could be much more useful if the corresponding structures are declared as mutable, and I don't see any downside on doing that.
It would be great to be able to modify atoms, residues and chains and create new models/structures with them.
Best regards,
Amaury
The text was updated successfully, but these errors were encountered: