Mapper (genomes)¶
- class pyham.mapper.HOGsMap(ham_object, genome1, genome2)[source]¶
Class to compare HOG evolutionary relations (duplication, loss, gain and retained) between an ancestor genome and its descendant genome.
Let’s consider Go the oldest genome and Gy the youngest genome with their respected HOGs Ho and Hy.
- Those relations are classified into the following categories:
RETAINED: if Ho will correspond to a single Hy.
DUPLICATE: If a duplication occurred in Ho in between Go ang Gy.
LOSS: If Ho have no representative Hy in Gy.
GAIN: if Hy have no ancestor Ho in Go.
First, a “UpMap” is build to find for each Hy its potential ancestor Ho. If during the traversal from Hy to Ho a duplication occurred, a flag “paralog” is added in the UpMap[Hy]. Hy with no corresponding Ho are considered as gained meanwhile Ho without corresponding Hy are considered as lost. Ho with only one corresponding Hy (and no duplication tag) are clustered as retained otherwhise as duplicated.
- Attributes:
- Ham (
pyham.pyham.Ham): Ham object.ancestor (pyham.genome.Genome):pyham.genome.Genomeof Go.descendant (pyham.genome.Genome):pyham.genome.Genomeof Gy.upMap (dict): a dictionary that map each Ho with its related Hy (or None if no HOG founded) associated a boolean if a duplication occurs or not in between them.RETAINED (dict): Dictionary that map a Ho with its descendant Hy.DUPLICATE (dict): Dictionary that map a Ho with its list of descendants Hy.LOSS (list): a list of Ho with no matching in Gy.GAIN: (list): a list of Hy with no ancestor in Go.number_duplication: (int): number of duplication events that explain the DUPLICATE genes. - Args:
- genome1 (
pyham.genome.Genome): Firstpyham.genome.Genometo compare.genome2 (pyham.genome.Genome): Secondpyham.genome.Genometo compare.
- class pyham.mapper.MapResults(HAM)[source]¶
Abstract class to map HOGs across multiple genomes through their most recent common ancestral genome. The HOGs are all clustered based on their relation with the mrca genome HOGs (duplicated, lost, gained and retained).
Let’s consider Go the mrca genome and Gn the youngest genomes with their respected HOGs Ho and Hn.
- The HOG relations between Ho and Hn are classified into the following categories:
RETAINED: if Ho will correspond to a single Hn in Gn.
DUPLICATE: If a duplication occurred in Ho in between Go ang Gn.
LOSS: If Ho have no representative Hn in Gn.
GAIN: if Hn have no ancestor Ho in Go.
- There is two type of possible mapping:
vertical: compare a genome with its ancestor (that act as “mrca”).
lateral: compare genomes with their mrca.
- The MapResults provides methods to compare HOGs across genomes:
get_loss()
get_gain()
get_duplicate()
get_retained()
- Attributes:
- Ham (
pyham.pyham.Ham): Ham object.ancestor (pyham.genome.Genome):pyham.genome.Genomeof Go.
- class pyham.mapper.MapVertical(ham)[source]¶
Class to map HOGs between a genome and its ancestor.
Let’s consider Go the oldest genome and Gn the youngest genome with their respected HOGs Ho and Hn.
- Attributes:
- descendant (
pyham.genome.Genome):pyham.genome.Genomeof Gn.map (pyham.mapper.HOGsMap):pyham.genome.Genomeof Go.
- add_map(HogMap)[source]¶
Method to set the HOGsMap.
- Args:
HogMap (
pyham.mapper.HOGsMap): HOGsMap to add.- Raises:
TypeError: if HogMap is not
pyham.mapper.HOGsMapor if apyham.mapper.HOGsMapis already set.
- get_duplicated()[source]¶
Getter for duplicated genes.
- Returns:
Dictionary of Ho mapped to their list of descendants Hy.
- class pyham.mapper.MapLateral(HAM)[source]¶
Class to map HOGs between genomes through their ancestor.
Let’s consider Go the oldest genome and Gn the youngest genomes with their respected HOGs Ho and Hn.
- Attributes:
- descendant (
list): list of Gn.map (dict): dictionary of Gn mapped to a HOGMap(Go,Gn).LOSS (dict): dictionary of Ho mapped to the list of Gn where this HOG is lost.GAIN (dict): dictionary of Gn mapped to their list of gained Hn.RETAINED (dict): dictionary of Ho mapped to a dict of Gn mapped to a Hn.DUPLICATE (dict): dictionary of Ho mapped to a dict of Gn mapped to a list of Hn.
- add_map(HogMap)[source]¶
Method to add the HOGsMap.
- Args:
HogMap (
pyham.mapper.HOGsMap): HOGsMap to add.- Raises:
TypeError: if HogMap is not
pyham.mapper.HOGsMapor if HOGMap ancestor doesn’t match the MapLateral one.