| |
THE YASARA PYTHON MODULE IS IN BETA-TESTING PHASE, PLEASE REPORT PROBLEMS EARLIER THAN LATER
There are currently three ways of running YASARA automatically:
- Yanaconda macros, the easiest solution.
- Python plugins, that are activated by clicking on a menu entry and then perform certain tasks.
- The YASARA Python module, which you can simply import into your Python scripts, as described here.
To use YASARA from your Python scripts, perform the following installation steps:
- Make sure that YASARA has been run at least once.
- Copy the YASARA module loader yasara/pym/yasara.py (Linux), yasara\pym\yasara.py (Windows) or YASARA.app/yasara/pym/yasara.py (MacOSX)
to the directory where you keep your Python scripts. If you have administrator privileges, you can also
copy it directly to the place where Python collects its modules (e.g. /usr/lib/pythonX.Y in Linux)
- Import the YASARA module in your script as shown in the example below,
which loads the PDB file 1crn:
from yasara import *
LoadPDB("1crn")
You can also resort to the following alternative, which requires more typing and is therefore not used here
(if you choose this option, you have to prepend 'yasara.' to all variable names and function calls shown throughout the rest of this chapter).
import yasara
yasara.LoadPDB("1crn")
|