Multiple Sequence Alignments are the building blocks of our Matrix data structure. The Matrix class takes a biopython MSA object and compresses it into a matrix that contains only the unique site data, while also keeping records to recover the entire matrix.
Enabled for the Matrix class is a variety of alphabets, including DNA (the default), RNA, Proteins, Codons, SNP, and Binary.

Currently, there is no reason for a user to explicitly create a Matrix.

To create a network is very easy and straightforward:

                        from phylogenpy.Graph import DAG

                        #Can initialize as an empty graph
                        tree = DAG()

                        #To make it a network, simply add in individual nodes
                        #one at a time, or pass in an array of nodes

                        #same applies to adding edges
                        tree.addEdges(arrayOfEdges) #Where an edge can just be [NodeObj, NodeObj2]

                        #Now you have a complete network. To grab the newick representation...
                        newickStr = tree.newickString() 

                        #You can now visualize your graph with IcyTree
                        #You can also initialize trees with node and edge lists 
                        tree2 = DAG(edgeList) #add nodes later
                        tree3 = DAG(nodes = nodeList) #add edges later
                        tree4 = DAG(edgeList, nodeList) #add both now

                        #To see a description of all the nodes in your graph:


A Node object has the following initialization parameters, all of which are defaults:

  1. branchLen = None
  2. parNode = [ ]
  3. attr = { }
  4. isReticulation = False
  5. name = None
                        from phylogenpy.Node import Node

                        #Can initialize as an empty Node
                        new_node = Node()

                        #To set the branch length
                        #To get the branch length
                        node_len = new_node.branchLen()

                        #To add a parent (must be a Node or UltrametricNode obj)

                        #or to set the parent

                        #To set the name of a Node
                        new_node.setName("Homo Sapiens")

                        #To get the name of the Node
                        node_name = new_node.getName()

                        #To set a custom attribute
                        new_node.setAttribute(attribute, value) #i.e "t" : 5.4
                        #To look up an attribute
                        attr_val = new_node.attrLookup(attribute) #i.e "t" returns 5.4

                        #To visualize the values contained in a Node obj 

                        #A more typical way to create a Node
                        new_node2 = Node(parNode = [par_node], attr = {"t":5.4}, name = "species2")