pyobo 0.12.2__tar.gz → 0.12.3__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 (202) hide show
  1. {pyobo-0.12.2 → pyobo-0.12.3}/PKG-INFO +3 -2
  2. {pyobo-0.12.2 → pyobo-0.12.3}/pyproject.toml +4 -3
  3. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/__init__.py +12 -4
  4. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/getters.py +10 -3
  5. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/identifier_utils/__init__.py +2 -0
  6. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/identifier_utils/api.py +3 -2
  7. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/__init__.py +2 -0
  8. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/drugbank/drugbank.py +1 -1
  9. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/gwascentral/gwascentral_study.py +1 -1
  10. pyobo-0.12.3/src/pyobo/sources/intact.py +79 -0
  11. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/struct/__init__.py +2 -1
  12. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/struct/functional/ontology.py +2 -2
  13. pyobo-0.12.3/src/pyobo/struct/obo/__init__.py +9 -0
  14. {pyobo-0.12.2/src/pyobo → pyobo-0.12.3/src/pyobo/struct/obo}/reader.py +21 -18
  15. pyobo-0.12.3/src/pyobo/struct/obograph/__init__.py +16 -0
  16. pyobo-0.12.3/src/pyobo/struct/obograph/export.py +315 -0
  17. pyobo-0.12.3/src/pyobo/struct/obograph/reader.py +242 -0
  18. pyobo-0.12.3/src/pyobo/struct/obograph/utils.py +47 -0
  19. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/struct/struct.py +13 -23
  20. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/struct/struct_utils.py +22 -14
  21. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/struct/typedef.py +4 -0
  22. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/struct/vocabulary.py +7 -0
  23. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/version.py +1 -1
  24. pyobo-0.12.2/src/pyobo/obographs.py +0 -152
  25. {pyobo-0.12.2 → pyobo-0.12.3}/LICENSE +0 -0
  26. {pyobo-0.12.2 → pyobo-0.12.3}/README.md +0 -0
  27. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/.DS_Store +0 -0
  28. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/__main__.py +0 -0
  29. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/api/__init__.py +0 -0
  30. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/api/alts.py +0 -0
  31. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/api/combine.py +0 -0
  32. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/api/edges.py +0 -0
  33. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/api/hierarchy.py +0 -0
  34. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/api/metadata.py +0 -0
  35. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/api/names.py +0 -0
  36. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/api/properties.py +0 -0
  37. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/api/relations.py +0 -0
  38. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/api/species.py +0 -0
  39. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/api/typedefs.py +0 -0
  40. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/api/utils.py +0 -0
  41. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/api/xrefs.py +0 -0
  42. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/cli/__init__.py +0 -0
  43. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/cli/cli.py +0 -0
  44. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/cli/database.py +0 -0
  45. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/cli/database_utils.py +0 -0
  46. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/cli/lookup.py +0 -0
  47. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/cli/utils.py +0 -0
  48. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/constants.py +0 -0
  49. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/gilda_utils.py +0 -0
  50. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/identifier_utils/relations/__init__.py +0 -0
  51. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/identifier_utils/relations/api.py +0 -0
  52. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/identifier_utils/relations/data.json +0 -0
  53. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/identifier_utils/relations/data_owl.json +0 -0
  54. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/identifier_utils/relations/data_rdf.json +0 -0
  55. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/identifier_utils/relations/data_rdfs.json +0 -0
  56. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/mocks.py +0 -0
  57. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/ner/__init__.py +0 -0
  58. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/ner/api.py +0 -0
  59. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/ner/normalizer.py +0 -0
  60. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/plugins.py +0 -0
  61. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/py.typed +0 -0
  62. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/resource_utils.py +0 -0
  63. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/resources/__init__.py +0 -0
  64. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/resources/ncbitaxon.py +0 -0
  65. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/resources/ncbitaxon.tsv.gz +0 -0
  66. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/resources/ro.py +0 -0
  67. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/resources/ro.tsv +0 -0
  68. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/resources/so.py +0 -0
  69. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/resources/so.tsv +0 -0
  70. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/README.md +0 -0
  71. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/agrovoc.py +0 -0
  72. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/antibodyregistry.py +0 -0
  73. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/bigg/__init__.py +0 -0
  74. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/bigg/bigg_compartment.py +0 -0
  75. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/bigg/bigg_metabolite.py +0 -0
  76. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/bigg/bigg_model.py +0 -0
  77. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/bigg/bigg_reaction.py +0 -0
  78. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/biogrid.py +0 -0
  79. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/ccle.py +0 -0
  80. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/cgnc.py +0 -0
  81. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/chebi.py +0 -0
  82. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/chembl/__init__.py +0 -0
  83. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/chembl/chembl_compound.py +0 -0
  84. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/chembl/chembl_target.py +0 -0
  85. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/civic_gene.py +0 -0
  86. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/clinicaltrials.py +0 -0
  87. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/complexportal.py +0 -0
  88. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/conso.py +0 -0
  89. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/cpt.py +0 -0
  90. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/credit.py +0 -0
  91. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/cvx.py +0 -0
  92. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/depmap.py +0 -0
  93. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/dictybase_gene.py +0 -0
  94. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/drugbank/__init__.py +0 -0
  95. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/drugbank/drugbank_salt.py +0 -0
  96. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/drugcentral.py +0 -0
  97. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/expasy.py +0 -0
  98. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/famplex.py +0 -0
  99. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/flybase.py +0 -0
  100. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/gard.py +0 -0
  101. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/geonames/__init__.py +0 -0
  102. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/geonames/features.py +0 -0
  103. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/geonames/geonames.py +0 -0
  104. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/geonames/utils.py +0 -0
  105. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/gmt_utils.py +0 -0
  106. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/go.py +0 -0
  107. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/gtdb.py +0 -0
  108. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/gwascentral/__init__.py +0 -0
  109. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/gwascentral/gwascentral_phenotype.py +0 -0
  110. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/hgnc/__init__.py +0 -0
  111. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/hgnc/hgnc.py +0 -0
  112. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/hgnc/hgncgenefamily.py +0 -0
  113. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/icd/__init__.py +0 -0
  114. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/icd/icd10.py +0 -0
  115. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/icd/icd11.py +0 -0
  116. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/icd/icd_utils.py +0 -0
  117. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/interpro.py +0 -0
  118. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/itis.py +0 -0
  119. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/kegg/__init__.py +0 -0
  120. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/kegg/api.py +0 -0
  121. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/kegg/genes.py +0 -0
  122. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/kegg/genome.py +0 -0
  123. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/kegg/pathway.py +0 -0
  124. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/mesh.py +0 -0
  125. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/mgi.py +0 -0
  126. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/mirbase/__init__.py +0 -0
  127. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/mirbase/mirbase.py +0 -0
  128. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/mirbase/mirbase_constants.py +0 -0
  129. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/mirbase/mirbase_family.py +0 -0
  130. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/mirbase/mirbase_mature.py +0 -0
  131. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/msigdb.py +0 -0
  132. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/ncbi/__init__.py +0 -0
  133. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/ncbi/ncbi_gc.py +0 -0
  134. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/ncbi/ncbigene.py +0 -0
  135. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/nih_reporter.py +0 -0
  136. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/nlm/__init__.py +0 -0
  137. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/nlm/nlm_catalog.py +0 -0
  138. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/nlm/nlm_publisher.py +0 -0
  139. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/nlm/utils.py +0 -0
  140. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/npass.py +0 -0
  141. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/omim_ps.py +0 -0
  142. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/pathbank.py +0 -0
  143. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/pfam/__init__.py +0 -0
  144. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/pfam/pfam.py +0 -0
  145. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/pfam/pfam_clan.py +0 -0
  146. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/pharmgkb/__init__.py +0 -0
  147. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/pharmgkb/pharmgkb_chemical.py +0 -0
  148. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/pharmgkb/pharmgkb_disease.py +0 -0
  149. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/pharmgkb/pharmgkb_gene.py +0 -0
  150. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/pharmgkb/pharmgkb_pathway.py +0 -0
  151. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/pharmgkb/pharmgkb_variant.py +0 -0
  152. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/pharmgkb/utils.py +0 -0
  153. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/pid.py +0 -0
  154. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/pombase.py +0 -0
  155. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/pubchem.py +0 -0
  156. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/reactome.py +0 -0
  157. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/rgd.py +0 -0
  158. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/rhea.py +0 -0
  159. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/ror.py +0 -0
  160. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/selventa/__init__.py +0 -0
  161. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/selventa/schem.py +0 -0
  162. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/selventa/scomp.py +0 -0
  163. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/selventa/sdis.py +0 -0
  164. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/selventa/sfam.py +0 -0
  165. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/sgd.py +0 -0
  166. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/signor/__init__.py +0 -0
  167. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/signor/download.py +0 -0
  168. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/signor/signor_complexes.py +0 -0
  169. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/slm.py +0 -0
  170. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/umls/__init__.py +0 -0
  171. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/umls/__main__.py +0 -0
  172. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/umls/get_synonym_types.py +0 -0
  173. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/umls/sty.py +0 -0
  174. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/umls/synonym_types.tsv +0 -0
  175. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/umls/umls.py +0 -0
  176. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/unimod.py +0 -0
  177. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/uniprot/__init__.py +0 -0
  178. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/uniprot/uniprot.py +0 -0
  179. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/uniprot/uniprot_ptm.py +0 -0
  180. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/utils.py +0 -0
  181. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/wikipathways.py +0 -0
  182. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/sources/zfin.py +0 -0
  183. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/ssg/__init__.py +0 -0
  184. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/ssg/base.html +0 -0
  185. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/ssg/index.html +0 -0
  186. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/ssg/term.html +0 -0
  187. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/ssg/typedef.html +0 -0
  188. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/struct/functional/__init__.py +0 -0
  189. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/struct/functional/dsl.py +0 -0
  190. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/struct/functional/macros.py +0 -0
  191. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/struct/functional/obo_to_functional.py +0 -0
  192. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/struct/functional/utils.py +0 -0
  193. {pyobo-0.12.2/src/pyobo → pyobo-0.12.3/src/pyobo/struct/obo}/reader_utils.py +0 -0
  194. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/struct/reference.py +0 -0
  195. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/struct/utils.py +0 -0
  196. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/utils/__init__.py +0 -0
  197. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/utils/cache.py +0 -0
  198. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/utils/io.py +0 -0
  199. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/utils/iter.py +0 -0
  200. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/utils/misc.py +0 -0
  201. {pyobo-0.12.2 → pyobo-0.12.3}/src/pyobo/utils/ndex_utils.py +0 -0
  202. {pyobo-0.12.2 → pyobo-0.12.3}/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.2
3
+ Version: 0.12.3
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
@@ -45,7 +45,7 @@ Requires-Dist: zenodo-client>=0.3.6
45
45
  Requires-Dist: class-resolver>=0.6.0
46
46
  Requires-Dist: psycopg2-binary
47
47
  Requires-Dist: pydantic>=2.0
48
- Requires-Dist: curies>=0.10.13
48
+ Requires-Dist: curies>=0.10.17
49
49
  Requires-Dist: curies-processing>=0.1.0
50
50
  Requires-Dist: python-dateutil
51
51
  Requires-Dist: networkx>=3.4
@@ -56,6 +56,7 @@ Requires-Dist: clinicaltrials-downloader>=0.0.2
56
56
  Requires-Dist: nih-reporter-downloader>=0.0.1
57
57
  Requires-Dist: typing-extensions
58
58
  Requires-Dist: rdflib
59
+ Requires-Dist: obographs>=0.0.8
59
60
  Requires-Dist: ssslm[gilda] ; extra == 'gilda'
60
61
  Requires-Dist: ssslm[gilda-slim] ; extra == 'gilda-slim'
61
62
  Maintainer: Charles Tapley Hoyt
@@ -4,7 +4,7 @@ build-backend = "uv_build"
4
4
 
5
5
  [project]
