Skip to content
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]: Add option to return PDB as a raw string in pyKVFinder.export function #113

Merged
merged 3 commits into from
Jun 11, 2024

Conversation

jvsguerra
Copy link
Member

@jvsguerra jvsguerra commented Jun 11, 2024

Major changes:

  • pyKVFinder.export(fn) now accepts None as the fn input and outputs the PDB-formatted data as a raw string.

Usage:

>>> 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

or,

>>> 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

@jvsguerra jvsguerra added the enhancement New feature or request label Jun 11, 2024
@jvsguerra jvsguerra self-assigned this Jun 11, 2024
@jvsguerra jvsguerra linked an issue Jun 11, 2024 that may be closed by this pull request
@jvsguerra jvsguerra merged commit 20d854d into LBC-LNBio:master Jun 11, 2024
8 checks passed
@jvsguerra jvsguerra deleted the issue-#112 branch June 11, 2024 19:20
@jvsguerra jvsguerra changed the title Add option to return PDB as a raw string in pyKVFinder.export function [ENH]: Add option to return PDB as a raw string in pyKVFinder.export function Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ENH]: Adding option to export/return PDB as a raw string
1 participant