Example #1
0
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.

    @keyword current:   The current selection state.
    @type current:      bool
    @keyword boolean:   The boolean operator used to select with.  It can be one of 'OR', 'NOR', 'AND', 'NAND', 'XOR', or 'XNOR'.
    @type boolean:      str
    @return:            The new selection state.
    @rtype:             bool
    """

    # Boolean selections.
    if boolean == 'OR':
Example #2
0
File: uf.py Project: tlinnet/relax
    "ts.", "'ts'",
    "The correlation time, ts.  The default colour gradient starts at 'blue' and ends at 'black'."
])
table.add_row([
    "Timescale of fast motions", "'time_fast'",
    "Model independent display of the timescale of fast motions.  For models m5 to m8, only the parameter tf is plotted.  For models m2 and m4, the parameter te is plotted only if it is less than 200 ps.  All other residues are assumed to have a correlation time of zero.  The default colour gradient is the same as that of te."
])
table.add_row([
    "Timescale of slow motions", "'time_slow'",
    "Model independent display of the timescale of slow motions.  For models m5 to m8, only the parameter ts is plotted.  For models m2 and m4, the parameter te is plotted only if it is greater than 200 ps.  All other residues are coloured white.  The default colour gradient is the same as that of ts."
])
table.add_row([
    "Chemical exchange", "'rex'",
    "The chemical exchange, Rex.  Residues which experience no chemical exchange are coloured white.  The default colour gradient starts at 'yellow' and finishes at 'red'."
])
classic_style_doc.add_table(table.label)

# Model elimination documentation.
eliminate_doc = []
eliminate_doc.append(Desc_container("Local tm model elimination rule"))
eliminate_doc[-1].add_paragraph(
    "The local tm, in some cases, may exceed the value expected for a global correlation time. Generally the tm value will be stuck at the upper limit defined for the parameter.  These models are eliminated using the rule:"
)
eliminate_doc[-1].add_verbatim("    tm >= c")
eliminate_doc[-1].add_paragraph(
    "The default value of c is 50 ns, although this can be overridden by supplying the value (in seconds) as the first element of the args tuple."
)
eliminate_doc.append(
    Desc_container(
        "Internal correlation times {te, tf, ts} model elimination rules"))
eliminate_doc[-1].add_paragraph(
Example #3
0
    @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
    """

    # Chi-squared.
    if search('^[Cc]hi2$', name) or search('^[Cc]hi[-_ ][Ss]quare', name):
        return 'chi2'

    # Iteration count.
Example #4
0
)
table.add_row(
    [
        "Timescale of slow motions",
        "'time_slow'",
        "Model independent display of the timescale of slow motions.  For models m5 to m8, only the parameter ts is plotted.  For models m2 and m4, the parameter te is plotted only if it is greater than 200 ps.  All other residues are coloured white.  The default colour gradient is the same as that of ts.",
    ]
)
table.add_row(
    [
        "Chemical exchange",
        "'rex'",
        "The chemical exchange, Rex.  Residues which experience no chemical exchange are coloured white.  The default colour gradient starts at 'yellow' and finishes at 'red'.",
    ]
)
classic_style_doc.add_table(table.label)

# Model elimination documentation.
eliminate_doc = []
eliminate_doc.append(Desc_container("Local tm model elimination rule"))
eliminate_doc[-1].add_paragraph(
    "The local tm, in some cases, may exceed the value expected for a global correlation time. Generally the tm value will be stuck at the upper limit defined for the parameter.  These models are eliminated using the rule:"
)
eliminate_doc[-1].add_verbatim("    tm >= c")
eliminate_doc[-1].add_paragraph(
    "The default value of c is 50 ns, although this can be overridden by supplying the value (in seconds) as the first element of the args tuple."
)
eliminate_doc.append(Desc_container("Internal correlation times {te, tf, ts} model elimination rules"))
eliminate_doc[-1].add_paragraph(
    "These parameters may experience the same problem as the local tm in that the model fails and the parameter value is stuck at the upper limit.  These parameters are constrained using the formula (te, tf, ts <= 2tm).  These failed models are eliminated using the rule:"
)
Example #5
0
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.

    @keyword current:   The current selection state.
    @type current:      bool
    @keyword boolean:   The boolean operator used to select with.  It can be one of 'OR', 'NOR', 'AND', 'NAND', 'XOR', or 'XNOR'.
    @type boolean:      str
    @return:            The new selection state.
    @rtype:             bool
    """

    # Boolean selections.
    if boolean == 'OR':