The proto-Nucleic-Acid Builder (pNAB)
|
A file for preparing, explaining and validating options. More...
Functions | |
def | validate_all_options (options) |
A method to validate all options. More... | |
def | _align_nucleobase (base_options) |
Aligns the provided nucleobase to purine or pyrimidine in the nucleic acid base pair standard reference frame. More... | |
def | _validate_input_file (file_name) |
Method to validate that the given file exists. More... | |
def | _validate_atom_indices (indices) |
Method to validate provided lists of atom indices. More... | |
def | _validate_helical_parameters (hp_i) |
Method to validate provided helical parameters for each parameter. More... | |
def | _validate_energy_filter (energy_filter) |
Method to validate provided energy filter. More... | |
def | _validate_strand (strand) |
Method to validate provided strand sequence. More... | |
def | _validate_bool_list (x) |
Method to validate a list of bools. More... | |
Variables | |
dictionary | _options_dict = {} |
Nucleic acid builder options used in the driver. More... | |
A file for preparing, explaining and validating options.
This option file defines a dictionary containing all the available options for the builder code. options._options_dict has three keys: Backbone, HelicalParameters, and RuntimeParameters. Each of these contains a dictionary of available options in each category. Each dictionary contains a short glossory that describe the option, a long glossory giving hints on how to use this option, a default value, and a validation scheme.
This file also contains additional functions to help in the validation.
|
private |
Aligns the provided nucleobase to purine or pyrimidine in the nucleic acid base pair standard reference frame.
This function aligns the provided nucleobase to either guanine if it has two rings or to uracil if it has one ring. The provided linker atoms that connect the base to the backbone are used for alignment. A third atom used in the alignment is determined by rearraning the atoms in the molecules using the canonical order. The function loops over all atoms in the provided nucleobase and the reference nucleobase and if two atoms have the same atomic number then these atoms are used for the alignment. A new file with the aligned nucleobase is created and used instead of the provided file.
base_options | (dict) The nucleobase options defined in the input file |
|
private |
Method to validate provided lists of atom indices.
Check whether the list has two atom indices
indices | (str|list) atom indices |
|
private |
Method to validate a list of bools.
x | (list) list of bools |
|
private |
Method to validate provided energy filter.
Energy filter has five thresholds [bond, angle, torsion, van der Waals, total]
energy_filter | (str|list) A list of five energy thresholds |
|
private |
Method to validate provided helical parameters for each parameter.
Check whether the list has correct helical parameter specifications. The correct specifications are [initial value in a range, final value in a range, number of steps]. If a single value is provided, then we assume it is the only value in a range. if two values are provided, then we assume it is a range with one configuration.
This specification is for internal use in the driver for generating multiple configurations and running them in parallel. The C++ code accepts a single value for each helical parameter.
hp_i | (str|float|list) Specifications for helical parameter i |
|
private |
Method to validate that the given file exists.
Check whether the file exists or not. If it does not exist as it is, the function checks whether the file is in the "pnab/data" directory.
file_name | (str) Path to a file |
|
private |
Method to validate provided strand sequence.
We use FASTA strings to specify the sequence in the strand. This is for use in the driver. The C++ code accepts base names with more than one letter. However, writing a FASTA sequence is easier.
The names of the bases are converted to upper case letters
strand | (str|list) FASTA sequence of the strand |
def options.validate_all_options | ( | options | ) |
A method to validate all options.
It loops over all available builder options and validates the user input. For options that have not been specified by the user, a default value is provided.
options | (dict) A dictionary containing all the user-defined options |
|
private |
Nucleic acid builder options used in the driver.
This is an internal options dictionary to be used for listing, explaining and validating the options used in the code. All options here have corresponding options in the C++ code, except options._options_dict['RuntimeParameters']['pair_a_u'], which is used in the driver to override the default adenine-thymine pairing.