pyobo 0.10.11__tar.gz → 0.10.12__tar.gz

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.
Files changed (265) hide show
  1. {pyobo-0.10.11/src/pyobo.egg-info → pyobo-0.10.12}/PKG-INFO +4 -4
  2. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.Obo.rst +2 -0
  3. pyobo-0.10.12/docs/source/api/pyobo.Reference.rst +45 -0
  4. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.Term.rst +4 -0
  5. pyobo-0.10.12/docs/source/api/pyobo.get_obsolete.rst +6 -0
  6. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/conf.py +1 -1
  7. {pyobo-0.10.11 → pyobo-0.10.12}/setup.cfg +4 -4
  8. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/api/names.py +27 -6
  9. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/api/utils.py +5 -0
  10. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/cli/lookup.py +2 -2
  11. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/constants.py +31 -1
  12. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/gilda_utils.py +21 -0
  13. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/identifier_utils.py +22 -5
  14. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/reader.py +1 -1
  15. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/__init__.py +2 -0
  16. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/antibodyregistry.py +2 -2
  17. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/biogrid.py +3 -3
  18. pyobo-0.10.12/src/pyobo/sources/credit.py +68 -0
  19. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/geonames.py +27 -9
  20. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/hgnc.py +2 -2
  21. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/mesh.py +3 -3
  22. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/msigdb.py +1 -1
  23. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/npass.py +1 -1
  24. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/pubchem.py +3 -3
  25. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/rgd.py +1 -1
  26. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/rhea.py +2 -2
  27. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/ror.py +67 -21
  28. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/uniprot/uniprot.py +2 -2
  29. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/struct/struct.py +4 -3
  30. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/struct/typedef.py +10 -0
  31. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/utils/path.py +2 -1
  32. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/version.py +1 -1
  33. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/xrefdb/sources/__init__.py +6 -3
  34. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/xrefdb/sources/chembl.py +5 -5
  35. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/xrefdb/sources/pubchem.py +3 -2
  36. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/xrefdb/sources/wikidata.py +8 -1
  37. {pyobo-0.10.11 → pyobo-0.10.12/src/pyobo.egg-info}/PKG-INFO +4 -4
  38. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo.egg-info/SOURCES.txt +2 -0
  39. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo.egg-info/requires.txt +1 -1
  40. {pyobo-0.10.11 → pyobo-0.10.12}/tests/test_alt_ids.py +10 -0
  41. {pyobo-0.10.11 → pyobo-0.10.12}/tox.ini +1 -1
  42. pyobo-0.10.11/docs/source/api/pyobo.Reference.rst +0 -7
  43. {pyobo-0.10.11 → pyobo-0.10.12}/.readthedocs.yml +0 -0
  44. {pyobo-0.10.11 → pyobo-0.10.12}/LICENSE +0 -0
  45. {pyobo-0.10.11 → pyobo-0.10.12}/MANIFEST.in +0 -0
  46. {pyobo-0.10.11 → pyobo-0.10.12}/README.rst +0 -0
  47. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.Canonicalizer.rst +0 -0
  48. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.OboNormalizer.rst +0 -0
  49. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.Synonym.rst +0 -0
  50. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.SynonymTypeDef.rst +0 -0
  51. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.TypeDef.rst +0 -0
  52. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.ensure_path.rst +0 -0
  53. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.from_obo_path.rst +0 -0
  54. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.from_obonet.rst +0 -0
  55. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_alts_to_id.rst +0 -0
  56. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_ancestors.rst +0 -0
  57. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_children.rst +0 -0
  58. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_definition.rst +0 -0
  59. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_descendants.rst +0 -0
  60. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_equivalent.rst +0 -0
  61. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_filtered_properties_df.rst +0 -0
  62. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_filtered_properties_mapping.rst +0 -0
  63. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_filtered_properties_multimapping.rst +0 -0
  64. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_filtered_relations_df.rst +0 -0
  65. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_filtered_xrefs.rst +0 -0
  66. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_graph.rst +0 -0
  67. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_hierarchy.rst +0 -0
  68. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_id_definition_mapping.rst +0 -0
  69. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_id_multirelations_mapping.rst +0 -0
  70. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_id_name_mapping.rst +0 -0
  71. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_id_species_mapping.rst +0 -0
  72. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_id_synonyms_mapping.rst +0 -0
  73. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_id_to_alts.rst +0 -0
  74. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_ids.rst +0 -0
  75. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_name.rst +0 -0
  76. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_name_by_curie.rst +0 -0
  77. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_name_id_mapping.rst +0 -0
  78. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_ontology.rst +0 -0
  79. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_primary_curie.rst +0 -0
  80. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_primary_identifier.rst +0 -0
  81. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_priority_curie.rst +0 -0
  82. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_properties.rst +0 -0
  83. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_properties_df.rst +0 -0
  84. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_property.rst +0 -0
  85. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_relation.rst +0 -0
  86. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_relation_mapping.rst +0 -0
  87. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_relations_df.rst +0 -0
  88. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_species.rst +0 -0
  89. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_sssom_df.rst +0 -0
  90. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_subhierarchy.rst +0 -0
  91. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_synonyms.rst +0 -0
  92. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_typedef_df.rst +0 -0
  93. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_version.rst +0 -0
  94. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_xref.rst +0 -0
  95. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_xrefs.rst +0 -0
  96. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.get_xrefs_df.rst +0 -0
  97. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.ground.rst +0 -0
  98. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.has_ancestor.rst +0 -0
  99. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.has_nomenclature_plugin.rst +0 -0
  100. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.has_xref_plugin.rst +0 -0
  101. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.is_descendent.rst +0 -0
  102. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.iter_nomenclature_plugins.rst +0 -0
  103. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.iter_xref_plugins.rst +0 -0
  104. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.normalize_curie.rst +0 -0
  105. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.parse_results_from_obo.rst +0 -0
  106. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.run_nomenclature_plugin.rst +0 -0
  107. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/api/pyobo.run_xref_plugin.rst +0 -0
  108. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/index.rst +0 -0
  109. {pyobo-0.10.11 → pyobo-0.10.12}/docs/source/logo.png +0 -0
  110. {pyobo-0.10.11 → pyobo-0.10.12}/pyproject.toml +0 -0
  111. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/__init__.py +0 -0
  112. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/__main__.py +0 -0
  113. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/api/__init__.py +0 -0
  114. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/api/alts.py +0 -0
  115. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/api/hierarchy.py +0 -0
  116. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/api/metadata.py +0 -0
  117. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/api/properties.py +0 -0
  118. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/api/relations.py +0 -0
  119. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/api/species.py +0 -0
  120. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/api/typedefs.py +0 -0
  121. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/api/xrefs.py +0 -0
  122. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/apps/__init__.py +0 -0
  123. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/apps/cli.py +0 -0
  124. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/apps/gilda/__init__.py +0 -0
  125. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/apps/gilda/__main__.py +0 -0
  126. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/apps/gilda/app.py +0 -0
  127. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/apps/gilda/cli.py +0 -0
  128. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/apps/gilda/templates/base.html +0 -0
  129. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/apps/gilda/templates/home.html +0 -0
  130. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/apps/gilda/templates/matches.html +0 -0
  131. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/apps/mapper/__init__.py +0 -0
  132. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/apps/mapper/__main__.py +0 -0
  133. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/apps/mapper/cli.py +0 -0
  134. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/apps/mapper/mapper.py +0 -0
  135. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/apps/mapper/templates/base.html +0 -0
  136. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/apps/mapper/templates/mapper_home.html +0 -0
  137. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/aws.py +0 -0
  138. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/cli/__init__.py +0 -0
  139. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/cli/aws.py +0 -0
  140. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/cli/cli.py +0 -0
  141. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/cli/database.py +0 -0
  142. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/cli/utils.py +0 -0
  143. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/getters.py +0 -0
  144. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/mocks.py +0 -0
  145. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/normalizer.py +0 -0
  146. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/obographs.py +0 -0
  147. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/plugins.py +0 -0
  148. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/registries/__init__.py +0 -0
  149. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/registries/metaregistry.json +0 -0
  150. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/registries/metaregistry.py +0 -0
  151. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/resource_utils.py +0 -0
  152. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/resources/__init__.py +0 -0
  153. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/resources/ncbitaxon.py +0 -0
  154. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/resources/ncbitaxon.tsv.gz +0 -0
  155. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/resources/ro.py +0 -0
  156. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/resources/ro.tsv +0 -0
  157. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/agrovoc.py +0 -0
  158. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/ccle.py +0 -0
  159. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/cgnc.py +0 -0
  160. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/chebi.py +0 -0
  161. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/chembl.py +0 -0
  162. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/civic_gene.py +0 -0
  163. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/complexportal.py +0 -0
  164. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/conso.py +0 -0
  165. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/cpt.py +0 -0
  166. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/cvx.py +0 -0
  167. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/depmap.py +0 -0
  168. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/dictybase_gene.py +0 -0
  169. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/drugbank.py +0 -0
  170. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/drugbank_salt.py +0 -0
  171. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/drugcentral.py +0 -0
  172. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/expasy.py +0 -0
  173. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/famplex.py +0 -0
  174. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/flybase.py +0 -0
  175. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/gmt_utils.py +0 -0
  176. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/go.py +0 -0
  177. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/gwascentral_phenotype.py +0 -0
  178. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/gwascentral_study.py +0 -0
  179. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/hgncgenefamily.py +0 -0
  180. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/icd10.py +0 -0
  181. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/icd11.py +0 -0
  182. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/icd_utils.py +0 -0
  183. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/interpro.py +0 -0
  184. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/itis.py +0 -0
  185. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/kegg/__init__.py +0 -0
  186. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/kegg/api.py +0 -0
  187. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/kegg/genes.py +0 -0
  188. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/kegg/genome.py +0 -0
  189. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/kegg/pathway.py +0 -0
  190. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/mgi.py +0 -0
  191. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/mirbase.py +0 -0
  192. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/mirbase_constants.py +0 -0
  193. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/mirbase_family.py +0 -0
  194. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/mirbase_mature.py +0 -0
  195. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/ncbigene.py +0 -0
  196. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/omim_ps.py +0 -0
  197. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/pathbank.py +0 -0
  198. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/pfam.py +0 -0
  199. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/pfam_clan.py +0 -0
  200. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/pid.py +0 -0
  201. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/pombase.py +0 -0
  202. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/reactome.py +0 -0
  203. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/selventa/__init__.py +0 -0
  204. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/selventa/schem.py +0 -0
  205. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/selventa/scomp.py +0 -0
  206. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/selventa/sdis.py +0 -0
  207. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/selventa/sfam.py +0 -0
  208. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/sgd.py +0 -0
  209. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/slm.py +0 -0
  210. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/umls/__init__.py +0 -0
  211. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/umls/__main__.py +0 -0
  212. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/umls/get_synonym_types.py +0 -0
  213. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/umls/synonym_types.tsv +0 -0
  214. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/umls/umls.py +0 -0
  215. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/uniprot/__init__.py +0 -0
  216. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/uniprot/uniprot_ptm.py +0 -0
  217. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/utils.py +0 -0
  218. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/wikipathways.py +0 -0
  219. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/sources/zfin.py +0 -0
  220. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/ssg/__init__.py +0 -0
  221. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/ssg/base.html +0 -0
  222. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/ssg/index.html +0 -0
  223. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/ssg/term.html +0 -0
  224. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/ssg/typedef.html +0 -0
  225. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/struct/__init__.py +0 -0
  226. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/struct/reference.py +0 -0
  227. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/struct/utils.py +0 -0
  228. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/utils/__init__.py +0 -0
  229. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/utils/cache.py +0 -0
  230. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/utils/io.py +0 -0
  231. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/utils/iter.py +0 -0
  232. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/utils/misc.py +0 -0
  233. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/utils/ndex_utils.py +0 -0
  234. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/xrefdb/__init__.py +0 -0
  235. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/xrefdb/canonicalizer.py +0 -0
  236. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/xrefdb/priority.py +0 -0
  237. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/xrefdb/sources/biomappings.py +0 -0
  238. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/xrefdb/sources/cbms2019.py +0 -0
  239. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/xrefdb/sources/compath.py +0 -0
  240. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/xrefdb/sources/famplex.py +0 -0
  241. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/xrefdb/sources/gilda.py +0 -0
  242. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/xrefdb/sources/intact.py +0 -0
  243. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/xrefdb/sources/ncit.py +0 -0
  244. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo/xrefdb/xrefs_pipeline.py +0 -0
  245. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo.egg-info/dependency_links.txt +0 -0
  246. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo.egg-info/entry_points.txt +0 -0
  247. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo.egg-info/not-zip-safe +0 -0
  248. {pyobo-0.10.11 → pyobo-0.10.12}/src/pyobo.egg-info/top_level.txt +0 -0
  249. {pyobo-0.10.11 → pyobo-0.10.12}/tests/__init__.py +0 -0
  250. {pyobo-0.10.11 → pyobo-0.10.12}/tests/constants.py +0 -0
  251. {pyobo-0.10.11 → pyobo-0.10.12}/tests/resources/citations.txt +0 -0
  252. {pyobo-0.10.11 → pyobo-0.10.12}/tests/resources/test_chebi.obo +0 -0
  253. {pyobo-0.10.11 → pyobo-0.10.12}/tests/resources/test_msigdb.gmt +0 -0
  254. {pyobo-0.10.11 → pyobo-0.10.12}/tests/resources/test_wikipathways.gmt +0 -0
  255. {pyobo-0.10.11 → pyobo-0.10.12}/tests/test_caches.py +0 -0
  256. {pyobo-0.10.11 → pyobo-0.10.12}/tests/test_extract.py +0 -0
  257. {pyobo-0.10.11 → pyobo-0.10.12}/tests/test_get.py +0 -0
  258. {pyobo-0.10.11 → pyobo-0.10.12}/tests/test_get_miriam_url.py +0 -0
  259. {pyobo-0.10.11 → pyobo-0.10.12}/tests/test_gmt.py +0 -0
  260. {pyobo-0.10.11 → pyobo-0.10.12}/tests/test_ground.py +0 -0
  261. {pyobo-0.10.11 → pyobo-0.10.12}/tests/test_mapper.py +0 -0
  262. {pyobo-0.10.11 → pyobo-0.10.12}/tests/test_sources/__init__.py +0 -0
  263. {pyobo-0.10.11 → pyobo-0.10.12}/tests/test_sources/test_famplex.py +0 -0
  264. {pyobo-0.10.11 → pyobo-0.10.12}/tests/test_struct.py +0 -0
  265. {pyobo-0.10.11 → pyobo-0.10.12}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyobo
3
- Version: 0.10.11
3
+ Version: 0.10.12
4
4
  Summary: Handling and writing OBO
5
5
  Home-page: https://github.com/pyobo/pyobo
6
6
  Download-URL: https://github.com/pyobo/pyobo/releases
@@ -19,14 +19,14 @@ Classifier: Intended Audience :: Science/Research
19
19
  Classifier: License :: OSI Approved :: MIT License
20
20
  Classifier: Operating System :: OS Independent
21
21
  Classifier: Programming Language :: Python
22
+ Classifier: Programming Language :: Python :: 3.12
22
23
  Classifier: Programming Language :: Python :: 3.11
23
24
  Classifier: Programming Language :: Python :: 3.10
24
25
  Classifier: Programming Language :: Python :: 3.9
25
- Classifier: Programming Language :: Python :: 3.8
26
26
  Classifier: Programming Language :: Python :: 3 :: Only
27
27
  Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
28
28
  Classifier: Topic :: Scientific/Engineering :: Chemistry
29
- Requires-Python: >=3.8
29
+ Requires-Python: >=3.9
30
30
  License-File: LICENSE
31
31
  Requires-Dist: obonet>=0.3.0
32
32
  Requires-Dist: click
@@ -55,7 +55,7 @@ Provides-Extra: tests
55
55
  Requires-Dist: coverage; extra == "tests"
56
56
  Requires-Dist: pytest; extra == "tests"
57
57
  Provides-Extra: docs
58
- Requires-Dist: sphinx; extra == "docs"
58
+ Requires-Dist: sphinx<8.0; extra == "docs"
59
59
  Requires-Dist: sphinx-rtd-theme; extra == "docs"
60
60
  Requires-Dist: sphinx-click; extra == "docs"
61
61
  Requires-Dist: sphinx_automodapi; extra == "docs"
@@ -54,6 +54,7 @@ Obo
54
54
  ~Obo.get_id_synonyms_mapping
55
55
  ~Obo.get_ids
56
56
  ~Obo.get_metadata
57
+ ~Obo.get_obsolete
57
58
  ~Obo.get_properties_df
58
59
  ~Obo.get_relation
59
60
  ~Obo.get_relation_mapping
@@ -133,6 +134,7 @@ Obo
133
134
  .. automethod:: get_id_synonyms_mapping
134
135
  .. automethod:: get_ids
135
136
  .. automethod:: get_metadata
137
+ .. automethod:: get_obsolete
136
138
  .. automethod:: get_properties_df
137
139
  .. automethod:: get_relation
138
140
  .. automethod:: get_relation_mapping
@@ -0,0 +1,45 @@
1
+ Reference
2
+ =========
3
+
4
+ .. currentmodule:: pyobo
5
+
6
+ .. autoclass:: Reference
7
+ :show-inheritance:
8
+
9
+ .. rubric:: Attributes Summary
10
+
11
+ .. autosummary::
12
+
13
+ ~Reference.bioregistry_link
14
+ ~Reference.model_computed_fields
15
+ ~Reference.model_config
16
+ ~Reference.model_fields
17
+ ~Reference.preferred_curie
18
+ ~Reference.preferred_prefix
19
+
20
+ .. rubric:: Methods Summary
21
+
22
+ .. autosummary::
23
+
24
+ ~Reference.auto
25
+ ~Reference.from_curie
26
+ ~Reference.from_iri
27
+ ~Reference.validate_identifier
28
+ ~Reference.validate_prefix
29
+
30
+ .. rubric:: Attributes Documentation
31
+
32
+ .. autoattribute:: bioregistry_link
33
+ .. autoattribute:: model_computed_fields
34
+ .. autoattribute:: model_config
35
+ .. autoattribute:: model_fields
36
+ .. autoattribute:: preferred_curie
37
+ .. autoattribute:: preferred_prefix
38
+
39
+ .. rubric:: Methods Documentation
40
+
41
+ .. automethod:: auto
42
+ .. automethod:: from_curie
43
+ .. automethod:: from_iri
44
+ .. automethod:: validate_identifier
45
+ .. automethod:: validate_prefix
@@ -13,6 +13,7 @@ Term
13
13
  ~Term.definition