6
6
  name = "pyobo"
7
- version = "0.12.2"
7
+ version = "0.12.3"
8
8
  description = "A python package for handling and generating OBO"
9
9
  readme = "README.md"
10
10
  authors = [
@@ -78,7 +78,7 @@ dependencies = [
78
78
  "class_resolver>=0.6.0",
79
79
  "psycopg2-binary",
80
80
  "pydantic>=2.0",
81
- "curies>=0.10.13",
81
+ "curies>=0.10.17",
82
82
  "curies-processing>=0.1.0",
83
83
  "python-dateutil",
84
84
  "networkx>=3.4",
@@ -90,6 +90,7 @@ dependencies = [
90
90
  "nih-reporter-downloader>=0.0.1",
91
91
  "typing_extensions",
92
92
  "rdflib",
93
+ "obographs>=0.0.8",
93
94
  ]
94
95
 
95
96
  # see https://peps.python.org/pep-0735/ and https://docs.astral.sh/uv/concepts/dependencies/#dependency-groups
@@ -289,7 +290,7 @@ known-first-party = [
289
290
  docstring-code-format = true
290
291
 
291
292
  [tool.bumpversion]
292
- current_version = "0.12.2"
293
+ current_version = "0.12.3"
293
294
  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-]+)*))?"
294
295
  serialize = [
295
296
  "{major}.{minor}.{patch}-{release}+{build}",
@@ -57,20 +57,29 @@ from .api import (
57
57
  )
58
58
  from .getters import get_ontology
59
59
  from .ner import get_grounder, ground
60
- from .obographs import parse_results_from_obo
61
60
  from .plugins import (
62
61
  has_nomenclature_plugin,
63
62
  iter_nomenclature_plugins,
64
63
  run_nomenclature_plugin,
65
64
  )
66
- from .reader import from_obo_path, from_obonet
67
- from .struct import Obo, Reference, Synonym, SynonymTypeDef, Term, TypeDef, default_reference
65
+ from .struct import (
66
+ Obo,
67
+ Reference,
68
+ StanzaType,
69
+ Synonym,
70
+ SynonymTypeDef,
71
+ Term,
72
+ TypeDef,
73
+ default_reference,
74
+ )
75
+ from .struct.obo import from_obo_path, from_obonet
68
76
  from .utils.path import ensure_path
69
77
  from .version import get_version
70
78
 
71
79
  __all__ = [
72
80
  "Obo",
73
81
  "Reference",
82
+ "StanzaType",
74
83
  "Synonym",
75
84
  "SynonymTypeDef",
76
85
  "Term",
@@ -138,6 +147,5 @@ __all__ = [
138
147
  "has_nomenclature_plugin",
139
148
  "is_descendent",
140
149
  "iter_nomenclature_plugins",
141
- "parse_results_from_obo",
142
150
  "run_nomenclature_plugin",
143
151
  ]
@@ -33,8 +33,8 @@ from .constants import (
33
33
  )
34
34
  from .identifier_utils import ParseError, wrap_norm_prefix
35
35
  from .plugins import has_nomenclature_plugin, run_nomenclature_plugin
36
- from .reader import from_obo_path, from_obonet
37
36
  from .struct import Obo
37
+ from .struct.obo import from_obo_path, from_obonet
38
38
  from .utils.io import safe_open_writer
39
39
  from .utils.path import ensure_path, prefix_directory_join
40
40
  from .version import get_git_hash, get_version
@@ -159,13 +159,20 @@ def get_ontology(
159
159
  elif ontology_format == "obo":
160
160
  pass # all gucci
161
161
  elif ontology_format == "owl":
162
- from bioontologies import robot
162
+ import bioontologies.robot
163
163
 
164
164
  _converted_obo_path = path.with_suffix(".obo")
165
165
  if prefix in REQUIRES_NO_ROBOT_CHECK:
166
166
  robot_check = False
167
- robot.convert(path, _converted_obo_path, check=robot_check)
167
+ bioontologies.robot.convert(path, _converted_obo_path, check=robot_check)
168
168
  path = _converted_obo_path
169
+ elif ontology_format == "json":
170
+ from .struct.obograph import read_obograph
171
+
172
+ obo = read_obograph(prefix=prefix, path=path)
173
+ if cache:
174
+ obo.write_default(force=force_process)
175
+ return obo
169
176
  else:
170
177
  raise UnhandledFormatError(f"[{prefix}] unhandled ontology file format: {path.suffix}")
171
178
 
@@ -12,6 +12,7 @@ from .api import (
12
12
  UnregisteredPrefixError,
13
13
  _is_valid_identifier,
14
14
  _parse_str_or_curie_or_uri_helper,
15
+ get_converter,
15
16
  standardize_ec,
16
17
  wrap_norm_prefix,
17
18
  )
@@ -27,6 +28,7 @@ __all__ = [
27
28
  "UnregisteredPrefixError",
28
29
  "_is_valid_identifier",
29
30
  "_parse_str_or_curie_or_uri_helper",
31
+ "get_converter",
30
32
  "get_rules",
31
33
  "ground_relation",
32
34
  "standardize_ec",
@@ -135,9 +135,10 @@ def _preclean_uri(s: str) -> str:
135
135
 
136
136
 
137
137
  @lru_cache(1)
138
- def _get_converter() -> PreprocessingConverter:
138
+ def get_converter() -> PreprocessingConverter:
139
+ """Get a converter."""
139
140
  return PreprocessingConverter(
140
- converter=bioregistry.manager.converter,
141
+ records=bioregistry.manager.converter.records,
141
142
  rules=get_rules(),
142
143
  preclean=_preclean_uri,
143
144
  )
@@ -27,6 +27,7 @@ from .gtdb import GTDBGetter
27
27
  from .gwascentral import GWASCentralPhenotypeGetter, GWASCentralStudyGetter
28
28
  from .hgnc import HGNCGetter, HGNCGroupGetter
29
29
  from .icd import ICD10Getter, ICD11Getter
30
+ from .intact import IntactGetter
30
31
  from .interpro import InterProGetter
31
32
  from .itis import ITISGetter
32
33
  from .kegg import KEGGGeneGetter, KEGGGenomeGetter, KEGGPathwayGetter
@@ -102,6 +103,7 @@ __all__ = [
102
103
  "ICD10Getter",
103
104
  "ICD11Getter",
104
105
  "ITISGetter",
106
+ "IntactGetter",
105
107
  "InterProGetter",
106
108
  "KEGGGeneGetter",
107
109
  "KEGGGenomeGetter",
@@ -149,7 +149,7 @@ def get_xml_root(version: str | None = None) -> ElementTree.Element:
149
149
  raise NoBuildError from e
150
150
 
151
151
  element = parse_drugbank(version=version, username=username, password=password)
152
- return element.getroot()
152
+ return element.getroot() # type:ignore
153
153
 
154
154
 
155
155
  ns = "{http://www.drugbank.ca}"
@@ -79,7 +79,7 @@ def iterate_terms(version: str, force: bool = False) -> Iterable[Term]:
79
79
  except ElementTree.ParseError:
80
80
  logger.warning("malformed XML in %s", tar_info.path)
81
81
  continue
82
- yield _get_term_from_tree(tree)
82
+ yield _get_term_from_tree(tree) # type:ignore
83
83
 
84
84
 
85
85
  if __name__ == "__main__":
@@ -0,0 +1,79 @@
1
+ """Converter for IntAct complexes."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from collections import defaultdict
6
+ from collections.abc import Iterable
7
+
8
+ import pandas as pd
9
+ from pydantic import ValidationError
10
+ from tqdm import tqdm
11
+
12
+ from pyobo.struct import Obo, Reference, Term
13
+ from pyobo.utils.path import ensure_path
14
+
15
+ __all__ = [
16
+ "IntactGetter",
17
+ ]
18
+
19
+ PREFIX = "intact"
20
+ COMPLEXPORTAL_MAPPINGS_UNVERSIONED = (
21
+ "https://ftp.ebi.ac.uk/pub/databases/intact/complex/current/various/cpx_ebi_ac_translation.txt"
22
+ )
23
+ REACTOME_MAPPINGS_UNVERSIONED = (
24
+ "https://ftp.ebi.ac.uk/pub/databases/intact/current/various/reactome.dat"
25
+ )
26
+
27
+
28
+ # TODO it looks like it's probably also the case that
29
+ # this semantic space contains IDs for proteins/
30
+ # interactors. These need to be added too
31
+
32
+
33
+ class IntactGetter(Obo):
34
+ """An ontology representation of Intact."""
35
+
36
+ bioversions_key = ontology = PREFIX
37
+
38
+ def iter_terms(self, force: bool = False) -> Iterable[Term]:
39
+ """Iterate over terms in the ontology."""
40
+ return get_terms(force=force, version=self._version_or_raise)
41
+
42
+
43
+ def get_terms(version: str, force: bool = False) -> Iterable[Term]:
44
+ """Get terms from the Contributor Roles Taxonomy via GitHub."""
45
+ cplx = _get_mappings(
46
+ COMPLEXPORTAL_MAPPINGS_UNVERSIONED, "complexportal", version=version, force=force
47
+ )
48
+ reactome = _get_mappings(
49
+ REACTOME_MAPPINGS_UNVERSIONED, "reactome", version=version, force=force
50
+ )
51
+ for intact_id in sorted(set(cplx).union(reactome)):
52
+ term = Term.from_triple(PREFIX, intact_id)
53
+ for complexportal_xref in sorted(cplx.get(intact_id, [])):
54
+ term.append_exact_match(complexportal_xref)
55
+ for reactome_xref in sorted(reactome.get(intact_id, [])):
56
+ term.append_xref(reactome_xref)
57
+ yield term
58
+
59
+
60
+ def _get_mappings(
61
+ url: str, target_prefix: str, version: str, *, force: bool = False
62
+ ) -> dict[str, set[Reference]]:
63
+ path = ensure_path(PREFIX, url=url, version=version, force=force)
64
+ df = pd.read_csv(path, sep="\t", header=None, usecols=[0, 1])
65
+
66
+ dd = defaultdict(set)
67
+ for intact_id, target_identifier in df.values:
68
+ try:
69
+ obj = Reference(prefix=target_prefix, identifier=target_identifier)
70
+ except ValidationError:
71
+ tqdm.write(f"[intact:{intact_id}] invalid xref: {target_prefix}:{target_identifier}")
72
+ continue
73
+ dd[intact_id].add(obj)
74
+
75
+ return dict(dd)
76
+
77
+
78
+ if __name__ == "__main__":
79
+ IntactGetter.cli()
@@ -18,7 +18,7 @@ from .struct import (
18
18
  TypeDef,
19
19
  make_ad_hoc_ontology,
20
20
  )
21
- from .struct_utils import Annotation, Stanza
21
+ from .struct_utils import Annotation, Stanza, StanzaType
22
22
  from .typedef import (
23
23
  derives_from,
24
24
  enables,
@@ -51,6 +51,7 @@ __all__ = [
51
51
  "Reference",
52
52
  "Referenced",
53
53
  "Stanza",
54
+ "StanzaType",
54
55
  "Synonym",
55
56
  "SynonymTypeDef",
56
57
  "Term",
@@ -250,7 +250,7 @@ class Import(Box):
250
250
 
251
251
  def get_rdf_graph_oracle(boxes: list[Box], *, prefix_map: dict[str, str]) -> Graph:
252
252
  """Serialize to turtle via OFN and conversion with ROBOT."""
253
- from bioontologies.robot import convert
253
+ import bioontologies.robot
254
254
 
255
255
  ontology = Ontology(
256
256
  iri=EXAMPLE_ONTOLOGY_IRI,
@@ -265,7 +265,7 @@ def get_rdf_graph_oracle(boxes: list[Box], *, prefix_map: dict[str, str]) -> Gra
265
265
  ofn_path.write_text(text)
266
266
  ttl_path = stub.with_suffix(".ttl")
267
267
  try:
268
- convert(ofn_path, ttl_path)
268
+ bioontologies.robot.convert(ofn_path, ttl_path)
269
269
  except subprocess.CalledProcessError:
270
270
  raise RuntimeError(f"failed to convert axioms from:\n\n{text}") from None
271
271
  graph.parse(ttl_path)
@@ -0,0 +1,9 @@
1
+ """OBO Flat file format."""
2
+
3
+ from .reader import from_obo_path, from_obonet, from_str
4
+
5
+ __all__ = [
6
+ "from_obo_path",
7
+ "from_obonet",
8
+ "from_str",
9
+ ]
@@ -20,15 +20,6 @@ from curies.vocabulary import SynonymScope
20
20
  from more_itertools import pairwise
21
21
  from tqdm.auto import tqdm
22
22
 
23
- from .constants import DATE_FORMAT, PROVENANCE_PREFIXES
24
- from .identifier_utils import (
25
- NotCURIEError,
26
- ParseError,
27
- UnparsableIRIError,
28
- _is_valid_identifier,
29
- _parse_str_or_curie_or_uri_helper,
30
- get_rules,
31
- )
32
23
  from .reader_utils import (
33
24
  _chomp_axioms,
34
25
  _chomp_references,
@@ -36,7 +27,9 @@ from .reader_utils import (
36
27
  _chomp_typedef,
37
28
  _parse_provenance_list,
38
29
  )
39
- from .struct import (
30
+ from .. import vocabulary as v
31
+ from ..reference import OBOLiteral, _obo_parse_identifier
32
+ from ..struct import (
40
33
  Obo,
41
34
  Reference,
42
35
  Synonym,
@@ -46,18 +39,26 @@ from .struct import (
46
39
  default_reference,
47
40
  make_ad_hoc_ontology,
48
41
  )
49
- from .struct import vocabulary as v
50
- from .struct.reference import OBOLiteral, _obo_parse_identifier
51
- from .struct.struct_utils import Annotation, Stanza
52
- from .struct.typedef import comment as has_comment
53
- from .struct.typedef import default_typedefs, has_ontology_root_term
54
- from .utils.cache import write_gzipped_graph
55
- from .utils.io import safe_open
56
- from .utils.misc import STATIC_VERSION_REWRITES, cleanup_version
42
+ from ..struct_utils import Annotation, Stanza
43
+ from ..typedef import comment as has_comment
44
+ from ..typedef import default_typedefs, has_ontology_root_term
45
+ from ...constants import DATE_FORMAT, PROVENANCE_PREFIXES
46
+ from ...identifier_utils import (
47
+ NotCURIEError,
48
+ ParseError,
49
+ UnparsableIRIError,
50
+ _is_valid_identifier,
51
+ _parse_str_or_curie_or_uri_helper,
52
+ get_rules,
53
+ )
54
+ from ...utils.cache import write_gzipped_graph
55
+ from ...utils.io import safe_open
56
+ from ...utils.misc import STATIC_VERSION_REWRITES, cleanup_version
57
57
 
58
58
  __all__ = [
59
59
  "from_obo_path",
60
60
  "from_obonet",
61
+ "from_str",
61
62
  ]
62
63
 
63
64
  logger = logging.getLogger(__name__)
@@ -1353,6 +1354,8 @@ def _handle_prop(
1353
1354
  case None:
1354
1355
  return None
1355
1356
 
1357
+ return None
1358
+
1356
1359
 
1357
1360
  def _get_prop(
1358
1361
  property_id: str,
@@ -0,0 +1,16 @@
1
+ """I/O for OBO Graph JSON."""
2
+
3
+ from .export import to_obograph, to_parsed_obograph, to_parsed_obograph_oracle, write_obograph
4
+ from .reader import from_obograph, from_standardized_graph, read_obograph
5
+ from .utils import assert_graph_equal
6
+
7
+ __all__ = [
8
+ "assert_graph_equal",
9
+ "from_obograph",
10
+ "from_standardized_graph",
11
+ "read_obograph",
12
+ "to_obograph",
13
+ "to_parsed_obograph",
14
+ "to_parsed_obograph_oracle",
15
+ "write_obograph",
16
+ ]