ebi-eva-common-pyutils 0.6.14__py3-none-any.whl → 0.6.16__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,6 +16,10 @@ import re
16
16
 
17
17
  from ebi_eva_common_pyutils.ncbi_utils import retrieve_species_scientific_name_from_tax_id_ncbi
18
18
  from ebi_eva_common_pyutils.network_utils import json_request
19
+ from ebi_eva_common_pyutils.logger import logging_config as log_cfg
20
+
21
+
22
+ logger = log_cfg.get_logger(__name__)
19
23
 
20
24
 
21
25
  def get_scientific_name_from_ensembl(taxonomy_id: int) -> str:
@@ -41,12 +45,16 @@ def get_normalized_scientific_name_from_ensembl(taxonomy_id: int) -> str:
41
45
  return normalise_taxon_scientific_name(get_scientific_name_from_ensembl(taxonomy_id))
42
46
 
43
47
 
44
- def get_scientific_name_from_taxonomy(taxonomy_id: int) -> str:
48
+ def get_scientific_name_from_taxonomy(taxonomy_id: int, api_key: str=None) -> str:
45
49
  """
46
50
  Search for a species scientific name based on the taxonomy id.
47
51
  Will first attempt to retrieve from Ensembl and then NCBI, if not found returns None.
48
52
  """
49
- species_name = get_scientific_name_from_ensembl(taxonomy_id)
53
+ try:
54
+ species_name = get_scientific_name_from_ensembl(taxonomy_id)
55
+ except Exception:
56
+ logger.warning("Failed to retrieve scientific name in Ensembl for taxonomy id {0}".format(taxonomy_id))
57
+ species_name = None
50
58
  if not species_name:
51
- species_name = retrieve_species_scientific_name_from_tax_id_ncbi(taxonomy_id)
59
+ species_name = retrieve_species_scientific_name_from_tax_id_ncbi(taxonomy_id, api_key=api_key)
52
60
  return species_name
@@ -0,0 +1,24 @@
1
+ Metadata-Version: 2.1
2
+ Name: ebi-eva-common-pyutils
3
+ Version: 0.6.16
4
+ Summary: EBI EVA - Common Python Utilities
5
+ Home-page: https://github.com/EBIVariation/eva-common-pyutils
6
+ License: Apache
7
+ Keywords: EBI,EVA,PYTHON,UTILITIES
8
+ Classifier: Development Status :: 5 - Production/Stable
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Topic :: Software Development :: Build Tools
11
+ Classifier: License :: OSI Approved :: Apache Software License
12
+ Classifier: Programming Language :: Python :: 3
13
+ License-File: LICENSE
14
+ Requires-Dist: requests (==2.*)
15
+ Requires-Dist: lxml (==4.*,>4.9)
16
+ Requires-Dist: pyyaml (==6.*)
17
+ Requires-Dist: cached-property (==1.5.*)
18
+ Requires-Dist: retry (==0.*,>0.9)
19
+ Requires-Dist: openpyxl (==3.*)
20
+ Provides-Extra: eva-internal
21
+ Requires-Dist: psycopg2-binary ; extra == 'eva-internal'
22
+ Requires-Dist: pymongo ; extra == 'eva-internal'
23
+ Requires-Dist: networkx (<=2.5) ; extra == 'eva-internal'
24
+
@@ -17,10 +17,10 @@ ebi_eva_common_pyutils/reference/__init__.py,sha256=NsDjGCu2H2CZLOPaEL6GCoZo5ND_
17
17
  ebi_eva_common_pyutils/reference/assembly.py,sha256=FK4zsvg4_GDeKd9z2z5ZeM9R84TsusgQYdMOGuggQU0,12162
18
18
  ebi_eva_common_pyutils/reference/sequence.py,sha256=bg96QcuB-oytQYpaUkV10OzM_RIFhxsy6t3PQOg2Gy0,3911
19
19
  ebi_eva_common_pyutils/taxonomy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
- ebi_eva_common_pyutils/taxonomy/taxonomy.py,sha256=p3XV4g3y0hEjyeZ4PwgN7Q3Et9G515ctQkSIo1kdDbU,2259
20
+ ebi_eva_common_pyutils/taxonomy/taxonomy.py,sha256=aXmRQ3NAaJotwmmOA2-u2XtcUT6iih-0_e-3QOxynoA,2578
21
21
  ebi_eva_common_pyutils/variation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
