当前位置: 首页>>代码示例>>Python>>正文


Python MatrixUtil.read_matrix方法代码示例

本文整理汇总了Python中MatrixUtil.read_matrix方法的典型用法代码示例。如果您正苦于以下问题:Python MatrixUtil.read_matrix方法的具体用法?Python MatrixUtil.read_matrix怎么用?Python MatrixUtil.read_matrix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MatrixUtil的用法示例。


在下文中一共展示了MatrixUtil.read_matrix方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_form

# 需要导入模块: import MatrixUtil [as 别名]
# 或者: from MatrixUtil import read_matrix [as 别名]
def get_form():
    """
    @return: the body of a form
    """
    lines = Util.get_stripped_lines(g_data.splitlines())
    D = np.array(MatrixUtil.read_matrix(lines))
    form_objects = [
            Form.Matrix('matrix', 'distance matrix',
                D, MatrixUtil.assert_predistance)]
    return form_objects
开发者ID:argriffing,项目名称:xgcode,代码行数:12,代码来源:20090202a.py

示例2: get_form

# 需要导入模块: import MatrixUtil [as 别名]
# 或者: from MatrixUtil import read_matrix [as 别名]
def get_form():
    """
    @return: the body of a form
    """
    lines = Util.get_stripped_lines(g_d.splitlines())
    D = np.array(MatrixUtil.read_matrix(lines))
    labels = list('xyabcmnp')
    # define the form objects
    form_objects = [
            Form.Matrix('matrix', 'distance matrix',
                D, MatrixUtil.assert_predistance),
            Form.MultiLine('labels', 'ordered labels',
                '\n'.join(labels)),
            Form.RadioGroup('recourse', 'recourse for degenerate partitions', [
                Form.RadioItem('njrecourse', 'neighbor joining', True),
                Form.RadioItem('halvingrecourse', 'stem length halving')])]
    return form_objects
开发者ID:argriffing,项目名称:xgcode,代码行数:19,代码来源:20080621b.py

示例3: get_form

# 需要导入模块: import MatrixUtil [as 别名]
# 或者: from MatrixUtil import read_matrix [as 别名]
def get_form():
    """
    @return: the body of a form
    """
    # define the default distance matrix
    # this is from figure two of a paper called why neighbor joining works
    D = MatrixUtil.read_matrix(Util.get_stripped_lines(g_data.splitlines()))
    states = list('xyabcmnp')
    # define some default strings
    ordered_label_string = '\n'.join(states)
    selected_label_string = '\n'.join(['m', 'n'])
    # define the sequence of form objects
    form_objects = [
            Form.Matrix('matrix', 'distance matrix',
                D, MatrixUtil.assert_predistance),
            Form.MultiLine('labels', 'ordered taxa',
                ordered_label_string),
            Form.MultiLine('selection', 'taxa to be grouped',
                selected_label_string)]
    # return the sequence of form objects
    return form_objects
开发者ID:argriffing,项目名称:xgcode,代码行数:23,代码来源:20090409a.py

示例4: get_form

# 需要导入模块: import MatrixUtil [as 别名]
# 或者: from MatrixUtil import read_matrix [as 别名]
def get_form():
    """
    @return: the body of a form
    """
    # define the default distance matrix and the ordered labels
    lines = Util.get_stripped_lines(g_data.splitlines())
    D = np.array(MatrixUtil.read_matrix(lines))
    ordered_labels = list('xyabcmnp')
    # define the form objects
    form_objects = [
            Form.Matrix('matrix', 'distance matrix',
                D, MatrixUtil.assert_predistance),
            Form.MultiLine('labels', 'ordered labels',
                '\n'.join(ordered_labels)),
            Form.RadioGroup('options', 'distance matrix splitting options', [
                Form.RadioItem('option_a',
                    'nj split with nj update', True),
                Form.RadioItem('option_b',
                    'nj split with laplace update'),
                Form.RadioItem('option_c',
                    'spectral with nj fallback and laplace update'),
                Form.RadioItem('option_d',
                    'spectral with partial fallback and laplace update')])]
    return form_objects
开发者ID:argriffing,项目名称:xgcode,代码行数:26,代码来源:20090416a.py


注:本文中的MatrixUtil.read_matrix方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。