The Edge
class
- class ppanggolin.pangenome.Edge(sourceGene, targetGene)[source]
Bases:
object
The Edge class represents an edge between two gene families in the pangenome graph. It is associated with all the organisms in which the neighborship is found, and all the involved genes as well.
- Parameters
sourceGene (
ppanggolin.genome.Gene
) – a first gene to initialize the edgetargetGene (
ppanggolin.genome.Gene
) – a second gene to initialize the edge
- addGenes(sourceGene, targetGene)[source]
Adds genes to the edge. They are supposed to be on the same organism.
- Parameters
sourceGene (
ppanggolin.genome.Gene
) – a source gene to add to the edgetargetGene (
ppanggolin.genome.Gene
) – a target gene to add to the edge
- Raises
Exception – If the genes are not on the same organism.
- property genePairs
- Returns
A list of all the gene pairs of the Edge
- Return type
list[tuple[
ppanggolin.genome.Gene
,ppanggolin.genome.Gene
]]
- getOrgDict()[source]
- Returns
A dictionnary of the Organisms in which the edge is found, with organisms as key and an iterable of the pairs of genes as value
- Return type
dict[
ppanggolin.genome.Organism
, tuple[ppanggolin.genome.Gene
,ppanggolin.genome.Gene
]]