-
Notifications
You must be signed in to change notification settings - Fork 664
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
Alias tempfactor & bfactors #1901
Comments
I am not 100% sure what the best way forward is (even though I raised the problem in #1899 (comment)). I am not a huge fan of lots of special casing if it can be avoided (and the Python philosophy is to "there should be preferable one way to do something"). Perhaps just the PDBWriter should take either and fail if both are present? Then the special casing is restricted to only one small part of the code and the user experience? (And then we can alias it to beta, too.) |
There's also an issue that MMTFReader used bfactors and PDBReader/Writer uses tempfactors. This leads to the annoying situation that writing a PDB from MMTF looses the tempfactors: import MDAnalysis as mda
u = mda.fetch_mmtf('1AKE')
u.select_atoms("segid A").write("1AKE_A.pdb") gives
|
Workaround for the MMTF/PDB case: import MDAnalysis as mda
u = mda.fetch_mmtf('1AKE')
u.add_TopologyAttr('tempfactors', u.atoms.bfactors) |
@lilyminium and I are keen to see this get fixed for 2.0, if anything it breaks colour-by-bfactor visualisation in NGLView. Do we need to warn users in 1.0.2? (I don't think so, but maybe I'm missing something). |
To repeat what I said on Discord, IMO we should in 2.0 but maybe not 1.0.2. My argument is that users may have assigned different information to bfactors and tempfactors in existing code. The most likely scenario to select atoms with custom tags (e.g. "bfactor 2" vs "tempfactor 2") |
Note that 1.1.0 promised 1eede18 :
If we decide to not honor this promise we would technically have to do 1.2.0 with a deprecation note. (We can decide that we're breaking semver a little bit here — but at least we should be clear about what we're doing.) |
🙀 Please no more 1.x branch - @lilyminium you're our only hope. |
To sum up earlier discussion before we all forget it, we have decided to alias bfactor to tempfactor so that tempfactor is the One True TopologyAttr. |
Fixes #1901 ## Work done in this PR - Aliases bfactor to tempfactor - Adds deprecation warnings for bfactor
These are currently separate attributes, but are in fact the same thing. Because both names are widely used maybe it makes more sense to alias them, so a single
TopologyAttr
gives you both access points...The text was updated successfully, but these errors were encountered: