The proto-Nucleic-Acid Builder (pNAB)
Functions | Variables
options Namespace Reference

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...
 

Detailed Description

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.

Function Documentation

◆ _align_nucleobase()

def options._align_nucleobase (   base_options)
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.

Parameters
base_options(dict) The nucleobase options defined in the input file

◆ _validate_atom_indices()

def options._validate_atom_indices (   indices)
private

Method to validate provided lists of atom indices.

Check whether the list has two atom indices

Parameters
indices(str|list) atom indices
Returns
indices after validation
See also
validate_all_options
_options_dict

◆ _validate_bool_list()

def options._validate_bool_list (   x)
private

Method to validate a list of bools.

Parameters
x(list) list of bools
Returns
validated list of bools
See also
validate_all_options
_options_dict

◆ _validate_energy_filter()

def options._validate_energy_filter (   energy_filter)
private

Method to validate provided energy filter.

Energy filter has five thresholds [bond, angle, torsion, van der Waals, total]

Parameters
energy_filter(str|list) A list of five energy thresholds
Returns
energy_filter after validation
See also
validate_all_options
_options_dict

◆ _validate_helical_parameters()

def options._validate_helical_parameters (   hp_i)
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.

Parameters
hp_i(str|float|list) Specifications for helical parameter i
Returns
hp_i after validation
See also
validate_all_options
_options_dict
pNAB.pNAB.run

◆ _validate_input_file()

def options._validate_input_file (   file_name)
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.

Parameters
file_name(str) Path to a file
Returns
file_name after validation
See also
validate_all_options
_options_dict

◆ _validate_strand()

def options._validate_strand (   strand)
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

Parameters
strand(str|list) FASTA sequence of the strand
Returns
strand list after validation
See also
validate_all_options
_options_dict

◆ validate_all_options()

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.

Parameters
options(dict) A dictionary containing all the user-defined options
Returns
None; options is modified in place
See also
pNAB.pNAB.__init__
_options_dict

Variable Documentation

◆ _options_dict

dictionary options._options_dict = {}
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.

See also
jupyter_widgets.builder()
PNAB::Backbone
PNAB::HelicalParameters
PNAB::RuntimeParameters