pyobo 0.10.8__tar.gz → 0.10.9__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 (263) hide show
  1. {pyobo-0.10.8/src/pyobo.egg-info → pyobo-0.10.9}/PKG-INFO +2 -2
  2. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/conf.py +1 -1
  3. {pyobo-0.10.8 → pyobo-0.10.9}/setup.cfg +2 -2
  4. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/api/hierarchy.py +21 -11
  5. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/api/xrefs.py +3 -1
  6. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/getters.py +2 -2
  7. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/__init__.py +4 -0
  8. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/cgnc.py +1 -1
  9. pyobo-0.10.9/src/pyobo/sources/civic_gene.py +55 -0
  10. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/mesh.py +29 -1
  11. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/ncbigene.py +5 -3
  12. pyobo-0.10.9/src/pyobo/sources/omim_ps.py +39 -0
  13. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/umls/umls.py +17 -2
  14. pyobo-0.10.9/src/pyobo/sources/uniprot/uniprot.py +181 -0
  15. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/struct/__init__.py +1 -0
  16. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/struct/struct.py +1 -1
  17. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/struct/typedef.py +9 -0
  18. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/utils/misc.py +22 -16
  19. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/version.py +1 -1
  20. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/xrefdb/sources/wikidata.py +5 -3
  21. {pyobo-0.10.8 → pyobo-0.10.9/src/pyobo.egg-info}/PKG-INFO +2 -2
  22. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo.egg-info/SOURCES.txt +2 -0
  23. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo.egg-info/requires.txt +1 -1
  24. pyobo-0.10.8/src/pyobo/sources/uniprot/uniprot.py +0 -74
  25. {pyobo-0.10.8 → pyobo-0.10.9}/.readthedocs.yml +0 -0
  26. {pyobo-0.10.8 → pyobo-0.10.9}/LICENSE +0 -0
  27. {pyobo-0.10.8 → pyobo-0.10.9}/MANIFEST.in +0 -0
  28. {pyobo-0.10.8 → pyobo-0.10.9}/README.rst +0 -0
  29. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.Canonicalizer.rst +0 -0
  30. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.Obo.rst +0 -0
  31. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.OboNormalizer.rst +0 -0
  32. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.Reference.rst +0 -0
  33. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.Synonym.rst +0 -0
  34. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.SynonymTypeDef.rst +0 -0
  35. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.Term.rst +0 -0
  36. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.TypeDef.rst +0 -0
  37. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.ensure_path.rst +0 -0
  38. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.from_obo_path.rst +0 -0
  39. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.from_obonet.rst +0 -0
  40. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_alts_to_id.rst +0 -0
  41. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_ancestors.rst +0 -0
  42. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_children.rst +0 -0
  43. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_definition.rst +0 -0
  44. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_descendants.rst +0 -0
  45. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_equivalent.rst +0 -0
  46. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_filtered_properties_df.rst +0 -0
  47. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_filtered_properties_mapping.rst +0 -0
  48. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_filtered_properties_multimapping.rst +0 -0
  49. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_filtered_relations_df.rst +0 -0
  50. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_filtered_xrefs.rst +0 -0
  51. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_graph.rst +0 -0
  52. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_hierarchy.rst +0 -0
  53. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_id_definition_mapping.rst +0 -0
  54. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_id_multirelations_mapping.rst +0 -0
  55. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_id_name_mapping.rst +0 -0
  56. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_id_species_mapping.rst +0 -0
  57. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_id_synonyms_mapping.rst +0 -0
  58. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_id_to_alts.rst +0 -0
  59. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_ids.rst +0 -0
  60. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_name.rst +0 -0
  61. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_name_by_curie.rst +0 -0
  62. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_name_id_mapping.rst +0 -0
  63. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_ontology.rst +0 -0
  64. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_primary_curie.rst +0 -0
  65. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_primary_identifier.rst +0 -0
  66. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_priority_curie.rst +0 -0
  67. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_properties.rst +0 -0
  68. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_properties_df.rst +0 -0
  69. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_property.rst +0 -0
  70. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_relation.rst +0 -0
  71. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_relation_mapping.rst +0 -0
  72. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_relations_df.rst +0 -0
  73. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_species.rst +0 -0
  74. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_sssom_df.rst +0 -0
  75. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_subhierarchy.rst +0 -0
  76. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_synonyms.rst +0 -0
  77. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_typedef_df.rst +0 -0
  78. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_version.rst +0 -0
  79. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_xref.rst +0 -0
  80. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_xrefs.rst +0 -0
  81. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.get_xrefs_df.rst +0 -0
  82. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.ground.rst +0 -0
  83. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.has_ancestor.rst +0 -0
  84. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.has_nomenclature_plugin.rst +0 -0
  85. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.has_xref_plugin.rst +0 -0
  86. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.is_descendent.rst +0 -0
  87. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.iter_nomenclature_plugins.rst +0 -0
  88. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.iter_xref_plugins.rst +0 -0
  89. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.normalize_curie.rst +0 -0
  90. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.parse_results_from_obo.rst +0 -0
  91. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.run_nomenclature_plugin.rst +0 -0
  92. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/api/pyobo.run_xref_plugin.rst +0 -0
  93. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/index.rst +0 -0
  94. {pyobo-0.10.8 → pyobo-0.10.9}/docs/source/logo.png +0 -0
  95. {pyobo-0.10.8 → pyobo-0.10.9}/pyproject.toml +0 -0
  96. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/__init__.py +0 -0
  97. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/__main__.py +0 -0
  98. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/api/__init__.py +0 -0
  99. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/api/alts.py +0 -0
  100. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/api/metadata.py +0 -0
  101. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/api/names.py +0 -0
  102. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/api/properties.py +0 -0
  103. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/api/relations.py +0 -0
  104. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/api/species.py +0 -0
  105. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/api/typedefs.py +0 -0
  106. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/api/utils.py +0 -0
  107. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/apps/__init__.py +0 -0
  108. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/apps/cli.py +0 -0
  109. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/apps/gilda/__init__.py +0 -0
  110. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/apps/gilda/__main__.py +0 -0
  111. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/apps/gilda/app.py +0 -0
  112. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/apps/gilda/cli.py +0 -0
  113. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/apps/gilda/templates/base.html +0 -0
  114. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/apps/gilda/templates/home.html +0 -0
  115. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/apps/gilda/templates/matches.html +0 -0
  116. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/apps/mapper/__init__.py +0 -0
  117. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/apps/mapper/__main__.py +0 -0
  118. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/apps/mapper/cli.py +0 -0
  119. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/apps/mapper/mapper.py +0 -0
  120. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/apps/mapper/templates/base.html +0 -0
  121. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/apps/mapper/templates/mapper_home.html +0 -0
  122. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/aws.py +0 -0
  123. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/cli/__init__.py +0 -0
  124. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/cli/aws.py +0 -0
  125. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/cli/cli.py +0 -0
  126. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/cli/database.py +0 -0
  127. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/cli/lookup.py +0 -0
  128. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/cli/utils.py +0 -0
  129. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/constants.py +0 -0
  130. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/gilda_utils.py +0 -0
  131. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/identifier_utils.py +0 -0
  132. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/mocks.py +0 -0
  133. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/normalizer.py +0 -0
  134. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/obographs.py +0 -0
  135. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/plugins.py +0 -0
  136. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/reader.py +0 -0
  137. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/registries/__init__.py +0 -0
  138. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/registries/metaregistry.json +0 -0
  139. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/registries/metaregistry.py +0 -0
  140. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/resource_utils.py +0 -0
  141. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/resources/__init__.py +0 -0
  142. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/resources/ncbitaxon.py +0 -0
  143. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/resources/ncbitaxon.tsv.gz +0 -0
  144. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/resources/ro.py +0 -0
  145. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/resources/ro.tsv +0 -0
  146. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/agrovoc.py +0 -0
  147. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/antibodyregistry.py +0 -0
  148. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/biogrid.py +0 -0
  149. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/ccle.py +0 -0
  150. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/chebi.py +0 -0
  151. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/chembl.py +0 -0
  152. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/complexportal.py +0 -0
  153. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/conso.py +0 -0
  154. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/cpt.py +0 -0
  155. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/cvx.py +0 -0
  156. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/depmap.py +0 -0
  157. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/dictybase_gene.py +0 -0
  158. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/drugbank.py +0 -0
  159. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/drugbank_salt.py +0 -0
  160. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/drugcentral.py +0 -0
  161. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/expasy.py +0 -0
  162. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/famplex.py +0 -0
  163. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/flybase.py +0 -0
  164. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/geonames.py +0 -0
  165. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/gmt_utils.py +0 -0
  166. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/go.py +0 -0
  167. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/gwascentral_phenotype.py +0 -0
  168. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/gwascentral_study.py +0 -0
  169. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/hgnc.py +0 -0
  170. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/hgncgenefamily.py +0 -0
  171. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/icd10.py +0 -0
  172. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/icd11.py +0 -0
  173. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/icd_utils.py +0 -0
  174. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/interpro.py +0 -0
  175. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/itis.py +0 -0
  176. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/kegg/__init__.py +0 -0
  177. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/kegg/api.py +0 -0
  178. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/kegg/genes.py +0 -0
  179. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/kegg/genome.py +0 -0
  180. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/kegg/pathway.py +0 -0
  181. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/mgi.py +0 -0
  182. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/mirbase.py +0 -0
  183. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/mirbase_constants.py +0 -0
  184. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/mirbase_family.py +0 -0
  185. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/mirbase_mature.py +0 -0
  186. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/msigdb.py +0 -0
  187. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/npass.py +0 -0
  188. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/pathbank.py +0 -0
  189. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/pfam.py +0 -0
  190. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/pfam_clan.py +0 -0
  191. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/pid.py +0 -0
  192. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/pombase.py +0 -0
  193. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/pubchem.py +0 -0
  194. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/reactome.py +0 -0
  195. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/rgd.py +0 -0
  196. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/rhea.py +0 -0
  197. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/ror.py +0 -0
  198. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/selventa/__init__.py +0 -0
  199. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/selventa/schem.py +0 -0
  200. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/selventa/scomp.py +0 -0
  201. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/selventa/sdis.py +0 -0
  202. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/selventa/sfam.py +0 -0
  203. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/sgd.py +0 -0
  204. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/slm.py +0 -0
  205. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/umls/__init__.py +0 -0
  206. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/umls/__main__.py +0 -0
  207. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/umls/get_synonym_types.py +0 -0
  208. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/umls/synonym_types.tsv +0 -0
  209. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/uniprot/__init__.py +0 -0
  210. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/uniprot/uniprot_ptm.py +0 -0
  211. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/utils.py +0 -0
  212. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/wikipathways.py +0 -0
  213. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/sources/zfin.py +0 -0
  214. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/ssg/__init__.py +0 -0
  215. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/ssg/base.html +0 -0
  216. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/ssg/index.html +0 -0
  217. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/ssg/term.html +0 -0
  218. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/ssg/typedef.html +0 -0
  219. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/struct/reference.py +0 -0
  220. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/struct/utils.py +0 -0
  221. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/utils/__init__.py +0 -0
  222. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/utils/cache.py +0 -0
  223. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/utils/io.py +0 -0
  224. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/utils/iter.py +0 -0
  225. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/utils/ndex_utils.py +0 -0
  226. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/utils/path.py +0 -0
  227. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/xrefdb/__init__.py +0 -0
  228. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/xrefdb/canonicalizer.py +0 -0
  229. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/xrefdb/priority.py +0 -0
  230. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/xrefdb/sources/__init__.py +0 -0
  231. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/xrefdb/sources/biomappings.py +0 -0
  232. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/xrefdb/sources/cbms2019.py +0 -0
  233. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/xrefdb/sources/chembl.py +0 -0
  234. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/xrefdb/sources/compath.py +0 -0
  235. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/xrefdb/sources/famplex.py +0 -0
  236. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/xrefdb/sources/gilda.py +0 -0
  237. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/xrefdb/sources/intact.py +0 -0
  238. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/xrefdb/sources/ncit.py +0 -0
  239. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/xrefdb/sources/pubchem.py +0 -0
  240. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo/xrefdb/xrefs_pipeline.py +0 -0
  241. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo.egg-info/dependency_links.txt +0 -0
  242. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo.egg-info/entry_points.txt +0 -0
  243. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo.egg-info/not-zip-safe +0 -0
  244. {pyobo-0.10.8 → pyobo-0.10.9}/src/pyobo.egg-info/top_level.txt +0 -0
  245. {pyobo-0.10.8 → pyobo-0.10.9}/tests/__init__.py +0 -0
  246. {pyobo-0.10.8 → pyobo-0.10.9}/tests/constants.py +0 -0
  247. {pyobo-0.10.8 → pyobo-0.10.9}/tests/resources/citations.txt +0 -0
  248. {pyobo-0.10.8 → pyobo-0.10.9}/tests/resources/test_chebi.obo +0 -0
  249. {pyobo-0.10.8 → pyobo-0.10.9}/tests/resources/test_msigdb.gmt +0 -0
  250. {pyobo-0.10.8 → pyobo-0.10.9}/tests/resources/test_wikipathways.gmt +0 -0
  251. {pyobo-0.10.8 → pyobo-0.10.9}/tests/test_alt_ids.py +0 -0
  252. {pyobo-0.10.8 → pyobo-0.10.9}/tests/test_caches.py +0 -0
  253. {pyobo-0.10.8 → pyobo-0.10.9}/tests/test_extract.py +0 -0
  254. {pyobo-0.10.8 → pyobo-0.10.9}/tests/test_get.py +0 -0
  255. {pyobo-0.10.8 → pyobo-0.10.9}/tests/test_get_miriam_url.py +0 -0
  256. {pyobo-0.10.8 → pyobo-0.10.9}/tests/test_gmt.py +0 -0
  257. {pyobo-0.10.8 → pyobo-0.10.9}/tests/test_ground.py +0 -0
  258. {pyobo-0.10.8 → pyobo-0.10.9}/tests/test_mapper.py +0 -0
  259. {pyobo-0.10.8 → pyobo-0.10.9}/tests/test_sources/__init__.py +0 -0
  260. {pyobo-0.10.8 → pyobo-0.10.9}/tests/test_sources/test_famplex.py +0 -0
  261. {pyobo-0.10.8 → pyobo-0.10.9}/tests/test_struct.py +0 -0
  262. {pyobo-0.10.8 → pyobo-0.10.9}/tests/test_utils.py +0 -0
  263. {pyobo-0.10.8 → pyobo-0.10.9}/tox.ini +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyobo
