Beispiel #1
0
def test_newick__get_leaf_nodes__complex_case():
    node_a = Newick(name = "Leaf A")
    node_b = Newick(name = "Leaf B")
    node_c = Newick(name = "Leaf C")
    sub_a  = Newick(children = [node_b, node_c])
    top_node = Newick(children = [node_a, sub_a])
    assert_list_equal(top_node.get_leaf_nodes(), [node_a, node_b, node_c])
Beispiel #2
0
def test_newick__get_leaf_nodes__complex_case():
    node_a = Newick(name="Leaf A")
    node_b = Newick(name="Leaf B")
    node_c = Newick(name="Leaf C")
    sub_a = Newick(children=[node_b, node_c])
    top_node = Newick(children=[node_a, sub_a])
    assert_list_equal(top_node.get_leaf_nodes(), [node_a, node_b, node_c])
Beispiel #3
0
def test_fasta__from_lines__multiple_records():
    lines    = [">first\n",  "TGTTCTCCACCGTGCACAAC\n", "CCTTCATCCA\n",
                ">Second XT:1:0\n", "GAGAGCTCAGCTAAC\n",
                ">Third\n",  "CGCTGACCAAAAACGGACAG\n", "GGCATTCGGC\n"]
    expected = [FASTA("first", None, "TGTTCTCCACCGTGCACAACCCTTCATCCA"),
                FASTA("Second", "XT:1:0", "GAGAGCTCAGCTAAC"),
                FASTA("Third", None, "CGCTGACCAAAAACGGACAGGGCATTCGGC")]
    assert_list_equal(FASTA.from_lines(lines), expected)
Beispiel #4
0
def test_fasta__from_lines__multiple_records():
    lines = [
        ">first\n", "TGTTCTCCACCGTGCACAAC\n", "CCTTCATCCA\n",
        ">Second XT:1:0\n", "GAGAGCTCAGCTAAC\n", ">Third\n",
        "CGCTGACCAAAAACGGACAG\n", "GGCATTCGGC\n"
    ]
    expected = [
        FASTA("first", None, "TGTTCTCCACCGTGCACAACCCTTCATCCA"),
        FASTA("Second", "XT:1:0", "GAGAGCTCAGCTAAC"),
        FASTA("Third", None, "CGCTGACCAAAAACGGACAGGGCATTCGGC")
    ]
    assert_list_equal(FASTA.from_lines(lines), expected)
Beispiel #5
0
def test_newick__get_leaf_nodes__internal_node_returns_leaf_nodes():
    node_a = Newick(name = "Leaf A")
    node_b = Newick(name = "Leaf B")
    top_node = Newick(children = [node_a, node_b])
    assert_list_equal(top_node.get_leaf_nodes(), [node_a, node_b])
Beispiel #6
0
def test_newick__get_leaf_nodes__leaf_returns_self():
    node = Newick(name = "Leaf")
    assert_list_equal(node.get_leaf_nodes(), [node])
Beispiel #7
0
def test_newick__get_leaf_nodes__internal_node_returns_leaf_nodes():
    node_a = Newick(name="Leaf A")
    node_b = Newick(name="Leaf B")
    top_node = Newick(children=[node_a, node_b])
    assert_list_equal(top_node.get_leaf_nodes(), [node_a, node_b])
Beispiel #8
0
def test_newick__get_leaf_nodes__leaf_returns_self():
    node = Newick(name="Leaf")
    assert_list_equal(node.get_leaf_nodes(), [node])
Beispiel #9
0
def test_fasta__from_lines_single_record():
    lines    = [">single\n", "TGTTCTCCACCGTGCACAAC\n", "CCTTCATCCA\n"]
    expected = [FASTA("single", None, "TGTTCTCCACCGTGCACAACCCTTCATCCA")]
    assert_list_equal(FASTA.from_lines(lines), expected)
Beispiel #10
0
def test_fasta__from_lines__no_records():
    assert_list_equal(FASTA.from_lines([]), [])
Beispiel #11
0
def test_fasta__from_lines_single_record():
    lines = [">single\n", "TGTTCTCCACCGTGCACAAC\n", "CCTTCATCCA\n"]
    expected = [FASTA("single", None, "TGTTCTCCACCGTGCACAACCCTTCATCCA")]
    assert_list_equal(FASTA.from_lines(lines), expected)
Beispiel #12
0
def test_fasta__from_lines__no_records():
    assert_list_equal(FASTA.from_lines([]), [])