pyobo 0.12.6__tar.gz → 0.12.8__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 (208) hide show
  1. {pyobo-0.12.6 → pyobo-0.12.8}/PKG-INFO +1 -1
  2. {pyobo-0.12.6 → pyobo-0.12.8}/pyproject.toml +2 -2
  3. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/__init__.py +4 -0
  4. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/api/__init__.py +2 -1
  5. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/api/embedding.py +26 -1
  6. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/__init__.py +2 -0
  7. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/chembl/chembl_target.py +1 -1
  8. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/iana_media_type.py +65 -9
  9. pyobo-0.12.8/src/pyobo/sources/iconclass.py +55 -0
  10. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/struct/functional/obo_to_functional.py +9 -3
  11. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/struct/obograph/export.py +8 -2
  12. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/struct/struct.py +12 -0
  13. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/struct/struct_utils.py +17 -3
  14. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/struct/typedef.py +1 -0
  15. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/version.py +1 -1
  16. {pyobo-0.12.6 → pyobo-0.12.8}/LICENSE +0 -0
  17. {pyobo-0.12.6 → pyobo-0.12.8}/README.md +0 -0
  18. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/.DS_Store +0 -0
  19. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/__main__.py +0 -0
  20. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/api/alts.py +0 -0
  21. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/api/combine.py +0 -0
  22. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/api/edges.py +0 -0
  23. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/api/hierarchy.py +0 -0
  24. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/api/metadata.py +0 -0
  25. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/api/names.py +0 -0
  26. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/api/properties.py +0 -0
  27. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/api/relations.py +0 -0
  28. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/api/species.py +0 -0
  29. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/api/typedefs.py +0 -0
  30. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/api/utils.py +0 -0
  31. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/api/xrefs.py +0 -0
  32. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/cli/__init__.py +0 -0
  33. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/cli/cli.py +0 -0
  34. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/cli/database.py +0 -0
  35. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/cli/database_utils.py +0 -0
  36. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/cli/lookup.py +0 -0
  37. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/cli/utils.py +0 -0
  38. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/constants.py +0 -0
  39. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/getters.py +0 -0
  40. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/gilda_utils.py +0 -0
  41. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/identifier_utils/__init__.py +0 -0
  42. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/identifier_utils/api.py +0 -0
  43. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/identifier_utils/relations/__init__.py +0 -0
  44. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/identifier_utils/relations/api.py +0 -0
  45. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/identifier_utils/relations/data.json +0 -0
  46. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/identifier_utils/relations/data_owl.json +0 -0
  47. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/identifier_utils/relations/data_rdf.json +0 -0
  48. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/identifier_utils/relations/data_rdfs.json +0 -0
  49. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/mocks.py +0 -0
  50. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/ner/__init__.py +0 -0
  51. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/ner/api.py +0 -0
  52. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/ner/normalizer.py +0 -0
  53. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/plugins.py +0 -0
  54. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/py.typed +0 -0
  55. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/resource_utils.py +0 -0
  56. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/resources/__init__.py +0 -0
  57. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/resources/ncbitaxon.py +0 -0
  58. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/resources/ncbitaxon.tsv.gz +0 -0
  59. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/resources/ro.py +0 -0
  60. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/resources/ro.tsv +0 -0
  61. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/resources/so.py +0 -0
  62. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/resources/so.tsv +0 -0
  63. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/README.md +0 -0
  64. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/agrovoc.py +0 -0
  65. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/antibodyregistry.py +0 -0
  66. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/bigg/__init__.py +0 -0
  67. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/bigg/bigg_compartment.py +0 -0
  68. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/bigg/bigg_metabolite.py +0 -0
  69. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/bigg/bigg_model.py +0 -0
  70. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/bigg/bigg_reaction.py +0 -0
  71. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/biogrid.py +0 -0
  72. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/ccle.py +0 -0
  73. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/cgnc.py +0 -0
  74. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/chebi.py +0 -0
  75. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/chembl/__init__.py +0 -0
  76. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/chembl/chembl_cell.py +0 -0
  77. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/chembl/chembl_compound.py +0 -0
  78. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/chembl/chembl_mechanism.py +0 -0
  79. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/chembl/chembl_tissue.py +0 -0
  80. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/civic_gene.py +0 -0
  81. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/clinicaltrials.py +0 -0
  82. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/complexportal.py +0 -0
  83. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/conso.py +0 -0
  84. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/cpt.py +0 -0
  85. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/credit.py +0 -0
  86. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/cvx.py +0 -0
  87. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/depmap.py +0 -0
  88. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/dictybase_gene.py +0 -0
  89. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/drugbank/__init__.py +0 -0
  90. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/drugbank/drugbank.py +0 -0
  91. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/drugbank/drugbank_salt.py +0 -0
  92. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/drugcentral.py +0 -0
  93. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/expasy.py +0 -0
  94. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/famplex.py +0 -0
  95. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/flybase.py +0 -0
  96. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/gard.py +0 -0
  97. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/geonames/__init__.py +0 -0
  98. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/geonames/features.py +0 -0
  99. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/geonames/geonames.py +0 -0
  100. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/geonames/utils.py +0 -0
  101. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/gmt_utils.py +0 -0
  102. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/go.py +0 -0
  103. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/gtdb.py +0 -0
  104. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/gwascentral/__init__.py +0 -0
  105. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/gwascentral/gwascentral_phenotype.py +0 -0
  106. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/gwascentral/gwascentral_study.py +0 -0
  107. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/hgnc/__init__.py +0 -0
  108. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/hgnc/hgnc.py +0 -0
  109. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/hgnc/hgncgenefamily.py +0 -0
  110. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/icd/__init__.py +0 -0
  111. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/icd/icd10.py +0 -0
  112. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/icd/icd11.py +0 -0
  113. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/icd/icd_utils.py +0 -0
  114. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/intact.py +0 -0
  115. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/interpro.py +0 -0
  116. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/itis.py +0 -0
  117. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/kegg/__init__.py +0 -0
  118. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/kegg/api.py +0 -0
  119. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/kegg/genes.py +0 -0
  120. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/kegg/genome.py +0 -0
  121. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/kegg/pathway.py +0 -0
  122. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/mesh.py +0 -0
  123. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/mgi.py +0 -0
  124. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/mirbase/__init__.py +0 -0
  125. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/mirbase/mirbase.py +0 -0
  126. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/mirbase/mirbase_constants.py +0 -0
  127. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/mirbase/mirbase_family.py +0 -0
  128. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/mirbase/mirbase_mature.py +0 -0
  129. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/msigdb.py +0 -0
  130. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/ncbi/__init__.py +0 -0
  131. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/ncbi/ncbi_gc.py +0 -0
  132. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/ncbi/ncbigene.py +0 -0
  133. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/nih_reporter.py +0 -0
  134. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/nlm/__init__.py +0 -0
  135. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/nlm/nlm_catalog.py +0 -0
  136. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/nlm/nlm_publisher.py +0 -0
  137. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/nlm/utils.py +0 -0
  138. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/npass.py +0 -0
  139. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/omim_ps.py +0 -0
  140. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/pathbank.py +0 -0
  141. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/pfam/__init__.py +0 -0
  142. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/pfam/pfam.py +0 -0
  143. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/pfam/pfam_clan.py +0 -0
  144. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/pharmgkb/__init__.py +0 -0
  145. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/pharmgkb/pharmgkb_chemical.py +0 -0
  146. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/pharmgkb/pharmgkb_disease.py +0 -0
  147. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/pharmgkb/pharmgkb_gene.py +0 -0
  148. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/pharmgkb/pharmgkb_pathway.py +0 -0
  149. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/pharmgkb/pharmgkb_variant.py +0 -0
  150. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/pharmgkb/utils.py +0 -0
  151. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/pid.py +0 -0
  152. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/pombase.py +0 -0
  153. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/pubchem.py +0 -0
  154. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/reactome.py +0 -0
  155. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/rgd.py +0 -0
  156. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/rhea.py +0 -0
  157. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/ror.py +0 -0
  158. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/selventa/__init__.py +0 -0
  159. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/selventa/schem.py +0 -0
  160. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/selventa/scomp.py +0 -0
  161. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/selventa/sdis.py +0 -0
  162. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/selventa/sfam.py +0 -0
  163. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/sgd.py +0 -0
  164. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/signor/__init__.py +0 -0
  165. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/signor/download.py +0 -0
  166. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/signor/signor_complexes.py +0 -0
  167. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/slm.py +0 -0
  168. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/spdx.py +0 -0
  169. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/umls/__init__.py +0 -0
  170. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/umls/__main__.py +0 -0
  171. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/umls/get_synonym_types.py +0 -0
  172. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/umls/sty.py +0 -0
  173. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/umls/synonym_types.tsv +0 -0
  174. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/umls/umls.py +0 -0
  175. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/unimod.py +0 -0
  176. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/uniprot/__init__.py +0 -0
  177. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/uniprot/uniprot.py +0 -0
  178. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/uniprot/uniprot_ptm.py +0 -0
  179. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/utils.py +0 -0
  180. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/wikipathways.py +0 -0
  181. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/sources/zfin.py +0 -0
  182. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/ssg/__init__.py +0 -0
  183. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/ssg/base.html +0 -0
  184. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/ssg/index.html +0 -0
  185. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/ssg/term.html +0 -0
  186. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/ssg/typedef.html +0 -0
  187. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/struct/__init__.py +0 -0
  188. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/struct/functional/__init__.py +0 -0
  189. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/struct/functional/dsl.py +0 -0
  190. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/struct/functional/macros.py +0 -0
  191. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/struct/functional/ontology.py +0 -0
  192. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/struct/functional/utils.py +0 -0
  193. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/struct/obo/__init__.py +0 -0
  194. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/struct/obo/reader.py +0 -0
  195. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/struct/obo/reader_utils.py +0 -0
  196. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/struct/obograph/__init__.py +0 -0
  197. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/struct/obograph/reader.py +0 -0
  198. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/struct/obograph/utils.py +0 -0
  199. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/struct/reference.py +0 -0
  200. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/struct/utils.py +0 -0
  201. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/struct/vocabulary.py +0 -0
  202. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/utils/__init__.py +0 -0
  203. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/utils/cache.py +0 -0
  204. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/utils/io.py +0 -0
  205. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/utils/iter.py +0 -0
  206. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/utils/misc.py +0 -0
  207. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/utils/ndex_utils.py +0 -0
  208. {pyobo-0.12.6 → pyobo-0.12.8}/src/pyobo/utils/path.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyobo
