-
Notifications
You must be signed in to change notification settings - Fork 10
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
[ENH]: Adding option to export/return PDB as a raw string #112
Comments
Hi @jbHedderich, Thank you for your suggestion. Are you interested in obtaining the coordinates of the cavity points from the string? If so, we shared a function ( Please let us know if this meets your needs. |
I have implemented an option to export PDB as a raw string in pyKVFinder v0.6.14. To use this feature, you can follow the examples below. Example 1: Using full workflow ( >>> import pyKVFinder
>>> pdb = os.path.join(os.path.dirname(pyKVFinder.__file__), 'data', 'tests', '1FMO.pdb')
>>> results = pyKVFinder.run_workflow(pdb)
>>> string = results.export(output=None)
>>> print(string)
ATOM 1 H KAA 0 0.000 0.000 0.000 1.00 0.00
...
ATOM 1000 H KAA 0 0.000 0.000 0.000 1.00 0.00
>>> string = results.export_all(output=None)
>>> print(string)
ATOM 1 H KAA 0 0.000 0.000 0.000 1.00 0.00
...
ATOM 1000 H KAA 0 0.000 0.000 0.000 1.00 0.00 Example 2: Using the stepwise workflow ( >>> import pyKVFinder
>>> pdb = os.path.join(os.path.dirname(pyKVFinder.__file__), 'data', 'tests', '1FMO.pdb')
>>> atomic = pyKVFinder.read_pdb(pdb)
>>> vertices = pyKVFinder.get_vertices(atomic)
>>> ncav, cavities = pyKVFinder.detect(atomic, vertices)
>>> string = pyKVFinder.export(None, cavities, None, vertices)
>>> print(string)
ATOM 1 H KAA 0 0.000 0.000 0.000 1.00 0.00
...
ATOM 1000 H KAA 0 0.000 0.000 0.000 1.00 0.00 Please let me know if this meets your needs. If you encounter any further issues or have additional questions, feel free to ask for assistance. |
Thanks, that helped a lot :)! |
Problem
It would be very useful to be able to return the cavities as a string in PDB format instead of immediately writing it to a file.
Thanks a lot!
Proposed solution
This should be done by editing the _export function, since the PDB string is anyways generated, right? Or are there any other possibilities that I am missing?
The text was updated successfully, but these errors were encountered: