pyobo 0.10.4__tar.gz → 0.10.6__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 (260) hide show
  1. {pyobo-0.10.4/src/pyobo.egg-info → pyobo-0.10.6}/PKG-INFO +37 -2
  2. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/conf.py +1 -1
  3. {pyobo-0.10.4 → pyobo-0.10.6}/setup.cfg +2 -2
  4. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/__init__.py +1 -0
  5. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/api/__init__.py +1 -0
  6. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/api/names.py +21 -0
  7. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/api/xrefs.py +8 -5
  8. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/gilda_utils.py +54 -47
  9. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/__init__.py +10 -3
  10. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/cgnc.py +4 -3
  11. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/chembl.py +5 -3
  12. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/depmap.py +4 -2
  13. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/drugbank.py +4 -4
  14. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/drugcentral.py +9 -5
  15. pyobo-0.10.6/src/pyobo/sources/geonames.py +229 -0
  16. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/hgnc.py +32 -1
  17. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/hgncgenefamily.py +1 -1
  18. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/mgi.py +6 -2
  19. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/mirbase.py +2 -0
  20. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/mirbase_family.py +5 -2
  21. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/mirbase_mature.py +5 -4
  22. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/npass.py +1 -1
  23. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/pombase.py +1 -1
  24. pyobo-0.10.6/src/pyobo/sources/ror.py +163 -0
  25. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/sgd.py +2 -5
  26. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/slm.py +14 -12
  27. pyobo-0.10.6/src/pyobo/sources/umls/get_synonym_types.py +36 -0
  28. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/umls/synonym_types.tsv +243 -242
  29. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/umls/umls.py +3 -7
  30. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/zfin.py +3 -2
  31. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/struct/reference.py +13 -2
  32. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/struct/struct.py +72 -18
  33. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/struct/typedef.py +32 -6
  34. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/version.py +1 -1
  35. {pyobo-0.10.4 → pyobo-0.10.6/src/pyobo.egg-info}/PKG-INFO +37 -2
  36. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo.egg-info/SOURCES.txt +3 -0
  37. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo.egg-info/requires.txt +1 -1
  38. {pyobo-0.10.4 → pyobo-0.10.6}/.readthedocs.yml +0 -0
  39. {pyobo-0.10.4 → pyobo-0.10.6}/LICENSE +0 -0
  40. {pyobo-0.10.4 → pyobo-0.10.6}/MANIFEST.in +0 -0
  41. {pyobo-0.10.4 → pyobo-0.10.6}/README.rst +0 -0
  42. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.Canonicalizer.rst +0 -0
  43. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.Obo.rst +0 -0
  44. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.OboNormalizer.rst +0 -0
  45. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.Reference.rst +0 -0
  46. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.Synonym.rst +0 -0
  47. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.SynonymTypeDef.rst +0 -0
  48. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.Term.rst +0 -0
  49. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.TypeDef.rst +0 -0
  50. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.ensure_path.rst +0 -0
  51. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.from_obo_path.rst +0 -0
  52. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.from_obonet.rst +0 -0
  53. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_alts_to_id.rst +0 -0
  54. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_ancestors.rst +0 -0
  55. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_children.rst +0 -0
  56. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_definition.rst +0 -0
  57. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_descendants.rst +0 -0
  58. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_equivalent.rst +0 -0
  59. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_filtered_properties_df.rst +0 -0
  60. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_filtered_properties_mapping.rst +0 -0
  61. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_filtered_properties_multimapping.rst +0 -0
  62. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_filtered_relations_df.rst +0 -0
  63. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_filtered_xrefs.rst +0 -0
  64. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_graph.rst +0 -0
  65. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_hierarchy.rst +0 -0
  66. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_id_definition_mapping.rst +0 -0
  67. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_id_multirelations_mapping.rst +0 -0
  68. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_id_name_mapping.rst +0 -0
  69. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_id_species_mapping.rst +0 -0
  70. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_id_synonyms_mapping.rst +0 -0
  71. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_id_to_alts.rst +0 -0
  72. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_ids.rst +0 -0
  73. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_name.rst +0 -0
  74. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_name_by_curie.rst +0 -0
  75. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_name_id_mapping.rst +0 -0
  76. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_ontology.rst +0 -0
  77. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_primary_curie.rst +0 -0
  78. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_primary_identifier.rst +0 -0
  79. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_priority_curie.rst +0 -0
  80. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_properties.rst +0 -0
  81. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_properties_df.rst +0 -0
  82. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_property.rst +0 -0
  83. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_relation.rst +0 -0
  84. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_relation_mapping.rst +0 -0
  85. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_relations_df.rst +0 -0
  86. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_species.rst +0 -0
  87. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_sssom_df.rst +0 -0
  88. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_subhierarchy.rst +0 -0
  89. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_synonyms.rst +0 -0
  90. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_typedef_df.rst +0 -0
  91. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_version.rst +0 -0
  92. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_xref.rst +0 -0
  93. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_xrefs.rst +0 -0
  94. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.get_xrefs_df.rst +0 -0
  95. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.ground.rst +0 -0
  96. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.has_ancestor.rst +0 -0
  97. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.has_nomenclature_plugin.rst +0 -0
  98. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.has_xref_plugin.rst +0 -0
  99. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.is_descendent.rst +0 -0
  100. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.iter_nomenclature_plugins.rst +0 -0
  101. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.iter_xref_plugins.rst +0 -0
  102. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.normalize_curie.rst +0 -0
  103. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.parse_results_from_obo.rst +0 -0
  104. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.run_nomenclature_plugin.rst +0 -0
  105. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/api/pyobo.run_xref_plugin.rst +0 -0
  106. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/index.rst +0 -0
  107. {pyobo-0.10.4 → pyobo-0.10.6}/docs/source/logo.png +0 -0
  108. {pyobo-0.10.4 → pyobo-0.10.6}/pyproject.toml +0 -0
  109. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/__main__.py +0 -0
  110. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/api/alts.py +0 -0
  111. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/api/hierarchy.py +0 -0
  112. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/api/metadata.py +0 -0
  113. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/api/properties.py +0 -0
  114. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/api/relations.py +0 -0
  115. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/api/species.py +0 -0
  116. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/api/typedefs.py +0 -0
  117. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/api/utils.py +0 -0
  118. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/apps/__init__.py +0 -0
  119. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/apps/cli.py +0 -0
  120. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/apps/gilda/__init__.py +0 -0
  121. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/apps/gilda/__main__.py +0 -0
  122. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/apps/gilda/app.py +0 -0
  123. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/apps/gilda/cli.py +0 -0
  124. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/apps/gilda/templates/base.html +0 -0
  125. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/apps/gilda/templates/home.html +0 -0
  126. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/apps/gilda/templates/matches.html +0 -0
  127. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/apps/mapper/__init__.py +0 -0
  128. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/apps/mapper/__main__.py +0 -0
  129. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/apps/mapper/cli.py +0 -0
  130. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/apps/mapper/mapper.py +0 -0
  131. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/apps/mapper/templates/base.html +0 -0
  132. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/apps/mapper/templates/mapper_home.html +0 -0
  133. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/aws.py +0 -0
  134. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/cli/__init__.py +0 -0
  135. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/cli/aws.py +0 -0
  136. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/cli/cli.py +0 -0
  137. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/cli/database.py +0 -0
  138. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/cli/lookup.py +0 -0
  139. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/cli/utils.py +0 -0
  140. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/constants.py +0 -0
  141. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/getters.py +0 -0
  142. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/identifier_utils.py +0 -0
  143. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/mocks.py +0 -0
  144. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/normalizer.py +0 -0
  145. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/obographs.py +0 -0
  146. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/plugins.py +0 -0
  147. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/reader.py +0 -0
  148. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/registries/__init__.py +0 -0
  149. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/registries/metaregistry.json +0 -0
  150. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/registries/metaregistry.py +0 -0
  151. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/resource_utils.py +0 -0
  152. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/resources/__init__.py +0 -0
  153. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/resources/ncbitaxon.py +0 -0
  154. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/resources/ncbitaxon.tsv.gz +0 -0
  155. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/resources/ro.py +0 -0
  156. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/resources/ro.tsv +0 -0
  157. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/agrovoc.py +0 -0
  158. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/antibodyregistry.py +0 -0
  159. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/biogrid.py +0 -0
  160. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/ccle.py +0 -0
  161. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/chebi.py +0 -0
  162. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/complexportal.py +0 -0
  163. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/conso.py +0 -0
  164. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/cpt.py +0 -0
  165. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/cvx.py +0 -0
  166. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/dictybase_gene.py +0 -0
  167. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/drugbank_salt.py +0 -0
  168. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/expasy.py +0 -0
  169. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/famplex.py +0 -0
  170. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/flybase.py +0 -0
  171. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/gmt_utils.py +0 -0
  172. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/go.py +0 -0
  173. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/gwascentral_phenotype.py +0 -0
  174. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/gwascentral_study.py +0 -0
  175. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/icd10.py +0 -0
  176. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/icd11.py +0 -0
  177. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/icd_utils.py +0 -0
  178. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/interpro.py +0 -0
  179. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/itis.py +0 -0
  180. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/kegg/__init__.py +0 -0
  181. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/kegg/api.py +0 -0
  182. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/kegg/genes.py +0 -0
  183. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/kegg/genome.py +0 -0
  184. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/kegg/pathway.py +0 -0
  185. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/mesh.py +0 -0
  186. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/mirbase_constants.py +0 -0
  187. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/msigdb.py +0 -0
  188. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/ncbigene.py +0 -0
  189. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/pathbank.py +0 -0
  190. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/pfam.py +0 -0
  191. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/pfam_clan.py +0 -0
  192. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/pid.py +0 -0
  193. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/pubchem.py +0 -0
  194. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/reactome.py +0 -0
  195. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/rgd.py +0 -0
  196. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/rhea.py +0 -0
  197. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/selventa/__init__.py +0 -0
  198. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/selventa/schem.py +0 -0
  199. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/selventa/scomp.py +0 -0
  200. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/selventa/sdis.py +0 -0
  201. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/selventa/sfam.py +0 -0
  202. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/umls/__init__.py +0 -0
  203. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/umls/__main__.py +0 -0
  204. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/uniprot/__init__.py +0 -0
  205. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/uniprot/uniprot.py +0 -0
  206. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/uniprot/uniprot_ptm.py +0 -0
  207. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/utils.py +0 -0
  208. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/sources/wikipathways.py +0 -0
  209. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/ssg/__init__.py +0 -0
  210. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/ssg/base.html +0 -0
  211. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/ssg/index.html +0 -0
  212. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/ssg/term.html +0 -0
  213. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/ssg/typedef.html +0 -0
  214. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/struct/__init__.py +0 -0
  215. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/struct/utils.py +0 -0
  216. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/utils/__init__.py +0 -0
  217. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/utils/cache.py +0 -0
  218. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/utils/io.py +0 -0
  219. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/utils/iter.py +0 -0
  220. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/utils/misc.py +0 -0
  221. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/utils/ndex_utils.py +0 -0
  222. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/utils/path.py +0 -0
  223. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/xrefdb/__init__.py +0 -0
  224. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/xrefdb/canonicalizer.py +0 -0
  225. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/xrefdb/priority.py +0 -0
  226. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/xrefdb/sources/__init__.py +0 -0
  227. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/xrefdb/sources/biomappings.py +0 -0
  228. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/xrefdb/sources/cbms2019.py +0 -0
  229. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/xrefdb/sources/chembl.py +0 -0
  230. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/xrefdb/sources/compath.py +0 -0
  231. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/xrefdb/sources/famplex.py +0 -0
  232. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/xrefdb/sources/gilda.py +0 -0
  233. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/xrefdb/sources/intact.py +0 -0
  234. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/xrefdb/sources/ncit.py +0 -0
  235. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/xrefdb/sources/pubchem.py +0 -0
  236. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/xrefdb/sources/wikidata.py +0 -0
  237. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo/xrefdb/xrefs_pipeline.py +0 -0
  238. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo.egg-info/dependency_links.txt +0 -0
  239. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo.egg-info/entry_points.txt +0 -0
  240. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo.egg-info/not-zip-safe +0 -0
  241. {pyobo-0.10.4 → pyobo-0.10.6}/src/pyobo.egg-info/top_level.txt +0 -0
  242. {pyobo-0.10.4 → pyobo-0.10.6}/tests/__init__.py +0 -0
  243. {pyobo-0.10.4 → pyobo-0.10.6}/tests/constants.py +0 -0
  244. {pyobo-0.10.4 → pyobo-0.10.6}/tests/resources/citations.txt +0 -0
  245. {pyobo-0.10.4 → pyobo-0.10.6}/tests/resources/test_chebi.obo +0 -0
  246. {pyobo-0.10.4 → pyobo-0.10.6}/tests/resources/test_msigdb.gmt +0 -0
  247. {pyobo-0.10.4 → pyobo-0.10.6}/tests/resources/test_wikipathways.gmt +0 -0
  248. {pyobo-0.10.4 → pyobo-0.10.6}/tests/test_alt_ids.py +0 -0
  249. {pyobo-0.10.4 → pyobo-0.10.6}/tests/test_caches.py +0 -0
  250. {pyobo-0.10.4 → pyobo-0.10.6}/tests/test_extract.py +0 -0
  251. {pyobo-0.10.4 → pyobo-0.10.6}/tests/test_get.py +0 -0
  252. {pyobo-0.10.4 → pyobo-0.10.6}/tests/test_get_miriam_url.py +0 -0
  253. {pyobo-0.10.4 → pyobo-0.10.6}/tests/test_gmt.py +0 -0
  254. {pyobo-0.10.4 → pyobo-0.10.6}/tests/test_ground.py +0 -0
  255. {pyobo-0.10.4 → pyobo-0.10.6}/tests/test_mapper.py +0 -0
  256. {pyobo-0.10.4 → pyobo-0.10.6}/tests/test_sources/__init__.py +0 -0
  257. {pyobo-0.10.4 → pyobo-0.10.6}/tests/test_sources/test_famplex.py +0 -0
  258. {pyobo-0.10.4 → pyobo-0.10.6}/tests/test_struct.py +0 -0
  259. {pyobo-0.10.4 → pyobo-0.10.6}/tests/test_utils.py +0 -0
  260. {pyobo-0.10.4 → pyobo-0.10.6}/tox.ini +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyobo
3
- Version: 0.10.4
3
+ Version: 0.10.6
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
@@ -27,11 +27,46 @@ Classifier: Programming Language :: Python :: 3 :: Only
27
27
  Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
28
28
  Classifier: Topic :: Scientific/Engineering :: Chemistry
29
29
  Requires-Python: >=3.8
30
+ License-File: LICENSE
31
+ Requires-Dist: obonet>=0.3.0
32
+ Requires-Dist: click
33
+ Requires-Dist: tqdm
34
+ Requires-Dist: pyyaml
35
+ Requires-Dist: pandas
36
+ Requires-Dist: requests
37
+ Requires-Dist: protmapper
38
+ Requires-Dist: more_itertools
39
+ Requires-Dist: more_click>=0.0.2
40
+ Requires-Dist: humanize
41
+ Requires-Dist: tabulate
42
+ Requires-Dist: cachier
43
+ Requires-Dist: pystow>=0.2.7
44
+ Requires-Dist: bioversions>=0.5.202
45
+ Requires-Dist: bioregistry>=0.10.20
46
+ Requires-Dist: bioontologies>=0.4.0
47
+ Requires-Dist: zenodo-client>=0.0.5
48
+ Requires-Dist: class_resolver
49
+ Requires-Dist: psycopg2-binary
50
+ Requires-Dist: drugbank_downloader
51
+ Requires-Dist: chembl_downloader
52
+ Requires-Dist: umls_downloader>=0.1.2
53
+ Requires-Dist: typing_extensions
30
54
  Provides-Extra: tests
