Example #1
0
    default = "A",
    py_type = "str",
    desc_short = "permutation",
    desc = "Which of the two permutations 'A' or 'B' to create.  Three permutations are possible, and 'A' and 'B' select those which are not the starting combination.",
    wiz_element_type = "combo",
    wiz_combo_choices = [
        "A",
        "B"
    ],
    wiz_read_only = True
)
# Description.
uf.desc.append(Desc_container())
uf.desc[-1].add_paragraph("The isotropic and pseudo-elliptic cone frame order models consist of multiple solutions as the optimisation space contains multiple local minima.  Because of the constraint cone_theta_x <= cone_theta_y in the pseudo-ellipse model, there are exactly three local minima (out of 6 possible permutations).  However the cone_theta_x == cone_theta_y condition of the isotropic cone collapses this to two minima.  The multiple minima correspond to permutations of the motional system - the eigenframe x, y and z-axes as well as the cone opening angles cone_theta_x, cone_theta_y, and cone_sigma_max associated with these axes.  But as the mechanics of the cone angles is not identical to that of the torsion angle, only one of the three local minima is the global minimum.")
uf.desc[-1].add_paragraph("When optimising the pseudo-elliptic models, specifically the '%s' and '%s' model, any of the three local minima can be found.  Convergence to the global minimum is not guaranteed.  Therefore this user function can be used to permute the motional system to jump from one local minimum to the other.  Optimisation will be required as the permuted parameters will not be exactly at the minimum." % (MODEL_PSEUDO_ELLIPSE, MODEL_PSEUDO_ELLIPSE_TORSIONLESS))
table = uf_tables.add_table(label="table: frame_order.permute_axes combinations", caption="The motional eigenframe axis permutations for the frame order models.", caption_short="The frame order axis permutations.")
table.add_headings(["Condition", "Permutation name", "Cone angles", "Axes"])
table.add_row(["x < y < z", "Self", "[x, y, z]", "[x, y, z]"])
table.add_row(["         ", " A  ", "[x, z, y]", "[-z, y, x]"])
table.add_row(["         ", " B  ", "[y, z, x]", "[z, x, y]"])
table.add_row(["x < z < y", "Self", "[x, y, z]", "[x, y, z]"])
table.add_row(["         ", " A  ", "[x, z, y]", "[-z, y, x]"])
table.add_row(["         ", " B  ", "[z, y, x]", "[x, -z, y]"])
table.add_row(["z < x < y", "Self", "[x, y, z]", "[x, y, z]"])
table.add_row(["         ", " A  ", "[z, x, y]", "[y, z, x]"])
table.add_row(["         ", " B  ", "[z, y, x]", "[x, -z, y]"])
uf.desc[-1].add_table(table.label)
uf.desc[-1].add_paragraph("In this table, the condition and cone angle values [x, y, z] correspond to cone_theta_x, cone_theta_y, and cone_sigma_max.")
# Prompt examples.
uf.desc.append(Desc_container("Prompt examples"))
uf.desc[-1].add_paragraph("For combination 'A', simply type:")
Example #2
0
# relax module imports.
from lib.errors import RelaxError, RelaxNoDomainError, RelaxNoSequenceError
from lib.io import read_spin_data
from lib.selection import Selection, spin_id_to_data_list
from lib.warnings import RelaxNoSpinWarning
from pipe_control import pipes
from pipe_control.interatomic import interatomic_loop
from pipe_control.mol_res_spin import exists_mol_res_spin_data, generate_spin_id_unique, return_spin, spin_loop
from user_functions.data import Uf_tables; uf_tables = Uf_tables()
from user_functions.objects import Desc_container


