-
Notifications
You must be signed in to change notification settings - Fork 657
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
Set b-factor for PDB file #1359
Comments
See #1092 . The problem is that the bfactors aren't in the original topology and this needs to be updated not the atomgroup you selected there. We are working on it. There should also be a PR from @richardjgowers that fixes this. Some comments on the UI/API would be nice. |
I am going to re-open this one, even though it is a duplicate of #1092 because
|
Note: at the moment you have to do manually add the tempfactors topology attribute u.add_TopologyAttr(MDAnalysis.core.topologyattrs.Tempfactors(np.zeros(len(u.atoms))))
u.atoms.tempfactors = 0.5
u.atoms.write("withbfacs.pdb") |
We might not do much more here than properly document it. Opinions? |
@orbeckst I think it is possible to make this behaviour work, I (or someone else) just needs to get the hacking done under the hood. Short term documenting it is definitely a good thing though. |
@orbeckst Just curious why "b-factor" is renamed "tempfactor" in the new version? |
tempFactor is the offical name in the ATOM record of the PDB format. We don't like camelCase so we use tempfactor. We also use the convention that "arrays" are plural words, hence tempfactors. The new usage is incompatible with previous versions of MDAnalysis where you could do things like EDIT: And I think we didn't mind renaming bfactors -> tempfactors because we were breaking everything anyway so we opted to go with the "proper" PDB name. |
I see, thank you! |
This should work now with #1092 and is also documented under Universe.add_TopologyAttr. |
@weiHelloWorld – just fyi, we added |
@orbeckst Thank you! |
Expected behaviour
I have a pdb file which I want to set b-factors to the atoms.
Actual behaviour
The b-factor field in the pdb file is not changed
Code to reproduce the behaviour
The content of test.pdb:
Currently version of MDAnalysis:
py35, mda0.16.1
The text was updated successfully, but these errors were encountered: