Mercurial > repos > bimib > cobraxy
comparison COBRAxy/utils/model_utils.py @ 538:fd53d42348bd draft default tip
Uploaded
| author | francesco_lapi |
|---|---|
| date | Sat, 25 Oct 2025 11:39:03 +0000 |
| parents | ca98c149ec61 |
| children |
comparison
equal
deleted
inserted
replaced
| 537:f79250e824b5 | 538:fd53d42348bd |
|---|---|
| 29 Args: | 29 Args: |
| 30 l (str): The gene identifier to check. | 30 l (str): The gene identifier to check. |
| 31 name (str): The name of the dataset, used in error messages. | 31 name (str): The name of the dataset, used in error messages. |
| 32 | 32 |
| 33 Returns: | 33 Returns: |
| 34 str: The type of gene ID ('hugo_id', 'ensembl_gene_id', 'symbol', or 'entrez_id'). | 34 str: The type of gene ID ('HGNC_ID', 'ENSG', 'HGNC_symbol', or 'entrez_id'). |
| 35 | 35 |
| 36 Raises: | 36 Raises: |
| 37 sys.exit: If the gene ID type is not supported, the execution is aborted. | 37 sys.exit: If the gene ID type is not supported, the execution is aborted. |
| 38 """ | 38 """ |
| 39 if check_hgnc(l): | 39 if check_hgnc(l): |
| 40 return 'hugo_id' | 40 return 'HGNC_ID' |
| 41 elif check_ensembl(l): | 41 elif check_ensembl(l): |
| 42 return 'ensembl_gene_id' | 42 return 'ENSG' |
| 43 elif check_symbol(l): | 43 elif check_symbol(l): |
| 44 return 'symbol' | 44 return 'HGNC_symbol' |
| 45 elif check_entrez(l): | 45 elif check_entrez(l): |
| 46 return 'entrez_id' | 46 return 'entrez_id' |
| 47 else: | 47 else: |
| 48 sys.exit('Execution aborted:\n' + | 48 sys.exit('Execution aborted:\n' + |
| 49 'gene ID type in ' + name + ' not supported. Supported ID'+ | 49 'gene ID type in ' + name + ' not supported. Supported ID'+ |
