ConservedSpots#
- class panorama.region.ConservedSpots(identifier, *spots)#
Bases:
objectRepresents a set of conserved spots across multiple pangenomes.
- __init__(identifier, *spots)#
Constructor method.
- Parameters:
identifier (
int) – The identifier of the conserved spots set.*spots (
Spot) – The spots to add to the conserved set.
- add(spot)#
Add a spot to the conserved set of spots.
- Parameters:
spot (
Spot) – The spot to add to the object.- Raises:
AssertionError – If the spot is not an instance of the Spot class.
KeyError – If the spot already exists in the conserved spots with the same ID.
- Return type:
None
- get(spot_id, pangenome_name)#
Get a spot from the conserved set of spots.
- Parameters:
spot_id (
int) – The identifier of the spot.pangenome_name (
str) – The name of the pangenome from which the spot belongs.
- Returns:
Spot – The spot with the given id and pangenome.
- Raises:
AssertionError – If the spot id is not an integer.
KeyError – If the spot is not in the conserved set of spots.
- Return type:
- pangenomes()#
Get the list of pangenomes where the conserved spot belongs.
- Returns:
List[str] – The list of pangenome names.
- Return type:
List[str]