55
+ Requires-Dist: coverage; extra == "tests"
56
+ Requires-Dist: pytest; extra == "tests"
31
57
  Provides-Extra: docs
58
+ Requires-Dist: sphinx; extra == "docs"
59
+ Requires-Dist: sphinx-rtd-theme; extra == "docs"
60
+ Requires-Dist: sphinx-click; extra == "docs"
61
+ Requires-Dist: sphinx_automodapi; extra == "docs"
32
62
  Provides-Extra: web
63
+ Requires-Dist: flask; extra == "web"
64
+ Requires-Dist: bootstrap-flask; extra == "web"
65
+ Requires-Dist: flask-admin; extra == "web"
66
+ Requires-Dist: flasgger; extra == "web"
67
+ Requires-Dist: psutil; extra == "web"
33
68
  Provides-Extra: agrovoc
34
- License-File: LICENSE
69
+ Requires-Dist: rdflib; extra == "agrovoc"
35
70
 
36
71
  PyOBO
37
72
  =====
@@ -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.4"
61
+ release = "0.10.6"
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.4
3
+ version = 0.10.6
4
4
  description = Handling and writing OBO
5
5
  long_description = file: README.rst
6
6
  url = https://github.com/pyobo/pyobo
@@ -56,7 +56,7 @@ install_requires =
56
56
  psycopg2-binary