3
- Version: 0.12.6
3
+ Version: 0.12.8
4
4
  Summary: A python package for handling and generating OBO
5
5
  Keywords: snekpack,cookiecutter,ontologies,biomedical ontologies,life sciences,natural sciences,bioinformatics,cheminformatics,Open Biomedical Ontologies,OBO
6
6
  Author: Charles Tapley Hoyt
@@ -4,7 +4,7 @@ build-backend = "uv_build"
4
4
 
5
5
  [project]
6
6
  name = "pyobo"
7
- version = "0.12.6"
7
+ version = "0.12.8"
8
8
  description = "A python package for handling and generating OBO"
9
9
  readme = "README.md"
10
10
  authors = [
@@ -296,7 +296,7 @@ known-first-party = [
296
296
  docstring-code-format = true
297
297
 
298
298
  [tool.bumpversion]
299
- current_version = "0.12.6"
299
+ current_version = "0.12.8"
300
300
  parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)(?:-(?P<release>[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?(?:\\+(?P<build>[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?"
301
301
  serialize = [
302
302
  "{major}.{minor}.{patch}-{release}+{build}",
@@ -50,6 +50,7 @@ from .api import (
50
50
  get_synonyms,
51
51
  get_text_embedding,
52
52
  get_text_embedding_similarity,
53
+ get_text_embeddings_df,
53
54
  get_typedef_df,
54
55
  get_xref,
55
56
  get_xrefs,
@@ -65,6 +66,7 @@ from .plugins import (
65
66
  run_nomenclature_plugin,
66
67
  )
67
68
  from .struct import (
69
+ Annotation,
68
70
  Obo,
69
71
  Reference,
70
72
  StanzaType,
@@ -80,6 +82,7 @@ from .utils.path import ensure_path
80
82
  from .version import get_version
81
83
 
82
84
  __all__ = [
85
+ "Annotation",
83
86
  "Obo",
84
87
  "Reference",
85
88
  "StanzaType",
@@ -143,6 +146,7 @@ __all__ = [
143
146
  "get_synonyms",
144
147
  "get_text_embedding",
145
148
  "get_text_embedding_similarity",
149
+ "get_text_embeddings_df",
146
150
  "get_typedef_df",
147
151
  "get_version",
148
152
  "get_xref",
@@ -8,7 +8,7 @@ from .alts import (
8
8
  )
9
9
  from .combine import get_literal_mappings_subset
10
10
  from .edges import get_edges, get_edges_df, get_graph
11
- from .embedding import get_text_embedding, get_text_embedding_similarity
11
+ from .embedding import get_text_embedding, get_text_embedding_similarity, get_text_embeddings_df
12
12
  from .hierarchy import (
13
13
  get_ancestors,
14
14
  get_children,
@@ -119,6 +119,7 @@ __all__ = [
119
119
  "get_synonyms",
120
120
  "get_text_embedding",
121
121
  "get_text_embedding_similarity",
122
+ "get_text_embeddings_df",
122
123
  "get_typedef_df",
123
124
  "get_version",
124
125
  "get_xref",
@@ -6,8 +6,9 @@ from typing import TYPE_CHECKING
6
6
 
7
7
  import curies
8
8
  import numpy as np
9
+ import pandas as pd
9
10
 
10
- from pyobo.api.names import get_definition, get_name
11
+ from pyobo.api.names import get_definition, get_name, get_references
11
12
 
12
13
  if TYPE_CHECKING:
13
14
  import sentence_transformers
@@ -16,6 +17,7 @@ __all__ = [
16
17
  "get_text_embedding",
17
18
  "get_text_embedding_model",
18
19
  "get_text_embedding_similarity",
20
+ "get_text_embeddings_df",
19
21
  ]
20
22
 
21
23
 
@@ -39,6 +41,29 @@ def _get_text(
39
41
  return name
40
42
 
41
43
 
44
+ def get_text_embeddings_df(
45
+ prefix: str,
46
+ *,
47
+ model: sentence_transformers.SentenceTransformer | None = None,
48
+ ) -> pd.DataFrame:
49
+ """Get embeddings for all entities in the resource.
50
+
51
+ :param prefix: A reference, either as a string or Reference object
52
+ :param model: A sentence transformer model. Defaults to ``all-MiniLM-L6-v2`` if not given.
53
+ """
54
+ luids, texts = [], []
55
+ for reference in get_references(prefix):
56
+ text = _get_text(reference)
57
+ if text is None:
58
+ continue
59
+ luids.append(reference.identifier)
60
+ texts.append(text)
61
+ if model is None:
62
+ model = get_text_embedding_model()
63
+ res = model.encode(texts)
64
+ return pd.DataFrame(res, index=luids)
65
+
66
+
42
67
  def get_text_embedding(
43
68
  reference: str | curies.Reference | curies.ReferenceTuple,
44
69
  *,
@@ -34,6 +34,7 @@ from .gwascentral import GWASCentralPhenotypeGetter, GWASCentralStudyGetter
34
34
  from .hgnc import HGNCGetter, HGNCGroupGetter
35
35
  from .iana_media_type import IANAGetter
36
36
  from .icd import ICD10Getter, ICD11Getter
37
+ from .iconclass import IconclassGetter
37
38
  from .intact import IntactGetter
38
39
  from .interpro import InterProGetter
39
40
  from .itis import ITISGetter
@@ -115,6 +116,7 @@ __all__ = [
115
116
  "ICD10Getter",
116
117
  "ICD11Getter",
117
118
  "ITISGetter",
119
+ "IconclassGetter",
118
120
  "IntactGetter",
119
121
  "InterProGetter",
120
122
  "KEGGGeneGetter",
@@ -138,7 +138,7 @@ def iter_terms(version: str) -> Iterable[Term]:
138
138
  def get_chembl_protein_equivalences(version: str | None = None) -> dict[str, list[str]]:
139
139
  """Get ChEMBL protein equivalences."""
140
140
  if version is None:
141
- version = chembl_downloader.latest()
141
+ version = chembl_downloader.latest(full=False)
142
142
  url = f"ftp://ftp.ebi.ac.uk/pub/databases/chembl/ChEMBLdb/releases/chembl_{version}/chembl_uniprot_mapping.txt"
143
143
  df = ensure_df(
144
144
  PREFIX,
@@ -5,14 +5,18 @@
5
5
 
6
6
  from collections.abc import Iterable
7
7
 
8
- from pyobo import Obo, Reference, Term, default_reference
9
- from pyobo.struct.typedef import term_replaced_by
8
+ import requests
9
+
10
+ from pyobo import Obo, Reference, Term, TypeDef, default_reference
11
+ from pyobo.struct import Annotation
12
+ from pyobo.struct.typedef import has_source, term_replaced_by
10
13
  from pyobo.utils.path import ensure_df
11
14
 
12
15
  __all__ = ["IANAGetter"]
13
16
 
14
17
  PREFIX = "iana.mediatype"
15
- ROOT = Term.from_triple(prefix="dcterms", identifier="MediaType", name="media type")
18
+ ROOT_MEDIA_TYPE = Term.from_triple(prefix="dcterms", identifier="MediaType", name="media type")
19
+ ROOT_FILE_FORMAT = Term.from_triple(prefix="dcterms", identifier="FileFormat", name="file format")
16
20
 
17
21
  #: The top-level types listed on https://www.iana.org/assignments/media-types/media-types.xhtml
18
22
  MEDIA_TYPE_GROUPS = [
@@ -31,13 +35,37 @@ MEDIA_TYPE_GROUPS = [
31
35
  GROUP_TO_CSV = {
32
36
  media_type_group: (
33
37
  f"https://www.iana.org/assignments/media-types/{media_type_group}.csv",
34
- Term(reference=default_reference(PREFIX, media_type_group, media_type_group)).append_parent(
35
- ROOT
36
- ),
38
+ Term(
39
+ reference=Reference(prefix=PREFIX, identifier=media_type_group, name=media_type_group)
40
+ ).append_parent(ROOT_MEDIA_TYPE),
37
41
  )
38
42
  for media_type_group in MEDIA_TYPE_GROUPS
39
43
  }
40
44
 
45
+ MIMETYPE_IO_URL = (
46
+ "https://github.com/patrickmccallum/mimetype-io/raw/refs/heads/master/src/mimeData.json"
47
+ )
48
+
49
+
50
+ def _get_mimetypes():
51
+ records = requests.get(MIMETYPE_IO_URL, timeout=5).json()
52
+ rv = {}
53
+ for record in records:
54
+ name = record.pop("name")
55
+ rv[name] = record
56
+ return rv
57
+
58
+
59
+ PREDICATE = TypeDef(
60
+ reference=default_reference(
61
+ prefix=PREFIX, identifier="extension", name="appears with file extension"
62
+ ),
63
+ domain=ROOT_MEDIA_TYPE.reference,
64
+ range=ROOT_FILE_FORMAT.reference,
65
+ definition="Connects a media type with a file format that has been observed to encode it",
66
+ is_metadata_tag=True,
67
+ )
68
+
41
69
 
42
70
  class IANAGetter(Obo):
43
71
  """An ontology representation of IANA media types (i.e. MIME types)."""
@@ -45,9 +73,10 @@ class IANAGetter(Obo):
45
73
  ontology = bioregistry_key = PREFIX
46
74
  name = "IANA Media Types"
47
75
  dynamic_version = True
48
- root_terms = [t.reference for _, (_, t) in sorted(GROUP_TO_CSV.items())]
76
+ root_terms = [ROOT_MEDIA_TYPE.reference, ROOT_FILE_FORMAT.reference]
49
77
  typedefs = [
50
78
  term_replaced_by,
79
+ PREDICATE,
51
80
  ]
52
81
 
53
82
  def iter_terms(self, force: bool = False) -> Iterable[Term]:
@@ -55,26 +84,53 @@ class IANAGetter(Obo):
55
84
  return get_terms()
56
85
 
57
86
 
58
- def get_terms() -> list[Term]:
87
+ def get_terms() -> Iterable[Term]:
59
88
  """Get IANA Media Type terms."""
89
+ mimetypes_data = _get_mimetypes()
90
+
91
+ filetype_to_term = {}
92
+ for record in mimetypes_data.values():
93
+ for filetype_str in record.get("fileTypes", []):
94
+ filetype_id = filetype_str.removeprefix(".")
95
+ filetype_term = Term(
96
+ reference=default_reference(PREFIX, identifier=filetype_id, name=filetype_str),
97
+ type="Instance",
98
+ )
99
+ filetype_term.append_parent(ROOT_FILE_FORMAT)
100
+ filetype_term.annotate_string(has_source, MIMETYPE_IO_URL)
101
+ filetype_to_term[filetype_str] = filetype_term
102
+ yield filetype_term
103
+
60
104
  terms: dict[str, Term] = {}
61
105
  forwards: dict[Term, str] = {}
62
106
  for key, (url, parent) in GROUP_TO_CSV.items():
63
107
  df = ensure_df(PREFIX, url=url, sep=",")
64
108
  terms[key] = parent
65
109
  for name, identifier, references in df.values:
110
+ mimetypes_record = mimetypes_data.get(identifier, {})
111
+
66
112
  if "OBSOLE" in name or "DEPRECATED" in name:
67
113
  is_obsolete = True
68
114
  else:
69
115
  is_obsolete = None
116
+
70
117
  term = Term(
71
118
  reference=Reference(prefix=PREFIX, identifier=identifier, name=name),
72
119
  is_obsolete=is_obsolete,
120
+ # TODO how to add definition source?
121
+ definition=mimetypes_record.get("description"),
73
122
  ).append_parent(parent)
74
123
  for reference in _process_references(references):
75
124
  term.append_see_also_uri(reference)
76
125
  terms[identifier.casefold()] = term
77
126
 
127
+ for filetype_str in mimetypes_record.get("fileTypes", []):
128
+ term.annotate_object(
129
+ PREDICATE,
130
+ filetype_to_term[filetype_str],
131
+ annotations=[Annotation.uri(has_source, MIMETYPE_IO_URL)],
132
+ )
133
+
78
134
  if "in favor of" in name:
79
135
  _, _, new = name.partition("in favor of ")
80
136
  forwards[term] = new.casefold().strip().rstrip(")").strip()
@@ -84,7 +140,7 @@ def get_terms() -> list[Term]:
84
140
  new = "application/vnd.afpc.afplinedata"
85
141
  old.append_replaced_by(terms[new].reference)
86
142
 
87
- return list(terms.values())
143
+ yield from terms.values()
88
144
 
89
145
 
90
146
  def _process_references(cell: str) -> list[str]:
@@ -0,0 +1,55 @@
1
+ """Get ICONCLASS as OBO."""
2
+
3
+ from collections.abc import Iterable
4
+ from urllib.parse import quote
5
+
6
+ import pandas as pd
7
+
8
+ from pyobo.struct import Obo, Term
9
+ from pyobo.utils.path import ensure_df
10
+
11
+ __all__ = [
12
+ "IconclassGetter",
13
+ ]
14
+
15
+ PREFIX = "iconclass"
16
+ BASE_URL = "https://github.com/iconclass/data/raw/refs/heads/main/txt/en/txt_en_{}.txt"
17
+ URLS = [
18
+ BASE_URL.format("0_1"),
19
+ BASE_URL.format("2_3"),
20
+ BASE_URL.format("4"),
21
+ BASE_URL.format("5_6_7_8"),
22
+ BASE_URL.format("9"),
23
+ BASE_URL.format("keys"),
24
+ # shakespeare
25
+ ]
26
+
27
+
28
+ def get_df() -> pd.DataFrame:
29
+ """Get an ICONCLASS terms dataframe."""
30
+ df = pd.concat(
31
+ ensure_df(prefix=PREFIX, url=url, sep="|", names=["luid", "name"]) for url in URLS
32
+ )
33
+ return df
34
+
35
+
36
+ def iter_terms() -> Iterable[Term]:
37
+ """Iterate over terms in ICONCLASS."""
38
+ for luid, name in get_df().values:
39
+ yv = Term.from_triple(prefix=PREFIX, identifier=quote(luid), name=name)
40
+ yield yv
41
+
42
+
43
+ class IconclassGetter(Obo):
44
+ """An ontology representation of ICONCLASS."""
45
+
46
+ ontology = PREFIX
47
+ dynamic_version = True
48
+
49
+ def iter_terms(self, force: bool = False) -> Iterable[Term]:
50
+ """Iterate over terms in the ontology."""
51
+ return iter_terms()
52
+
53
+
54
+ if __name__ == "__main__":
55
+ IconclassGetter.cli()
@@ -39,9 +39,15 @@ def get_ofn_from_obo(
39
39
  prefix = obo_ontology.ontology
40
40
  base = f"{_BASE}/{prefix}"
41
41
  if iri is None:
42
- iri = f"{base}/{prefix}.ofn"
43
- if version_iri is None and obo_ontology.data_version:
44
- version_iri = f"{base}/{obo_ontology.data_version}/{prefix}.ofn"
42
+ if obo_ontology.ontology_iri:
43
+ iri = obo_ontology.ontology_iri
44
+ else:
45
+ iri = f"{base}/{prefix}.ofn"
46
+ if version_iri is None:
47
+ if obo_ontology.ontology_version_iri:
48
+ version_iri = obo_ontology.ontology_version_iri
49
+ elif obo_ontology.data_version:
50
+ version_iri = f"{base}/{obo_ontology.data_version}/{prefix}.ofn"
45
51
  ofn_ontology = Ontology(
46
52
  iri=iri,
47
53
  version_iri=version_iri,
@@ -70,8 +70,12 @@ def to_parsed_obograph(obo: Obo) -> og.StandardizedGraphDocument:
70
70
 
71
71
 
72
72
  def _to_parsed_graph(obo: Obo) -> og.StandardizedGraph:
73
+ if obo.ontology_iri:
74
+ ontology_iri = obo.ontology_iri
75
+ else:
76
+ ontology_iri = f"http://purl.obolibrary.org/obo/{obo.ontology}.owl"
73
77
  return og.StandardizedGraph(
74
- id=f"http://purl.obolibrary.org/obo/{obo.ontology}.owl",
78
+ id=ontology_iri,
75
79
  meta=_get_meta(obo),
76
80
  nodes=_get_nodes(obo),
77
81
  edges=_get_edges(obo),
@@ -167,7 +171,9 @@ def _get_meta(obo: Obo) -> og.StandardizedMeta | None:
167
171
  )
168
172
  )
169
173
 
170
- if obo.data_version:
174
+ if obo.ontology_version_iri:
175
+ version_iri = obo.ontology_version_iri
176
+ elif obo.data_version:
171
177
  version_iri = (
172
178
  f"http://purl.obolibrary.org/obo/{obo.ontology}/{obo.data_version}/{obo.ontology}.owl"
173
179
  )
@@ -594,6 +594,10 @@ class Obo:
594
594
 
595
595
  imports: ClassVar[list[str] | None] = None
596
596
 
597
+ ontology_iri: ClassVar[str | None] = None
598
+
599
+ ontology_version_iri: ClassVar[str | None] = None
600
+
597
601
  def __post_init__(self):
598
602
  """Run post-init checks."""
599
603
  if self.ontology is None:
@@ -2319,6 +2323,8 @@ def build_ontology(
2319
2323
  mailing_list: str | None = None,
2320
2324
  logo: str | None = None,
2321
2325
  repository: str | None = None,
2326
+ ontology_iri: str | None = None,
2327
+ ontology_version_iri: str | None = None,
2322
2328
  ) -> Obo:
2323
2329
  """Build an ontology from parts."""
2324
2330
  if name is None:
@@ -2378,6 +2384,8 @@ def build_ontology(
2378
2384
  _subsetdefs=subsetdefs,
2379
2385
  _property_values=properties,
2380
2386
  _imports=imports,
2387
+ _ontology_iri=ontology_iri,
2388
+ _ontology_version_iri=ontology_version_iri,
2381
2389
  terms=terms,
2382
2390
  )
2383
2391
 
@@ -2395,6 +2403,8 @@ def make_ad_hoc_ontology(
2395
2403
  _subsetdefs: list[tuple[Reference, str]] | None = None,
2396
2404
  _property_values: list[Annotation] | None = None,
2397
2405
  _imports: list[str] | None = None,
2406
+ _ontology_iri: str | None = None,
2407
+ _ontology_version_iri: str | None = None,
2398
2408
  *,
2399
2409
  terms: list[Term] | None = None,
2400
2410
  ) -> Obo:
@@ -2413,6 +2423,8 @@ def make_ad_hoc_ontology(
2413
2423
  subsetdefs = _subsetdefs
2414
2424
  property_values = _property_values
2415
2425
  imports = _imports
2426
+ ontology_iri = _ontology_iri
2427
+ ontology_version_iri = _ontology_version_iri
2416
2428
 
2417
2429
  def __post_init__(self):
2418
2430
  self.date = _date
@@ -59,18 +59,32 @@ class Annotation(NamedTuple):
59
59
  value: Reference | OBOLiteral
60
60
 
61
61
  @classmethod
62
- def float(cls, predicate: Reference, value: float) -> Self:
62
+ def float(cls, predicate: Reference | TypeDef, value: float) -> Self:
63
63
  """Return a literal property for a float."""
64
+ from .struct import TypeDef
65
+
66
+ if isinstance(predicate, TypeDef):
67
+ predicate = predicate.reference
64
68
  return cls(predicate, OBOLiteral.float(value))
65
69
 
66
70
  @classmethod
67
- def uri(cls, predicate: Reference, uri: str) -> Self:
71
+ def uri(cls, predicate: Reference | TypeDef, uri: str) -> Self:
68
72
  """Return a literal property for a URI."""
73
+ from .struct import TypeDef
74
+
75
+ if isinstance(predicate, TypeDef):
76
+ predicate = predicate.reference
69
77
  return cls(predicate, OBOLiteral.uri(uri))
70
78
 
71
79
  @classmethod
72
- def string(cls, predicate: Reference, value: str, *, language: str | None = None) -> Self:
80
+ def string(
81
+ cls, predicate: Reference | TypeDef, value: str, *, language: str | None = None
82
+ ) -> Self:
73
83
  """Return a literal property for a float."""
84
+ from .struct import TypeDef
85
+
86
+ if isinstance(predicate, TypeDef):
87
+ predicate = predicate.reference
74
88
  return cls(predicate, OBOLiteral.string(value, language=language))
75
89
 
76
90
  @staticmethod
@@ -135,6 +135,7 @@ rdf_type = TypeDef(reference=v.rdf_type)
135
135
  subproperty_of = TypeDef(reference=v.subproperty_of)
136
136
  see_also = TypeDef(reference=v.see_also, is_metadata_tag=True)
137
137
  comment = TypeDef(reference=v.comment, is_metadata_tag=True)
138
+ label = TypeDef(reference=v.label, is_metadata_tag=True)
138
139
  has_member = TypeDef(
139
140
  reference=Reference(prefix=RO_PREFIX, identifier="0002351", name="has member"),
140
141
  )
@@ -12,7 +12,7 @@ __all__ = [
12
12
  "get_version",
13
13
  ]
14
14
 
15
- VERSION = "0.12.6"
15
+ VERSION = "0.12.8"
16
16
 
17
17
 
18
18
  def get_git_hash() -> str:
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes