ragtag_utilities/ScaffoldGraph.py
def add_edge(self, u, v, **kwargs):
        """ Add edges like normal for a networkx graph, but ensure that the edge has necessary data. """
        if not kwargs:
            raise ValueError("Scaffold Graph edges must have the following data: {}".format(",".join(list(self._req_edge_data))))

        for i in self._req_edge_data:
            if i not in kwargs:
                raise ValueError("Scaffold Graph edges must have the following data: {}".format(i))

        # Add the nodes before making the edge.
        # Not strictly necessary for networkx, but it ensures that all nodes match the fasta file
        if u not in self.nodes:
            self.add_node(u)

        if v not in self.nodes:
            self.add_node(v)

        self.graph.add_edge(u, v, **kwargs)
 Add edges like normal for a networkx graph, but ensure that the edge has necessary data. 
Add edges like normal for a networkx graph, but ensure that the edge has necessary data.
Add edges like normal for a networkx graph but ensure that the edge has necessary data .
def add_edge(self, u, v, **kwargs):
        if not kwargs:
            raise ValueError("Scaffold Graph edges must have the following data: {}".format(",".join(list(self._req_edge_data))))
        for i in self._req_edge_data:
            if i not in kwargs:
                raise ValueError("Scaffold Graph edges must have the following data: {}".format(i))
        if u not in self.nodes:
            self.add_node(u)
        if v not in self.nodes:
            self.add_node(v)
        self.graph.add_edge(u, v, **kwargs)
def add_edge ( self , u , v , ** kwargs ) : if not kwargs : raise ValueError ( "Scaffold Graph edges must have the following data: {}" . format ( "," . join ( list ( self . _req_edge_data ) ) ) ) for i in self . _req_edge_data : if i not in kwargs : raise ValueError ( "Scaffold Graph edges must have the following data: {}" . format ( i ) ) if u not in self . nodes : self . add_node ( u ) if v not in self . nodes : self . add_node ( v ) self . graph . add_edge ( u , v , ** kwargs )
Add edges like normal for a networkx graph, but ensure that the edge has necessary data.
Add edges like normal for a networkx graph but ensure that the edge has necessary data .
""" Add edges like normal for a networkx graph, but ensure that the edge has necessary data. """ # Add the nodes before making the edge. # Not strictly necessary for networkx, but it ensures that all nodes match the fasta file
self
u
v