22
  ebi_eva_common_pyutils/variation/contig_utils.py,sha256=kMNEW_P2yPnd8Xx1tep19hy5ee7ojxz6ZOO1grTQsRQ,5230
23
- ebi_eva_common_pyutils-0.6.14.data/scripts/archive_directory.py,sha256=0lWJ0ju_AB2ni7lMnJXPFx6U2OdTGbe-WoQs-4BfKOM,4976
23
+ ebi_eva_common_pyutils-0.6.16.data/scripts/archive_directory.py,sha256=0lWJ0ju_AB2ni7lMnJXPFx6U2OdTGbe-WoQs-4BfKOM,4976
24
24
  ebi_eva_internal_pyutils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
25
  ebi_eva_internal_pyutils/archive_directory.py,sha256=IxVEfh_gaCiT652k0Q_-58fonRusy1yzXu7BCO8yVLo,4989
26
26
  ebi_eva_internal_pyutils/config_utils.py,sha256=EGRC5rsmU_ug7OY9-t1UW1XZXRsauSyZB9xPcBux8ts,7909
@@ -32,8 +32,8 @@ ebi_eva_internal_pyutils/mongodb/__init__.py,sha256=0oyTlkYZCV7udlPl09Zl-sDyE3c9
32
32
  ebi_eva_internal_pyutils/mongodb/mongo_database.py,sha256=kesaJaaxYFeF_uYZBgL8tbufGKUXll7bXb4WlOS9vKM,9596
33
33
  ebi_eva_internal_pyutils/nextflow/__init__.py,sha256=OOiJS8jZOz98q0t77NNog7aI_fFrVxi4kGmiSskuAqM,122
34
34
  ebi_eva_internal_pyutils/nextflow/nextflow_pipeline.py,sha256=ew623hhK8jmFLQjJwLZbgBmW9RTiJBEULVqHfIUv_dc,10114
35
- ebi_eva_common_pyutils-0.6.14.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
36
- ebi_eva_common_pyutils-0.6.14.dist-info/METADATA,sha256=13ykCwUwZJ9YSL7MG8vItGSaw-4dvFvLZuJE-U2vVKg,956
37
- ebi_eva_common_pyutils-0.6.14.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
38
- ebi_eva_common_pyutils-0.6.14.dist-info/top_level.txt,sha256=sXoiqiGU8vlMQpFWDlKrekxhlusk06AhkOH3kSvDT6c,48
39
- ebi_eva_common_pyutils-0.6.14.dist-info/RECORD,,
35
+ ebi_eva_common_pyutils-0.6.16.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
36
+ ebi_eva_common_pyutils-0.6.16.dist-info/METADATA,sha256=63KHAq4SOKke2g7o47PLlud1X_20OMOezWXkrb6afrw,909
37
+ ebi_eva_common_pyutils-0.6.16.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
38
+ ebi_eva_common_pyutils-0.6.16.dist-info/top_level.txt,sha256=sXoiqiGU8vlMQpFWDlKrekxhlusk06AhkOH3kSvDT6c,48
39
+ ebi_eva_common_pyutils-0.6.16.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.2)
2
+ Generator: bdist_wheel (0.38.4)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,29 +0,0 @@
1
- Metadata-Version: 2.2
2
- Name: ebi_eva_common_pyutils
3
- Version: 0.6.14
4
- Summary: EBI EVA - Common Python Utilities
5
- Home-page: https://github.com/EBIVariation/eva-common-pyutils
6
- License: Apache
7
- Keywords: EBI,EVA,PYTHON,UTILITIES
8
- Classifier: Development Status :: 5 - Production/Stable
9
- Classifier: Intended Audience :: Developers
10
- Classifier: Topic :: Software Development :: Build Tools
11
- Classifier: License :: OSI Approved :: Apache Software License
12
- Classifier: Programming Language :: Python :: 3
13
- License-File: LICENSE
14
- Requires-Dist: requests
15
- Requires-Dist: lxml
16
- Requires-Dist: pyyaml
17
- Requires-Dist: cached-property
18
- Requires-Dist: retry
19
- Provides-Extra: eva-internal
20
- Requires-Dist: psycopg2-binary; extra == "eva-internal"
21
- Requires-Dist: pymongo; extra == "eva-internal"
22
- Requires-Dist: networkx<=2.5; extra == "eva-internal"
23
- Dynamic: classifier
24
- Dynamic: home-page
25
- Dynamic: keywords
26
- Dynamic: license
27
- Dynamic: provides-extra
28
- Dynamic: requires-dist
29
- Dynamic: summary