Giter Site home page Giter Site logo

bio-phys / bioen Goto Github PK

View Code? Open in Web Editor NEW
14.0 8.0 8.0 48.36 MB

BioEn - Bayesian Inference Of ENsembles

License: Other

Python 64.30% C 22.82% Shell 2.07% Cython 10.81%
biological-simulations molecular-dynamics electron-paramagnetic-resonance structural-biology nmr xray-scattering-experiments bayesian-inference deer peldor data-integration

bioen's Issues

Creating `Observables` in a python session might crash the interpreter.

print('ERROR: The experimental data type {} is not implemented in BioEn yet. ' \
'Please try \"generic\" (useful for distances, NOEs, CS, J-couplings, ' \
'PREs etc.)'.format(experiment))
sys.exit()

This is a hard exit of the python interpreter. When using BioEn as a library (e.g. in a notebook) it can crash the process instead of failing gracefully. To fail gracefully an exception should be raised.

To maintain well-formatted error messages in the CLI tool one can use try-except in the main function

try:
   obs = function_that_can_raise()
except Exception as e:
   print("Exception occurred")
   print("Error Message: ")
   print(e)
   if verbose:
       raise(e)  # to show stacktrace
   sys.exit(1)  # show tool exited with an error with return-code 1

Path to BioEn analyze executable on Mac

On my laptop I had problems with DEER example Jupyter notebook as it did not find the BioEn executable. I installed the BioEn package with the --user flag.

bioen

-bash: bioen: command not found

The executable lives in /Users/lukas/.local/bin/bioen, which is was not on my path. A simple fix was simple to add this folder to the path. The question is whether there is a more general fix.

Leaked file descriptor in Deer observables class

pickle.dump([self.labels, self.moddepth, self.nrestraints, self.exp_tmp,
self.exp_err_tmp, self.sim_tmp], open(self.out_pkl, 'wb'))

This line contains a leak. The call to open returns a file descriptor that is never closed again. This is OK when using only the bioen CLI tool. It will be a problem when using the library from python and analyzing a lot of deer data examples with pkl_out set because each process only is allowed a limited number of open file descriptors. The correct solution would be to use a context manager.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.