pyobo 0.11.2__tar.gz → 0.12.0__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.
- {pyobo-0.11.2/src/pyobo.egg-info → pyobo-0.12.0}/PKG-INFO +228 -229
- {pyobo-0.11.2 → pyobo-0.12.0}/README.md +182 -176
- {pyobo-0.11.2 → pyobo-0.12.0}/pyproject.toml +39 -49
- pyobo-0.12.0/src/pyobo/.DS_Store +0 -0
- pyobo-0.12.0/src/pyobo/__init__.py +143 -0
- pyobo-0.12.0/src/pyobo/api/__init__.py +126 -0
- pyobo-0.12.0/src/pyobo/api/alts.py +102 -0
- pyobo-0.12.0/src/pyobo/api/combine.py +39 -0
- pyobo-0.12.0/src/pyobo/api/edges.py +68 -0
- pyobo-0.12.0/src/pyobo/api/hierarchy.py +319 -0
- pyobo-0.12.0/src/pyobo/api/metadata.py +35 -0
- pyobo-0.12.0/src/pyobo/api/names.py +335 -0
- pyobo-0.12.0/src/pyobo/api/properties.py +210 -0
- pyobo-0.12.0/src/pyobo/api/relations.py +181 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/api/species.py +24 -21
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/api/typedefs.py +11 -11
- pyobo-0.12.0/src/pyobo/api/utils.py +157 -0
- pyobo-0.12.0/src/pyobo/api/xrefs.py +181 -0
- pyobo-0.12.0/src/pyobo/cli/cli.py +105 -0
- pyobo-0.12.0/src/pyobo/cli/database.py +360 -0
- pyobo-0.11.2/src/pyobo/xrefdb/xrefs_pipeline.py → pyobo-0.12.0/src/pyobo/cli/database_utils.py +54 -73
- pyobo-0.12.0/src/pyobo/cli/lookup.py +302 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/cli/utils.py +19 -6
- pyobo-0.12.0/src/pyobo/constants.py +198 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/getters.py +196 -118
- pyobo-0.12.0/src/pyobo/gilda_utils.py +151 -0
- pyobo-0.12.0/src/pyobo/identifier_utils/__init__.py +41 -0
- pyobo-0.12.0/src/pyobo/identifier_utils/api.py +296 -0
- pyobo-0.12.0/src/pyobo/identifier_utils/model.py +130 -0
- pyobo-0.12.0/src/pyobo/identifier_utils/preprocessing.json +812 -0
- pyobo-0.12.0/src/pyobo/identifier_utils/preprocessing.py +61 -0
- pyobo-0.12.0/src/pyobo/identifier_utils/relations/__init__.py +8 -0
- pyobo-0.12.0/src/pyobo/identifier_utils/relations/api.py +162 -0
- pyobo-0.12.0/src/pyobo/identifier_utils/relations/data.json +5824 -0
- pyobo-0.12.0/src/pyobo/identifier_utils/relations/data_owl.json +57 -0
- pyobo-0.12.0/src/pyobo/identifier_utils/relations/data_rdf.json +1 -0
- pyobo-0.12.0/src/pyobo/identifier_utils/relations/data_rdfs.json +7 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/mocks.py +9 -6
- pyobo-0.12.0/src/pyobo/ner/__init__.py +9 -0
- pyobo-0.12.0/src/pyobo/ner/api.py +72 -0
- pyobo-0.12.0/src/pyobo/ner/normalizer.py +33 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/obographs.py +43 -39
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/plugins.py +5 -4
- pyobo-0.12.0/src/pyobo/reader.py +1583 -0
- pyobo-0.12.0/src/pyobo/reader_utils.py +155 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/resource_utils.py +42 -22
- pyobo-0.12.0/src/pyobo/resources/goc.py +75 -0
- pyobo-0.12.0/src/pyobo/resources/goc.tsv +188 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/resources/ncbitaxon.py +4 -5
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/resources/ro.py +3 -2
- pyobo-0.12.0/src/pyobo/sources/README.md +19 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/__init__.py +52 -29
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/antibodyregistry.py +11 -12
- pyobo-0.12.0/src/pyobo/sources/bigg/__init__.py +13 -0
- pyobo-0.12.0/src/pyobo/sources/bigg/bigg_compartment.py +81 -0
- pyobo-0.12.0/src/pyobo/sources/bigg/bigg_metabolite.py +229 -0
- pyobo-0.12.0/src/pyobo/sources/bigg/bigg_model.py +46 -0
- pyobo-0.12.0/src/pyobo/sources/bigg/bigg_reaction.py +77 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/biogrid.py +1 -2
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/ccle.py +7 -12
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/cgnc.py +0 -5
- pyobo-0.12.0/src/pyobo/sources/chembl/__init__.py +9 -0
- pyobo-0.11.2/src/pyobo/sources/chembl.py → pyobo-0.12.0/src/pyobo/sources/chembl/chembl_compound.py +13 -25
- pyobo-0.12.0/src/pyobo/sources/chembl/chembl_target.py +160 -0
- pyobo-0.12.0/src/pyobo/sources/civic_gene.py +94 -0
- pyobo-0.12.0/src/pyobo/sources/clinicaltrials.py +160 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/complexportal.py +24 -24
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/conso.py +14 -22
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/credit.py +1 -9
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/cvx.py +27 -5
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/depmap.py +9 -12
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/dictybase_gene.py +2 -7
- pyobo-0.12.0/src/pyobo/sources/drugbank/__init__.py +9 -0
- {pyobo-0.11.2/src/pyobo/sources → pyobo-0.12.0/src/pyobo/sources/drugbank}/drugbank.py +11 -16
- {pyobo-0.11.2/src/pyobo/sources → pyobo-0.12.0/src/pyobo/sources/drugbank}/drugbank_salt.py +3 -8
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/drugcentral.py +17 -13
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/expasy.py +31 -34
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/famplex.py +13 -18
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/flybase.py +3 -8
- pyobo-0.12.0/src/pyobo/sources/gard.py +62 -0
- pyobo-0.12.0/src/pyobo/sources/geonames/__init__.py +9 -0
- pyobo-0.12.0/src/pyobo/sources/geonames/features.py +28 -0
- {pyobo-0.11.2/src/pyobo/sources → pyobo-0.12.0/src/pyobo/sources/geonames}/geonames.py +87 -26
- pyobo-0.12.0/src/pyobo/sources/geonames/utils.py +115 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/gmt_utils.py +6 -7
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/go.py +20 -13
- pyobo-0.12.0/src/pyobo/sources/gtdb.py +154 -0
- pyobo-0.12.0/src/pyobo/sources/gwascentral/__init__.py +9 -0
- {pyobo-0.11.2/src/pyobo/sources → pyobo-0.12.0/src/pyobo/sources/gwascentral}/gwascentral_phenotype.py +5 -7
- {pyobo-0.11.2/src/pyobo/sources → pyobo-0.12.0/src/pyobo/sources/gwascentral}/gwascentral_study.py +1 -7
- pyobo-0.12.0/src/pyobo/sources/hgnc/__init__.py +9 -0
- {pyobo-0.11.2/src/pyobo/sources → pyobo-0.12.0/src/pyobo/sources/hgnc}/hgnc.py +56 -70
- {pyobo-0.11.2/src/pyobo/sources → pyobo-0.12.0/src/pyobo/sources/hgnc}/hgncgenefamily.py +8 -18
- pyobo-0.12.0/src/pyobo/sources/icd/__init__.py +9 -0
- {pyobo-0.11.2/src/pyobo/sources → pyobo-0.12.0/src/pyobo/sources/icd}/icd10.py +35 -37
- pyobo-0.12.0/src/pyobo/sources/icd/icd11.py +148 -0
- {pyobo-0.11.2/src/pyobo/sources → pyobo-0.12.0/src/pyobo/sources/icd}/icd_utils.py +66 -20
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/interpro.py +4 -9
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/itis.py +0 -5
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/kegg/api.py +16 -38
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/kegg/genes.py +9 -20
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/kegg/genome.py +1 -7
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/kegg/pathway.py +9 -21
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/mesh.py +58 -24
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/mgi.py +3 -10
- pyobo-0.12.0/src/pyobo/sources/mirbase/__init__.py +11 -0
- {pyobo-0.11.2/src/pyobo/sources → pyobo-0.12.0/src/pyobo/sources/mirbase}/mirbase.py +8 -11
- {pyobo-0.11.2/src/pyobo/sources → pyobo-0.12.0/src/pyobo/sources/mirbase}/mirbase_family.py +4 -8
- {pyobo-0.11.2/src/pyobo/sources → pyobo-0.12.0/src/pyobo/sources/mirbase}/mirbase_mature.py +3 -7
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/msigdb.py +74 -39
- pyobo-0.12.0/src/pyobo/sources/ncbi/__init__.py +9 -0
- pyobo-0.12.0/src/pyobo/sources/ncbi/ncbi_gc.py +162 -0
- {pyobo-0.11.2/src/pyobo/sources → pyobo-0.12.0/src/pyobo/sources/ncbi}/ncbigene.py +18 -19
- pyobo-0.12.0/src/pyobo/sources/nih_reporter.py +60 -0
- pyobo-0.12.0/src/pyobo/sources/nlm/__init__.py +9 -0
- pyobo-0.12.0/src/pyobo/sources/nlm/nlm_catalog.py +48 -0
- pyobo-0.12.0/src/pyobo/sources/nlm/nlm_publisher.py +36 -0
- pyobo-0.12.0/src/pyobo/sources/nlm/utils.py +116 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/npass.py +6 -8
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/omim_ps.py +10 -3
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/pathbank.py +4 -8
- pyobo-0.12.0/src/pyobo/sources/pfam/__init__.py +9 -0
- {pyobo-0.11.2/src/pyobo/sources → pyobo-0.12.0/src/pyobo/sources/pfam}/pfam.py +3 -8
- {pyobo-0.11.2/src/pyobo/sources → pyobo-0.12.0/src/pyobo/sources/pfam}/pfam_clan.py +2 -7
- pyobo-0.12.0/src/pyobo/sources/pharmgkb/__init__.py +15 -0
- pyobo-0.12.0/src/pyobo/sources/pharmgkb/pharmgkb_chemical.py +89 -0
- pyobo-0.12.0/src/pyobo/sources/pharmgkb/pharmgkb_disease.py +77 -0
- pyobo-0.12.0/src/pyobo/sources/pharmgkb/pharmgkb_gene.py +108 -0
- pyobo-0.12.0/src/pyobo/sources/pharmgkb/pharmgkb_pathway.py +63 -0
- pyobo-0.12.0/src/pyobo/sources/pharmgkb/pharmgkb_variant.py +84 -0
- pyobo-0.12.0/src/pyobo/sources/pharmgkb/utils.py +86 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/pid.py +1 -6
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/pombase.py +6 -10
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/pubchem.py +4 -9
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/reactome.py +5 -11
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/rgd.py +11 -16
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/rhea.py +37 -36
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/ror.py +69 -42
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/selventa/schem.py +4 -7
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/selventa/scomp.py +1 -6
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/selventa/sdis.py +4 -7
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/selventa/sfam.py +1 -6
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/sgd.py +6 -11
- pyobo-0.12.0/src/pyobo/sources/signor/__init__.py +7 -0
- pyobo-0.12.0/src/pyobo/sources/signor/download.py +41 -0
- pyobo-0.12.0/src/pyobo/sources/signor/signor_complexes.py +105 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/slm.py +12 -15
- pyobo-0.12.0/src/pyobo/sources/umls/__init__.py +9 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/umls/get_synonym_types.py +20 -4
- pyobo-0.12.0/src/pyobo/sources/umls/sty.py +57 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/umls/synonym_types.tsv +1 -1
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/umls/umls.py +18 -22
- pyobo-0.12.0/src/pyobo/sources/unimod.py +46 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/uniprot/uniprot.py +40 -32
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/uniprot/uniprot_ptm.py +4 -34
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/utils.py +3 -2
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/wikipathways.py +7 -10
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/zfin.py +5 -10
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/ssg/__init__.py +12 -16
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/ssg/index.html +26 -13
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/ssg/term.html +12 -2
- pyobo-0.12.0/src/pyobo/struct/__init__.py +80 -0
- pyobo-0.12.0/src/pyobo/struct/functional/__init__.py +1 -0
- pyobo-0.12.0/src/pyobo/struct/functional/dsl.py +2572 -0
- pyobo-0.12.0/src/pyobo/struct/functional/macros.py +423 -0
- pyobo-0.12.0/src/pyobo/struct/functional/obo_to_functional.py +385 -0
- pyobo-0.12.0/src/pyobo/struct/functional/ontology.py +270 -0
- pyobo-0.12.0/src/pyobo/struct/functional/utils.py +112 -0
- pyobo-0.12.0/src/pyobo/struct/reference.py +373 -0
- pyobo-0.12.0/src/pyobo/struct/struct.py +2266 -0
- pyobo-0.12.0/src/pyobo/struct/struct_utils.py +1078 -0
- pyobo-0.12.0/src/pyobo/struct/typedef.py +331 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/struct/utils.py +12 -5
- pyobo-0.12.0/src/pyobo/struct/vocabulary.py +138 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/utils/cache.py +13 -11
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/utils/io.py +17 -31
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/utils/iter.py +5 -5
- pyobo-0.12.0/src/pyobo/utils/misc.py +76 -0
- pyobo-0.12.0/src/pyobo/utils/path.py +147 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/version.py +3 -3
- pyobo-0.11.2/MANIFEST.in +0 -11
- pyobo-0.11.2/PKG-INFO +0 -711
- pyobo-0.11.2/setup.cfg +0 -4
- pyobo-0.11.2/src/pyobo/__init__.py +0 -68
- pyobo-0.11.2/src/pyobo/api/__init__.py +0 -55
- pyobo-0.11.2/src/pyobo/api/alts.py +0 -92
- pyobo-0.11.2/src/pyobo/api/hierarchy.py +0 -291
- pyobo-0.11.2/src/pyobo/api/metadata.py +0 -40
- pyobo-0.11.2/src/pyobo/api/names.py +0 -255
- pyobo-0.11.2/src/pyobo/api/properties.py +0 -206
- pyobo-0.11.2/src/pyobo/api/relations.py +0 -207
- pyobo-0.11.2/src/pyobo/api/utils.py +0 -104
- pyobo-0.11.2/src/pyobo/api/xrefs.py +0 -187
- pyobo-0.11.2/src/pyobo/aws.py +0 -162
- pyobo-0.11.2/src/pyobo/cli/aws.py +0 -47
- pyobo-0.11.2/src/pyobo/cli/cli.py +0 -120
- pyobo-0.11.2/src/pyobo/cli/database.py +0 -338
- pyobo-0.11.2/src/pyobo/cli/lookup.py +0 -334
- pyobo-0.11.2/src/pyobo/constants.py +0 -99
- pyobo-0.11.2/src/pyobo/gilda_utils.py +0 -272
- pyobo-0.11.2/src/pyobo/identifier_utils.py +0 -142
- pyobo-0.11.2/src/pyobo/normalizer.py +0 -232
- pyobo-0.11.2/src/pyobo/reader.py +0 -620
- pyobo-0.11.2/src/pyobo/registries/__init__.py +0 -16
- pyobo-0.11.2/src/pyobo/registries/metaregistry.json +0 -507
- pyobo-0.11.2/src/pyobo/registries/metaregistry.py +0 -135
- pyobo-0.11.2/src/pyobo/sources/README.md +0 -15
- pyobo-0.11.2/src/pyobo/sources/civic_gene.py +0 -54
- pyobo-0.11.2/src/pyobo/sources/icd11.py +0 -105
- pyobo-0.11.2/src/pyobo/sources/umls/__init__.py +0 -3
- pyobo-0.11.2/src/pyobo/struct/__init__.py +0 -34
- pyobo-0.11.2/src/pyobo/struct/reference.py +0 -178
- pyobo-0.11.2/src/pyobo/struct/struct.py +0 -1496
- pyobo-0.11.2/src/pyobo/struct/typedef.py +0 -379
- pyobo-0.11.2/src/pyobo/utils/misc.py +0 -88
- pyobo-0.11.2/src/pyobo/utils/path.py +0 -141
- pyobo-0.11.2/src/pyobo/xrefdb/__init__.py +0 -1
- pyobo-0.11.2/src/pyobo/xrefdb/canonicalizer.py +0 -214
- pyobo-0.11.2/src/pyobo/xrefdb/priority.py +0 -59
- pyobo-0.11.2/src/pyobo/xrefdb/sources/__init__.py +0 -60
- pyobo-0.11.2/src/pyobo/xrefdb/sources/biomappings.py +0 -36
- pyobo-0.11.2/src/pyobo/xrefdb/sources/cbms2019.py +0 -91
- pyobo-0.11.2/src/pyobo/xrefdb/sources/chembl.py +0 -83
- pyobo-0.11.2/src/pyobo/xrefdb/sources/compath.py +0 -82
- pyobo-0.11.2/src/pyobo/xrefdb/sources/famplex.py +0 -64
- pyobo-0.11.2/src/pyobo/xrefdb/sources/gilda.py +0 -50
- pyobo-0.11.2/src/pyobo/xrefdb/sources/intact.py +0 -113
- pyobo-0.11.2/src/pyobo/xrefdb/sources/ncit.py +0 -133
- pyobo-0.11.2/src/pyobo/xrefdb/sources/pubchem.py +0 -27
- pyobo-0.11.2/src/pyobo/xrefdb/sources/wikidata.py +0 -116
- pyobo-0.11.2/src/pyobo.egg-info/SOURCES.txt +0 -181
- pyobo-0.11.2/src/pyobo.egg-info/dependency_links.txt +0 -1
- pyobo-0.11.2/src/pyobo.egg-info/entry_points.txt +0 -2
- pyobo-0.11.2/src/pyobo.egg-info/requires.txt +0 -36
- pyobo-0.11.2/src/pyobo.egg-info/top_level.txt +0 -1
- pyobo-0.11.2/tests/__init__.py +0 -1
- pyobo-0.11.2/tests/constants.py +0 -18
- pyobo-0.11.2/tests/resources/citations.txt +0 -201
- pyobo-0.11.2/tests/resources/test_chebi.obo +0 -436
- pyobo-0.11.2/tests/resources/test_msigdb.gmt +0 -3
- pyobo-0.11.2/tests/resources/test_wikipathways.gmt +0 -3
- pyobo-0.11.2/tests/test_alt_ids.py +0 -91
- pyobo-0.11.2/tests/test_caches.py +0 -86
- pyobo-0.11.2/tests/test_extract.py +0 -63
- pyobo-0.11.2/tests/test_get.py +0 -264
- pyobo-0.11.2/tests/test_gmt.py +0 -57
- pyobo-0.11.2/tests/test_ground.py +0 -38
- pyobo-0.11.2/tests/test_mapper.py +0 -63
- pyobo-0.11.2/tests/test_sources/__init__.py +0 -1
- pyobo-0.11.2/tests/test_sources/test_famplex.py +0 -14
- pyobo-0.11.2/tests/test_sources/test_meta.py +0 -38
- pyobo-0.11.2/tests/test_struct.py +0 -51
- pyobo-0.11.2/tests/test_utils.py +0 -75
- pyobo-0.11.2/tests/test_version_pins.py +0 -44
- {pyobo-0.11.2 → pyobo-0.12.0}/LICENSE +0 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/__main__.py +0 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/cli/__init__.py +0 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/py.typed +0 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/resources/__init__.py +0 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/resources/ncbitaxon.tsv.gz +0 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/resources/ro.tsv +0 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/resources/so.py +0 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/resources/so.tsv +0 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/agrovoc.py +0 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/chebi.py +1 -1
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/cpt.py +0 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/kegg/__init__.py +0 -0
- {pyobo-0.11.2/src/pyobo/sources → pyobo-0.12.0/src/pyobo/sources/mirbase}/mirbase_constants.py +0 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/selventa/__init__.py +0 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/umls/__main__.py +0 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/sources/uniprot/__init__.py +1 -1
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/ssg/base.html +0 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/ssg/typedef.html +0 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/utils/__init__.py +0 -0
- {pyobo-0.11.2 → pyobo-0.12.0}/src/pyobo/utils/ndex_utils.py +0 -0
|
@@ -1,36 +1,11 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: pyobo
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.12.0
|
|
4
4
|
Summary: A python package for handling and generating OBO
|
|
5
|
-
Author-email: Charles Tapley Hoyt <cthoyt@gmail.com>
|
|
6
|
-
Maintainer-email: Charles Tapley Hoyt <cthoyt@gmail.com>
|
|
7
|
-
License: MIT License
|
|
8
|
-
|
|
9
|
-
Copyright (c) 2024 Charles Tapley Hoyt
|
|
10
|
-
|
|
11
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
-
in the Software without restriction, including without limitation the rights
|
|
14
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
-
furnished to do so, subject to the following conditions:
|
|
17
|
-
|
|
18
|
-
The above copyright notice and this permission notice shall be included in all
|
|
19
|
-
copies or substantial portions of the Software.
|
|
20
|
-
|
|
21
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
-
SOFTWARE.
|
|
28
|
-
|
|
29
|
-
Project-URL: Bug Tracker, https://github.com/biopragmatics/pyobo/issues
|
|
30
|
-
Project-URL: Homepage, https://github.com/biopragmatics/pyobo
|
|
31
|
-
Project-URL: Repository, https://github.com/biopragmatics/pyobo.git
|
|
32
|
-
Project-URL: Documentation, https://pyobo.readthedocs.io
|
|
33
5
|
Keywords: snekpack,cookiecutter,ontologies,biomedical ontologies,life sciences,natural sciences,bioinformatics,cheminformatics,Open Biomedical Ontologies,OBO
|
|
6
|
+
Author: Charles Tapley Hoyt
|
|
7
|
+
Author-email: Charles Tapley Hoyt <cthoyt@gmail.com>
|
|
8
|
+
License-File: LICENSE
|
|
34
9
|
Classifier: Development Status :: 4 - Beta
|
|
35
10
|
Classifier: Environment :: Console
|
|
36
11
|
Classifier: Intended Audience :: Developers
|
|
@@ -39,16 +14,16 @@ Classifier: Operating System :: OS Independent
|
|
|
39
14
|
Classifier: Framework :: Pytest
|
|
40
15
|
Classifier: Framework :: tox
|
|
41
16
|
Classifier: Framework :: Sphinx
|
|
17
|
+
Classifier: Natural Language :: English
|
|
42
18
|
Classifier: Programming Language :: Python
|
|
43
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
44
19
|
Classifier: Programming Language :: Python :: 3.10
|
|
45
20
|
Classifier: Programming Language :: Python :: 3.11
|
|
46
21
|
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
47
23
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
24
|
+
Classifier: Typing :: Typed
|
|
48
25
|
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
49
26
|
Classifier: Topic :: Scientific/Engineering :: Chemistry
|
|
50
|
-
Requires-Python: >=3.9
|
|
51
|
-
Description-Content-Type: text/markdown
|
|
52
27
|
Requires-Dist: obonet>=0.3.0
|
|
53
28
|
Requires-Dist: click
|
|
54
29
|
Requires-Dist: tqdm
|
|
@@ -56,33 +31,51 @@ Requires-Dist: pyyaml
|
|
|
56
31
|
Requires-Dist: pandas
|
|
57
32
|
Requires-Dist: requests
|
|
58
33
|
Requires-Dist: protmapper
|
|
59
|
-
Requires-Dist:
|
|
60
|
-
Requires-Dist:
|
|
34
|
+
Requires-Dist: more-itertools
|
|
35
|
+
Requires-Dist: more-click>=0.0.2
|
|
61
36
|
Requires-Dist: humanize
|
|
62
37
|
Requires-Dist: tabulate
|
|
63
38
|
Requires-Dist: cachier
|
|
64
|
-
Requires-Dist: pystow>=0.
|
|
65
|
-
Requires-Dist: bioversions>=0.
|
|
66
|
-
Requires-Dist: bioregistry>=0.
|
|
67
|
-
Requires-Dist: bioontologies>=0.
|
|
68
|
-
Requires-Dist:
|
|
69
|
-
Requires-Dist:
|
|
39
|
+
Requires-Dist: pystow>=0.7.0
|
|
40
|
+
Requires-Dist: bioversions>=0.7.0
|
|
41
|
+
Requires-Dist: bioregistry>=0.12.7
|
|
42
|
+
Requires-Dist: bioontologies>=0.7.1
|
|
43
|
+
Requires-Dist: ssslm>=0.0.13
|
|
44
|
+
Requires-Dist: zenodo-client>=0.3.6
|
|
45
|
+
Requires-Dist: class-resolver>=0.6.0
|
|
70
46
|
Requires-Dist: psycopg2-binary
|
|
71
47
|
Requires-Dist: pydantic>=2.0
|
|
72
|
-
Requires-Dist:
|
|
73
|
-
Requires-Dist:
|
|
74
|
-
Requires-Dist:
|
|
75
|
-
Requires-Dist:
|
|
76
|
-
Requires-Dist:
|
|
48
|
+
Requires-Dist: curies>=0.10.10
|
|
49
|
+
Requires-Dist: python-dateutil
|
|
50
|
+
Requires-Dist: networkx>=3.4
|
|
51
|
+
Requires-Dist: drugbank-downloader
|
|
52
|
+
Requires-Dist: chembl-downloader
|
|
53
|
+
Requires-Dist: umls-downloader>=0.1.3
|
|
54
|
+
Requires-Dist: clinicaltrials-downloader>=0.0.2
|
|
55
|
+
Requires-Dist: nih-reporter-downloader>=0.0.1
|
|
56
|
+
Requires-Dist: typing-extensions
|
|
77
57
|
Requires-Dist: rdflib
|
|
78
|
-
|
|
79
|
-
Requires-Dist:
|
|
80
|
-
Requires-Dist:
|
|
58
|
+
Requires-Dist: sphinx>=8 ; extra == 'docs'
|
|
59
|
+
Requires-Dist: sphinx-rtd-theme>=3.0 ; extra == 'docs'
|
|
60
|
+
Requires-Dist: sphinx-click ; extra == 'docs'
|
|
61
|
+
Requires-Dist: sphinx-automodapi ; extra == 'docs'
|
|
62
|
+
Requires-Dist: ssslm[gilda] ; extra == 'gilda'
|
|
63
|
+
Requires-Dist: ssslm[gilda-slim] ; extra == 'gilda-slim'
|
|
64
|
+
Requires-Dist: pytest ; extra == 'tests'
|
|
65
|
+
Requires-Dist: coverage[toml] ; extra == 'tests'
|
|
66
|
+
Maintainer: Charles Tapley Hoyt
|
|
67
|
+
Maintainer-email: Charles Tapley Hoyt <cthoyt@gmail.com>
|
|
68
|
+
Requires-Python: >=3.10
|
|
69
|
+
Project-URL: Bug Tracker, https://github.com/biopragmatics/pyobo/issues
|
|
70
|
+
Project-URL: Documentation, https://pyobo.readthedocs.io
|
|
71
|
+
Project-URL: Funding, https://github.com/sponsors/cthoyt
|
|
72
|
+
Project-URL: Homepage, https://github.com/biopragmatics/pyobo
|
|
73
|
+
Project-URL: Repository, https://github.com/biopragmatics/pyobo.git
|
|
81
74
|
Provides-Extra: docs
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
75
|
+
Provides-Extra: gilda
|
|
76
|
+
Provides-Extra: gilda-slim
|
|
77
|
+
Provides-Extra: tests
|
|
78
|
+
Description-Content-Type: text/markdown
|
|
86
79
|
|
|
87
80
|
<!--
|
|
88
81
|
<p align="center">
|
|
@@ -117,25 +110,24 @@ Requires-Dist: sphinx_automodapi; extra == "docs"
|
|
|
117
110
|
<img src="https://zenodo.org/badge/DOI/10.5281/zenodo.3381961.svg" alt="DOI"></a>
|
|
118
111
|
</p>
|
|
119
112
|
|
|
120
|
-
Tools for biological identifiers, names, synonyms, xrefs, hierarchies,
|
|
121
|
-
perspective of OBO.
|
|
113
|
+
Tools for biological identifiers, names, synonyms, xrefs, hierarchies,
|
|
114
|
+
relations, and properties through the perspective of OBO.
|
|
122
115
|
|
|
123
116
|
## Example Usage
|
|
124
117
|
|
|
125
|
-
Note! PyOBO is no-nonsense. This means that there's no repetitive
|
|
126
|
-
|
|
127
|
-
no exceptions.
|
|
118
|
+
Note! PyOBO is no-nonsense. This means that there's no repetitive prefixes in
|
|
119
|
+
identifiers. It also means all identifiers are strings, no exceptions.
|
|
128
120
|
|
|
129
|
-
Note! The first time you run these, they have to download and cache
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
121
|
+
Note! The first time you run these, they have to download and cache all
|
|
122
|
+
resources. We're not in the business of redistributing data, so all scripts
|
|
123
|
+
should be completely reproducible. There's some AWS tools for
|
|
124
|
+
hosting/downloading pre-compiled versions in `pyobo.aws` if you don't have time
|
|
125
|
+
for that.
|
|
134
126
|
|
|
135
|
-
Note! PyOBO can perform grounding in a limited number of cases, but
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
127
|
+
Note! PyOBO can perform grounding in a limited number of cases, but it is _not_
|
|
128
|
+
a general solution for named entity recognition (NER) or grounding. It's
|
|
129
|
+
suggested to check `Gilda <https://github.com/indralab/gilda>`\_ for a
|
|
130
|
+
no-nonsense solution.
|
|
139
131
|
|
|
140
132
|
### Mapping Identifiers and CURIEs
|
|
141
133
|
|
|
@@ -185,6 +177,7 @@ one using alternative identifiers listed in the underlying OBO with:
|
|
|
185
177
|
|
|
186
178
|
```python
|
|
187
179
|
import pyobo
|
|
180
|
+
from pyobo import Reference
|
|
188
181
|
|
|
189
182
|
# Look up DNA-binding transcription factor activity (go:0003700)
|
|
190
183
|
# based on an old id
|
|
@@ -192,13 +185,13 @@ primary_curie = pyobo.get_primary_curie('go:0001071')
|
|
|
192
185
|
assert primary_curie == 'go:0003700'
|
|
193
186
|
|
|
194
187
|
# If it's already the primary, it just gets returned
|
|
195
|
-
assert 'go:0003700' == pyobo.
|
|
188
|
+
assert Reference.from_curie('go:0003700') == pyobo.get_primary_curie('go:0003700')
|
|
196
189
|
```
|
|
197
190
|
|
|
198
191
|
### Mapping Species
|
|
199
192
|
|
|
200
|
-
Some resources have species information for their term. Get a mapping of
|
|
201
|
-
to species (as NCBI taxonomy identifiers):
|
|
193
|
+
Some resources have species information for their term. Get a mapping of
|
|
194
|
+
WikiPathway identifiers to species (as NCBI taxonomy identifiers):
|
|
202
195
|
|
|
203
196
|
```python
|
|
204
197
|
import pyobo
|
|
@@ -229,30 +222,28 @@ it up and its preferred label.
|
|
|
229
222
|
```python
|
|
230
223
|
import pyobo
|
|
231
224
|
|
|
232
|
-
|
|
233
|
-
assert prefix == 'chebi'
|
|
234
|
-
assert identifier == '132964'
|
|
235
|
-
assert name == 'fluazifop-P-butyl'
|
|
225
|
+
reference = pyobo.ground('chebi', 'Fusilade II')
|
|
226
|
+
assert reference.prefix == 'chebi'
|
|
227
|
+
assert reference.identifier == '132964'
|
|
228
|
+
assert reference.name == 'fluazifop-P-butyl'
|
|
236
229
|
|
|
237
230
|
# When failure happens...
|
|
238
|
-
|
|
239
|
-
assert
|
|
240
|
-
assert identifier is None
|
|
241
|
-
assert name is None
|
|
231
|
+
reference = pyobo.ground('chebi', 'Definitely not a real name')
|
|
232
|
+
assert reference is None
|
|
242
233
|
```
|
|
243
234
|
|
|
244
|
-
If you're not really sure which namespace a name might belong to, you
|
|
245
|
-
|
|
246
|
-
|
|
235
|
+
If you're not really sure which namespace a name might belong to, you can try a
|
|
236
|
+
few in a row (prioritize by ones that cover the appropriate entity type to avoid
|
|
237
|
+
false positives in case of conflicts):
|
|
247
238
|
|
|
248
239
|
```python
|
|
249
240
|
import pyobo
|
|
250
241
|
|
|
251
242
|
# looking for phenotypes/pathways
|
|
252
|
-
|
|
253
|
-
assert prefix == 'go'
|
|
254
|
-
assert identifier == '0030433'
|
|
255
|
-
assert name == 'ubiquitin-dependent ERAD pathway'
|
|
243
|
+
reference = pyobo.ground(['efo', 'go'], 'ERAD')
|
|
244
|
+
assert reference.prefix == 'go'
|
|
245
|
+
assert reference.identifier == '0030433'
|
|
246
|
+
assert reference.name == 'ubiquitin-dependent ERAD pathway'
|
|
256
247
|
```
|
|
257
248
|
|
|
258
249
|
### Cross-referencing
|
|
@@ -277,8 +268,8 @@ pubchem_compound_id = pyobo.get_xref('chebi', '132964', 'pubchem.compound')
|
|
|
277
268
|
assert pubchem_compound_id == '3033674'
|
|
278
269
|
```
|
|
279
270
|
|
|
280
|
-
Get xrefs from Entrez to HGNC, but they're only available through HGNC,
|
|
281
|
-
|
|
271
|
+
Get xrefs from Entrez to HGNC, but they're only available through HGNC, so you
|
|
272
|
+
need to flip them:
|
|
282
273
|
|
|
283
274
|
```python
|
|
284
275
|
import pyobo
|
|
@@ -292,8 +283,8 @@ mapt_hgnc = ncbigene_id_to_hgnc_id['4137']
|
|
|
292
283
|
assert mapt_hgnc == '6893'
|
|
293
284
|
```
|
|
294
285
|
|
|
295
|
-
Since this is a common pattern, there's a keyword argument `flip`
|
|
296
|
-
|
|
286
|
+
Since this is a common pattern, there's a keyword argument `flip` that does this
|
|
287
|
+
for you:
|
|
297
288
|
|
|
298
289
|
```python
|
|
299
290
|
import pyobo
|
|
@@ -313,45 +304,10 @@ hgnc_id = pyobo.get_xref('hgnc', '4137', 'ncbigene', flip=True)
|
|
|
313
304
|
assert hgnc_id == '6893'
|
|
314
305
|
```
|
|
315
306
|
|
|
316
|
-
Remap a CURIE based on pre-defined priority list and [Inspector Javert's Xref
|
|
317
|
-
Database](https://cthoyt.com/2020/04/19/inspector-javerts-xref-database.html):
|
|
318
|
-
|
|
319
|
-
```python
|
|
320
|
-
|
|
321
|
-
import pyobo
|
|
322
|
-
|
|
323
|
-
# Map to the best source possible
|
|
324
|
-
mapt_ncbigene = pyobo.get_priority_curie('hgnc:6893')
|
|
325
|
-
assert mapt_ncbigene == 'ncbigene:4137'
|
|
326
|
-
|
|
327
|
-
# Sometimes you know you're the best. Own it.
|
|
328
|
-
assert 'ncbigene:4137' == pyobo.get_priority_curie('ncbigene:4137')
|
|
329
|
-
```
|
|
330
|
-
|
|
331
|
-
Find all CURIEs mapped to a given one using Inspector Javert's Xref Database:
|
|
332
|
-
|
|
333
|
-
```python
|
|
334
|
-
import pyobo
|
|
335
|
-
|
|
336
|
-
# Get a set of all CURIEs mapped to MAPT
|
|
337
|
-
mapt_curies = pyobo.get_equivalent('hgnc:6893')
|
|
338
|
-
assert 'ncbigene:4137' in mapt_curies
|
|
339
|
-
assert 'ensembl:ENSG00000186868' in mapt_curies
|
|
340
|
-
```
|
|
341
|
-
|
|
342
|
-
If you don't want to wait to build the database locally for the `pyobo.get_priority_curie` and
|
|
343
|
-
`pyobo.get_equivalent`, you can use the following code to download a release from
|
|
344
|
-
[Zenodo](https://zenodo.org/record/3757266):
|
|
345
|
-
|
|
346
|
-
```python
|
|
347
|
-
import pyobo.resource_utils
|
|
348
|
-
|
|
349
|
-
pyobo.resource_utils.ensure_inspector_javert()
|
|
350
|
-
```
|
|
351
|
-
|
|
352
307
|
### Properties
|
|
353
308
|
|
|
354
|
-
Get properties, like SMILES. The semantics of these are defined on an OBO-OBO
|
|
309
|
+
Get properties, like SMILES. The semantics of these are defined on an OBO-OBO
|
|
310
|
+
basis.
|
|
355
311
|
|
|
356
312
|
```python
|
|
357
313
|
import pyobo
|
|
@@ -378,47 +334,50 @@ assert smiles == 'C1(=CC=C(N=C1)OC2=CC=C(C=C2)O[C@@H](C(OCCCC)=O)C)C(F)(F)F'
|
|
|
378
334
|
Check if an entity is in the hierarchy:
|
|
379
335
|
|
|
380
336
|
```python
|
|
381
|
-
import networkx as nx
|
|
382
337
|
import pyobo
|
|
338
|
+
from pyobo import Reference
|
|
383
339
|
|
|
384
340
|
# check that go:0008219 ! cell death is an ancestor of go:0006915 ! apoptotic process
|
|
385
|
-
assert 'go:0008219' in pyobo.get_ancestors('go', '0006915')
|
|
341
|
+
assert Reference.from_curie('go:0008219') in pyobo.get_ancestors('go', '0006915')
|
|
386
342
|
|
|
387
343
|
# check that go:0070246 ! natural killer cell apoptotic process is a
|
|
388
344
|
# descendant of go:0006915 ! apoptotic process
|
|
389
345
|
apopototic_process_descendants = pyobo.get_descendants('go', '0006915')
|
|
390
|
-
assert 'go:0070246' in apopototic_process_descendants
|
|
346
|
+
assert Reference.from_curie('go:0070246') in apopototic_process_descendants
|
|
391
347
|
```
|
|
392
348
|
|
|
393
349
|
Get the sub-hierarchy below a given node:
|
|
394
350
|
|
|
395
351
|
```python
|
|
396
352
|
import pyobo
|
|
353
|
+
from pyobo import Reference
|
|
397
354
|
|
|
398
355
|
# get the descendant graph of go:0006915 ! apoptotic process
|
|
399
356
|
apopototic_process_subhierarchy = pyobo.get_subhierarchy('go', '0006915')
|
|
400
357
|
|
|
401
358
|
# check that go:0070246 ! natural killer cell apoptotic process is a
|
|
402
359
|
# descendant of go:0006915 ! apoptotic process through the subhierarchy
|
|
403
|
-
assert 'go:0070246' in apopototic_process_subhierarchy
|
|
360
|
+
assert Reference.from_curie('go:0070246') in apopototic_process_subhierarchy
|
|
404
361
|
```
|
|
405
362
|
|
|
406
363
|
Get a hierarchy with properties preloaded in the node data dictionaries:
|
|
407
364
|
|
|
408
365
|
```python
|
|
409
366
|
import pyobo
|
|
367
|
+
from pyobo import Reference
|
|
410
368
|
|
|
411
369
|
prop = 'http://purl.obolibrary.org/obo/chebi/smiles'
|
|
412
370
|
chebi_hierarchy = pyobo.get_hierarchy('chebi', properties=[prop])
|
|
413
371
|
|
|
414
|
-
assert 'chebi:132964' in chebi_hierarchy
|
|
372
|
+
assert Reference.from_curie('chebi:132964') in chebi_hierarchy
|
|
415
373
|
assert prop in chebi_hierarchy.nodes['chebi:132964']
|
|
416
374
|
assert chebi_hierarchy.nodes['chebi:132964'][prop] == 'C1(=CC=C(N=C1)OC2=CC=C(C=C2)O[C@@H](C(OCCCC)=O)C)C(F)(F)F'
|
|
417
375
|
```
|
|
418
376
|
|
|
419
377
|
### Relations
|
|
420
378
|
|
|
421
|
-
Get all orthologies (`ro:HOM0000017`) between HGNC and MGI (note: this is one
|
|
379
|
+
Get all orthologies (`ro:HOM0000017`) between HGNC and MGI (note: this is one
|
|
380
|
+
way)
|
|
422
381
|
|
|
423
382
|
```python
|
|
424
383
|
>>> import pyobo
|
|
@@ -440,11 +399,10 @@ If you want to do it in one line, use:
|
|
|
440
399
|
|
|
441
400
|
### Writings Tests that Use PyOBO
|
|
442
401
|
|
|
443
|
-
If you're writing your own code that relies on PyOBO, and unit
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
pre-build patches like in the following:
|
|
402
|
+
If you're writing your own code that relies on PyOBO, and unit testing it (as
|
|
403
|
+
you should) in a continuous integration setting, you've probably realized that
|
|
404
|
+
loading all the resources on each build is not so fast. In those scenarios, you
|
|
405
|
+
can use some of the pre-build patches like in the following:
|
|
448
406
|
|
|
449
407
|
```python
|
|
450
408
|
import unittest
|
|
@@ -464,57 +422,75 @@ class MyTestCase(unittest.TestCase):
|
|
|
464
422
|
pyobo.get_name('chebi', '1234')
|
|
465
423
|
```
|
|
466
424
|
|
|
467
|
-
|
|
468
425
|
## Curation of the Bioregistry
|
|
469
426
|
|
|
470
427
|
In order to normalize references and identify resources, PyOBO uses the
|
|
471
|
-
[Bioregistry](https://github.com/bioregistry/bioregistry). It used to be a part
|
|
472
|
-
been externalized for more general reuse.
|
|
428
|
+
[Bioregistry](https://github.com/bioregistry/bioregistry). It used to be a part
|
|
429
|
+
of PyOBO, but has since been externalized for more general reuse.
|
|
473
430
|
|
|
474
|
-
At
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
431
|
+
At
|
|
432
|
+
[src/pyobo/registries/metaregistry.json](https://github.com/pyobo/pyobo/blob/master/src/pyobo/registries/metaregistry.json)
|
|
433
|
+
is the curated "metaregistry". This is a source of information that contains all
|
|
434
|
+
sorts of fixes for missing/wrong information in MIRIAM, OLS, and OBO Foundry;
|
|
435
|
+
entries that don't appear in any of them; additional synonym information for
|
|
436
|
+
each namespace/prefix; rules for normalizing xrefs and CURIEs, etc.
|
|
478
437
|
|
|
479
438
|
Other entries in the metaregistry:
|
|
480
439
|
|
|
481
|
-
- The `"remappings"->"full"` entry is a dictionary from strings that might
|
|
482
|
-
in a given OBO file that need to be completely replaced, due to
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
440
|
+
- The `"remappings"->"full"` entry is a dictionary from strings that might
|
|
441
|
+
follow `xref:` in a given OBO file that need to be completely replaced, due to
|
|
442
|
+
incorrect formatting
|
|
443
|
+
- The `"remappings"->"prefix"` entry contains a dictionary of prefixes for xrefs
|
|
444
|
+
that need to be remapped. Several rules, for example, remove superfluous
|
|
445
|
+
spaces that occur inside CURIEs or and others address instances of the GOGO
|
|
446
|
+
issue.
|
|
447
|
+
- The `"blacklists"` entry contains rules for throwing out malformed xrefs based
|
|
448
|
+
on full string, just prefix, or just suffix.
|
|
488
449
|
|
|
489
450
|
## Troubleshooting
|
|
490
451
|
|
|
491
|
-
The OBO Foundry seems to be pretty unstable with respect to the URLs to OBO
|
|
452
|
+
The OBO Foundry seems to be pretty unstable with respect to the URLs to OBO
|
|
453
|
+
resources. If you get an error like:
|
|
492
454
|
|
|
493
455
|
```
|
|
494
456
|
pyobo.getters.MissingOboBuild: OBO Foundry is missing a build for: mondo
|
|
495
457
|
```
|
|
496
458
|
|
|
497
|
-
Then you should check the corresponding page on the OBO Foundry (in this case,
|
|
498
|
-
and make update to the `url`
|
|
459
|
+
Then you should check the corresponding page on the OBO Foundry (in this case,
|
|
460
|
+
http://www.obofoundry.org/ontology/mondo.html) and make update to the `url`
|
|
461
|
+
entry for that namespace in the Bioregistry.
|
|
499
462
|
|
|
500
463
|
## 🚀 Installation
|
|
501
464
|
|
|
502
465
|
The most recent release can be installed from
|
|
503
|
-
[PyPI](https://pypi.org/project/pyobo/) with:
|
|
466
|
+
[PyPI](https://pypi.org/project/pyobo/) with uv:
|
|
504
467
|
|
|
505
468
|
```console
|
|
506
|
-
|
|
469
|
+
$ uv pip install pyobo
|
|
507
470
|
```
|
|
508
471
|
|
|
509
|
-
|
|
472
|
+
or with pip:
|
|
510
473
|
|
|
511
474
|
```console
|
|
512
|
-
python3 -m pip install
|
|
475
|
+
$ python3 -m pip install pyobo
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
The most recent code and data can be installed directly from GitHub with uv:
|
|
479
|
+
|
|
480
|
+
```console
|
|
481
|
+
$ uv pip install git+https://github.com/biopragmatics/pyobo.git
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
or with pip:
|
|
485
|
+
|
|
486
|
+
```console
|
|
487
|
+
$ python3 -m pip install git+https://github.com/biopragmatics/pyobo.git
|
|
513
488
|
```
|
|
514
489
|
|
|
515
490
|
## 👐 Contributing
|
|
516
491
|
|
|
517
|
-
Contributions, whether filing an issue, making a pull request, or forking, are
|
|
492
|
+
Contributions, whether filing an issue, making a pull request, or forking, are
|
|
493
|
+
appreciated. See
|
|
518
494
|
[CONTRIBUTING.md](https://github.com/biopragmatics/pyobo/blob/master/.github/CONTRIBUTING.md)
|
|
519
495
|
for more information on getting involved.
|
|
520
496
|
|
|
@@ -551,49 +527,59 @@ This project has been supported by the following grants:
|
|
|
551
527
|
|
|
552
528
|
### 🍪 Cookiecutter
|
|
553
529
|
|
|
554
|
-
This package was created with
|
|
555
|
-
[
|
|
556
|
-
[cookiecutter
|
|
530
|
+
This package was created with
|
|
531
|
+
[@audreyfeldroy](https://github.com/audreyfeldroy)'s
|
|
532
|
+
[cookiecutter](https://github.com/cookiecutter/cookiecutter) package using
|
|
533
|
+
[@cthoyt](https://github.com/cthoyt)'s
|
|
534
|
+
[cookiecutter-snekpack](https://github.com/cthoyt/cookiecutter-snekpack)
|
|
535
|
+
template.
|
|
557
536
|
|
|
558
537
|
## 🛠️ For Developers
|
|
559
538
|
|
|
560
539
|
<details>
|
|
561
540
|
<summary>See developer instructions</summary>
|
|
562
541
|
|
|
563
|
-
The final section of the README is for if you want to get involved by making a
|
|
542
|
+
The final section of the README is for if you want to get involved by making a
|
|
543
|
+
code contribution.
|
|
564
544
|
|
|
565
545
|
### Development Installation
|
|
566
546
|
|
|
567
547
|
To install in development mode, use the following:
|
|
568
548
|
|
|
569
549
|
```console
|
|
570
|
-
git clone git+https://github.com/biopragmatics/pyobo.git
|
|
571
|
-
cd pyobo
|
|
572
|
-
|
|
550
|
+
$ git clone git+https://github.com/biopragmatics/pyobo.git
|
|
551
|
+
$ cd pyobo
|
|
552
|
+
$ uv pip install -e .
|
|
553
|
+
```
|
|
554
|
+
|
|
555
|
+
Alternatively, install using pip:
|
|
556
|
+
|
|
557
|
+
```console
|
|
558
|
+
$ python3 -m pip install -e .
|
|
573
559
|
```
|
|
574
560
|
|
|
575
561
|
### Updating Package Boilerplate
|
|
576
562
|
|
|
577
|
-
This project uses `cruft` to keep boilerplate (i.e., configuration, contribution
|
|
578
|
-
configuration)
|
|
579
|
-
|
|
563
|
+
This project uses `cruft` to keep boilerplate (i.e., configuration, contribution
|
|
564
|
+
guidelines, documentation configuration) up-to-date with the upstream
|
|
565
|
+
cookiecutter package. Install cruft with either `uv tool install cruft` or
|
|
566
|
+
`python3 -m pip install cruft` then run:
|
|
580
567
|
|
|
581
568
|
```console
|
|
582
|
-
|
|
583
|
-
cruft update
|
|
569
|
+
$ cruft update
|
|
584
570
|
```
|
|
585
571
|
|
|
586
|
-
More info on Cruft's update command is
|
|
587
|
-
|
|
572
|
+
More info on Cruft's update command is available
|
|
573
|
+
[here](https://github.com/cruft/cruft?tab=readme-ov-file#updating-a-project).
|
|
588
574
|
|
|
589
575
|
### 🥼 Testing
|
|
590
576
|
|
|
591
577
|
After cloning the repository and installing `tox` with
|
|
592
|
-
`python3 -m pip install tox tox-uv`,
|
|
593
|
-
|
|
578
|
+
`uv tool install tox --with tox-uv` or `python3 -m pip install tox tox-uv`, the
|
|
579
|
+
unit tests in the `tests/` folder can be run reproducibly with:
|
|
594
580
|
|
|
595
581
|
```console
|
|
596
|
-
tox -e py
|
|
582
|
+
$ tox -e py
|
|
597
583
|
```
|
|
598
584
|
|
|
599
585
|
Additionally, these tests are automatically re-run with each commit in a
|
|
@@ -604,67 +590,77 @@ Additionally, these tests are automatically re-run with each commit in a
|
|
|
604
590
|
The documentation can be built locally using the following:
|
|
605
591
|
|
|
606
592
|
```console
|
|
607
|
-
git clone git+https://github.com/biopragmatics/pyobo.git
|
|
608
|
-
cd pyobo
|
|
609
|
-
tox -e docs
|
|
610
|
-
open docs/build/html/index.html
|
|
593
|
+
$ git clone git+https://github.com/biopragmatics/pyobo.git
|
|
594
|
+
$ cd pyobo
|
|
595
|
+
$ tox -e docs
|
|
596
|
+
$ open docs/build/html/index.html
|
|
611
597
|
```
|
|
612
598
|
|
|
613
|
-
The documentation automatically installs the package as well as the `docs`
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
`extensions` list in [`docs/source/conf.py`](
|
|
599
|
+
The documentation automatically installs the package as well as the `docs` extra
|
|
600
|
+
specified in the [`pyproject.toml`](pyproject.toml). `sphinx` plugins like
|
|
601
|
+
`texext` can be added there. Additionally, they need to be added to the
|
|
602
|
+
`extensions` list in [`docs/source/conf.py`](docs/source/conf.py).
|
|
617
603
|
|
|
618
604
|
The documentation can be deployed to [ReadTheDocs](https://readthedocs.io) using
|
|
619
|
-
[this guide](https://docs.readthedocs.io/en/stable/intro/import-guide.html).
|
|
620
|
-
|
|
621
|
-
You can also set up continuous integration on GitHub to check not
|
|
622
|
-
Sphinx can build the documentation in an isolated environment (i.e.,
|
|
623
|
-
|
|
605
|
+
[this guide](https://docs.readthedocs.io/en/stable/intro/import-guide.html). The
|
|
606
|
+
[`.readthedocs.yml`](.readthedocs.yml) YAML file contains all the configuration
|
|
607
|
+
you'll need. You can also set up continuous integration on GitHub to check not
|
|
608
|
+
only that Sphinx can build the documentation in an isolated environment (i.e.,
|
|
609
|
+
with `tox -e docs-test`) but also that
|
|
610
|
+
[ReadTheDocs can build it too](https://docs.readthedocs.io/en/stable/pull-requests.html).
|
|
624
611
|
|
|
625
612
|
#### Configuring ReadTheDocs
|
|
626
613
|
|
|
627
|
-
1. Log in to ReadTheDocs with your GitHub account to install the integration
|
|
628
|
-
|
|
629
|
-
2. Import your project by navigating to https://readthedocs.org/dashboard/import
|
|
630
|
-
your repository
|
|
631
|
-
3. You can rename the repository on the next screen using a more stylized name
|
|
614
|
+
1. Log in to ReadTheDocs with your GitHub account to install the integration at
|
|
615
|
+
https://readthedocs.org/accounts/login/?next=/dashboard/
|
|
616
|
+
2. Import your project by navigating to https://readthedocs.org/dashboard/import
|
|
617
|
+
then clicking the plus icon next to your repository
|
|
618
|
+
3. You can rename the repository on the next screen using a more stylized name
|
|
619
|
+
(i.e., with spaces and capital letters)
|
|
632
620
|
4. Click next, and you're good to go!
|
|
633
621
|
|
|
634
622
|
### 📦 Making a Release
|
|
635
623
|
|
|
636
624
|
#### Configuring Zenodo
|
|
637
625
|
|
|
638
|
-
[Zenodo](https://zenodo.org) is a long-term archival system that assigns a DOI
|
|
626
|
+
[Zenodo](https://zenodo.org) is a long-term archival system that assigns a DOI
|
|
627
|
+
to each release of your package.
|
|
639
628
|
|
|
640
|
-
1. Log in to Zenodo via GitHub with this link:
|
|
641
|
-
|
|
642
|
-
|
|
629
|
+
1. Log in to Zenodo via GitHub with this link:
|
|
630
|
+
https://zenodo.org/oauth/login/github/?next=%2F. This brings you to a page
|
|
631
|
+
that lists all of your organizations and asks you to approve installing the
|
|
632
|
+
Zenodo app on GitHub. Click "grant" next to any organizations you want to
|
|
633
|
+
enable the integration for, then click the big green "approve" button. This
|
|
643
634
|
step only needs to be done once.
|
|
644
|
-
2. Navigate to https://zenodo.org/account/settings/github/, which lists all of
|
|
645
|
-
|
|
646
|
-
|
|
635
|
+
2. Navigate to https://zenodo.org/account/settings/github/, which lists all of
|
|
636
|
+
your GitHub repositories (both in your username and any organizations you
|
|
637
|
+
enabled). Click the on/off toggle for any relevant repositories. When you
|
|
638
|
+
make a new repository, you'll have to come back to this
|
|
647
639
|
|
|
648
|
-
After these steps, you're ready to go! After you make "release" on GitHub (steps
|
|
649
|
-
to
|
|
650
|
-
to see
|
|
640
|
+
After these steps, you're ready to go! After you make "release" on GitHub (steps
|
|
641
|
+
for this are below), you can navigate to
|
|
642
|
+
https://zenodo.org/account/settings/github/repository/biopragmatics/pyobo to see
|
|
643
|
+
the DOI for the release and link to the Zenodo record for it.
|
|
651
644
|
|
|
652
645
|
#### Registering with the Python Package Index (PyPI)
|
|
653
646
|
|
|
654
647
|
You only have to do the following steps once.
|
|
655
648
|
|
|
656
|
-
1. Register for an account on the
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
649
|
+
1. Register for an account on the
|
|
650
|
+
[Python Package Index (PyPI)](https://pypi.org/account/register)
|
|
651
|
+
2. Navigate to https://pypi.org/manage/account and make sure you have verified
|
|
652
|
+
your email address. A verification email might not have been sent by default,
|
|
653
|
+
so you might have to click the "options" dropdown next to your address to get
|
|
654
|
+
to the "re-send verification email" button
|
|
655
|
+
3. 2-Factor authentication is required for PyPI since the end of 2023 (see this
|
|
656
|
+
[blog post from PyPI](https://blog.pypi.org/posts/2023-05-25-securing-pypi-with-2fa/)).
|
|
657
|
+
This means you have to first issue account recovery codes, then set up
|
|
658
|
+
2-factor authentication
|
|
663
659
|
4. Issue an API token from https://pypi.org/manage/account/token
|
|
664
660
|
|
|
665
661
|
#### Configuring your machine's connection to PyPI
|
|
666
662
|
|
|
667
|
-
You have to do the following steps once per machine.
|
|
663
|
+
You have to do the following steps once per machine.
|
|
668
664
|
|
|
669
665
|
```console
|
|
670
666
|
$ uv tool install keyring
|
|
@@ -676,34 +672,37 @@ Note that this deprecates previous workflows using `.pypirc`.
|
|
|
676
672
|
|
|
677
673
|
#### Uploading to PyPI
|
|
678
674
|
|
|
679
|
-
After installing the package in development mode and installing
|
|
680
|
-
`tox
|
|
681
|
-
|
|
675
|
+
After installing the package in development mode and installing `tox` with
|
|
676
|
+
`uv tool install tox --with tox-uv` or `python3 -m pip install tox tox-uv`, run
|
|
677
|
+
the following from the console:
|
|
682
678
|
|
|
683
679
|
```console
|
|
684
|
-
tox -e finish
|
|
680
|
+
$ tox -e finish
|
|
685
681
|
```
|
|
686
682
|
|
|
687
683
|
This script does the following:
|
|
688
684
|
|
|
689
|
-
1. Uses [bump-my-version](https://github.com/callowayproject/bump-my-version) to
|
|
690
|
-
the `pyproject.toml`, `CITATION.cff`,
|
|
691
|
-
and [`docs/source/conf.py`](
|
|
685
|
+
1. Uses [bump-my-version](https://github.com/callowayproject/bump-my-version) to
|
|
686
|
+
switch the version number in the `pyproject.toml`, `CITATION.cff`,
|
|
687
|
+
`src/pyobo/version.py`, and [`docs/source/conf.py`](docs/source/conf.py) to
|
|
688
|
+
not have the `-dev` suffix
|
|
692
689
|
2. Packages the code in both a tar archive and a wheel using
|
|
693
690
|
[`uv build`](https://docs.astral.sh/uv/guides/publish/#building-your-package)
|
|
694
|
-
3. Uploads to PyPI using
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
691
|
+
3. Uploads to PyPI using
|
|
692
|
+
[`uv publish`](https://docs.astral.sh/uv/guides/publish/#publishing-your-package).
|
|
693
|
+
4. Push to GitHub. You'll need to make a release going with the commit where the
|
|
694
|
+
version was bumped.
|
|
695
|
+
5. Bump the version to the next patch. If you made big changes and want to bump
|
|
696
|
+
the version by minor, you can use `tox -e bumpversion -- minor` after.
|
|
698
697
|
|
|
699
698
|
#### Releasing on GitHub
|
|
700
699
|
|
|
701
|
-
1. Navigate
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
3. Click the "Generate Release Notes" button to get a quick outline of recent
|
|
706
|
-
as you see fit
|
|
700
|
+
1. Navigate to https://github.com/biopragmatics/pyobo/releases/new to draft a
|
|
701
|
+
new release
|
|
702
|
+
2. Click the "Choose a Tag" dropdown and select the tag corresponding to the
|
|
703
|
+
release you just made
|
|
704
|
+
3. Click the "Generate Release Notes" button to get a quick outline of recent
|
|
705
|
+
changes. Modify the title and description as you see fit
|
|
707
706
|
4. Click the big green "Publish Release" button
|
|
708
707
|
|
|
709
708
|
This will trigger Zenodo to assign a DOI to your release as well.
|