boolean_doc = Desc_container("Boolean operators")
boolean_doc.add_paragraph("The boolean operator can be used to change how spin systems or interatomic data containers are selected.  The allowed values are: 'OR', 'NOR', 'AND', 'NAND', 'XOR', 'XNOR'.  The following table details how the selections will occur for the different boolean operators.")
table = uf_tables.add_table(label="table: bool operators", caption="Boolean operators and their effects on selections")
table.add_headings(["Spin system or interatomic data container", "1", "2", "3", "4", "5", "6", "7", "8", "9"])
table.add_row(["Original selection", "0", "1", "1", "1", "1", "0", "1", "0", "1"])
table.add_row(["New selection", "0", "1", "1", "1", "1", "1", "0", "0", "0"])
table.add_row(["OR", "0", "1", "1", "1", "1", "1", "1", "0", "1"])
table.add_row(["NOR", "1", "0", "0", "0", "0", "0", "0", "1", "0"])
table.add_row(["AND", "0", "1", "1", "1", "1", "0", "0", "0", "0"])
table.add_row(["NAND", "1", "0", "0", "0", "0", "1", "1", "1", "1"])
table.add_row(["XOR", "0", "0", "0", "0", "0", "1", "1", "0", "1"])
table.add_row(["XNOR", "1", "1", "1", "1", "1", "0", "0", "1", "0"])
boolean_doc.add_table(table.label)


def boolean_deselect(current=None, boolean=None):
    """Return the new boolean deselection result using the current selection.
Example #3
0
    desc=
    "Which of the two permutations 'A' or 'B' to create.  Three permutations are possible, and 'A' and 'B' select those which are not the starting combination.",
    wiz_element_type="combo",
    wiz_combo_choices=["A", "B"],
    wiz_read_only=True)
# Description.
uf.desc.append(Desc_container())
uf.desc[-1].add_paragraph(
    "The isotropic and pseudo-elliptic cone frame order models consist of multiple solutions as the optimisation space contains multiple local minima.  Because of the constraint cone_theta_x <= cone_theta_y in the pseudo-ellipse model, there are exactly three local minima (out of 6 possible permutations).  However the cone_theta_x == cone_theta_y condition of the isotropic cone collapses this to two minima.  The multiple minima correspond to permutations of the motional system - the eigenframe x, y and z-axes as well as the cone opening angles cone_theta_x, cone_theta_y, and cone_sigma_max associated with these axes.  But as the mechanics of the cone angles is not identical to that of the torsion angle, only one of the three local minima is the global minimum."
)
uf.desc[-1].add_paragraph(
    "When optimising the pseudo-elliptic models, specifically the '%s' and '%s' model, any of the three local minima can be found.  Convergence to the global minimum is not guaranteed.  Therefore this user function can be used to permute the motional system to jump from one local minimum to the other.  Optimisation will be required as the permuted parameters will not be exactly at the minimum."
    % (MODEL_PSEUDO_ELLIPSE, MODEL_PSEUDO_ELLIPSE_TORSIONLESS))
table = uf_tables.add_table(
    label="table: frame_order.permute_axes combinations",
    caption=
    "The motional eigenframe axis permutations for the frame order models.",
    caption_short="The frame order axis permutations.")
table.add_headings(["Condition", "Permutation name", "Cone angles", "Axes"])
table.add_row(["x < y < z", "Self", "[x, y, z]", "[x, y, z]"])
table.add_row(["         ", " A  ", "[x, z, y]", "[-z, y, x]"])
table.add_row(["         ", " B  ", "[y, z, x]", "[z, x, y]"])
table.add_row(["x < z < y", "Self", "[x, y, z]", "[x, y, z]"])
table.add_row(["         ", " A  ", "[x, z, y]", "[-z, y, x]"])
table.add_row(["         ", " B  ", "[z, y, x]", "[x, -z, y]"])
table.add_row(["z < x < y", "Self", "[x, y, z]", "[x, y, z]"])
table.add_row(["         ", " A  ", "[z, x, y]", "[y, z, x]"])
table.add_row(["         ", " B  ", "[z, y, x]", "[x, -z, y]"])
uf.desc[-1].add_table(table.label)
uf.desc[-1].add_paragraph(
    "In this table, the condition and cone angle values [x, y, z] correspond to cone_theta_x, cone_theta_y, and cone_sigma_max."
Example #4
0
uf.title_short = "Peak intensity error analysis."
uf.add_keyarg(
    name = "subset",
    py_type = "str_list",
    desc_short = "subset spectrum IDs",
    desc = "The list of spectrum ID strings to restrict the error analysis to.",
    wiz_combo_iter = spectrum.get_ids,
    wiz_read_only = True,
    can_be_none = True
)
# Description.
uf.desc.append(Desc_container())
uf.desc[-1].add_paragraph("This user function must only be called after all peak intensities have been loaded and all other necessary spectral information set.  This includes the baseplane RMSD and the number of points used in volume integration, both of which are only used if spectra have not been replicated.")
uf.desc[-1].add_paragraph("The error analysis can be restricted to a subset of the loaded spectral data.  This is useful, for example, if half the spectra have been collected on one spectrometer and the other half on a different spectrometer.")
uf.desc[-1].add_paragraph("Six different types of error analysis are supported depending on whether peak heights or volumes are supplied, whether noise is determined from replicated spectra or the RMSD of the baseplane noise, and whether all spectra or only a subset have been duplicated.  These are:")
table = uf_tables.add_table(label="table: peak intensity error analysis", caption="The six peak intensity error analysis types.")
table.add_headings(["Int type", "Noise source", "Error scope"])
table.add_row(["Heights", "RMSD baseplane", "One sigma per peak per spectrum"])
table.add_row(["Heights", "Partial duplicate + variance averaging", "One sigma for all peaks, all spectra"])
table.add_row(["Heights", "All replicated + variance averaging", "One sigma per replicated spectra set"])
table.add_row(["Volumes", "RMSD baseplane", "One sigma per peak per spectrum"])
table.add_row(["Volumes", "Partial duplicate + variance averaging", "One sigma for all peaks, all spectra"])
table.add_row(["Volumes", "All replicated + variance averaging", "One sigma per replicated spectra set"])
uf.desc[-1].add_table(table.label)
# Peak heights with baseplane noise RMSD.
uf.desc.append(Desc_container("Peak heights with baseplane noise RMSD"))
uf.desc[-1].add_paragraph("When none of the spectra have been replicated, then the peak height errors are calculated using the RMSD of the baseplane noise, the value of which is set by the spectrum.baseplane_rmsd user function.  This results in a different error per peak per spectrum.  The standard deviation error measure for the peak height, sigma_I, is set to the RMSD value.")
# Peak heights with partially replicated spectra.
uf.desc.append(Desc_container("Peak heights with partially replicated spectra"))
uf.desc[-1].add_paragraph("When spectra are replicated, the variance for a single spin at a single replicated spectra set is calculated by the formula")
uf.desc[-1].add_item_list_element(None, "sigma^2 =  sum({Ii - Iav}^2) / (n - 1),")
Example #5
0
    basic_types = ["bool"],
    desc_short = "error flag",
    desc = "A flag which if True will cause the error rather than parameter to be set."
)
uf.add_keyarg(
    name = "force",
    default = True,
    basic_types = ["bool"],
    desc_short = "force flag",
    desc = "A flag which, if set to True, will cause the destination parameter to be overwritten."
)
# Description.
uf.desc.append(Desc_container())
uf.desc[-1].add_paragraph("If this function is used to change values of previously minimised results, then the minimisation statistics (chi-squared value, iteration count, function count, gradient count, and Hessian count) will be reset.")
uf.desc[-1].add_paragraph("The value can be None, a single value, or an array of values while the parameter can be None, a string, or array of strings.  The choice of which combination determines the behaviour of this function.  The following table describes what occurs in each instance.  In these columns, 'None' corresponds to None, '1' corresponds to either a single value or single string, and 'n' corresponds to either an array of values or an array of strings.")
table = uf_tables.add_table(label="table: value.set combinations", caption="The value and parameter combination options for the value.set user function.", caption_short="The value and parameter combinations for the value.set user function.")
table.add_headings(["Value", "Param", "Description"])
table.add_row(["None", "None", "This case is used to set the model parameters prior to minimisation or calculation.  The model parameters are set to the default values."])
table.add_row(["1", "None", "Invalid combination."])
table.add_row(["n", "None", "This case is used to set the model parameters prior to minimisation or calculation.  The length of the val array must be equal to the number of model parameters.  The parameters will be set to the corresponding number."])
table.add_row(["None", "1", "The parameter matching the string will be set to the default value."])
table.add_row(["1", "1", "The parameter matching the string will be set to the supplied number."])
table.add_row(["n", "1", "Invalid combination."])
table.add_row(["None", "n", "Each parameter matching the strings will be set to the default values."])
table.add_row(["1", "n", "Each parameter matching the strings will be set to the supplied number."])
table.add_row(["n", "n", "Each parameter matching the strings will be set to the corresponding number.  Both arrays must be of equal length."])
uf.desc[-1].add_table(table.label)
# Spin identification.
uf.desc.append(Desc_container("Spin ID string"))
uf.desc[-1].add_paragraph("For spin-specific parameters, the spin ID string can be used to restrict the value setting to a specific spin system or group of spins.  It has no effect for global parameters such as in the N-state model and frame order analyses.")
uf.desc.append(relax_fit_params.uf_doc(label="table: curve-fit parameter value setting with defaults"))
Example #6
0
# The API object.
api_model_free = Model_free()


# Classic style documentation.
classic_style_doc = Desc_container("Model-free classic style")
classic_style_doc.add_paragraph("Creator:  Edward d'Auvergne")
classic_style_doc.add_paragraph('Argument string:  "classic"')
classic_style_doc.add_paragraph(
    "Description:  The classic style draws the backbone of a protein in a cylindrical bond style.  Rather than colouring the amino acids to which the NH bond belongs, the three covalent bonds of the peptide bond from Ca to Ca in which the NH bond is located are coloured.  Deselected residues are shown as black lines."
)
classic_style_doc.add_paragraph("Supported data types:")
table = uf_tables.add_table(
    label="table: model-free macro classic style",
    caption="The model-free classic style for mapping model spin specific data onto 3D molecular structures using either PyMOL or Molmol.",
    caption_short="The model-free classic style for PyMOL and Molmol data mapping.",
)
table.add_headings(["Data type", "String", "Description"])
table.add_row(
    [
        "S2.",
        "'s2'",
        "The standard model-free order parameter, equal to S2f.S2s for the two timescale models.  The default colour gradient starts at 'yellow' and ends at 'red'.",
    ]
)
table.add_row(
    [
        "S2f.",
        "'s2f'",
        "The order parameter of the faster of two internal motions.  Residues which are described by model-free models m1 to m4, the single timescale models, are illustrated as white neon bonds.  The default colour gradient is the same as that for the S2 data type.",
Example #7
0
File: uf.py Project: tlinnet/relax
from user_functions.objects import Desc_container

# The API object.
api_model_free = Model_free()

# Classic style documentation.
classic_style_doc = Desc_container("Model-free classic style")
classic_style_doc.add_paragraph("Creator:  Edward d'Auvergne")
classic_style_doc.add_paragraph("Argument string:  \"classic\"")
classic_style_doc.add_paragraph(
    "Description:  The classic style draws the backbone of a protein in a cylindrical bond style.  Rather than colouring the amino acids to which the NH bond belongs, the three covalent bonds of the peptide bond from Ca to Ca in which the NH bond is located are coloured.  Deselected residues are shown as black lines."
)
classic_style_doc.add_paragraph("Supported data types:")
table = uf_tables.add_table(
    label="table: model-free macro classic style",
    caption=
    "The model-free classic style for mapping model spin specific data onto 3D molecular structures using either PyMOL or Molmol.",
    caption_short=
    "The model-free classic style for PyMOL and Molmol data mapping.")
table.add_headings(["Data type", "String", "Description"])
table.add_row([
    "S2.", "'s2'",
    "The standard model-free order parameter, equal to S2f.S2s for the two timescale models.  The default colour gradient starts at 'yellow' and ends at 'red'."
])
table.add_row([
    "S2f.", "'s2f'",
    "The order parameter of the faster of two internal motions.  Residues which are described by model-free models m1 to m4, the single timescale models, are illustrated as white neon bonds.  The default colour gradient is the same as that for the S2 data type."
])
table.add_row([
    "S2s.", "'s2s'",
    "The order parameter of the slower of two internal motions.  This functions exactly as S2f except that S2s is plotted instead."
])
Example #8
0
)
uf.desc[-1].add_item_list_element(
    "'[]'",
    "A sequence or set of characters to match to a single character.  For example, '[Nn]ewton' will match both 'Newton' and 'newton'."
)
uf.desc[-1].add_item_list_element("'^'", "Match the start of the string.")
uf.desc[-1].add_item_list_element(
    "'$'",
    "Match the end of the string.  For example, '^[Ll][Mm]$' will match 'lm' and 'LM' but will not match if characters are placed either before or after these strings."
)
uf.desc[-1].add_paragraph(
    "To select a minimisation algorithm, use a string which matches one of the following patterns given in the tables."
)
uf.desc[-1].add_paragraph("Unconstrained line search methods:")
table = uf_tables.add_table(
    label="table: min - line search",
    caption="Minimisation algorithms -- unconstrained line search methods.")
table.add_headings(["Minimisation algorithm", "Patterns"])
table.add_row([
    "Back-and-forth coordinate descent",
    "'^[Cc][Dd]$' or '^[Cc]oordinate[ _-][Dd]escent$'"
])
table.add_row(
    ["Steepest descent", "'^[Ss][Dd]$' or '^[Ss]teepest[ _-][Dd]escent$'"])
table.add_row(["Quasi-Newton BFGS", "'^[Bb][Ff][Gg][Ss]$'"])
table.add_row(["Newton", "'^[Nn]ewton$'"])
table.add_row(["Newton-CG", "'^[Nn]ewton[ _-][Cc][Gg]$' or '^[Nn][Cc][Gg]$'"])
uf.desc[-1].add_table(table.label)
uf.desc[-1].add_paragraph("Unconstrained trust-region methods:")
table = uf_tables.add_table(
    label="table: min - trust-region",
Example #9
0
uf.desc.append(Desc_container())
uf.desc[-1].add_paragraph("This will perform an optimisation starting from the current parameter values.  This is only suitable for data pipe types which have target functions and hence support optimisation.")
# Diagonal scaling.
uf.desc.append(Desc_container("Diagonal scaling"))
uf.desc[-1].add_paragraph("Diagonal scaling is the transformation of parameter values such that each value has a similar order of magnitude.  Certain minimisation techniques, for example the trust region methods, perform extremely poorly with badly scaled problems.  In addition, methods which are insensitive to scaling such as Newton minimisation may still benefit due to the minimisation of round off errors.")
uf.desc[-1].add_paragraph("In Model-free analysis for example, if S2 = 0.5, te = 200 ps, and Rex = 15 1/s at 600 MHz, the unscaled parameter vector would be [0.5, 2.0e-10, 1.055e-18].  Rex is divided by (2 * pi * 600,000,000)**2 to make it field strength independent.  The scaling vector for this model may be something like [1.0, 1e-9, 1/(2 * pi * 6e8)**2].  By dividing the unscaled parameter vector by the scaling vector the scaled parameter vector is [0.5, 0.2, 15.0].  To revert to the original unscaled parameter vector, the scaled parameter vector and scaling vector are multiplied.")
# Minimisation algorithms.
uf.desc.append(Desc_container("Minimisation algorithms"))
uf.desc[-1].add_paragraph("A minimisation function is selected if the minimisation algorithm matches a certain pattern.  Because the python regular expression 'match' statement is used, various strings can be supplied to select the same minimisation algorithm.  Below is a list of the minimisation algorithms available together with the corresponding patterns.")
uf.desc[-1].add_paragraph("This is a short description of python regular expression, for more information, see the regular expression syntax section of the Python Library Reference.  Some of the regular expression syntax used in this function is:")
uf.desc[-1].add_item_list_element("'[]'", "A sequence or set of characters to match to a single character.  For example, '[Nn]ewton' will match both 'Newton' and 'newton'.")
uf.desc[-1].add_item_list_element("'^'", "Match the start of the string.")
uf.desc[-1].add_item_list_element("'$'", "Match the end of the string.  For example, '^[Ll][Mm]$' will match 'lm' and 'LM' but will not match if characters are placed either before or after these strings.")
uf.desc[-1].add_paragraph("To select a minimisation algorithm, use a string which matches one of the following patterns given in the tables.")
uf.desc[-1].add_paragraph("Unconstrained line search methods:")
table = uf_tables.add_table(label="table: min - line search", caption="Minimisation algorithms -- unconstrained line search methods.")
table.add_headings(["Minimisation algorithm", "Patterns"])
table.add_row(["Back-and-forth coordinate descent", "'^[Cc][Dd]$' or '^[Cc]oordinate[ _-][Dd]escent$'"])
table.add_row(["Steepest descent", "'^[Ss][Dd]$' or '^[Ss]teepest[ _-][Dd]escent$'"])
table.add_row(["Quasi-Newton BFGS", "'^[Bb][Ff][Gg][Ss]$'"])
table.add_row(["Newton", "'^[Nn]ewton$'"])
table.add_row(["Newton-CG", "'^[Nn]ewton[ _-][Cc][Gg]$' or '^[Nn][Cc][Gg]$'"])
uf.desc[-1].add_table(table.label)
uf.desc[-1].add_paragraph("Unconstrained trust-region methods:")
table = uf_tables.add_table(label="table: min - trust-region", caption="Minimisation algorithms -- unconstrained trust-region methods.")
table.add_headings(["Minimisation algorithm", "Patterns"])
table.add_row(["Cauchy point", "'^[Cc]auchy'"])
table.add_row(["Dogleg", "'^[Dd]ogleg'"])
table.add_row(["CG-Steihaug", "'^[Cc][Gg][-_ ][Ss]teihaug' or '^[Ss]teihaug'"])
table.add_row(["Exact trust region", "'^[Ee]xact'"])
uf.desc[-1].add_table(table.label)
Example #10
0
    desc_short = "point file name prefix",
    desc = "The name of that the point output files will be prefixed with.",
    can_be_none = True
)
uf.add_keyarg(
    name = "remap",
    py_type = "func",
    arg_type = "func",
    desc_short = "remap function",
    desc = "A user supplied remapping function.  This function will receive the parameter array and must return an array of equal length.",
    can_be_none = True
)
# Description.
uf.desc.append(Desc_container())
uf.desc[-1].add_paragraph("This will map the space corresponding to the spin identifier and create the OpenDX files.  The map type can be changed to one of the following supported map types:")
table = uf_tables.add_table(label="table: opendx map", caption="OpenDx mapping types.")
table.add_headings(["Surface type", "Name"])
table.add_row(["3D isosurface", "'Iso3D'"])
uf.desc[-1].add_table(table.label)
# Additional.
uf.desc.append(regexp_doc)
uf.desc.append(diffusion_tensor.__return_data_name_doc__)
uf.desc.append(Model_free.return_data_name_doc)
# Prompt examples.
uf.desc.append(Desc_container("Prompt examples"))
uf.desc[-1].add_paragraph("The following commands will generate a map of the extended model-free space for model 'm5' consisting of the parameters {S2, S2f, ts}.  Files will be output into the directory 'dx' and will be prefixed by 'map'.  In this case, the system is a protein and residue number 6 will be mapped.")
uf.desc[-1].add_prompt("relax> dx.map(['s2', 's2f', 'ts'], spin_id=':6')")
uf.desc[-1].add_prompt("relax> dx.map(['s2', 's2f', 'ts'], spin_id=':6', file_prefix='map', dir='dx')")
uf.desc[-1].add_prompt("relax> dx.map(params=['s2', 's2f', 'ts'], spin_id=':6', inc=20, file_prefix='map', dir='dx')")
uf.desc[-1].add_prompt("relax> dx.map(params=['s2', 's2f', 'ts'], spin_id=':6', map_type='Iso3D', inc=20, file_prefix='map', dir='dx')")
uf.desc[-1].add_paragraph("To map the model-free space 'm4' for residue 2, spin N6 defined by the parameters {S2, te, Rex}, name the results 'test', and to place the files in the current directory, use one of the following commands:")
Example #11
0

def return_conversion_factor(stat_type):
    """Dummy function for returning 1.0.

    @param stat_type:   The name of the statistic.  This is unused!
    @type stat_type:    str
    @return:            A conversion factor of 1.0.
    @rtype:             float
    """

    return 1.0


return_data_name_doc = Desc_container("Minimisation statistic data type string matching patterns")
table = uf_tables.add_table(label="table: min data type patterns", caption="Minimisation statistic data type string matching patterns.")
table.add_headings(["Data type", "Object name", "Patterns"])
table.add_row(["Chi-squared statistic", "'chi2'", "'^[Cc]hi2$' or '^[Cc]hi[-_ ][Ss]quare'"])
table.add_row(["Iteration count", "'iter'", "'^[Ii]ter'"])
table.add_row(["Function call count", "'f_count'", "'^[Ff].*[ -_][Cc]ount'"])
table.add_row(["Gradient call count", "'g_count'", "'^[Gg].*[ -_][Cc]ount'"])
table.add_row(["Hessian call count", "'h_count'", "'^[Hh].*[ -_][Cc]ount'"])
return_data_name_doc.add_table(table.label)

def return_data_name(name):
    """Return a unique identifying string for the minimisation parameter.

    @param name:    The minimisation parameter.
    @type name:     str
    @return:        The unique parameter identifying string.
    @rtype:         str
