pygfa.graph_element package

Submodules

pygfa.graph_element.edge module

class pygfa.graph_element.edge.Edge(edge_id, from_node, from_orn, to_node, to_orn, from_positions, to_positions, alignment, distance=None, variance=None, opt_fields={}, is_dovetail=False)[source]

Bases: object

alignment
distance
eid
classmethod from_line(line_)[source]
from_node
from_orn
from_positions
from_segment_end
is_dovetail
opt_fields
to_node
to_orn
to_positions
to_segment_end
variance
exception pygfa.graph_element.edge.InvalidEdgeError[source]

Bases: Exception

pygfa.graph_element.edge.is_edge(obj)[source]

pygfa.graph_element.node module

exception pygfa.graph_element.node.InvalidNodeError[source]

Bases: Exception

class pygfa.graph_element.node.Node(node_id, sequence, length, opt_fields={})[source]

Bases: object

A Node object that abstract the GFA1 and GFA2 Sequence concepts.

GFA graphs will operate on Nodes, by adding them directly to their structures.

Node accepts elements (ids, sequences, lengths and so on) from the more tolerant of the two specification. So, a sequence will be accepted if and only if is a valid GFA2 sequence, since GFA2 sequence is more tolerant than GFA1 sequence.

classmethod from_line(segment_line)[source]

Given a Segment Line construct a Node from it.

If segment_line is a GFA1 Segment segment_line then the sequence length taken into account will be the value of the optional field LN if specified in the line fields.

Parameters:segment_line – A valid Segment Segment_line.
Raises:InvalidSegment_lineError – If the given segment_line is not valid.
nid
opt_fields
sequence
slen
pygfa.graph_element.node.is_node(obj)[source]

Check wheter the given object is a Node object.

Parameters:obj – Any Python object.
Returns True:If obj can be treated as a Node object.

pygfa.graph_element.subgraph module

exception pygfa.graph_element.subgraph.InvalidSubgraphError[source]

Bases: Exception

class pygfa.graph_element.subgraph.Subgraph(graph_id, elements, opt_fields={})[source]

Bases: object

as_dict()[source]

Turn the Subgraph into a dictionary,

Put all fields and the optional fields into a dictionary.

elements
classmethod from_line(line_)[source]
is_path()[source]
opt_fields
sub_id
pygfa.graph_element.subgraph.is_subgraph(obj)[source]

Module contents