pyobo 0.10.8__tar.gz → 0.10.10__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.10}/PKG-INFO +2 -2
  2. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/conf.py +1 -1
  3. {pyobo-0.10.8 → pyobo-0.10.10}/setup.cfg +2 -2
  4. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/api/hierarchy.py +21 -11
  5. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/api/names.py +4 -4
  6. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/api/xrefs.py +3 -1
  7. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/getters.py +2 -2
  8. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/__init__.py +4 -0
  9. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/cgnc.py +1 -1
  10. pyobo-0.10.10/src/pyobo/sources/civic_gene.py +55 -0
  11. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/expasy.py +26 -13
  12. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/mesh.py +29 -1
  13. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/ncbigene.py +5 -3
  14. pyobo-0.10.10/src/pyobo/sources/omim_ps.py +39 -0
  15. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/umls/umls.py +17 -2
  16. pyobo-0.10.10/src/pyobo/sources/uniprot/uniprot.py +181 -0
  17. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/struct/__init__.py +1 -0
  18. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/struct/struct.py +1 -1
  19. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/struct/typedef.py +9 -0
  20. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/utils/misc.py +22 -16
  21. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/version.py +1 -1
  22. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/xrefdb/sources/wikidata.py +5 -3
  23. {pyobo-0.10.8 → pyobo-0.10.10/src/pyobo.egg-info}/PKG-INFO +2 -2
  24. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo.egg-info/SOURCES.txt +2 -0
  25. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo.egg-info/requires.txt +1 -1
  26. pyobo-0.10.8/src/pyobo/sources/uniprot/uniprot.py +0 -74
  27. {pyobo-0.10.8 → pyobo-0.10.10}/.readthedocs.yml +0 -0
  28. {pyobo-0.10.8 → pyobo-0.10.10}/LICENSE +0 -0
  29. {pyobo-0.10.8 → pyobo-0.10.10}/MANIFEST.in +0 -0
  30. {pyobo-0.10.8 → pyobo-0.10.10}/README.rst +0 -0
  31. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.Canonicalizer.rst +0 -0
  32. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.Obo.rst +0 -0
  33. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.OboNormalizer.rst +0 -0
  34. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.Reference.rst +0 -0
  35. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.Synonym.rst +0 -0
  36. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.SynonymTypeDef.rst +0 -0
  37. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.Term.rst +0 -0
  38. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.TypeDef.rst +0 -0
  39. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.ensure_path.rst +0 -0
  40. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.from_obo_path.rst +0 -0
  41. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.from_obonet.rst +0 -0
  42. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_alts_to_id.rst +0 -0
  43. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_ancestors.rst +0 -0
  44. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_children.rst +0 -0
  45. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_definition.rst +0 -0
  46. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_descendants.rst +0 -0
  47. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_equivalent.rst +0 -0
  48. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_filtered_properties_df.rst +0 -0
  49. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_filtered_properties_mapping.rst +0 -0
  50. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_filtered_properties_multimapping.rst +0 -0
  51. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_filtered_relations_df.rst +0 -0
  52. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_filtered_xrefs.rst +0 -0
  53. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_graph.rst +0 -0
  54. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_hierarchy.rst +0 -0
  55. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_id_definition_mapping.rst +0 -0
  56. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_id_multirelations_mapping.rst +0 -0
  57. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_id_name_mapping.rst +0 -0
  58. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_id_species_mapping.rst +0 -0
  59. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_id_synonyms_mapping.rst +0 -0
  60. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_id_to_alts.rst +0 -0
  61. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_ids.rst +0 -0
  62. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_name.rst +0 -0
  63. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_name_by_curie.rst +0 -0
  64. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_name_id_mapping.rst +0 -0
  65. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_ontology.rst +0 -0
  66. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_primary_curie.rst +0 -0
  67. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_primary_identifier.rst +0 -0
  68. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_priority_curie.rst +0 -0
  69. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_properties.rst +0 -0
  70. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_properties_df.rst +0 -0
  71. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_property.rst +0 -0
  72. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_relation.rst +0 -0
  73. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_relation_mapping.rst +0 -0
  74. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_relations_df.rst +0 -0
  75. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_species.rst +0 -0
  76. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_sssom_df.rst +0 -0
  77. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_subhierarchy.rst +0 -0
  78. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_synonyms.rst +0 -0
  79. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_typedef_df.rst +0 -0
  80. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_version.rst +0 -0
  81. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_xref.rst +0 -0
  82. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_xrefs.rst +0 -0
  83. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.get_xrefs_df.rst +0 -0
  84. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.ground.rst +0 -0
  85. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.has_ancestor.rst +0 -0
  86. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.has_nomenclature_plugin.rst +0 -0
  87. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.has_xref_plugin.rst +0 -0
  88. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.is_descendent.rst +0 -0
  89. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.iter_nomenclature_plugins.rst +0 -0
  90. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.iter_xref_plugins.rst +0 -0
  91. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.normalize_curie.rst +0 -0
  92. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.parse_results_from_obo.rst +0 -0
  93. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.run_nomenclature_plugin.rst +0 -0
  94. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/api/pyobo.run_xref_plugin.rst +0 -0
  95. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/index.rst +0 -0
  96. {pyobo-0.10.8 → pyobo-0.10.10}/docs/source/logo.png +0 -0
  97. {pyobo-0.10.8 → pyobo-0.10.10}/pyproject.toml +0 -0
  98. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/__init__.py +0 -0
  99. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/__main__.py +0 -0
  100. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/api/__init__.py +0 -0
  101. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/api/alts.py +0 -0
  102. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/api/metadata.py +0 -0
  103. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/api/properties.py +0 -0
  104. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/api/relations.py +0 -0
  105. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/api/species.py +0 -0
  106. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/api/typedefs.py +0 -0
  107. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/api/utils.py +0 -0
  108. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/apps/__init__.py +0 -0
  109. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/apps/cli.py +0 -0
  110. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/apps/gilda/__init__.py +0 -0
  111. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/apps/gilda/__main__.py +0 -0
  112. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/apps/gilda/app.py +0 -0
  113. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/apps/gilda/cli.py +0 -0
  114. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/apps/gilda/templates/base.html +0 -0
  115. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/apps/gilda/templates/home.html +0 -0
  116. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/apps/gilda/templates/matches.html +0 -0
  117. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/apps/mapper/__init__.py +0 -0
  118. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/apps/mapper/__main__.py +0 -0
  119. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/apps/mapper/cli.py +0 -0
  120. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/apps/mapper/mapper.py +0 -0
  121. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/apps/mapper/templates/base.html +0 -0
  122. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/apps/mapper/templates/mapper_home.html +0 -0
  123. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/aws.py +0 -0
  124. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/cli/__init__.py +0 -0
  125. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/cli/aws.py +0 -0
  126. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/cli/cli.py +0 -0
  127. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/cli/database.py +0 -0
  128. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/cli/lookup.py +0 -0
  129. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/cli/utils.py +0 -0
  130. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/constants.py +0 -0
  131. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/gilda_utils.py +0 -0
  132. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/identifier_utils.py +0 -0
  133. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/mocks.py +0 -0
  134. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/normalizer.py +0 -0
  135. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/obographs.py +0 -0
  136. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/plugins.py +0 -0
  137. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/reader.py +0 -0
  138. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/registries/__init__.py +0 -0
  139. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/registries/metaregistry.json +0 -0
  140. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/registries/metaregistry.py +0 -0
  141. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/resource_utils.py +0 -0
  142. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/resources/__init__.py +0 -0
  143. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/resources/ncbitaxon.py +0 -0
  144. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/resources/ncbitaxon.tsv.gz +0 -0
  145. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/resources/ro.py +0 -0
  146. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/resources/ro.tsv +0 -0
  147. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/agrovoc.py +0 -0
  148. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/antibodyregistry.py +0 -0
  149. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/biogrid.py +0 -0
  150. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/ccle.py +0 -0
  151. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/chebi.py +0 -0
  152. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/chembl.py +0 -0
  153. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/complexportal.py +0 -0
  154. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/conso.py +0 -0
  155. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/cpt.py +0 -0
  156. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/cvx.py +0 -0
  157. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/depmap.py +0 -0
  158. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/dictybase_gene.py +0 -0
  159. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/drugbank.py +0 -0
  160. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/drugbank_salt.py +0 -0
  161. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/drugcentral.py +0 -0
  162. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/famplex.py +0 -0
  163. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/flybase.py +0 -0
  164. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/geonames.py +0 -0
  165. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/gmt_utils.py +0 -0
  166. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/go.py +0 -0
  167. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/gwascentral_phenotype.py +0 -0
  168. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/gwascentral_study.py +0 -0
  169. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/hgnc.py +0 -0
  170. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/hgncgenefamily.py +0 -0
  171. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/icd10.py +0 -0
  172. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/icd11.py +0 -0
  173. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/icd_utils.py +0 -0
  174. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/interpro.py +0 -0
  175. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/itis.py +0 -0
  176. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/kegg/__init__.py +0 -0
  177. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/kegg/api.py +0 -0
  178. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/kegg/genes.py +0 -0
  179. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/kegg/genome.py +0 -0
  180. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/kegg/pathway.py +0 -0
  181. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/mgi.py +0 -0
  182. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/mirbase.py +0 -0
  183. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/mirbase_constants.py +0 -0
  184. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/mirbase_family.py +0 -0
  185. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/mirbase_mature.py +0 -0
  186. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/msigdb.py +0 -0
  187. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/npass.py +0 -0
  188. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/pathbank.py +0 -0
  189. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/pfam.py +0 -0
  190. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/pfam_clan.py +0 -0
  191. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/pid.py +0 -0
  192. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/pombase.py +0 -0
  193. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/pubchem.py +0 -0
  194. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/reactome.py +0 -0
  195. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/rgd.py +0 -0
  196. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/rhea.py +0 -0
  197. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/ror.py +0 -0
  198. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/selventa/__init__.py +0 -0
  199. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/selventa/schem.py +0 -0
  200. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/selventa/scomp.py +0 -0
  201. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/selventa/sdis.py +0 -0
  202. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/selventa/sfam.py +0 -0
  203. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/sgd.py +0 -0
  204. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/slm.py +0 -0
  205. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/umls/__init__.py +0 -0
  206. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/umls/__main__.py +0 -0
  207. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/umls/get_synonym_types.py +0 -0
  208. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/umls/synonym_types.tsv +0 -0
  209. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/uniprot/__init__.py +0 -0
  210. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/uniprot/uniprot_ptm.py +0 -0
  211. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/utils.py +0 -0
  212. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/wikipathways.py +0 -0
  213. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/sources/zfin.py +0 -0
  214. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/ssg/__init__.py +0 -0
  215. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/ssg/base.html +0 -0
  216. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/ssg/index.html +0 -0
  217. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/ssg/term.html +0 -0
  218. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/ssg/typedef.html +0 -0
  219. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/struct/reference.py +0 -0
  220. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/struct/utils.py +0 -0
  221. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/utils/__init__.py +0 -0
  222. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/utils/cache.py +0 -0
  223. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/utils/io.py +0 -0
  224. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/utils/iter.py +0 -0
  225. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/utils/ndex_utils.py +0 -0
  226. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/utils/path.py +0 -0
  227. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/xrefdb/__init__.py +0 -0
  228. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/xrefdb/canonicalizer.py +0 -0
  229. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/xrefdb/priority.py +0 -0
  230. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/xrefdb/sources/__init__.py +0 -0
  231. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/xrefdb/sources/biomappings.py +0 -0
  232. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/xrefdb/sources/cbms2019.py +0 -0
  233. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/xrefdb/sources/chembl.py +0 -0
  234. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/xrefdb/sources/compath.py +0 -0
  235. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/xrefdb/sources/famplex.py +0 -0
  236. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/xrefdb/sources/gilda.py +0 -0
  237. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/xrefdb/sources/intact.py +0 -0
  238. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/xrefdb/sources/ncit.py +0 -0
  239. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/xrefdb/sources/pubchem.py +0 -0
  240. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo/xrefdb/xrefs_pipeline.py +0 -0
  241. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo.egg-info/dependency_links.txt +0 -0
  242. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo.egg-info/entry_points.txt +0 -0
  243. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo.egg-info/not-zip-safe +0 -0
  244. {pyobo-0.10.8 → pyobo-0.10.10}/src/pyobo.egg-info/top_level.txt +0 -0
  245. {pyobo-0.10.8 → pyobo-0.10.10}/tests/__init__.py +0 -0
  246. {pyobo-0.10.8 → pyobo-0.10.10}/tests/constants.py +0 -0
  247. {pyobo-0.10.8 → pyobo-0.10.10}/tests/resources/citations.txt +0 -0
  248. {pyobo-0.10.8 → pyobo-0.10.10}/tests/resources/test_chebi.obo +0 -0
  249. {pyobo-0.10.8 → pyobo-0.10.10}/tests/resources/test_msigdb.gmt +0 -0
  250. {pyobo-0.10.8 → pyobo-0.10.10}/tests/resources/test_wikipathways.gmt +0 -0
  251. {pyobo-0.10.8 → pyobo-0.10.10}/tests/test_alt_ids.py +0 -0
  252. {pyobo-0.10.8 → pyobo-0.10.10}/tests/test_caches.py +0 -0
  253. {pyobo-0.10.8 → pyobo-0.10.10}/tests/test_extract.py +0 -0
  254. {pyobo-0.10.8 → pyobo-0.10.10}/tests/test_get.py +0 -0
  255. {pyobo-0.10.8 → pyobo-0.10.10}/tests/test_get_miriam_url.py +0 -0
  256. {pyobo-0.10.8 → pyobo-0.10.10}/tests/test_gmt.py +0 -0
  257. {pyobo-0.10.8 → pyobo-0.10.10}/tests/test_ground.py +0 -0
  258. {pyobo-0.10.8 → pyobo-0.10.10}/tests/test_mapper.py +0 -0
  259. {pyobo-0.10.8 → pyobo-0.10.10}/tests/test_sources/__init__.py +0 -0
  260. {pyobo-0.10.8 → pyobo-0.10.10}/tests/test_sources/test_famplex.py +0 -0
  261. {pyobo-0.10.8 → pyobo-0.10.10}/tests/test_struct.py +0 -0
  262. {pyobo-0.10.8 → pyobo-0.10.10}/tests/test_utils.py +0 -0
  263. {pyobo-0.10.8 → pyobo-0.10.10}/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.10
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.10"
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.10
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())
@@ -30,11 +30,11 @@ __all__ = [
30
30
  logger = logging.getLogger(__name__)
31
31
 
32
32
 
33
- def get_name_by_curie(curie: str) -> Optional[str]:
33
+ def get_name_by_curie(curie: str, *, version: Optional[str] = None) -> Optional[str]:
34
34
  """Get the name for a CURIE, if possible."""
35
35
  prefix, identifier = normalize_curie(curie)
36
36
  if prefix and identifier:
37
- return get_name(prefix, identifier)
37
+ return get_name(prefix, identifier, version=version)
38
38
  return None
39
39
 
40
40
 
@@ -74,9 +74,9 @@ def _help_get(
74
74
 
75
75
 
76
76
  @wrap_norm_prefix
77
- def get_name(prefix: str, identifier: str) -> Optional[str]:
77
+ def get_name(prefix: str, identifier: str, *, version: Optional[str] = None) -> Optional[str]:
78
78
  """Get the name for an entity."""
79
- return _help_get(get_id_name_mapping, prefix, identifier)
79
+ return _help_get(get_id_name_mapping, prefix, identifier, version=version)
80
80
 
81
81
 
82
82
  @lru_cache()
@@ -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()
@@ -4,11 +4,11 @@
4
4
 
5
5
  import logging
6
6
  from collections import defaultdict
7
- from typing import Dict, Iterable, Mapping, Optional, Set, Tuple
7
+ from typing import Any, Dict, Iterable, Mapping, Optional, Set, Tuple
8
8
 
9
9
  from .utils import get_go_mapping
10
10
  from ..struct import Obo, Reference, Synonym, Term
11
- from ..struct.typedef import enables, has_member
11
+ from ..struct.typedef import enables, has_member, term_replaced_by
12
12
  from ..utils.path import ensure_path
13
13
 
14
14
  __all__ = [
@@ -93,12 +93,29 @@ def get_terms(version: str, force: bool = False) -> Iterable[Term]:
93
93
 
94
94
  database_path = ensure_path(PREFIX, url=EXPASY_DATABASE_URL, version=version)
95
95
  with open(database_path) as file:
96
- _data = get_database(file)
96
+ id_to_data = get_database(file)
97
97
 
98
98
  ec2go = get_ec2go(version=version)
99
99
 
100
100
  ec_code_to_alt_ids = {}
101
- for ec_code, data in _data.items():
101
+ for ec_code, data in id_to_data.items():
102
+ if data.get("deleted"):
103
+ terms[ec_code] = Term(
104
+ reference=Reference(prefix=PREFIX, identifier=ec_code), is_obsolete=True
105
+ )
106
+ continue
107
+
108
+ transfer_ids = data.get("transfer_id")
109
+ if transfer_ids:
110
+ term = terms[ec_code] = Term(
111
+ reference=Reference(prefix=PREFIX, identifier=ec_code), is_obsolete=True
112
+ )
113
+ for transfer_id in transfer_ids:
114
+ term.append_relationship(
115
+ term_replaced_by, Reference(prefix=PREFIX, identifier=transfer_id)
116
+ )
117
+ continue
118
+
102
119
  parent_ec_code = data["parent"]["identifier"]
103
120
  parent_term = terms[parent_ec_code]
104
121
 
@@ -210,7 +227,7 @@ def get_database(lines: Iterable[str]) -> Mapping:
210
227
  for groups in _group_by_id(lines):
211
228
  _, expasy_id = groups[0]
212
229
 
213
- rv[expasy_id] = ec_data_entry = {
230
+ ec_data_entry: Dict[str, Any] = {
214
231
  "concept": {
215
232
  "namespace": PREFIX,
216
233
  "identifier": expasy_id,
@@ -230,10 +247,10 @@ def get_database(lines: Iterable[str]) -> Mapping:
230
247
  if descriptor == "//":
231
248
  continue
232
249
  elif descriptor == DE and value == "Deleted entry.":
233
- continue
250
+ ec_data_entry["deleted"] = True
234
251
  elif descriptor == DE and value.startswith("Transferred entry: "):
235
- value = value[len("Transferred entry: ") :].rstrip()
236
- ec_data_entry["transfer_id"] = value
252
+ value = value[len("Transferred entry: ") :].rstrip().rstrip(".")
253
+ ec_data_entry["transfer_id"] = value.split(" and ")
237
254
  elif descriptor == DE:
238
255
  ec_data_entry["concept"]["name"] = value.rstrip(".") # type:ignore
239
256
  elif descriptor == AN:
@@ -259,11 +276,7 @@ def get_database(lines: Iterable[str]) -> Mapping:
259
276
  )
260
277
  )
261
278
 
262
- for expasy_id, data in rv.items():
263
- transfer_id = data.pop("transfer_id", None)
264
- if transfer_id is not None:
265
- rv[expasy_id]["alt_ids"].append(transfer_id) # type:ignore
266
-
279
+ rv[expasy_id] = ec_data_entry
267
280
  return rv
268
281
 
269
282
 
@@ -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