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

allow skipping of frames where PROPKA fails #10

Closed
orbeckst opened this issue Oct 30, 2017 · 3 comments
Closed

allow skipping of frames where PROPKA fails #10

orbeckst opened this issue Oct 30, 2017 · 3 comments
Assignees

Comments

@orbeckst
Copy link
Member

orbeckst commented Oct 30, 2017

If PROPKA fails for mysterious reasons then we want to have the option to move on and skip frames.

requirements

  • keyword argument that allows ignoring failing frames (skip_failing = True)
  • use try/except to skip
  • log frames that fail
  • log error message at end if any frames were skipped and summarize the percentage of skipped frames

design notes

Put a try/except around https://github.com/Becksteinlab/propkatraj/blob/master/propkatraj/propkatraj.py#L74 together with the logging.

  • If skip_failing = False then raise the exception.
  • If skip_failing = True then log error and continue

Something like

try:
        mol = pk.single(pstream, optargs=['--quiet'])
except IndexError as err:
        if not skip_failing:
            raise
        else:
            # log ...
            # continue the loop at the next frame, not sure if this
            # is working....
            continue
finally:
       pstream.close(force=True) # deallocate

(IndexError is the PROPKA error that @rsexton2 encounters.)

rsexton2 added a commit that referenced this issue Oct 30, 2017
@orbeckst
Copy link
Member Author

orbeckst commented Nov 6, 2017

@rsexton2 please attach a zip file with structure and trajectory that fail together with the code you used for testing. Thanks!

@rsexton2
Copy link
Contributor

rsexton2 commented Nov 6, 2017

Script used where failing frame is isolated (ts = 1414ns).

import MDAnalysis as mda
import propkatraj

traj = 'test_traj.xtc'
topology = 'test_top.gro'
u = mda.Universe(topology, traj)

pkas = propkatraj.get_propka(u, sel='protein', skip_failure=True, start=10, stop=19)

@rsexton2
Copy link
Contributor

rsexton2 commented Nov 7, 2017

Zip file containing the topology and trajectory where propka fails.

test_traj_top.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants