The FileLibrary
provides the functionality to patch flag-files by Method extensions or Method patches. Flag-files are read into the FileLibrary in setup_file_library
, are stored as dictionaries and are later re-assembled into a flat file during the generation of Runs by FileLibrary.read_lib_file() called by the Substitutor. The storage of flag-files and patch-files as dictionaries allows to easily replace single flags or add more arguments to existing flags.
The following methods exist to manipulate contents in the FileLibrary.
provide_file()
a file is read into the file-library
override()
a flag is replaced entirely (e.g., -iterative:max_nstruct 0 0 0 0 0 0
–> -iterative:max_nstruct -1 -1 0 0 0 0
add()
additional entries are added to a flag (e.g., -rdc med1.rdc
–> -rdc med1.rdc med2.rdc
remove()
a flag is removed
Additionally to files the FileLibrary also provides strings. This functionality is used to specify the executable and the command-line. Use method add_string()
for this.
Examples:
fl.provide_file( "flags", path, "flags_iterative" )
fl.provide_file( "flags", path, "flags_cs_rescore" )
fl.provide_file( "others", path, "noe_super_quick_relax.txt" )
fl.add_string( "commandline", "@flags_iterative -run:archive");
if args.fix_topol:
fl.override("flags", "flags_iterative", "-iterative:max_nstruct -1 -1 0 0 0 0" )
The Method should provide all flag-files in the FileLibrary as happened here, for instance, for the file “flags_cs_rescore”. Whether the file is later used is decided by the Substitutor
based on whether it finds a “@flags_cs_rescore” entry during parsing of the commandline.