3
- Version: 0.10.8
3
+ Version: 0.10.9
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
@@ -49,7 +49,7 @@ Requires-Dist: class_resolver
49
49
  Requires-Dist: psycopg2-binary
50
50
  Requires-Dist: drugbank_downloader
51
51
  Requires-Dist: chembl_downloader
52
- Requires-Dist: umls_downloader>=0.1.2
52
+ Requires-Dist: umls_downloader>=0.1.3
53
53
  Requires-Dist: typing_extensions
54
54
  Provides-Extra: tests
55
55
  Requires-Dist: coverage; extra == "tests"
@@ -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.8"
61
+ release = "0.10.9"
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.8
3
+ version = 0.10.9
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>=0.1.2
59
+ umls_downloader>=0.1.3
60
60
  typing_extensions
61
61
  zip_safe = false
62
62
  include_package_data = True
@@ -168,14 +168,15 @@ def is_descendent(prefix, identifier, ancestor_prefix, ancestor_identifier) -> b
168
168
  @lru_cache()
169
169
  def get_descendants(
170
170
  prefix: str,
171
- identifier: str,
171
+ identifier: Optional[str] = None,
172
172
  include_part_of: bool = True,
173
173
  include_has_member: bool = False,
174
174
  use_tqdm: bool = False,
175
175
  force: bool = False,
176
176
  **kwargs,
177
177
  ) -> Optional[Set[str]]:
178
- """Get all of the descendants (children) of the term as CURIEs."""
178
+ """Get all the descendants (children) of the term as CURIEs."""
179
+ curie, prefix, identifier = _pic(prefix, identifier)
179
180
  hierarchy = get_hierarchy(
180
181
  prefix=prefix,
181
182
  include_has_member=include_has_member,
@@ -184,23 +185,32 @@ def get_descendants(
184
185
  force=force,
185
186
  **kwargs,
186
187
  )
187
- curie = f"{prefix}:{identifier}"
188
188
  if curie not in hierarchy:
189
189
  return None
190
190
  return nx.ancestors(hierarchy, curie) # note this is backwards
191
191
 
192
192
 
193
+ def _pic(prefix, identifier=None) -> Tuple[str, str, str]:
194
+ if identifier is None:
195
+ curie = prefix
196
+ prefix, identifier = prefix.split(":")
197
+ else:
198
+ curie = f"{prefix}:{identifier}"
199
+ return curie, prefix, identifier
200
+
201
+
193
202
  @lru_cache()
194
203
  def get_children(
195
204
  prefix: str,
196
- identifier: str,
205
+ identifier: Optional[str] = None,
197
206
  include_part_of: bool = True,
198
207
  include_has_member: bool = False,
199
208
  use_tqdm: bool = False,
200
209
  force: bool = False,
201
210
  **kwargs,
202
211
  ) -> Optional[Set[str]]:
203
- """Get all of the descendants (children) of the term as CURIEs."""
212
+ """Get all the descendants (children) of the term as CURIEs."""
213
+ curie, prefix, identifier = _pic(prefix, identifier)
204
214
  hierarchy = get_hierarchy(
205
215
  prefix=prefix,
206
216
  include_has_member=include_has_member,
@@ -209,7 +219,6 @@ def get_children(
209
219
  force=force,
210
220
  **kwargs,
211
221
  )
212
- curie = f"{prefix}:{identifier}"
213
222
  if curie not in hierarchy:
214
223
  return None
215
224
  return set(hierarchy.predecessors(curie))
@@ -228,14 +237,15 @@ def has_ancestor(prefix, identifier, ancestor_prefix, ancestor_identifier) -> bo
228
237
  @lru_cache()
229
238
  def get_ancestors(
230
239
  prefix: str,
231
- identifier: str,
240
+ identifier: Optional[str] = None,
232
241
  include_part_of: bool = True,
233
242
  include_has_member: bool = False,
234
243
  use_tqdm: bool = False,
235
244
  force: bool = False,
236
245
  **kwargs,
237
246
  ) -> Optional[Set[str]]:
238
- """Get all of the ancestors (parents) of the term as CURIEs."""
247
+ """Get all the ancestors (parents) of the term as CURIEs."""
248
+ curie, prefix, identifier = _pic(prefix, identifier)
239
249
  hierarchy = get_hierarchy(
240
250
  prefix=prefix,
241
251
  include_has_member=include_has_member,
@@ -244,7 +254,6 @@ def get_ancestors(
244
254
  force=force,
245
255
  **kwargs,
246
256
  )
247
- curie = f"{prefix}:{identifier}"
248
257
  if curie not in hierarchy:
249
258
  return None
250
259
  return nx.descendants(hierarchy, curie) # note this is backwards
@@ -252,7 +261,7 @@ def get_ancestors(
252
261
 
253
262
  def get_subhierarchy(
254
263
  prefix: str,
255
- identifier: str,
264
+ identifier: Optional[str] = None,
256
265
  include_part_of: bool = True,
257
266
  include_has_member: bool = False,
258
267
  use_tqdm: bool = False,
@@ -260,6 +269,7 @@ def get_subhierarchy(
260
269
  **kwargs,
261
270
  ) -> nx.DiGraph:
262
271
  """Get the subhierarchy for a given node."""
272
+ curie, prefix, identifier = _pic(prefix, identifier)
263
273
  hierarchy = get_hierarchy(
264
274
  prefix=prefix,
265
275
  include_has_member=include_has_member,
@@ -271,7 +281,7 @@ def get_subhierarchy(
271
281
  logger.info(
272
282
  "getting descendants of %s:%s ! %s", prefix, identifier, get_name(prefix, identifier)
273
283
  )
274
- curies = nx.ancestors(hierarchy, f"{prefix}:{identifier}") # note this is backwards
284
+ curies = nx.ancestors(hierarchy, curie) # note this is backwards
275
285
  logger.info("inducing subgraph")
276
286
  sg = hierarchy.subgraph(curies).copy()
277
287
  logger.info("subgraph has %d nodes/%d edges", sg.number_of_nodes(), sg.number_of_edges())
@@ -142,7 +142,9 @@ def get_sssom_df(
142
142
  df = get_xrefs_df(prefix=prefix, **kwargs)
143
143
  rows: List[Tuple[str, ...]] = []
144
144
  with logging_redirect_tqdm():
145
- for source_id, target_prefix, target_id in tqdm(df.values, unit="mapping", unit_scale=True):
145
+ for source_id, target_prefix, target_id in tqdm(
146
+ df.values, unit="mapping", unit_scale=True, desc=f"[{prefix}] SSSOM"
147
+ ):
146
148
  source = Reference(prefix=prefix, identifier=source_id)
147
149
  target = Reference(prefix=target_prefix, identifier=target_id)
148
150
 
@@ -55,7 +55,7 @@ class UnhandledFormat(NoBuild):
55
55
 
56
56
  #: The following prefixes can not be loaded through ROBOT without
57
57
  #: turning off integrity checks
58
- REQUIRES_NO_ROBOT_CHECK = {"clo", "vo"}
58
+ REQUIRES_NO_ROBOT_CHECK = {"clo", "vo", "orphanet.ordo", "orphanet"}
59
59
 
60
60
 
61
61
  @wrap_norm_prefix
@@ -117,7 +117,7 @@ def get_ontology(
117
117
 
118
118
  ontology_format, path = _ensure_ontology_path(prefix, force=force, version=version)
119
119
  if path is None:
120
- raise NoBuild
120
+ raise NoBuild(prefix)
121
121
  elif ontology_format == "obo":
122
122
  pass # all gucci
123
123
  elif ontology_format == "owl":
@@ -8,6 +8,7 @@ from .antibodyregistry import AntibodyRegistryGetter
8
8
  from .ccle import CCLEGetter
9
9
  from .cgnc import CGNCGetter
10
10
  from .chembl import ChEMBLCompoundGetter
11
+ from .civic_gene import CIVICGeneGetter
11
12
  from .complexportal import ComplexPortalGetter
12
13
  from .conso import CONSOGetter
13
14
  from .cpt import CPTGetter
@@ -38,6 +39,7 @@ from .mirbase_mature import MiRBaseMatureGetter
38
39
  from .msigdb import MSigDBGetter
39
40
  from .ncbigene import NCBIGeneGetter
40
41
  from .npass import NPASSGetter
42
+ from .omim_ps import OMIMPSGetter
41
43
  from .pathbank import PathBankGetter
42
44
  from .pfam import PfamGetter
43
45
  from .pfam_clan import PfamClanGetter
@@ -61,6 +63,7 @@ __all__ = [
61
63
  "AntibodyRegistryGetter",
62
64
  "CCLEGetter",
63
65
  "CGNCGetter",
66
+ "CIVICGeneGetter",
64
67
  "CONSOGetter",
65
68
  "CPTGetter",
66
69
  "CVXGetter",
@@ -94,6 +97,7 @@ __all__ = [
94
97
  "MiRBaseMatureGetter",
95
98
  "NCBIGeneGetter",
96
99
  "NPASSGetter",
100
+ "OMIMPSGetter",
97
101
  "PIDGetter",
98
102
  "PathBankGetter",
99
103
  "PfamClanGetter",
@@ -69,7 +69,7 @@ def get_terms(force: bool = False) -> Iterable[Term]:
69
69
  term = Term.from_triple(
70
70
  prefix=PREFIX,
71
71
  identifier=cgnc_id,
72
- name=name,
72
+ name=name if pd.notna(name) else None,
73
73
  )
74
74
  term.set_species(identifier="9031", name="Gallus gallus")
75
75
  if entrez_id and pd.notna(entrez_id):
@@ -0,0 +1,55 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ """Converter for CiVIC Genes."""
4
+
5
+ from typing import Iterable, Optional
6
+
7
+ import pandas as pd
8
+
9
+ from pyobo.struct import Obo, Reference, Term
10
+ from pyobo.utils.path import ensure_df
11
+
12
+ __all__ = [
13
+ "CIVICGeneGetter",
14
+ ]
15
+
16
+ PREFIX = "civic.gid"
17
+ URL = "https://civicdb.org/downloads/nightly/nightly-GeneSummaries.tsv"
18
+
19
+
20
+ def _sort(_o, t):
21
+ return int(t.identifier)
22
+
23
+
24
+ class CIVICGeneGetter(Obo):
25
+ """An ontology representation of CiVIC's gene nomenclature."""
26
+
27
+ bioversions_key = ontology = PREFIX
28
+ term_sort_key = _sort
29
+
30
+ def iter_terms(self, force: bool = False) -> Iterable[Term]:
31
+ """Iterate over gene terms for CiVIC."""
32
+ yield from get_terms(self.data_version, force=force)
33
+
34
+
35
+ def get_terms(version: Optional[str] = None, force: bool = False) -> Iterable[Term]:
36
+ """Get CIVIC terms."""
37
+ # if version is not None:
38
+ # version_dt: datetime.date = dateutil.parser.parse(version)
39
+ # else:
40
+ # version_dt: datetime.date = datetime.today()
41
+ # version = version_dt.strftime("01-%b-%Y")
42
+ # version is like 01-Feb-2024
43
+ url = f"https://civicdb.org/downloads/{version}/{version}-GeneSummaries.tsv"
44
+ df = ensure_df(prefix=PREFIX, url=url, sep="\t", force=force, dtype=str, version=version)
45
+ for identifier, _, name, entrez_id, description, _last_review, _flag in df.values:
46
+ term = Term(
47
+ reference=Reference(prefix=PREFIX, identifier=identifier, name=name),
48
+ definition=description if pd.notna(description) else None,
49
+ )
50
+ term.append_exact_match(Reference(prefix="ncbigene", identifier=entrez_id))
51
+ yield term
52
+
53
+
54
+ if __name__ == "__main__":
55
+ CIVICGeneGetter.cli()
@@ -6,7 +6,7 @@ import datetime
6
6
  import itertools as itt
7
7
  import logging
8
8
  import re
9
- from typing import Any, Dict, Iterable, List, Mapping, Optional, Set, Tuple
9
+ from typing import Any, Collection, Dict, Iterable, List, Mapping, Optional, Set, Tuple
10
10
  from xml.etree.ElementTree import Element
11
11
 
12
12
  from tqdm.auto import tqdm
@@ -19,6 +19,7 @@ from pyobo.utils.path import ensure_path, prefix_directory_join
19
19
 
20
20
  __all__ = [
21
21
  "MeSHGetter",
22
+ "get_mesh_category_curies",
22
23
  ]
23
24
 
24
25
  logger = logging.getLogger(__name__)
@@ -317,5 +318,32 @@ def _get_descriptor_qualifiers(descriptor: Element) -> List[Mapping[str, str]]:
317
318
  ]
318
319
 
319
320
 
321
+ def get_mesh_category_curies(letter: str, skip: Optional[Collection[str]] = None) -> List[str]:
322
+ """Get the MeSH LUIDs for a category, by letter (e.g., "A").
323
+
324
+ :param letter: The MeSH tree, A for anatomy, C for disease, etc.
325
+ :param skip: An optional collection of MeSH tree codes to skip, such as "A03"
326
+ :returns: A list of MeSH CURIE strings for the top level of each MeSH tree.
327
+
328
+ .. seealso:: https://meshb.nlm.nih.gov/treeView
329
+ """
330
+ import bioversions
331
+
332
+ mesh_version = bioversions.get_version("mesh")
333
+ if mesh_version is None:
334
+ raise ValueError
335
+ tree_to_mesh = get_tree_to_mesh_id(mesh_version)
336
+ rv = []
337
+ for i in range(1, 100):
338
+ key = f"{letter}{i:02}"
339
+ if skip and key in skip:
340
+ continue
341
+ mesh_id = tree_to_mesh.get(key)
342
+ if mesh_id is None:
343
+ break
344
+ rv.append(f"mesh:{mesh_id}")
345
+ return rv
346
+
347
+
320
348
  if __name__ == "__main__":
321
349
  get_obo(force=True).write_default(force=True, write_obo=True)
@@ -171,15 +171,17 @@ def get_terms(force: bool = False) -> Iterable[Term]:
171
171
  continue
172
172
  term = Term(
173
173
  reference=Reference(prefix=PREFIX, identifier=gene_id, name=symbol),
174
- definition=description,
174
+ definition=description if pd.notna(description) else None,
175
175
  )
176
176
  term.set_species(identifier=tax_id)
177
177
  if pd.notna(xref_curies):
178
178
  for xref_curie in xref_curies.split("|"):
179
179
  if xref_curie.startswith("EnsemblRapid"):
180
180
  continue
181
- if xref_curie.startswith("AllianceGenome"):
181
+ elif xref_curie.startswith("AllianceGenome"):
182
182
  xref_curie = xref_curie[len("xref_curie") :]
183
+ elif xref_curie.startswith("nome:WB:"):
184
+ xref_curie = xref_curie[len("nome:") :]
183
185
  xref_prefix, xref_id = bioregistry.parse_curie(xref_curie)
184
186
  if xref_prefix and xref_id:
185
187
  term.append_xref(Reference(prefix=xref_prefix, identifier=xref_id))
@@ -187,7 +189,7 @@ def get_terms(force: bool = False) -> Iterable[Term]:
187
189
  p = xref_curie.split(":")[0]
188
190
  if p not in warning_prefixes:
189
191
  warning_prefixes.add(p)
190
- tqdm.write(f"[{PREFIX}] unhandled xref prefix: {p}")
192
+ tqdm.write(f"[{PREFIX}] unhandled prefix in xref: {xref_curie}")
191
193
  yield term
192
194
 
193
195
 
@@ -0,0 +1,39 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ """Converter for OMIM Phenotypic Series."""
4
+
5
+ import logging
6
+ from typing import Iterable
7
+
8
+ from bioversions.utils import get_soup
9
+
10
+ from pyobo.struct import Obo, Term
11
+
12
+ __all__ = [
13
+ "OMIMPSGetter",
14
+ ]
15
+
16
+
17
+ logger = logging.getLogger(__name__)
18
+ PREFIX = "omim.ps"
19
+ URL = "https://omim.org/phenotypicSeriesTitles/all"
20
+
21
+
22
+ class OMIMPSGetter(Obo):
23
+ """An ontology representation of OMIM Phenotypic Series."""
24
+
25
+ ontology = bioversions_key = PREFIX
26
+
27
+ def iter_terms(self, force: bool = False) -> Iterable[Term]:
28
+ """Iterate over terms in the ontology."""
29
+ soup = get_soup(URL, user_agent="Mozilla/5.0")
30
+ rows = soup.find(id="mimContent").find("table").find("tbody").find_all("tr")
31
+ for row in rows:
32
+ anchor = row.find("td").find("a")
33
+ name = anchor.text.strip()
34
+ identifier = anchor.attrs["href"][len("/phenotypicSeries/") :]
35
+ yield Term.from_triple(PREFIX, identifier, name)
36
+
37
+
38
+ if __name__ == "__main__":
39
+ OMIMPSGetter.cli()
@@ -7,12 +7,13 @@ Run with ``python -m pyobo.sources.umls``
7
7
 
8
8
  import itertools as itt
9
9
  import operator
10
- from typing import Iterable
10
+ from collections import defaultdict
11
+ from typing import Iterable, Mapping, Set
11
12
 
12
13
  import bioregistry
13
14
  import pandas as pd
14
15
  from tqdm.auto import tqdm
15
- from umls_downloader import open_umls
16
+ from umls_downloader import open_umls, open_umls_semantic_types
16
17
 
17
18
  from pyobo import Obo, Reference, Synonym, SynonymTypeDef, Term
18
19
 
@@ -66,8 +67,20 @@ def get_obo() -> Obo:
66
67
  return UMLSGetter()
67
68
 
68
69
 
70
+ def get_semantic_types() -> Mapping[str, Set[str]]:
71
+ """Get UMLS semantic types for each term."""
72
+ dd = defaultdict(set)
73
+ with open_umls_semantic_types() as file:
74
+ for line in tqdm(file, unit_scale=True):
75
+ cui, sty, _ = line.decode("utf8").split("|", 2)
76
+ dd[cui].add(sty)
77
+ return dict(dd)
78
+
79
+
69
80
  def iter_terms(version: str) -> Iterable[Term]:
70
81
  """Iterate over UMLS terms."""
82
+ semantic_types = get_semantic_types()
83
+
71
84
  with open_umls(version=version) as file:
72
85
  it = tqdm(file, unit_scale=True, desc="[umls] parsing")
73
86
  lines = (line.decode("utf-8").strip().split("|") for line in it)
@@ -118,6 +131,8 @@ def iter_terms(version: str) -> Iterable[Term]:
118
131
  synonyms=synonyms,
119
132
  xrefs=xrefs,
120
133
  )
134
+ for sty_id in semantic_types.get(cui, set()):
135
+ term.append_parent(Reference(prefix="sty", identifier=sty_id))
121
136
  yield term
122
137
 
123
138
 
@@ -0,0 +1,181 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ """Converter for UniProt."""
4
+
5
+ from operator import attrgetter
6
+ from pathlib import Path
7
+ from typing import Iterable, List, Optional, cast
8
+
9
+ import bioversions
10
+ from tqdm.auto import tqdm
11
+
12
+ from pyobo import Obo, Reference
13
+ from pyobo.constants import RAW_MODULE
14
+ from pyobo.identifier_utils import standardize_ec
15
+ from pyobo.struct import Term, derives_from, enables, from_species, participates_in
16
+ from pyobo.struct.typedef import gene_product_of, located_in, molecularly_interacts_with
17
+ from pyobo.utils.io import open_reader
18
+
19
+ PREFIX = "uniprot"
20
+ BASE_URL = "https://rest.uniprot.org/uniprotkb/stream"
21
+ SEARCH_URL = "https://rest.uniprot.org/uniprotkb/search"
22
+ QUERY = "(*) AND (reviewed:true)"
23
+ FIELDS = [
24
+ "accession",
25
+ "id",
26
+ "organism_id",
27
+ "protein_name",
28
+ "ec",
29
+ "lit_pubmed_id",
30
+ "xref_pdb",
31
+ "xref_proteomes",
32
+ "xref_geneid",
33
+ "rhea",
34
+ "go_c",
35
+ "go_f",
36
+ "go_p",
37
+ "ft_binding",
38
+ "cc_function",
39
+ ]
40
+ PARAMS = {
41
+ "compressed": "true",
42
+ "format": "tsv",
43
+ # "size": 10, # only used with search
44
+ "query": QUERY,
45
+ "fields": FIELDS,
46
+ }
47
+
48
+
49
+ class UniProtGetter(Obo):
50
+ """An ontology representation of the UniProt database."""
51
+
52
+ bioversions_key = ontology = PREFIX
53
+ typedefs = [
54
+ from_species,
55
+ enables,
56
+ participates_in,
57
+ gene_product_of,
58
+ molecularly_interacts_with,
59
+ derives_from,
60
+ ]
61
+
62
+ def iter_terms(self, force: bool = False) -> Iterable[Term]:
63
+ """Iterate over terms in the ontology."""
64
+ yield from iter_terms(version=self._version_or_raise)
65
+
66
+
67
+ def get_obo(force: bool = False) -> Obo:
68
+ """Get UniProt as OBO."""
69
+ return UniProtGetter(force=force)
70
+
71
+
72
+ def iter_terms(version: Optional[str] = None) -> Iterable[Term]:
73
+ """Iterate over UniProt Terms."""
74
+ with open_reader(ensure(version=version)) as reader:
75
+ _ = next(reader) # header
76
+ for (
77
+ uniprot_id,
78
+ accession,
79
+ taxonomy_id,
80
+ _name, # this field should have the name, but it's a mismatch of random name annotations
81
+ ecs,
82
+ pubmeds,
83
+ pdbs,
84
+ proteome,
85
+ gene_id,
86
+ rhea_curies,
87
+ go_components,
88
+ go_functions,
89
+ go_processes,
90
+ bindings,
91
+ description,
92
+ ) in tqdm(reader, desc="Mapping UniProt", unit_scale=True):
93
+ if description:
94
+ description = description.removeprefix("FUNCTION: ")
95
+ term = Term(
96
+ reference=Reference(prefix=PREFIX, identifier=uniprot_id, name=accession),
97
+ definition=description or None,
98
+ )
99
+ term.set_species(taxonomy_id)
100
+ if gene_id:
101
+ term.append_relationship(
102
+ gene_product_of, Reference(prefix="ncbigene", identifier=gene_id)
103
+ )
104
+
105
+ # TODO add type=Reference(prefix="xsd", identifier="boolean")
106
+ term.append_property("reviewed", "true")
107
+
108
+ for go_process_ref in _parse_go(go_processes):
109
+ term.append_relationship(participates_in, go_process_ref)
110
+ for go_function_ref in _parse_go(go_functions):
111
+ term.append_relationship(enables, go_function_ref)
112
+ for go_component_ref in _parse_go(go_components):
113
+ term.append_relationship(located_in, go_component_ref)
114
+
115
+ if proteome:
116
+ uniprot_proteome_id = proteome.split(":")[0]
117
+ term.append_relationship(
118
+ derives_from,
119
+ Reference(prefix="uniprot.proteome", identifier=uniprot_proteome_id),
120
+ )
121
+
122
+ if rhea_curies:
123
+ for rhea_curie in rhea_curies.split(" "):
124
+ term.append_relationship(
125
+ # FIXME this needs a different relation than enables
126
+ # see https://github.com/biopragmatics/pyobo/pull/168#issuecomment-1918680152
127
+ enables,
128
+ cast(Reference, Reference.from_curie(rhea_curie, strict=True)),
129
+ )
130
+
131
+ if bindings:
132
+ binding_references = set()
133
+ for part in bindings.split(";"):
134
+ part = part.strip()
135
+ if part.startswith("/ligand_id"):
136
+ curie = part.removeprefix('/ligand_id="').rstrip('"')
137
+ binding_references.add(
138
+ cast(Reference, Reference.from_curie(curie, strict=True))
139
+ )
140
+ for binding_reference in sorted(binding_references, key=attrgetter("curie")):
141
+ term.append_relationship(molecularly_interacts_with, binding_reference)
142
+
143
+ if ecs:
144
+ for ec in ecs.split(";"):
145
+ term.append_relationship(
146
+ enables, Reference(prefix="eccode", identifier=standardize_ec(ec))
147
+ )
148
+ for pubmed in pubmeds.split(";"):
149
+ if pubmed:
150
+ term.append_provenance(Reference(prefix="pubmed", identifier=pubmed.strip()))
151
+ for pdb in pdbs.split(";"):
152
+ if pdb:
153
+ term.append_xref(Reference(prefix="pdb", identifier=pdb.strip()))
154
+ yield term
155
+
156
+
157
+ def _parse_go(go_terms) -> List[Reference]:
158
+ rv = []
159
+ if go_terms:
160
+ for go_term in go_terms.split(";"):
161
+ go_id = go_term.rsplit("[GO:")[1].rstrip("]")
162
+ rv.append(Reference(prefix="go", identifier=go_id))
163
+ return rv
164
+
165
+
166
+ def ensure(version: Optional[str] = None, force: bool = False) -> Path:
167
+ """Ensure the reviewed uniprot names are available."""
168
+ if version is None:
169
+ version = bioversions.get_version("uniprot")
170
+ return RAW_MODULE.ensure(
171
+ PREFIX,
172
+ version,
173
+ force=force,
174
+ name="reviewed.tsv.gz",
175
+ url=BASE_URL, # switch to SEARCH_URL for debugging
176
+ download_kwargs={"backend": "requests", "params": PARAMS},
177
+ )
178
+
179
+
180
+ if __name__ == "__main__":
181
+ UniProtGetter.cli()
@@ -15,6 +15,7 @@ from .struct import ( # noqa: F401
15
15
  from .typedef import ( # noqa: F401
16
16
  RelationHint,
17
17
  TypeDef,
18
+ derives_from,
18
19
  enables,
19
20
  from_species,
20
21
  gene_product_member_of,
@@ -1023,7 +1023,7 @@ class Obo:
1023
1023
  def iterate_id_name(self, *, use_tqdm: bool = False) -> Iterable[Tuple[str, str]]:
1024
1024
  """Iterate identifier name pairs."""
1025
1025
  for term in self._iter_terms(use_tqdm=use_tqdm, desc=f"[{self.ontology}] getting names"):
1026
- if term.name:
1026
+ if term.prefix == self.ontology and term.name:
1027
1027
  yield term.identifier, term.name
1028
1028
 
1029
1029
  def get_id_name_mapping(self, *, use_tqdm: bool = False) -> Mapping[str, str]:
@@ -205,6 +205,15 @@ has_participant = TypeDef(
205
205
  comment="Inverse of has participant",
206
206
  inverse=Reference(prefix=RO_PREFIX, identifier="0000056", name="participates in"),
207
207
  )
208
+ derives_from = TypeDef(
209
+ reference=Reference(prefix=RO_PREFIX, identifier="0001000", name="derives from"),
210
+ )
211
+ molecularly_interacts_with = TypeDef(
212
+ reference=Reference(prefix=RO_PREFIX, identifier="0002436", name="molecularly interacts with"),
213
+ )
214
+ located_in = TypeDef(
215
+ reference=Reference(prefix=RO_PREFIX, identifier="0001025", name="located in"),
216
+ )
208
217
  exact_match = TypeDef(
209
218
  reference=Reference(prefix="skos", identifier="exactMatch", name="exact match"),
210
219
  )