Example #1
0
def get_form():
    """
    @return: the body of a form
    """
    # define the default tree lines
    default_tree_lines = [
        '(((a:0.05, b:0.05):0.15, c:0.2):0.8, x:1.0, (((m:0.05, n:0.05):0.15, p:0.2):0.8, y:1.0):1.0);',
        '(a:1.062, c:0.190, (d:1.080, b:2.30):2.112);',
        '((d:0.083, b:0.614):0.150, e:0.581, (c:1.290, a:0.359):1.070);',
        '((b:1.749, d:0.523):0.107, e:1.703, (a:0.746, c:0.070):4.025);'
    ]
    # define the list of form objects
    form_objects = [
        Form.MultiLine('trees', 'newick trees (one tree per line)',
                       '\n'.join(default_tree_lines)),
        Form.Float('epsilon', 'non-negligible eigenvalue', '1e-9'),
        Form.CheckGroup('options', 'show these tree sets', [
            CheckItem('show_all', 'all reconstructed trees', True),
            CheckItem('show_incomplete',
                      'incompletely resolved reconstructed trees', True),
            CheckItem('show_conflicting', 'conflicting reconstructed trees',
                      True),
            CheckItem('show_negligible',
                      'trees with potentially informative but small loadings',
                      True)
        ])
    ]
    return form_objects
Example #2
0
def get_form():
    """
    @return: the body of a form
    """
    # define the default tree string
    tree = NewickIO.parse(g_default_string, FelTree.NewickTree)
    formatted_tree_string = NewickIO.get_narrow_newick_string(tree, 60)
    # define the form objects
    form_objects = [
        Form.MultiLine('tree', 'newick tree', formatted_tree_string),
        Form.RadioGroup('matrix', 'nodes used for the distance matrix', [
            RadioItem('standard', 'tips only', True),
            RadioItem('augmented', 'all nodes'),
            RadioItem('named', 'all named nodes')
        ]),
        Form.CheckGroup('output_options', 'output options', [
            CheckItem('show_split', 'exact criterion partition', True),
            CheckItem('show_value', 'exact criterion value', True),
            CheckItem('show_value_minus_trace',
                      'exact criterion value minus trace', True),
            CheckItem('show_fiedler_split', 'show the spectral sign partition',
                      True),
            CheckItem('show_fiedler_eigenvector',
                      'show the eigenvector of interest', True),
            CheckItem('show_labels', 'ordered labels', True),
            CheckItem('show_distance_matrix', 'distance matrix', True),
            CheckItem('show_M_matrix', 'M matrix', True)
        ])
    ]
    return form_objects
Example #3
0
def get_form():
    """
    @return: the body of a form
    """
    # define the default tree string
    tree = get_default_original_tree()
    formatted_tree_string = NewickIO.get_narrow_newick_string(tree, 60)
    # define the form objects
    form_objects = [
        Form.MultiLine('tree', 'original tree with branch lengths',
                       formatted_tree_string),
        Form.Integer('iterations', 'reconstruct this many trees', 10, low=1),
        Form.Integer('length', 'use sequences that are this long', 100, low=2),
        Form.RadioGroup('criterion', 'bipartition function', [
            RadioItem('exact', 'exact criterion'),
            RadioItem('sign', 'spectral sign approximation', True),
            RadioItem('threshold', 'spectral threshold approximation'),
            RadioItem('nj', 'neighbor joining criterion'),
            RadioItem('random', 'random bipartition')
        ]),
        Form.RadioGroup('recourse', 'recourse for degenerate partitions', [
            RadioItem('njrecourse', 'neighbor joining', True),
            RadioItem('halvingrecourse', 'leaf stem length halving')
        ]),
        Form.CheckGroup(
            'output_options', 'extra output option',
            [CheckItem('showtrees', 'show reconstructed tree topologies')])
    ]
    return form_objects
Example #4
0
def get_form():
    """
    @return: the body of a form
    """
    # define the default tree string and ordered tip labels
    tree_string = '(a:1, (b:2, d:5):1, c:4);'
    tree = NewickIO.parse(tree_string, FelTree.NewickTree)
    formatted_tree_string = NewickIO.get_narrow_newick_string(tree, 60)
    labels = list(sorted(tip.name for tip in tree.gen_tips()))
    # define the form objects
    form_objects = [
        Form.MultiLine('tree', 'newick tree', formatted_tree_string),
        Form.MultiLine('inlabels', 'ordered labels', '\n'.join(labels)),
        Form.Float('strength', 'perturbation strength', 0.1, low_inclusive=0),
        Form.CheckGroup('options', 'output options', [
            CheckItem('perturbed', 'a perturbed distance matrix', True),
            CheckItem('distance', 'the original distance matrix'),
            CheckItem('outlabels', 'ordered labels')
        ])
    ]
    return form_objects
Example #5
0
def get_form():
    """
    @return: the body of a form
    """
    form_objects = [
            Form.RadioGroup('leaf_options', 'number of leaves', [
                RadioItem('six_leaves', '6', True),
                RadioItem('seven_leaves', '7')]),
            Form.CheckGroup('requirements', 'requirements', [
                CheckItem('invalid_dendrogram',
                    'the topology of the naive dendrogram must be incorrect',
                    True),
                CheckItem('informative_children',
                    'splits of the child trees must be informative',
                    True),
                CheckItem('force_difference',
                    'full graph split must differ from Schur graph split',
                    False),
                CheckItem('informative_full_split',
                    'full graph split must be informative', False)]),
            Form.CheckGroup('sampling_options', 'branch length sampling', [
                CheckItem('allow_integers',
                    'allow single digit integer branch lengths', True),
                CheckItem('allow_reciprocals',
                    'allow reciprocal single digit integer branch lengths',
                    False)])]
    return form_objects
Example #6
0
def get_form():
    """
    @return: the body of a form
    """
    L = np.array([
            [1.0, 0.0, 0.0, 0.0, -1.0, 0.0],
            [0.0, 1.0, 0.0, 0.0, -1.0, 0.0],
            [0.0, 0.0, 1.0, 0.0, 0.0, -1.0],
            [0.0, 0.0, 0.0, 1.0, 0.0, -1.0],
            [-1.0, -1.0, 0.0, 0.0, 3.0, -1.0],
            [0.0, 0.0, -1.0, -1.0, -1.0, 3.0]])
    # define the form objects
    form_objects = [
            Form.Matrix('laplacian', 'combinatorial Laplacian matrix',
                L, MatrixUtil.assert_symmetric),
            Form.RadioGroup('normalization', 'use this matrix', [
                RadioItem('combinatorial', 'combinatorial Laplacian', True),
                RadioItem('normalized', 'normalized Laplacian')]),
            Form.CheckGroup('options', 'output options', [
                CheckItem('show_magnitudes',
                    'show the distance of each point from the origin'),
                CheckItem('show_contrasts',
                    'show the contrast loading matrix')])]
    return form_objects
Example #7
0
def get_form():
    """
    @return: the body of a form
    """
    form_objects = [
        RadioGroup('distance_options', 'recursive matrix construction', [
            RadioItem('like_pruning',
                      'go through the Laplacian, like Felsenstein pruning',
                      True),
            RadioItem('like_nj',
                      'directly use distances, like neighbor joining')
        ]),
        CheckGroup('format_options', 'options', [
            CheckItem('supplementary', 'download the supplementary data', True)
        ])
    ]
    return form_objects