57
57
  drugbank_downloader
58
58
  chembl_downloader
59
- umls_downloader
59
+ umls_downloader>=0.1.2
60
60
  typing_extensions
61
61
  zip_safe = false
62
62
  include_package_data = True
@@ -25,6 +25,7 @@ from .api import ( # noqa: F401
25
25
  get_name,
26
26
  get_name_by_curie,
27
27
  get_name_id_mapping,
28
+ get_obsolete,
28
29
  get_primary_curie,
29
30
  get_primary_identifier,
30
31
  get_properties,
@@ -27,6 +27,7 @@ from .names import ( # noqa: F401
27
27
  get_name,
28
28
  get_name_by_curie,
29
29
  get_name_id_mapping,
30
+ get_obsolete,
30
31
  get_synonyms,
31
32
  )
32
33
  from .properties import ( # noqa: F401
@@ -24,6 +24,7 @@ __all__ = [
24
24
  "get_id_definition_mapping",
25
25
  "get_synonyms",
26
26
  "get_id_synonyms_mapping",
27
+ "get_obsolete",
27
28
  ]
28
29
 
29
30
  logger = logging.getLogger(__name__)
@@ -184,6 +185,26 @@ def get_id_definition_mapping(
184
185
  return _get_mapping()
185
186
 
186
187
 
188
+ def get_obsolete(
189
+ prefix: str,
190
+ *,
191
+ force: bool = False,
192
+ strict: bool = False,
193
+ version: Optional[str] = None,
194
+ ) -> Set[str]:
195
+ """Get the set of obsolete local unique identifiers."""
196
+ if version is None:
197
+ version = get_version(prefix)
198
+ path = prefix_cache_join(prefix, name="obsolete.tsv", version=version)
199
+
200
+ @cached_collection(path=path, force=force)
201
+ def _get_obsolete() -> Set[str]:
202
+ ontology = get_ontology(prefix, force=force, strict=strict, version=version)
203
+ return ontology.get_obsolete()
204
+
205
+ return set(_get_obsolete())
206
+
207
+
187
208
  @wrap_norm_prefix
188
209
  def get_synonyms(prefix: str, identifier: str) -> Optional[List[str]]:
189
210
  """Get the synonyms for an entity."""
@@ -4,7 +4,7 @@
4
4
 
5
5
  import logging
6
6
  from functools import lru_cache
7
- from typing import List, Mapping, Optional, Tuple
7
+ from typing import List, Mapping, Optional, Tuple, Union
8
8
 
9
9
  import pandas as pd
10
10
  from tqdm.auto import tqdm
@@ -14,7 +14,7 @@ from .utils import get_version
14
14
  from ..constants import TARGET_ID, TARGET_PREFIX
15
15
  from ..getters import get_ontology
16
16
  from ..identifier_utils import wrap_norm_prefix
17
- from ..struct import Reference
17
+ from ..struct import Obo, Reference
18
18
  from ..utils.cache import cached_df, cached_mapping
19
19
  from ..utils.path import prefix_cache_join
20
20
 
@@ -100,9 +100,8 @@ def get_xrefs_df(
100
100
  return _df_getter()
101
101
 
102
102
 
103
- @wrap_norm_prefix
104
103
  def get_sssom_df(
105
- prefix: str,
104
+ prefix: Union[str, Obo],
106
105
  *,
107
106
  predicate_id: str = "oboinowl:hasDbXref",
108
107
  justification: str = "sempav:UnspecifiedMatching",
@@ -136,7 +135,11 @@ def get_sssom_df(
136
135
  """
137
136
  from .names import get_name
138
137
 
139
- df = get_xrefs_df(prefix=prefix, **kwargs)
138
+ if isinstance(prefix, Obo):
139
+ df = prefix.get_xrefs_df()
140
+ prefix = prefix.ontology
141
+ else:
142
+ df = get_xrefs_df(prefix=prefix, **kwargs)
140
143
  rows: List[Tuple[str, ...]] = []
141
144
  with logging_redirect_tqdm():
142
145
  for source_id, target_prefix, target_id in tqdm(df.values, unit="mapping", unit_scale=True):
@@ -2,7 +2,6 @@
2
2
 
3
3
  """PyOBO's Gilda utilities."""
4
4
 
5
- import itertools as itt
6
5
  import logging
7
6
  from typing import Iterable, List, Optional, Tuple, Type, Union
8
7
 
@@ -11,6 +10,7 @@ import gilda.api
11
10
  import gilda.term
12
11
  from gilda.grounder import Grounder
13
12
  from gilda.process import normalize
13
+ from gilda.term import filter_out_duplicates
14
14
  from tqdm.auto import tqdm
15
15
 
16
16
  from pyobo import (
@@ -18,6 +18,7 @@ from pyobo import (
18
18
  get_id_species_mapping,
19
19
  get_id_synonyms_mapping,
20
20
  get_ids,
21
+ get_obsolete,
21
22
  )
22
23
  from pyobo.getters import NoBuild
23
24
  from pyobo.utils.io import multidict
@@ -31,32 +32,6 @@ __all__ = [
31
32
  logger = logging.getLogger(__name__)
32
33
 
33
34
 
34
- _STATUSES = {"curated": 1, "name": 2, "synonym": 3, "former_name": 4}
35
-
36
-
37
- def filter_out_duplicates(terms: List[gilda.term.Term]) -> List[gilda.term.Term]:
38
- """Filter out duplicates."""
39
- # TODO import from gilda.term import filter_out_duplicates when it gets moved,
40
- # see https://github.com/indralab/gilda/pull/103
41
- logger.debug("filtering %d terms for uniqueness", len(terms))
42
- new_terms: List[gilda.term.Term] = [
43
- min(terms_group, key=_status_key)
44
- for _, terms_group in itt.groupby(sorted(terms, key=_term_key), key=_term_key)
45
- ]
46
- # Re-sort the terms
47
- new_terms = sorted(new_terms, key=lambda x: (x.text, x.db, x.id))
48
- logger.debug("got %d unique terms.", len(new_terms))
49
- return new_terms
50
-
51
-
52
- def _status_key(term: gilda.term.Term) -> int:
53
- return _STATUSES[term.status]
54
-
55
-
56
- def _term_key(term: gilda.term.Term) -> Tuple[str, str, str]:
57
- return term.db, term.id, term.text
58
-
59
-
60
35
  def iter_gilda_prediction_tuples(
61
36
  prefix: str,
62
37
  relation: str = "skos:exactMatch",
@@ -115,10 +90,12 @@ def normalize_identifier(prefix: str, identifier: str) -> str:
115
90
 
116
91
  def get_grounder(
117
92
  prefixes: Union[str, Iterable[str]],
93
+ *,
118
94
  unnamed: Optional[Iterable[str]] = None,
119
95
  grounder_cls: Optional[Type[Grounder]] = None,
120
96
  versions: Union[None, str, Iterable[Union[str, None]]] = None,
121
97
  strict: bool = True,
98
+ skip_obsolete: bool = False,
122
99
  ) -> Grounder:
123
100
  """Get a Gilda grounder for the given prefix(es)."""
124
101
  unnamed = set() if unnamed is None else set(unnamed)
@@ -140,7 +117,11 @@ def get_grounder(
140
117
  try:
141
118
  p_terms = list(
142
119
  get_gilda_terms(
143
- prefix, identifiers_are_names=prefix in unnamed, version=version, strict=strict
120
+ prefix,
121
+ identifiers_are_names=prefix in unnamed,
122
+ version=version,
123
+ strict=strict,
124
+ skip_obsolete=skip_obsolete,
144
125
  )
145
126
  )
146
127
  except NoBuild:
@@ -155,26 +136,50 @@ def get_grounder(
155
136
  return grounder_cls(terms_dict)
156
137
 
157
138
 
139
+ def _fast_term(
140
+ *,
141
+ text: str,
142
+ prefix: str,
143
+ identifier: str,
144
+ name: str,
145
+ status: str,
146
+ organism: Optional[str] = None,
147
+ ) -> gilda.term.Term:
148
+ return gilda.term.Term(
149
+ norm_text=normalize(text),
150
+ text=text,
151
+ db=prefix,
152
+ id=identifier,
153
+ entry_name=name,
154
+ status=status,
155
+ source=prefix,
156
+ organism=organism,
157
+ )
158
+
159
+
158
160
  def get_gilda_terms(
159
161
  prefix: str,
162
+ *,
160
163
  identifiers_are_names: bool = False,
161
164
  version: Optional[str] = None,
162
165
  strict: bool = True,
166
+ skip_obsolete: bool = False,
163
167
  ) -> Iterable[gilda.term.Term]:
164
168
  """Get gilda terms for the given namespace."""
165
169
  id_to_name = get_id_name_mapping(prefix, version=version, strict=strict)
166
170
  id_to_species = get_id_species_mapping(prefix, version=version, strict=strict)
171
+ obsoletes = get_obsolete(prefix, version=version, strict=strict) if skip_obsolete else set()
167
172
 
168
173
  it = tqdm(id_to_name.items(), desc=f"[{prefix}] mapping", unit_scale=True, unit="name")
169
174
  for identifier, name in it:
170
- yield gilda.term.Term(
171
- norm_text=normalize(name),
175
+ if identifier in obsoletes:
176
+ continue
177
+ yield _fast_term(
172
178
  text=name,
173
- db=prefix,
174
- id=identifier,
175
- entry_name=name,
179
+ prefix=prefix,
180
+ identifier=identifier,
181
+ name=name,
176
182
  status="name",
177
- source=prefix,
178
183
  organism=id_to_species.get(identifier),
179
184
  )
180
185
 
@@ -184,29 +189,31 @@ def get_gilda_terms(
184
189
  id_to_synonyms.items(), desc=f"[{prefix}] mapping", unit_scale=True, unit="synonym"
185
190
  )
186
191
  for identifier, synonyms in it:
192
+ if identifier in obsoletes:
193
+ continue
187
194
  name = id_to_name[identifier]
188
195
  for synonym in synonyms:
189
- yield gilda.term.Term(
190
- norm_text=normalize(synonym),
196
+ if not synonym:
197
+ continue
198
+ yield _fast_term(
191
199
  text=synonym,
192
- db=prefix,
193
- id=identifier,
194
- entry_name=name,
200
+ prefix=prefix,
201
+ identifier=identifier,
202
+ name=name,
195
203
  status="synonym",
196
- source=prefix,
197
204
  organism=id_to_species.get(identifier),
198
205
  )
199
206
 
200
207
  if identifiers_are_names:
201
208
  it = tqdm(get_ids(prefix), desc=f"[{prefix}] mapping", unit_scale=True, unit="id")
202
209
  for identifier in it:
203
- yield gilda.term.Term(
204
- norm_text=normalize(identifier),
210
+ if identifier in obsoletes:
211
+ continue
212
+ yield _fast_term(
205
213
  text=identifier,
206
- db=prefix,
207
- id=identifier,
208
- entry_name=None,
209
- status="identifier",
210
- source=prefix,
214
+ prefix=prefix,
215
+ identifier=identifier,
216
+ name=identifier,
217
+ status="name",
211
218
  organism=id_to_species.get(identifier),
212
219
  )
@@ -20,6 +20,7 @@ from .drugcentral import DrugCentralGetter
20
20
  from .expasy import ExpasyGetter
21
21
  from .famplex import FamPlexGetter
22
22
  from .flybase import FlyBaseGetter
23
+ from .geonames import GeonamesGetter
23
24
  from .gwascentral_phenotype import GWASCentralPhenotypeGetter
24
25
  from .gwascentral_study import GWASCentralStudyGetter
25
26
  from .hgnc import HGNCGetter
@@ -31,6 +32,9 @@ from .itis import ITISGetter
31
32
  from .kegg import KEGGGeneGetter, KEGGGenomeGetter, KEGGPathwayGetter
32
33
  from .mesh import MeSHGetter
33
34
  from .mgi import MGIGetter
35
+ from .mirbase import MiRBaseGetter
36
+ from .mirbase_family import MiRBaseFamilyGetter
37
+ from .mirbase_mature import MiRBaseMatureGetter
34
38
  from .msigdb import MSigDBGetter
35
39
  from .ncbigene import NCBIGeneGetter
36
40
  from .npass import NPASSGetter
@@ -43,6 +47,7 @@ from .pubchem import PubChemCompoundGetter
43
47
  from .reactome import ReactomeGetter
44
48
  from .rgd import RGDGetter
45
49
  from .rhea import RheaGetter
50
+ from .ror import RORGetter
46
51
  from .selventa import SCHEMGetter, SCOMPGetter, SDISGetter, SFAMGetter
47
52
  from .sgd import SGDGetter
48
53
  from .slm import SLMGetter
@@ -71,6 +76,7 @@ __all__ = [
71
76
  "FlyBaseGetter",
72
77
  "GWASCentralPhenotypeGetter",
73
78
  "GWASCentralStudyGetter",
79
+ "GeonamesGetter",
74
80
  "HGNCGetter",
75
81
  "HGNCGroupGetter",
76
82
  "ICD10Getter",
@@ -83,9 +89,9 @@ __all__ = [
83
89
  "MGIGetter",
84
90
  "MSigDBGetter",
85
91
  "MeSHGetter",
86
- # "MiRBaseFamilyGetter",
87
- # "MiRBaseGetter",
88
- # "MiRBaseMatureGetter",
92
+ "MiRBaseFamilyGetter",
93
+ "MiRBaseGetter",
94
+ "MiRBaseMatureGetter",
89
95
  "NCBIGeneGetter",
90
96
  "NPASSGetter",
91
97
  "PIDGetter",
@@ -95,6 +101,7 @@ __all__ = [
95
101
  "PomBaseGetter",
96
102
  "PubChemCompoundGetter",
97
103
  "RGDGetter",
104
+ "RORGetter",
98
105
  "ReactomeGetter",
99
106
  "RheaGetter",
100
107
  "SCHEMGetter",
@@ -8,6 +8,7 @@ from typing import Iterable
8
8
  import pandas as pd
9
9
 
10
10
  from pyobo.struct import Obo, Reference, Term, from_species
11
+ from pyobo.struct.typedef import exact_match
11
12
  from pyobo.utils.path import ensure_df
12
13
 
13
14
  __all__ = [
@@ -25,7 +26,7 @@ class CGNCGetter(Obo):
25
26
 
26
27
  ontology = PREFIX
27
28
  dynamic_version = True
28
- typedefs = [from_species]
29
+ typedefs = [from_species, exact_match]
29
30
 
30
31
  def iter_terms(self, force: bool = False) -> Iterable[Term]:
31
32
  """Iterate over terms in the ontology."""
@@ -72,9 +73,9 @@ def get_terms(force: bool = False) -> Iterable[Term]:
72
73
  )
73
74
  term.set_species(identifier="9031", name="Gallus gallus")
74
75
  if entrez_id and pd.notna(entrez_id):
75
- term.append_xref(Reference(prefix="ncbigene", identifier=entrez_id))
76
+ term.append_exact_match(Reference(prefix="ncbigene", identifier=entrez_id))
76
77
  if pd.notna(ensembl_id):
77
- term.append_xref(Reference(prefix="ensembl", identifier=ensembl_id))
78
+ term.append_exact_match(Reference(prefix="ensembl", identifier=ensembl_id))
78
79
  if synonym_1 and pd.notna(synonym_1):
79
80
  term.append_synonym(synonym_1)
80
81
  if synoynm_2 and pd.notna(synoynm_2):
@@ -12,6 +12,7 @@ from typing import Iterable
12
12
  import chembl_downloader
13
13
 
14
14
  from pyobo.struct import Obo, Reference, Term
15
+ from pyobo.struct.typedef import exact_match, has_inchi, has_smiles
15
16
 
16
17
  __all__ = [
17
18
  "ChEMBLCompoundGetter",
@@ -44,6 +45,7 @@ class ChEMBLCompoundGetter(Obo):
44
45
 
45
46
  ontology = "chembl.compound"
46
47
  bioversions_key = "chembl"
48
+ typedefs = [exact_match]
47
49
 
48
50
  def iter_terms(self, force: bool = False) -> Iterable[Term]:
49
51
  """Iterate over terms in the ontology."""
@@ -66,11 +68,11 @@ def iter_terms(version: str) -> Iterable[Term]:
66
68
  # TODO add xrefs?
67
69
  term = Term.from_triple(prefix=PREFIX, identifier=chembl_id, name=name)
68
70
  if smiles:
69
- term.append_property("smiles", smiles)
71
+ term.append_property(has_smiles, smiles)
70
72
  if inchi:
71
- term.append_property("inchi", inchi)
73
+ term.append_property(has_inchi, inchi)
72
74
  if inchi_key:
73
- term.append_xref(Reference(prefix="inchikey", identifier=inchi_key))
75
+ term.append_exact_match(Reference(prefix="inchikey", identifier=inchi_key))
74
76
  yield term
75
77
 
76
78
 
@@ -8,6 +8,7 @@ import pandas as pd
8
8
  import pystow
9
9
 
10
10
  from pyobo import Obo, Reference, Term
11
+ from pyobo.struct.typedef import exact_match
11
12
 
12
13
  __all__ = [
13
14
  "get_obo",
@@ -23,6 +24,7 @@ class DepMapGetter(Obo):
23
24
 
24
25
  ontology = bioversions_key = PREFIX
25
26
  data_version = VERSION
27
+ typedefs = [exact_match]
26
28
 
27
29
  def iter_terms(self, force: bool = False) -> Iterable[Term]:
28
30
  """Iterate over terms in the ontology."""
@@ -84,9 +86,9 @@ def iter_terms(version: str, force: bool = False) -> Iterable[Term]:
84
86
  continue
85
87
  term.append_synonym(alias)
86
88
  if pd.notna(cosmic_id):
87
- term.append_xref(Reference(prefix="cosmic.cell", identifier=cosmic_id))
89
+ term.append_exact_match(Reference(prefix="cosmic.cell", identifier=cosmic_id))
88
90
  if pd.notna(cellosaurus_id):
89
- term.append_xref(Reference(prefix="cellosaurus", identifier=cellosaurus_id))
91
+ term.append_exact_match(Reference(prefix="cellosaurus", identifier=cellosaurus_id))
90
92
 
91
93
  # WTSI stands for welcome trust sanger institute
92
94
  # Not sure where this prefix goes
@@ -17,7 +17,7 @@ from tqdm.auto import tqdm
17
17
 
18
18
  from ..getters import NoBuild
19
19
  from ..struct import Obo, Reference, Term
20
- from ..struct.typedef import has_salt
20
+ from ..struct.typedef import has_inchi, has_salt, has_smiles
21
21
  from ..utils.cache import cached_pickle
22
22
  from ..utils.path import prefix_directory_join
23
23
 
@@ -121,10 +121,10 @@ def _make_term(drug_info: Mapping[str, Any]) -> Term:
121
121
  if identifier:
122
122
  term.append_xref(Reference(prefix=xref_prefix, identifier=identifier))
123
123
 
124
- for prop in ["smiles", "inchi"]:
125
- identifier = drug_info.get(xref_prefix)
124
+ for prop, debio_curie in [("smiles", has_smiles), ("inchi", has_inchi)]:
125
+ identifier = drug_info.get(prop)
126
126
  if identifier:
127
- term.append_property(prop, identifier)
127
+ term.append_property(debio_curie, identifier)
128
128
 
129
129
  for salt in drug_info.get("salts", []):
130
130
  term.append_relationship(
@@ -12,6 +12,7 @@ import psycopg2
12
12
  from tqdm.auto import tqdm
13
13
 
14
14
  from pyobo.struct import Obo, Reference, Synonym, Term
15
+ from pyobo.struct.typedef import exact_match, has_inchi, has_smiles
15
16
 
16
17
  __all__ = [
17
18
  "DrugCentralGetter",
@@ -33,6 +34,7 @@ class DrugCentralGetter(Obo):
33
34
  """An ontology representation of the DrugCentral database."""
34
35
 
35
36
  ontology = bioversions_key = PREFIX
37
+ typedefs = [exact_match]
36
38
 
37
39
  def iter_terms(self, force: bool = False) -> Iterable[Term]:
38
40
  """Iterate over terms in the ontology."""
@@ -87,13 +89,15 @@ def iter_terms() -> Iterable[Term]:
87
89
  xrefs=xrefs.get(drugcentral_id, []),
88
90
  )
89
91
  if inchi_key:
90
- term.append_xref(Reference(prefix="inchikey", identifier=inchi_key))
91
- term.append_property("smiles", smiles)
92
- term.append_property("inchi", inchi)
92
+ term.append_exact_match(Reference(prefix="inchikey", identifier=inchi_key))
93
+ if smiles:
94
+ term.append_property(has_smiles, smiles)
95
+ if inchi:
96
+ term.append_property(has_inchi, inchi)
93
97
  if cas:
94
- term.append_xref(Reference(prefix="cas", identifier=cas))
98
+ term.append_exact_match(Reference(prefix="cas", identifier=cas))
95
99
  yield term
96
100
 
97
101
 
98
102
  if __name__ == "__main__":
99
- DrugCentralGetter.cli()
103
+ get_obo().write_default(write_obo=True)