Methods Implementation (Automated Setup)

Methods are implemented in subdirectories of csrosetta3/flag_library/methods. It is possible to provide common functionality in abstract base-methods in sub-directories starting with “_”. Each non-abstract method, METHOD, provides python-code in methods/METHOD/options.py and abstract base-classes provide code in methods/_BASE_METHOD/BASE_METHOD_options.py . In these python files, a class METHOD inherited from BasicMethod (csrosetta3/python) has to be implemented and instantiated. You can start your own options.py by copying methods/TEMPLATE/options.py. For working examples see /methods/_denovo_base/denovo_options.py and methods/abrelax/options.py.

Subclasses of BasicMethod have to overload two methods, setup_file_library and make_target_flags.

Method setup_file_library is responsible for reading templated flag-files provided in the same directory as the methods python code. These templated files are parsed during the generation of a run and variables of the form $CM_XXX are replaced with appropriate values. The FileLibrary is responsible to provide all flag-files and patch-files for the generation of the Run. It also provides mechanisms to patch the content of these files. I.e., the flag -iterative:max_nstruct 0 0 0 0 0 0 , has to be changed into -iterative:max_nstruct -1 -1 0 0 0 0 in some variants of the RASREC protocol. Instead of providing a whole new method for this variant we use the patching-mechanism to change this flag.

Method make_target_flags() is called during Run generation and is responsible for parsing method-specific cmd-line options. For example, cmd-line option -frags makes only sense in the context of denovo-structure calculations of ROSETTA and thus is defined in methods/_denovo_base/denovo_options.py. The code to handle cmd-line options such as -frags lives in make_target_flags() .