14
14
  ~Term.is_obsolete
15
15
  ~Term.namespace
16
+ ~Term.type
16
17
 
17
18
  .. rubric:: Methods Summary
18
19
 
@@ -25,6 +26,7 @@ Term
25
26
  ~Term.append_property
26
27
  ~Term.append_provenance
27
28
  ~Term.append_relationship
29
+ ~Term.append_replaced_by
28
30
  ~Term.append_see_also
29
31
  ~Term.append_synonym
30
32
  ~Term.append_xref
@@ -48,6 +50,7 @@ Term
48
50
  .. autoattribute:: definition
49
51
  .. autoattribute:: is_obsolete
50
52
  .. autoattribute:: namespace
53
+ .. autoattribute:: type
51
54
 
52
55
  .. rubric:: Methods Documentation
53
56
 
@@ -58,6 +61,7 @@ Term
58
61
  .. automethod:: append_property
59
62
  .. automethod:: append_provenance
60
63
  .. automethod:: append_relationship
64
+ .. automethod:: append_replaced_by
61
65
  .. automethod:: append_see_also
62
66
  .. automethod:: append_synonym
63
67
  .. automethod:: append_xref
@@ -0,0 +1,6 @@
1
+ get_obsolete
2
+ ============
3
+
4
+ .. currentmodule:: pyobo
5
+
6
+ .. autofunction:: get_obsolete
@@ -58,7 +58,7 @@ author = "Charles Tapley Hoyt"
58
58
  #
59
59
 
60
60
  # The full version, including alpha/beta/rc tags.
61
- release = "0.10.11"
61
+ release = "0.10.12"
62
62
 
63
63
  # The short X.Y version.
