mosaicmpi.dataset.Dataset.map_gene_ids#
- Dataset.map_gene_ids(source_species: Literal['hsapiens', 'mmusculus', 'rnorvegicus', 'sscrofa', 'dmelanogaster', 'drerio', 'celegans'], dest_species: Literal['hsapiens', 'mmusculus', 'rnorvegicus', 'sscrofa', 'dmelanogaster', 'drerio', 'celegans'], source_ids: Literal['ensembl_gene', 'gene_name'], dest_ids: Literal['ensembl_gene', 'gene_name'], one_to_one: bool = True, one_to_many: Literal[False, 'duplicate', 'divide'] = False, many_to_one: Literal[False, 'mean', 'sum'] = False, many_to_many: Literal[False, 'mean', 'sum'] = False, unmapped_prefix: str = 'unmapped_', case_sensitive: bool = False, biomart_url: str = 'http://www.ensembl.org:80/biomart/martservice')#
Map the feature IDs in place for a dataset. Mapping occurs from a source to the dest species, and can be gene names or ensembl gene IDs (eg., ENSG…, ENSMUSG…).
- Parameters:
source_species (Literal["hsapiens", "mmusculus", "rnorvegicus", "sscrofa", "dmelanogaster", "drerio", "celegans"]) – Species name for IDs in the dataset.
dest_species (Literal["hsapiens", "mmusculus", "rnorvegicus", "sscrofa", "dmelanogaster", "drerio", "celegans"]) – Species name for IDs after mapping
source_ids (Literal["ensembl_gene", "gene_name"]) – Whether the IDs are gene names (eg., EGFR), or Ensembl genes (eg., ENSG00000146648)
dest_ids (Literal["ensembl_gene", "gene_name"]) – Whether the IDs should be mapped to gene names (eg., EGFR), or Ensembl genes (eg., ENSG00000146648)
one_to_one (bool, optional) – Whether to map genes that have a one-to-one mapping, defaults to True
one_to_many (Literal[False, "duplicate", "divide"], optional) – Whether to map genes that have a one-to-many mapping, defaults to False
many_to_one (Literal[False, "mean", "sum"], optional) – Whether and how to map genes that have a many-to-one mapping, defaults to False
many_to_many (Literal[False, "mean", "sum"], optional) – Whether and how to map genes that have a many-to-many mapping, defaults to False
unmapped_prefix (str, optional) – For unmapped features, prepend this text to their ID, defaults to “unmapped_”
case_sensitive (bool, optional) – Case-sensitive ID matching, defaults to False
biomart_url (str, optional) – URL to connect to the Biomart web server, defaults to “http://www.ensembl.org:80/biomart/martservice”
- Raises:
NotImplementedError – for features net yet implemented, including many-to-one and many-to-many gene mappings