Example #12
0
# relax module imports.
from lib.errors import RelaxError, RelaxNoDomainError, RelaxNoSequenceError
from lib.selection import Selection, spin_id_to_data_list
from lib.sequence import read_spin_data, write_spin_data
from lib.warnings import RelaxNoSpinWarning
from pipe_control.interatomic import interatomic_loop
from pipe_control.mol_res_spin import check_mol_res_spin_data, exists_mol_res_spin_data, generate_spin_id_unique, return_spin, spin_loop
from pipe_control.pipes import check_pipe
from user_functions.data import Uf_tables; uf_tables = Uf_tables()
from user_functions.objects import Desc_container


boolean_doc = Desc_container("Boolean operators")
boolean_doc.add_paragraph("The boolean operator can be used to change how spin systems or interatomic data containers are selected.  The allowed values are: 'OR', 'NOR', 'AND', 'NAND', 'XOR', 'XNOR'.  The following table details how the selections will occur for the different boolean operators.")
table = uf_tables.add_table(label="table: bool operators", caption="Boolean operators and their effects on selections")
table.add_headings(["Spin system or interatomic data container", "1", "2", "3", "4", "5", "6", "7", "8", "9"])
table.add_row(["Original selection", "0", "1", "1", "1", "1", "0", "1", "0", "1"])
table.add_row(["New selection", "0", "1", "1", "1", "1", "1", "0", "0", "0"])
table.add_row(["OR", "0", "1", "1", "1", "1", "1", "1", "0", "1"])
table.add_row(["NOR", "1", "0", "0", "0", "0", "0", "0", "1", "0"])
table.add_row(["AND", "0", "1", "1", "1", "1", "0", "0", "0", "0"])
table.add_row(["NAND", "1", "0", "0", "0", "0", "1", "1", "1", "1"])
table.add_row(["XOR", "0", "0", "0", "0", "0", "1", "1", "0", "1"])
table.add_row(["XNOR", "1", "1", "1", "1", "1", "0", "0", "1", "0"])
boolean_doc.add_table(table.label)


def boolean_deselect(current=None, boolean=None):
    """Return the new boolean deselection result using the current selection.
Example #13
0
    wiz_combo_iter=spectrum.get_ids,
    wiz_read_only=True,
    can_be_none=True)
# Description.
uf.desc.append(Desc_container())
uf.desc[-1].add_paragraph(
    "This user function must only be called after all peak intensities have been loaded and all other necessary spectral information set.  This includes the baseplane RMSD and the number of points used in volume integration, both of which are only used if spectra have not been replicated."
)
uf.desc[-1].add_paragraph(
    "The error analysis can be restricted to a subset of the loaded spectral data.  This is useful, for example, if half the spectra have been collected on one spectrometer and the other half on a different spectrometer."
)
uf.desc[-1].add_paragraph(
    "Six different types of error analysis are supported depending on whether peak heights or volumes are supplied, whether noise is determined from replicated spectra or the RMSD of the baseplane noise, and whether all spectra or only a subset have been duplicated.  These are:"
)
table = uf_tables.add_table(
    label="table: peak intensity error analysis",
    caption="The six peak intensity error analysis types.")
table.add_headings(["Int type", "Noise source", "Error scope"])
table.add_row(["Heights", "RMSD baseplane", "One sigma per peak per spectrum"])
table.add_row([
    "Heights", "Partial duplicate + variance averaging",
    "One sigma for all peaks, all spectra"
])
table.add_row([
    "Heights", "All replicated + variance averaging",
    "One sigma per replicated spectra set"
])
table.add_row(["Volumes", "RMSD baseplane", "One sigma per peak per spectrum"])
table.add_row([
    "Volumes", "Partial duplicate + variance averaging",
    "One sigma for all peaks, all spectra"
Example #14
0
    default=True,
    py_type="bool",
    desc_short="force flag",
    desc="A flag which, if set to True, will cause the destination parameter to be overwritten.",
)
# Description.
uf.desc.append(Desc_container())
uf.desc[-1].add_paragraph(
    "If this function is used to change values of previously minimised results, then the minimisation statistics (chi-squared value, iteration count, function count, gradient count, and Hessian count) will be reset."
)
uf.desc[-1].add_paragraph(
    "The value can be None, a single value, or an array of values while the parameter can be None, a string, or array of strings.  The choice of which combination determines the behaviour of this function.  The following table describes what occurs in each instance.  In these columns, 'None' corresponds to None, '1' corresponds to either a single value or single string, and 'n' corresponds to either an array of values or an array of strings."
)
table = uf_tables.add_table(
    label="table: value.set combinations",
    caption="The value and parameter combination options for the value.set user function.",
    caption_short="The value and parameter combinations for the value.set user function.",
)
table.add_headings(["Value", "Param", "Description"])
table.add_row(
    [
        "None",
        "None",
        "This case is used to set the model parameters prior to minimisation or calculation.  The model parameters are set to the default values.",
    ]
)
table.add_row(["1", "None", "Invalid combination."])
table.add_row(
    [
        "n",
        "None",