64
64
  parsed_version = re.match(
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = pyobo
3
- version = 0.10.11
3
+ version = 0.10.12
4
4
  description = Handling and writing OBO
5
5
  long_description = file: README.rst
6
6
  url = https://github.com/pyobo/pyobo
@@ -22,10 +22,10 @@ classifiers =
22
22
  License :: OSI Approved :: MIT License
23
23
  Operating System :: OS Independent
24
24
  Programming Language :: Python
25
+ Programming Language :: Python :: 3.12
25
26
  Programming Language :: Python :: 3.11
26
27
  Programming Language :: Python :: 3.10
27
28
  Programming Language :: Python :: 3.9
28
- Programming Language :: Python :: 3.8
29
29
  Programming Language :: Python :: 3 :: Only
30
30
  Topic :: Scientific/Engineering :: Bio-Informatics
31
31
  Topic :: Scientific/Engineering :: Chemistry
@@ -60,7 +60,7 @@ install_requires =
60
60
  typing_extensions
61
61
  zip_safe = false
62
62
  include_package_data = True
63
- python_requires = >=3.8
63
+ python_requires = >=3.9
64
64
  packages = find:
65
65
  package_dir =
66
66
  = src
@@ -73,7 +73,7 @@ tests =
73
73
  coverage
74
74
  pytest
75
75
  docs =
76
- sphinx
76
+ sphinx<8.0
77
77
  sphinx-rtd-theme
78
78
  sphinx-click
79
79
  sphinx_automodapi
@@ -2,11 +2,15 @@
2
2
 
3
3
  """High-level API for nomenclature."""
4
4
 
5
+ from __future__ import annotations
6
+
5
7
  import logging
6
8
  import subprocess
7
9
  from functools import lru_cache
8
10
  from typing import Callable, List, Mapping, Optional, Set, TypeVar
9
11
 
12
+ from curies import Reference, ReferenceTuple
13
+
10
14
  from .alts import get_primary_identifier
11
15
  from .utils import get_version
12
16
  from ..getters import NoBuild, get_ontology
@@ -32,6 +36,8 @@ logger = logging.getLogger(__name__)
32
36
 
33
37
  def get_name_by_curie(curie: str, *, version: Optional[str] = None) -> Optional[str]:
34
38
  """Get the name for a CURIE, if possible."""
39
+ if version is None:
40
+ version = get_version(curie.split(":")[0])
35
41
  prefix, identifier = normalize_curie(curie)
36
42
  if prefix and identifier:
37
43
  return get_name(prefix, identifier, version=version)
@@ -40,7 +46,8 @@ def get_name_by_curie(curie: str, *, version: Optional[str] = None) -> Optional[
40
46
 
41
47
  X = TypeVar("X")
42
48
 
43
- NO_BUILD_PREFIXES = set()
49
+ NO_BUILD_PREFIXES: Set[str] = set()
50
+ NO_BUILD_LOGGED: Set = set()
44
51
 
45
52
 
46
53
  def _help_get(
@@ -59,8 +66,10 @@ def _help_get(
59
66
  logger.warning("[%s] unable to look up results with %s", prefix, f)
60
67
  NO_BUILD_PREFIXES.add(prefix)
61
68
  return None
62
- except ValueError:
63
- logger.warning("[%s] unable to look up results with %s", prefix, f)
69
+ except ValueError as e:
70
+ if prefix not in NO_BUILD_PREFIXES:
71
+ logger.warning("[%s] value error while looking up results with %s: %s", prefix, f, e)
72
+ NO_BUILD_PREFIXES.add(prefix)
64
73
  return None
65
74
 
66
75
  if not mapping:
@@ -74,9 +83,17 @@ def _help_get(
74
83
 
75
84
 
76
85
  @wrap_norm_prefix
77
- def get_name(prefix: str, identifier: str, *, version: Optional[str] = None) -> Optional[str]:
86
+ def get_name(
87
+ prefix: str | Reference | ReferenceTuple,
88
+ identifier: Optional[str] = None,
89
+ /,
90
+ *,
91
+ version: Optional[str] = None,
92
+ ) -> Optional[str]:
78
93
  """Get the name for an entity."""
79
- return _help_get(get_id_name_mapping, prefix, identifier, version=version)
94
+ if isinstance(prefix, (ReferenceTuple, Reference)):
95
+ prefix, identifier = prefix.prefix, prefix.identifier
96
+ return _help_get(get_id_name_mapping, prefix, identifier, version=version) # type:ignore
80
97
 
81
98
 
82
99
  @lru_cache()
@@ -159,8 +176,12 @@ def get_name_id_mapping(
159
176
 
160
177
 
161
178
  @wrap_norm_prefix
162
- def get_definition(prefix: str, identifier: str, *, version: Optional[str] = None) -> Optional[str]:
179
+ def get_definition(
180
+ prefix: str, identifier: str | None = None, *, version: Optional[str] = None
181
+ ) -> Optional[str]:
163
182
  """Get the definition for an entity."""
183
+ if identifier is None:
184
+ prefix, _, identifier = prefix.rpartition(":")
164
185
  return _help_get(get_id_definition_mapping, prefix, identifier, version=version)
165
186
 
166
187
 
@@ -7,6 +7,7 @@ from typing import Optional
7
7
 
8
8
  import bioversions
9
9
 
10
+ from ..constants import VERSION_PINS
10
11
  from ..utils.path import prefix_directory_join
11
12
 
12
13
  __all__ = [
@@ -25,6 +26,10 @@ def get_version(prefix: str) -> Optional[str]:
25
26
  :param prefix: the resource name
26
27
  :return: The version if available else None
27
28
  """
29
+ # Prioritize loaded environmental variable VERSION_PINS dictionary
30
+ version = VERSION_PINS.get(prefix)
31
+ if version:
32
+ return version
28
33
  try:
29
34
  version = bioversions.get_version(prefix)
30
35
  except KeyError:
@@ -282,7 +282,7 @@ def ancestors(prefix: str, identifier: str, force: bool, version: Optional[str])
282
282
  """Look up ancestors."""
283
283
  curies = get_ancestors(prefix=prefix, identifier=identifier, force=force, version=version)
284
284
  for curie in sorted(curies or []):
285
- click.echo(f"{curie}\t{get_name_by_curie(curie)}")
285
+ click.echo(f"{curie}\t{get_name_by_curie(curie, version=version)}")
286
286
 
287
287
 
288
288
  @lookup.command()
@@ -295,7 +295,7 @@ def descendants(prefix: str, identifier: str, force: bool, version: Optional[str
295
295
  """Look up descendants."""
296
296
  curies = get_descendants(prefix=prefix, identifier=identifier, force=force, version=version)
297
297
  for curie in sorted(curies or []):
298
- click.echo(f"{curie}\t{get_name_by_curie(curie)}")
298
+ click.echo(f"{curie}\t{get_name_by_curie(curie, version=version)}")
299
299
 
300
300
 
301
301
  @lookup.command()
@@ -2,7 +2,9 @@
2
2
 
3
3
  """Constants for PyOBO."""
4
4
 
5
+ import json
5
6
  import logging
7
+ import os
6
8
  import re
7
9
 
8
10
  import pystow
@@ -11,6 +13,7 @@ __all__ = [
11
13
  "RAW_DIRECTORY",
12
14
  "DATABASE_DIRECTORY",
13
15
  "SPECIES_REMAPPING",
16
+ "VERSION_PINS",
14
17
  ]
15
18
 
16
19
  logger = logging.getLogger(__name__)
@@ -80,7 +83,6 @@ TYPEDEFS_FILE = "typedefs.tsv.gz"
80
83
  SPECIES_RECORD = "5334738"
81
84
  SPECIES_FILE = "species.tsv.gz"
82
85
 
83
-
84
86
  NCBITAXON_PREFIX = "NCBITaxon"
85
87
  DATE_FORMAT = "%d:%m:%Y %H:%M"
86
88
  PROVENANCE_PREFIXES = {
@@ -99,3 +101,31 @@ PROVENANCE_PREFIXES = {
99
101
  "isbn",
100
102
  "issn",
101
103
  }
104
+
105
+ # Load version pin dictionary from the environmental variable VERSION_PINS
106
+ try:
107
+ VERSION_PINS_STR = os.getenv("VERSION_PINS")
108
+ if not VERSION_PINS_STR:
109
+ VERSION_PINS = {}
110
+ else:
111
+ VERSION_PINS = json.loads(VERSION_PINS_STR)
112
+ for k, v in VERSION_PINS.items():
113
+ if not isinstance(k, str) or not isinstance(v, str):
114
+ logger.error("The prefix and version name must both be " "strings")
115
+ VERSION_PINS = {}
116
+ break
117
+ except ValueError as e:
118
+ logger.error(
119
+ "The value for the environment variable VERSION_PINS must be a valid JSON string: %s" % e
120
+ )
121
+ VERSION_PINS = {}
122
+
123
+ if VERSION_PINS:
124
+ logger.debug(
125
+ f"These are the resource versions that are pinned.\n{VERSION_PINS}. "
126
+ f"\nPyobo will download the latest version of a resource if it's "
127
+ f"not pinned.\nIf you want to use a specific version of a "
128
+ f"resource, edit your VERSION_PINS environmental "
129
+ f"variable which is a JSON string to include a prefix and version "
130
+ f"name."
131
+ )
@@ -15,6 +15,7 @@ from gilda.term import filter_out_duplicates
15
15
  from tqdm.auto import tqdm
16
16
 
17
17
  from pyobo import (
18
+ get_descendants,
18
19
  get_id_name_mapping,
19
20
  get_id_species_mapping,
20
21
  get_id_synonyms_mapping,
@@ -247,3 +248,23 @@ def get_gilda_terms(
247
248
  )
248
249
  if term is not None:
249
250
  yield term
251
+
252
+
253
+ def get_gilda_term_subset(
254
+ source: str, ancestors: Union[str, List[str]], **kwargs
255
+ ) -> Iterable[gilda.term.Term]:
256
+ """Get a subset of terms."""
257
+ subset = {
258
+ descendant
259
+ for parent_curie in _ensure_list(ancestors)
260
+ for descendant in get_descendants(*parent_curie.split(":")) or []
261
+ }
262
+ for term in get_gilda_terms(source, **kwargs):
263
+ if bioregistry.curie_to_str(term.db, term.id) in subset:
264
+ yield term
265
+
266
+
267
+ def _ensure_list(s: Union[str, List[str]]) -> List[str]:
268
+ if isinstance(s, str):
269
+ return [s]
270
+ return s
@@ -2,11 +2,14 @@
2
2
 
3
3
  """Utilities for handling prefixes."""
4
4
 
5
+ from __future__ import annotations
6
+
5
7
  import logging
6
8
  from functools import wraps
7
9
  from typing import Optional, Tuple, Union
8
10
 
9
11
  import bioregistry
12
+ from curies import Reference, ReferenceTuple
10
13
 
11
14
  from .registries import (
12
15
  curie_has_blacklisted_prefix,
@@ -108,11 +111,25 @@ def wrap_norm_prefix(f):
108
111
  """Decorate a function that take in a prefix to auto-normalize, or return None if it can't be normalized."""
109
112
 
110
113
  @wraps(f)
111
- def _wrapped(prefix, *args, **kwargs):
112
- norm_prefix = bioregistry.normalize_prefix(prefix)
113
- if norm_prefix is None:
114
- raise ValueError(f"Invalid prefix: {prefix}")
115
- return f(norm_prefix, *args, **kwargs)
114
+ def _wrapped(prefix: str | Reference | ReferenceTuple, *args, **kwargs):
115
+ if isinstance(prefix, str):
116
+ norm_prefix = bioregistry.normalize_prefix(prefix)
117
+ if norm_prefix is None:
118
+ raise ValueError(f"Invalid prefix: {prefix}")
119
+ prefix = norm_prefix
120
+ elif isinstance(prefix, Reference):
121
+ norm_prefix = bioregistry.normalize_prefix(prefix.prefix)
122
+ if norm_prefix is None:
123
+ raise ValueError(f"Invalid prefix: {prefix.prefix}")
124
+ prefix = Reference(prefix=norm_prefix, identifier=prefix.identifier)
125
+ elif isinstance(prefix, ReferenceTuple):
126
+ norm_prefix = bioregistry.normalize_prefix(prefix.prefix)
127
+ if norm_prefix is None:
128
+ raise ValueError(f"Invalid prefix: {prefix.prefix}")
129
+ prefix = ReferenceTuple(norm_prefix, prefix.identifier)
130
+ else:
131
+ raise TypeError
132
+ return f(prefix, *args, **kwargs)
116
133
 
117
134
  return _wrapped
118
135
 
@@ -417,7 +417,7 @@ def _clean_definition(s: str) -> str:
417
417
  # if '\t' in s:
418
418
  # logger.warning('has tab')
419
419
  return (
420
- s.replace('\\"', '"').replace("\n", " ").replace("\t", " ").replace("\d", "") # noqa:W605
420
+ s.replace('\\"', '"').replace("\n", " ").replace("\t", " ").replace(r"\d", "") # noqa:W605
421
421
  )
422
422
 
423
423
 
@@ -12,6 +12,7 @@ from .civic_gene import CIVICGeneGetter
12
12
  from .complexportal import ComplexPortalGetter
13
13
  from .conso import CONSOGetter
14
14
  from .cpt import CPTGetter
15
+ from .credit import CreditGetter
15
16
  from .cvx import CVXGetter
16
17
  from .depmap import DepMapGetter
17
18
  from .dictybase_gene import DictybaseGetter
@@ -69,6 +70,7 @@ __all__ = [
69
70
  "CVXGetter",
70
71
  "ChEMBLCompoundGetter",
71
72
  "ComplexPortalGetter",
73
+ "CreditGetter",
72
74
  "DepMapGetter",
73
75
  "DictybaseGetter",
74
76
  "DrugBankGetter",
@@ -5,12 +5,12 @@
5
5
  import logging
6
6
  from typing import Iterable, Mapping, Optional
7
7
 
8
- import bioversions
9
8
  import pandas as pd
10
9
  from bioregistry.utils import removeprefix
11
10
  from tqdm.auto import tqdm
12
11
 
13
12
  from pyobo import Obo, Term
13
+ from pyobo.api.utils import get_version
14
14
  from pyobo.utils.path import ensure_df
15
15
 
16
16
  __all__ = [
@@ -27,7 +27,7 @@ CHUNKSIZE = 20_000
27
27
  def get_chunks(*, force: bool = False, version: Optional[str] = None) -> pd.DataFrame:
28
28
  """Get the BioGRID identifiers mapping dataframe."""
29
29
  if version is None:
30
- version = bioversions.get_version(PREFIX)
30
+ version = get_version(PREFIX)
31
31
  df = ensure_df(
32
32
  PREFIX,
33
33
  url=URL,
@@ -5,9 +5,9 @@
5
5
  from functools import partial
6
6
  from typing import Mapping, Optional
7
7
 
8
- import bioversions
9
8
  import pandas as pd
10
9
 
10
+ from pyobo.api.utils import get_version
11
11
  from pyobo.resources.ncbitaxon import get_ncbitaxon_id
12
12
  from pyobo.utils.cache import cached_mapping
13
13
  from pyobo.utils.path import ensure_df, prefix_directory_join
@@ -52,7 +52,7 @@ def _lookup(name: str) -> Optional[str]:
52
52
 
53
53
  def get_df() -> pd.DataFrame:
54
54
  """Get the BioGRID identifiers mapping dataframe."""
55
- version = bioversions.get_version("biogrid")
55
+ version = get_version("biogrid")
56
56
  url = f"{BASE_URL}/BIOGRID-{version}/BIOGRID-IDENTIFIERS-{version}.tab.zip"
57
57
  df = ensure_df(PREFIX, url=url, skiprows=28, dtype=str, version=version)
58
58
  df["taxonomy_id"] = df["ORGANISM_OFFICIAL_NAME"].map(_lookup)
@@ -65,7 +65,7 @@ def get_df() -> pd.DataFrame:
65
65
  "cache",
66
66
  "xrefs",
67
67
  name="ncbigene.tsv",
68
- version=partial(bioversions.get_version, PREFIX),
68
+ version=partial(get_version, PREFIX),
69
69
  ),
70
70
  header=["biogrid_id", "ncbigene_id"],
71
71
  )
@@ -0,0 +1,68 @@
1
+ """Converter for the Contributor Roles Taxonomy."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import json
6
+ from typing import Iterable
7
+
8
+ from more_itertools import chunked
9
+
10
+ from pyobo.struct import Obo, Term
11
+ from pyobo.utils.path import ensure_path
12
+
13
+ __all__ = [
14
+ "CreditGetter",
15
+ ]
16
+
17
+ url = "https://api.github.com/repos/CASRAI-CRedIT/Dictionary/contents/Picklists/Contributor%20Roles"
18
+ PREFIX = "credit"
19
+
20
+
21
+ class CreditGetter(Obo):
22
+ """An ontology representation of the Contributor Roles Taxonomy."""
23
+
24
+ ontology = PREFIX
25
+ static_version = "2022"
26
+ idspaces = {
27
+ PREFIX: "https://credit.niso.org/contributor-roles/",
28
+ }
29
+
30
+ def iter_terms(self, force: bool = False) -> Iterable[Term]:
31
+ """Iterate over terms in the ontology."""
32
+ return get_terms(force=force)
33
+
34
+
35
+ def get_obo(force: bool = False) -> Obo:
36
+ """Get RGD as OBO."""
37
+ return CreditGetter(force=force)
38
+
39
+
40
+ def get_terms(force: bool = False) -> list[Term]:
41
+ """Get terms from the Contributor Roles Taxonomy via GitHub."""
42
+ path = ensure_path(PREFIX, url=url, name="picklist-api.json", force=force)
43
+ with open(path) as f:
44
+ data = json.load(f)
45
+ terms = []
46
+ for x in data:
47
+ name = x["name"].removesuffix(".md").lower()
48
+
49
+ pp = ensure_path(PREFIX, "picklist", url=x["download_url"], backend="requests")
50
+ with open(pp) as f:
51
+ header, *rest = f.read().splitlines()
52
+ name = header = header.removeprefix("# Contributor Roles/")
53
+ dd = {k.removeprefix("## "): v for k, v in chunked(rest, 2)}
54
+ identifier = (
55
+ dd["Canonical URL"]
56
+ .removeprefix("https://credit.niso.org/contributor-roles/")
57
+ .rstrip("/")
58
+ )
59
+ desc = dd["Short definition"]
60
+ terms.append(
61
+ Term.from_triple(prefix=PREFIX, identifier=identifier, name=name, definition=desc)
62
+ )
63
+
64
+ return terms
65
+
66
+
67
+ if __name__ == "__main__":
68
+ get_obo(force=True).write_default(write_obo=True)
@@ -1,5 +1,7 @@
1
1
  """Get terms from geonames."""
2
2
 
3
+ from __future__ import annotations
4
+
3
5
  import logging
4
6
  from typing import Collection, Iterable, Mapping
5
7
 
@@ -146,15 +148,7 @@ def get_code_to_admin2(
146
148
  return code_to_admin2
147
149
 
148
150
 
149
- def get_cities(
150
- code_to_country,
151
- code_to_admin1,
152
- code_to_admin2,
153
- *,
154
- minimum_population: int = 100_000,
155
- force: bool = False,
156
- ) -> Mapping[str, Term]:
157
- """Get a mapping from city code to term."""
151
+ def _get_cities_df(force: bool = False) -> pd.DataFrame:
158
152
  columns = [
159
153
  "geonames_id",
160
154
  "name",
@@ -184,7 +178,19 @@ def get_cities(
184
178
  names=columns,
185
179
  dtype=str,
186
180
  )
181
+ return cities_df
182
+
187
183
 
184
+ def get_cities(
185
+ code_to_country,
186
+ code_to_admin1,
187
+ code_to_admin2,
188
+ *,
189
+ minimum_population: int = 100_000,
190
+ force: bool = False,
191
+ ) -> Mapping[str, Term]:
192
+ """Get a mapping from city code to term."""
193
+ cities_df = _get_cities_df(force=force)
188
194
  cities_df = cities_df[cities_df.population.astype(int) > minimum_population]
189
195
  cities_df.synonyms = cities_df.synonyms.str.split(",")
190
196
 
@@ -235,5 +241,17 @@ def get_cities(
235
241
  return terms
236
242
 
237
243
 
244
+ def get_city_to_country() -> dict[str, str]:
245
+ """Get a mapping from city GeoNames to country GeoNames id."""
246
+ rv = {}
247
+ code_to_country = get_code_to_country()
248
+ cities_df = _get_cities_df()
249
+ for city_geonames_id, country_code in cities_df[["geonames_id", "country_code"]].values:
250
+ if pd.isna(city_geonames_id) or pd.isna(country_code):
251
+ continue
252
+ rv[city_geonames_id] = code_to_country[country_code].identifier
253
+ return rv
254
+
255
+
238
256
  if __name__ == "__main__":
239
257
  GeonamesGetter().write_default(write_obo=True, force=True)
@@ -10,10 +10,10 @@ from collections import Counter, defaultdict
10
10
  from operator import attrgetter
11
11
  from typing import DefaultDict, Dict, Iterable, Optional
12
12
 
13
- import bioversions
14
13
  from tabulate import tabulate
15
14
  from tqdm.auto import tqdm
16
15
 
16
+ from pyobo.api.utils import get_version
17
17
  from pyobo.struct import (
18
18
  Obo,
19
19
  Reference,
@@ -241,7 +241,7 @@ def get_obo(*, force: bool = False) -> Obo:
241
241
  def get_terms(version: Optional[str] = None, force: bool = False) -> Iterable[Term]: # noqa:C901
242
242
  """Get HGNC terms."""
243
243
  if version is None:
244
- version = bioversions.get_version("hgnc")
244
+ version = get_version("hgnc")
245
245
  unhandled_entry_keys: typing.Counter[str] = Counter()
246
246
  unhandle_locus_types: DefaultDict[str, Dict[str, Term]] = defaultdict(dict)
247
247
  path = ensure_path(