BioClients 0.2.20__tar.gz → 0.2.30__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.
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/gwascatalog/Client.py +39 -8
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/gwascatalog/Utils.py +211 -21
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/icite/Utils.py +3 -3
- BioClients-0.2.30/BioClients/umls/CPTClient.py +144 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/umls/Utils.py +0 -74
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/pandas/App.py +9 -2
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients.egg-info/PKG-INFO +26 -9
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients.egg-info/SOURCES.txt +1 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/PKG-INFO +26 -9
- {BioClients-0.2.20 → BioClients-0.2.30}/README.md +25 -4
- {BioClients-0.2.20 → BioClients-0.2.30}/setup.py +1 -1
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/allen/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/allen/brain/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/allen/brain/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/allen/brain/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/amp/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/amp/t2d/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/amp/t2d/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/amp/t2d/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/badapple/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/badapple/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/badapple/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/bindingdb/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/bindingdb/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/bindingdb/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/biogrid/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/biogrid/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/biogrid/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/biomarkerkb/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/biomarkerkb/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/biomarkerkb/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/bioregistry/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/bioregistry/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/bioregistry/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/brenda/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/brenda/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/brenda/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/cas/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/cas/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/cas/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/cdc/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/cdc/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/cdc/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/cfde/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/cfde/cfchemdb/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/cfde/cfchemdb/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/cfde/cfchemdb/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/chebi/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/chebi/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/chebi/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/chem2bio2rdf/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/chem2bio2rdf/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/chem2bio2rdf/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/chem2bio2rdf/slap/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/chem2bio2rdf/slap/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/chem2bio2rdf/slap/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/chembl/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/chembl/FetchByID.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/chembl/UnichemClient.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/chembl/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/chembl/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/chemidplus/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/chemidplus/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/chemidplus/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/clinicaltrials/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/clinicaltrials/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/clinicaltrials/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/disgenet/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/disgenet/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/disgenet/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/dnorm/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/dnorm/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/drugcentral/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/drugcentral/Test.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/drugcentral/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/drugcentral/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/emblebi/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/emblebi/identifiers/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/emblebi/identifiers/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/emblebi/identifiers/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/emblebi/unichem/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/emblebi/unichem/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/emblebi/unichem/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/ensembl/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/ensembl/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/ensembl/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/ensembl/biomart/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/ensembl/biomart/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/ensembl/biomart/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/entrez/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/entrez/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/entrez/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/fda/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/fda/aer/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/fda/aer/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/fda/aer/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/geneontology/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/geneontology/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/geneontology/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/glygen/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/glygen/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/glygen/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/gtex/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/gtex/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/gtex/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/gwascatalog/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/hubmap/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/hubmap/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/hubmap/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/hugo/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/hugo/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/hugo/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/humanbase/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/humanbase/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/icite/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/icite/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/idg/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/idg/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/idg/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/idg/pharos/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/idg/pharos/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/idg/pharos/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/idg/rss/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/idg/rss/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/idg/rss/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/idg/tcrd/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/idg/tcrd/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/idg/tcrd/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/idg/tiga/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/idg/tiga/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/idg/tiga/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/idg/tinx/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/idg/tinx/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/idg/tinx/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/iuphar/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/iuphar/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/iuphar/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/jensenlab/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/jensenlab/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/jensenlab/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/lincs/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/lincs/Client_lincscloud.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/lincs/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/lincs/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/lincs/sigcom/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/lincs/sigcom/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/lincs/sigcom/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/maayanlab/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/maayanlab/archs4/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/maayanlab/archs4/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/maayanlab/archs4/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/maayanlab/harmonizome/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/maayanlab/harmonizome/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/maayanlab/harmonizome/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/medline/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/medline/connect/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/medline/connect/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/medline/connect/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/medline/genetics/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/medline/genetics/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/medline/genetics/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/mesh/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/mesh/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/mesh/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/monarch/Biolink.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/monarch/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/monarch/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/monarch/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/mygene/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/mygene/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/mygene/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/ncats/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/ncats/gsrs/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/ncats/gsrs/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/ncats/gsrs/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/ncbo/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/ncbo/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/ncbo/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/omim/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/omim/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/oncotree/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/oncotree/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/oncotree/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/openphacts/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/openphacts/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/openphacts/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/opentargets/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/opentargets/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/opentargets/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/panther/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/panther/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/pdb/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/pdb/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/pdb/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/pubchem/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/pubchem/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/pubchem/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/pubchem/ftp/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/pubchem/ftp/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/pubchem/ftp/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/pubchem/ftp/pubchem_ftp_actives.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/pubchem/ftp/pubchem_ftp_assay_fetch.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/pubchem/ftp/pubchem_ftp_assay_results.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/pubchem/ftp/pubchem_ftp_assay_search.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/pubchem/ftp/pubchem_ftp_assaysim.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/pubchem/ftp/pubchem_ftp_compound_assaystats.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/pubchem/ftp/pubchem_ftp_gini_index.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/pubchem/rdf/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/pubchem/rdf/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/pubchem/soap/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/pubchem/soap/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/pubchem/soap/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/pubchem/soap/pug_aids2assays.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/pubchem/soap/pug_ids2mols.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/pubchem/soap/pug_substance_search.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/pubmed/App_XML.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/pubmed/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/pubmed/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/pubmed/Utils_XML.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/pubmed/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/pubtator/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/pubtator/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/pubtator/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/reactome/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/reactome/SMBL_utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/reactome/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/reactome/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/rxnorm/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/rxnorm/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/rxnorm/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/stringdb/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/stringdb/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/stringdb/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/tcga/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/tcga/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/tcga/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/ubkg/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/ubkg/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/ubkg/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/umls/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/umls/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/uniprot/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/uniprot/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/uniprot/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/db/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/db/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/graphql/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/graphql/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/hdf/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/hdf/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/igraph/App.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/igraph/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/igraph/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/neo4j/App.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/neo4j/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/neo4j/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/obo/App.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/obo/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/obo/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/owl/App.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/owl/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/owl/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/pandas/Csv2Html.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/pandas/Csv2Markdown.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/pandas/Csv2Sql.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/pandas/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/pandas/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/rdf/App.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/rdf/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/rdf/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/rest/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/rest/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/sparql/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/sparql/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/sparql/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/xml/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/xml/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/yaml/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/util/yaml/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/wikidata/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/wikidata/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/wikidata/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/wikipathways/Client.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/wikipathways/Utils.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients/wikipathways/__init__.py +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients.egg-info/dependency_links.txt +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/BioClients.egg-info/top_level.txt +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/LICENSE +0 -0
- {BioClients-0.2.20 → BioClients-0.2.30}/setup.cfg +0 -0
|
@@ -2,10 +2,17 @@
|
|
|
2
2
|
"""
|
|
3
3
|
GWAS Catalog REST API client.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
https://www.ebi.ac.uk/gwas/
|
|
7
|
-
https://www.ebi.ac.uk/gwas/rest/
|
|
8
|
-
https://www.ebi.ac.uk/gwas/rest/docs/
|
|
5
|
+
V1:
|
|
6
|
+
- https://www.ebi.ac.uk/gwas/docs/api
|
|
7
|
+
- https://www.ebi.ac.uk/gwas/rest/api
|
|
8
|
+
- https://www.ebi.ac.uk/gwas/rest/docs/api
|
|
9
|
+
- https://www.ebi.ac.uk/gwas/rest/docs/sample-scripts
|
|
10
|
+
|
|
11
|
+
V2:
|
|
12
|
+
- https://www.ebi.ac.uk/gwas/rest/api/v2/docs
|
|
13
|
+
- "GWAS RESTful API V2 has been released with various enhancements & improvements over GWAS RESTful API V1. V1 is deprecated and will be retired no later than May 2026."
|
|
14
|
+
- https://www.ebi.ac.uk/gwas/rest/api/v2/docs/reference
|
|
15
|
+
|
|
9
16
|
"""
|
|
10
17
|
import sys,os,re,argparse,json,time,logging
|
|
11
18
|
#
|
|
@@ -19,9 +26,19 @@ Example GCSTs: GCST004364, GCST000227;
|
|
|
19
26
|
Example EFOIDs: EFO_0004232;
|
|
20
27
|
Example SNPIDs: rs6085920, rs2273833, rs6684514, rs144991356
|
|
21
28
|
"""
|
|
22
|
-
parser = argparse.ArgumentParser(description='GWAS Catalog REST API client', epilog=epilog)
|
|
29
|
+
parser = argparse.ArgumentParser(description='GWAS Catalog REST API (V1|V2) client', epilog=epilog)
|
|
23
30
|
searchtypes=['pubmedmid', 'gcst', 'efotrait', 'efouri', 'accessionid', 'rs']
|
|
24
|
-
ops = [
|
|
31
|
+
ops = [
|
|
32
|
+
'get_metadata_v2',
|
|
33
|
+
'list_studies',
|
|
34
|
+
'list_studies_v2',
|
|
35
|
+
'get_studyAssociations',
|
|
36
|
+
'get_studyAssociations_v2',
|
|
37
|
+
'get_snps',
|
|
38
|
+
'get_snps_v2',
|
|
39
|
+
'search_studies',
|
|
40
|
+
'search_studies_v2'
|
|
41
|
+
]
|
|
25
42
|
parser.add_argument("op", choices=ops, help='operation')
|
|
26
43
|
parser.add_argument("--ids", dest="ids", help="IDs, comma-separated")
|
|
27
44
|
parser.add_argument("--searchtype", choices=searchtypes, help="ID type")
|
|
@@ -31,11 +48,13 @@ Example SNPIDs: rs6085920, rs2273833, rs6684514, rs144991356
|
|
|
31
48
|
parser.add_argument("--nmax", type=int, default=None)
|
|
32
49
|
parser.add_argument("--api_host", default=gwascatalog.API_HOST)
|
|
33
50
|
parser.add_argument("--api_base_path", default=gwascatalog.API_BASE_PATH)
|
|
51
|
+
parser.add_argument("--api_base_path_v2", default=gwascatalog.API_BASE_PATH_V2)
|
|
34
52
|
parser.add_argument("-v", "--verbose", default=0, action="count")
|
|
35
53
|
parser.add_argument("-q", "--quiet", default=0, action="count")
|
|
36
54
|
args = parser.parse_args()
|
|
37
55
|
|
|
38
56
|
base_url = 'https://'+args.api_host+args.api_base_path
|
|
57
|
+
base_url_v2 = 'https://'+args.api_host+args.api_base_path_v2
|
|
39
58
|
|
|
40
59
|
fout = open(args.ofile, 'w') if args.ofile else sys.stdout
|
|
41
60
|
|
|
@@ -55,18 +74,30 @@ Example SNPIDs: rs6085920, rs2273833, rs6684514, rs144991356
|
|
|
55
74
|
ids = re.split(r'\s*,\s*', args.ids.strip())
|
|
56
75
|
if ids: logging.info(f"Input IDs: {len(ids)}")
|
|
57
76
|
|
|
58
|
-
if args.op == '
|
|
59
|
-
gwascatalog.
|
|
77
|
+
if args.op == 'get_metadata_v2':
|
|
78
|
+
gwascatalog.GetMetadataV2(base_url, fout)
|
|
60
79
|
|
|
61
80
|
elif args.op == 'list_studies':
|
|
62
81
|
gwascatalog.ListStudies(base_url, fout)
|
|
63
82
|
|
|
83
|
+
elif args.op == 'list_studies_v2':
|
|
84
|
+
gwascatalog.ListStudies(base_url_v2, fout)
|
|
85
|
+
|
|
64
86
|
elif args.op == 'get_studyAssociations':
|
|
65
87
|
gwascatalog.GetStudyAssociations(ids, args.skip, args.nmax, base_url, fout)
|
|
66
88
|
|
|
89
|
+
elif args.op == 'get_studyAssociations_v2':
|
|
90
|
+
gwascatalog.GetStudyAssociationsV2(ids, args.skip, args.nmax, base_url_v2, fout)
|
|
91
|
+
|
|
67
92
|
elif args.op == 'get_snps':
|
|
68
93
|
gwascatalog.GetSnps(ids, args.skip, args.nmax, base_url, fout)
|
|
69
94
|
|
|
95
|
+
elif args.op == 'get_snps_v2':
|
|
96
|
+
gwascatalog.GetSnpsV2(ids, args.skip, args.nmax, base_url_v2, fout)
|
|
97
|
+
|
|
98
|
+
elif args.op == 'search_studies':
|
|
99
|
+
gwascatalog.SearchStudies(ids, args.searchtype, base_url, fout)
|
|
100
|
+
|
|
70
101
|
else:
|
|
71
102
|
parser.error(f"Unknown operation: {args.op}")
|
|
72
103
|
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
"""
|
|
3
|
-
|
|
3
|
+
V1:
|
|
4
|
+
- https://www.ebi.ac.uk/gwas/rest/docs/api
|
|
5
|
+
|
|
6
|
+
V2:
|
|
7
|
+
- https://www.ebi.ac.uk/gwas/rest/api/v2/docs
|
|
8
|
+
- "GWAS RESTful API V2 has been released with various enhancements & improvements over GWAS RESTful API V1. V1 is deprecated and will be retired no later than May 2026."
|
|
9
|
+
- https://www.ebi.ac.uk/gwas/rest/api/v2/docs/reference
|
|
4
10
|
"""
|
|
5
11
|
###
|
|
6
12
|
import sys,os,re,json,time,logging,tqdm
|
|
@@ -12,28 +18,54 @@ import pandas as pd
|
|
|
12
18
|
#
|
|
13
19
|
API_HOST='www.ebi.ac.uk'
|
|
14
20
|
API_BASE_PATH='/gwas/rest/api'
|
|
21
|
+
API_BASE_PATH_V2='/gwas/rest/api/v2'
|
|
15
22
|
BASE_URL='https://'+API_HOST+API_BASE_PATH
|
|
23
|
+
BASE_URL_V2='https://'+API_HOST+API_BASE_PATH_V2
|
|
16
24
|
#
|
|
17
25
|
NCHUNK=100;
|
|
18
26
|
#
|
|
19
27
|
##############################################################################
|
|
20
|
-
def
|
|
21
|
-
"""Only simple metadata."""
|
|
22
|
-
tags=[]; n_study=0; rval=None; df=None; tq=None;
|
|
23
|
-
|
|
28
|
+
def InitiateSession():
|
|
24
29
|
retry_strategy = Retry(
|
|
25
30
|
total=10,
|
|
26
31
|
status=4,
|
|
27
32
|
backoff_factor=2,
|
|
28
33
|
status_forcelist=[413, 429, 500, 502, 503, 504],
|
|
29
34
|
allowed_methods=Retry.DEFAULT_ALLOWED_METHODS
|
|
30
|
-
#method_whitelist=["HEAD", "GET", "PUT", "DELETE", "OPTIONS", "TRACE"] #DEPRECATED: method_whitelist deprecated and removed from urllib3==1.26.0 onwards, as per https://github.com/urllib3/urllib3/blob/main/CHANGES.rst#1260-2020-11-10
|
|
31
35
|
)
|
|
32
36
|
adapter = HTTPAdapter(max_retries=retry_strategy)
|
|
33
37
|
session = requests.Session()
|
|
34
38
|
session.mount("https://", adapter)
|
|
35
39
|
session.mount("http://", adapter)
|
|
40
|
+
return session
|
|
41
|
+
|
|
42
|
+
##############################################################################
|
|
43
|
+
def GetMetadataV2(base_url=BASE_URL_V2, fout=None):
|
|
44
|
+
session = InitiateSession()
|
|
45
|
+
url_this = base_url+f'/metadata'
|
|
46
|
+
response = session.get(url_this)
|
|
47
|
+
if (response.status_code!=200):
|
|
48
|
+
logging.error(f"(status_code={response.status_code}): url_this: {url_this}")
|
|
49
|
+
return
|
|
50
|
+
try:
|
|
51
|
+
rval = response.json()
|
|
52
|
+
except Exception as e:
|
|
53
|
+
logging.error(f"{str(e)}; response.text: {response.text}")
|
|
54
|
+
return
|
|
55
|
+
logging.debug(json.dumps(rval, sort_keys=True, indent=2))
|
|
56
|
+
metadata = rval['_embedded']['mappingMetadatas'][0]
|
|
57
|
+
for key in metadata.keys():
|
|
58
|
+
metadata[key] = [metadata[key]]
|
|
59
|
+
df_this = pd.DataFrame.from_dict(metadata)
|
|
60
|
+
if fout is not None:
|
|
61
|
+
df_this.to_csv(fout, sep="\t", index=False, header=True)
|
|
62
|
+
return df_this
|
|
36
63
|
|
|
64
|
+
##############################################################################
|
|
65
|
+
def ListStudies(base_url=BASE_URL, fout=None):
|
|
66
|
+
"""Only simple metadata."""
|
|
67
|
+
tags=[]; n_study=0; rval=None; df=None; tq=None;
|
|
68
|
+
session = InitiateSession()
|
|
37
69
|
url_this = base_url+f'/studies?size={NCHUNK}'
|
|
38
70
|
while True:
|
|
39
71
|
logging.debug(url_this)
|
|
@@ -55,7 +87,13 @@ def ListStudies(base_url=BASE_URL, fout=None):
|
|
|
55
87
|
if not tags:
|
|
56
88
|
tags = list(study.keys())
|
|
57
89
|
for tag in tags[:]:
|
|
58
|
-
if type(study[tag]) in (list, dict) and tag
|
|
90
|
+
if type(study[tag]) in (list, dict) and tag not in (
|
|
91
|
+
"diseaseTrait", #V1
|
|
92
|
+
"disease_trait", #V2
|
|
93
|
+
"efo_traits", #V2
|
|
94
|
+
"genotyping_technologies", #V2
|
|
95
|
+
"discovery_ancestry" #V2
|
|
96
|
+
):
|
|
59
97
|
tags.remove(tag)
|
|
60
98
|
logging.info(f"Ignoring tag: {tag}")
|
|
61
99
|
df_this = pd.DataFrame({tag:[str(study[tag]) if tag in study else ''] for tag in tags})
|
|
@@ -138,6 +176,77 @@ https://www.ebi.ac.uk/gwas/rest/api/studies/GCST001430/associations?projection=a
|
|
|
138
176
|
logging.info(f"INPUT RCSTs: {n_id}; OUTPUT RCSTs: {n_gcst} ; assns: {n_assn} ; loci: {n_loci} ; alleles: {n_sra} ; snps: {n_snp}")
|
|
139
177
|
if fout is None: return(df)
|
|
140
178
|
|
|
179
|
+
##############################################################################
|
|
180
|
+
def GetStudyAssociationsV2(ids, skip=0, nmax=None, base_url=BASE_URL_V2, fout=None):
|
|
181
|
+
"""
|
|
182
|
+
https://www.ebi.ac.uk/gwas/rest/api/v2/associations?accession_id=GCST000854&page=0&size=20
|
|
183
|
+
sea = SNP effect allele
|
|
184
|
+
"""
|
|
185
|
+
n_id=0; n_assn=0; df=None; tq=None;
|
|
186
|
+
tags_assn=[];
|
|
187
|
+
gcsts=set([]); snps=set([]); loci=set([]); seas=set([]);
|
|
188
|
+
quiet = bool(logging.getLogger().getEffectiveLevel()>15)
|
|
189
|
+
if skip>0: logging.info(f"SKIP IDs skipped: {skip}")
|
|
190
|
+
for id_this in ids[skip:]:
|
|
191
|
+
if not quiet and tq is None: tq = tqdm.tqdm(total=len(ids)-skip)
|
|
192
|
+
if tq is not None: tq.update()
|
|
193
|
+
url_this = base_url+f'/associations?accession_id={id_this}'
|
|
194
|
+
response = requests.get(url_this)
|
|
195
|
+
if (response.status_code!=200):
|
|
196
|
+
logging.error(f"(status_code={response.status_code}): url_this: {url_this}")
|
|
197
|
+
continue
|
|
198
|
+
rval = response.json()
|
|
199
|
+
if not rval: continue
|
|
200
|
+
logging.debug(json.dumps(rval, sort_keys=True, indent=2))
|
|
201
|
+
if '_embedded' in rval and 'associations' in rval['_embedded']:
|
|
202
|
+
assns = rval['_embedded']['associations']
|
|
203
|
+
else:
|
|
204
|
+
logging.error(f'No associations for study: {id_this}')
|
|
205
|
+
continue
|
|
206
|
+
df_this=None;
|
|
207
|
+
for assn in assns:
|
|
208
|
+
n_assn+=1
|
|
209
|
+
if n_assn==1:
|
|
210
|
+
for key,val in assn.items():
|
|
211
|
+
if type(val) not in (list, dict):
|
|
212
|
+
tags_assn.append(key)
|
|
213
|
+
df_assn = pd.DataFrame({tag_assn:[assn[tag_assn]] for tag_assn in tags_assn})
|
|
214
|
+
if 'accession_id' in assn: gcsts.add(assn['accession_id'])
|
|
215
|
+
links = assn['_links'] if '_links' in assn else {}
|
|
216
|
+
loci_this = links['loci']['href'] if 'loci' in links and 'href' in links['loci'] else {}
|
|
217
|
+
snps_this = links['snp']['href'] if 'snp' in links and 'href' in links['snp'] else {}
|
|
218
|
+
if loci_this:
|
|
219
|
+
loci.add(loci_this)
|
|
220
|
+
df_assn['loci'] = [str(loci_this)]
|
|
221
|
+
else:
|
|
222
|
+
df_assn['loci'] = []
|
|
223
|
+
if snps_this:
|
|
224
|
+
snps.add(snps_this)
|
|
225
|
+
df_assn['snps'] = [str(snps_this)]
|
|
226
|
+
else:
|
|
227
|
+
df_assn['snps'] = []
|
|
228
|
+
seas_this = assn['snp_effect_allele'] if 'snp_effect_allele' in assn else []
|
|
229
|
+
if seas_this:
|
|
230
|
+
df_assn['seas'] = [str(seas_this)]
|
|
231
|
+
else:
|
|
232
|
+
df_assn['seas'] = []
|
|
233
|
+
for sea in seas_this:
|
|
234
|
+
seas.add(sea)
|
|
235
|
+
df_this = pd.concat([df_this, df_assn], axis=0)
|
|
236
|
+
if fout: df_this.to_csv(fout, sep="\t", index=False, header=(n_id==0), mode=('w' if n_id==0 else 'a'))
|
|
237
|
+
if fout is None: df = pd.concat([df, df_this], axis=0)
|
|
238
|
+
n_id+=1
|
|
239
|
+
if n_id==nmax:
|
|
240
|
+
logging.info(f"NMAX IDs reached: {nmax}")
|
|
241
|
+
break
|
|
242
|
+
if tq is not None: tq.close()
|
|
243
|
+
n_gcst = len(gcsts)
|
|
244
|
+
n_loci = len(loci)
|
|
245
|
+
n_snp = len(snps)
|
|
246
|
+
n_sea = len(seas)
|
|
247
|
+
logging.info(f"INPUT RCSTs: {n_id}; OUTPUT RCSTs: {n_gcst} ; assns: {n_assn} ; loci: {n_loci} ; alleles: {n_sea} ; snps: {n_snp}")
|
|
248
|
+
if fout is None: return(df)
|
|
249
|
+
|
|
141
250
|
##############################################################################
|
|
142
251
|
def GetSnps(ids, skip=0, nmax=None, base_url=BASE_URL, fout=None):
|
|
143
252
|
"""
|
|
@@ -148,20 +257,7 @@ gc = genomicContext
|
|
|
148
257
|
n_snp=0; n_gene=0; n_loc=0; df=None; tq=None;
|
|
149
258
|
tags_snp=[]; tags_loc=[]; tags_gc=[]; tags_gcloc=[]; tags_gene=[];
|
|
150
259
|
quiet = bool(logging.getLogger().getEffectiveLevel()>15)
|
|
151
|
-
|
|
152
|
-
retry_strategy = Retry(
|
|
153
|
-
total=10,
|
|
154
|
-
status=4,
|
|
155
|
-
backoff_factor=2,
|
|
156
|
-
status_forcelist=[413, 429, 502, 503, 504], #Not 500
|
|
157
|
-
allowed_methods=Retry.DEFAULT_ALLOWED_METHODS
|
|
158
|
-
#method_whitelist=["HEAD", "GET", "PUT", "DELETE", "OPTIONS", "TRACE"] #DEPRECATED: method_whitelist deprecated and removed from urllib3==1.26.0 onwards, as per https://github.com/urllib3/urllib3/blob/main/CHANGES.rst#1260-2020-11-10
|
|
159
|
-
)
|
|
160
|
-
adapter = HTTPAdapter(max_retries=retry_strategy)
|
|
161
|
-
session = requests.Session()
|
|
162
|
-
session.mount("https://", adapter)
|
|
163
|
-
session.mount("http://", adapter)
|
|
164
|
-
|
|
260
|
+
session = InitiateSession()
|
|
165
261
|
url = base_url+'/singleNucleotidePolymorphisms'
|
|
166
262
|
if skip>0: logging.info(f"SKIP IDs skipped: {skip}")
|
|
167
263
|
for id_this in ids[skip:]:
|
|
@@ -214,6 +310,100 @@ gc = genomicContext
|
|
|
214
310
|
logging.info(f"SNPs: {n_snp}; genes: {n_gene}")
|
|
215
311
|
if fout is None: return(df)
|
|
216
312
|
|
|
313
|
+
##############################################################################
|
|
314
|
+
def GetSnpsV2(ids, skip=0, nmax=None, base_url=BASE_URL_V2, fout=None):
|
|
315
|
+
"""
|
|
316
|
+
Input: rs_id, e.g. rs7329174
|
|
317
|
+
https://www.ebi.ac.uk/gwas/rest/api/v2/single-nucleotide-polymorphisms?rs_id=rs7329174&page=0&size=20
|
|
318
|
+
To do(?): Include genomic contexts
|
|
319
|
+
"""
|
|
320
|
+
n_snp=0; n_gene=0; n_loc=0; n_gc=0; df=None; tq=None;
|
|
321
|
+
tags_snp=[]; tags_gc=[];
|
|
322
|
+
quiet = bool(logging.getLogger().getEffectiveLevel()>15)
|
|
323
|
+
session = InitiateSession()
|
|
324
|
+
url = base_url+'/single-nucleotide-polymorphisms'
|
|
325
|
+
if skip>0: logging.info(f"SKIP IDs skipped: {skip}")
|
|
326
|
+
for id_this in ids[skip:]:
|
|
327
|
+
if not quiet and tq is None: tq = tqdm.tqdm(total=len(ids)-skip)
|
|
328
|
+
if tq is not None: tq.update()
|
|
329
|
+
url_this = url+f"?rs_id={id_this}"
|
|
330
|
+
try:
|
|
331
|
+
response = session.get(url_this)
|
|
332
|
+
except Exception as e:
|
|
333
|
+
logging.error(f"Failed for SNP:{id_this}; URL:{url_this}; {str(e)}")
|
|
334
|
+
continue
|
|
335
|
+
if response.status_code!=200:
|
|
336
|
+
logging.error(f"(status_code={response.status_code}): url_this: {url_this}")
|
|
337
|
+
continue
|
|
338
|
+
|
|
339
|
+
rval = response.json()
|
|
340
|
+
logging.debug(json.dumps(rval, sort_keys=True, indent=2))
|
|
341
|
+
snps = rval['_embedded']['snps'] if '_embedded' in rval and 'snps' in rval['_embedded'] else []
|
|
342
|
+
df_this=None;
|
|
343
|
+
for snp in snps:
|
|
344
|
+
if not tags_snp:
|
|
345
|
+
for key,val in snp.items():
|
|
346
|
+
if type(val) not in (list, dict): tags_snp.append(key)
|
|
347
|
+
df_snp = pd.DataFrame({tag_snp:[snp[tag_snp]] for tag_snp in tags_snp})
|
|
348
|
+
if 'mapped_genes' in snp:
|
|
349
|
+
df_snp['mapped_genes'] = [','.join(snp['mapped_genes'])]
|
|
350
|
+
n_gene += len(snp['mapped_genes'])
|
|
351
|
+
links = snp['_links'] if '_links' in snp else {}
|
|
352
|
+
gcs_url = links['genomic_contexts']['href'] if 'genomic_contexts' in links and 'href' in links['genomic_contexts'] else None
|
|
353
|
+
df_snp['genomic_contexts_url'] = [gcs_url]
|
|
354
|
+
|
|
355
|
+
locs = snp['locations'] if 'locations' in snp else []
|
|
356
|
+
locs_strs = []
|
|
357
|
+
for loc in locs:
|
|
358
|
+
cn = loc['chromosome_name'] if 'chromosome_name' in loc else ''
|
|
359
|
+
cp = loc['chromosome_position'] if 'chromosome_position' in loc else ''
|
|
360
|
+
cr = loc['region']['name'] if 'region' in loc and 'name' in loc['region'] else ''
|
|
361
|
+
locs_strs.append(f"{cn}|{cp}|{cr}")
|
|
362
|
+
df_snp['locations'] = [','.join(locs_strs)]
|
|
363
|
+
n_loc += len(locs)
|
|
364
|
+
|
|
365
|
+
rs_id = snp['rs_id'] if 'rs_id' in snp else None
|
|
366
|
+
gcs = GetGenomicContextsV2(rs_id, session)
|
|
367
|
+
df_gc = None
|
|
368
|
+
for gc in gcs:
|
|
369
|
+
if not tags_gc:
|
|
370
|
+
for key,val in gc.items():
|
|
371
|
+
if type(val) not in (list, dict): tags_gc.append(key)
|
|
372
|
+
df_gc = pd.concat([df_gc, pd.DataFrame({tag_gc:[gc[tag_gc]] for tag_gc in tags_gc})])
|
|
373
|
+
n_gc += len(gcs)
|
|
374
|
+
df_snp = pd.concat([df_snp, df_gc], axis=1)
|
|
375
|
+
df_this = pd.concat([df_this, df_snp], axis=0)
|
|
376
|
+
|
|
377
|
+
if fout: df_this.to_csv(fout, sep="\t", index=False, header=(n_snp==0), mode=('w' if n_snp==0 else 'a'))
|
|
378
|
+
if fout is None: df = pd.concat([df, df_this], axis=0)
|
|
379
|
+
n_snp+=1
|
|
380
|
+
if n_snp==nmax:
|
|
381
|
+
logging.info(f"NMAX IDs reached: {nmax}")
|
|
382
|
+
break
|
|
383
|
+
if tq is not None: tq.close()
|
|
384
|
+
logging.info(f"SNPs: {n_snp}; mapped_genes: {n_gene}; locations: {n_loc}; genomic_contexts: {n_gc}")
|
|
385
|
+
if fout is None: return(df)
|
|
386
|
+
|
|
387
|
+
##############################################################################
|
|
388
|
+
def GetGenomicContextsV2(rs_id, session):
|
|
389
|
+
"""
|
|
390
|
+
https://www.ebi.ac.uk/gwas/rest/api/v2/single-nucleotide-polymorphisms/rs7329174/genomic-contexts?sort=distance&direction=asc
|
|
391
|
+
"""
|
|
392
|
+
if not rs_id: return []
|
|
393
|
+
url_this = f"https://www.ebi.ac.uk/gwas/rest/api/v2/single-nucleotide-polymorphisms/{rs_id}/genomic-contexts?sort=distance&direction=asc"
|
|
394
|
+
try:
|
|
395
|
+
response = session.get(url_this)
|
|
396
|
+
except Exception as e:
|
|
397
|
+
logging.error(f"Failed for SNP:{rs_id}; URL:{url_this}; {str(e)}")
|
|
398
|
+
return []
|
|
399
|
+
if response.status_code!=200:
|
|
400
|
+
logging.error(f"(status_code={response.status_code}): url_this: {url_this}")
|
|
401
|
+
return []
|
|
402
|
+
rval = response.json()
|
|
403
|
+
logging.debug(json.dumps(rval, sort_keys=True, indent=2))
|
|
404
|
+
gcs = rval['_embedded']['genomic_contexts'] if '_embedded' in rval and 'genomic_contexts' in rval['_embedded'] else []
|
|
405
|
+
return gcs
|
|
406
|
+
|
|
217
407
|
##############################################################################
|
|
218
408
|
def SearchStudies(ids, searchtype, base_url=BASE_URL, fout=None):
|
|
219
409
|
tags=[]; n_study=0; rval=None; df=None; tq=None;
|
|
@@ -27,11 +27,11 @@ cited_by) reported as counts."""
|
|
|
27
27
|
break
|
|
28
28
|
result = response.json()
|
|
29
29
|
logging.debug(json.dumps(result, indent=2))
|
|
30
|
-
url_self = result['links']['self']
|
|
31
|
-
pubs = result['data']
|
|
30
|
+
#url_self = result['links']['self']
|
|
31
|
+
pubs = result['data'] if 'data' in result else []
|
|
32
32
|
for pub in pubs:
|
|
33
33
|
if not tags: tags = list(pub.keys())
|
|
34
|
-
df_this = pd.DataFrame({
|
|
34
|
+
df_this = pd.DataFrame({tag:[pub[tag] if tag in pub else None] for tag in tags})
|
|
35
35
|
if fout: df_this.to_csv(fout, sep="\t", index=False, header=bool(n_out==0))
|
|
36
36
|
df = pd.concat([df, df_this])
|
|
37
37
|
n_out+=1
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
CPT Client - Current Procedural Terminology (CPT) codes.
|
|
4
|
+
A tool for exploring the UMLS content from the AMA CPT.
|
|
5
|
+
Ref: https://www.ama-assn.org/topics/cpt-codes
|
|
6
|
+
|
|
7
|
+
https://cts.nlm.nih.gov/fhir/res/CodeSystem/$lookup?system=http://www.ama-assn.org/go/cpt&version=2025&code=0031U
|
|
8
|
+
|
|
9
|
+
https://cts.nlm.nih.gov/fhir/res/CodeSystem/$lookup?system=http%3A%2F%2Fwww.ama-assn.org%2Fgo%2Fcpt&version=2025&code=0031U
|
|
10
|
+
|
|
11
|
+
https://cts.nlm.nih.gov/fhir/res/CodeSystem/$lookup?system=http://www.ama-assn.org/go/cpt&version=2025&code=0113U
|
|
12
|
+
"""
|
|
13
|
+
###
|
|
14
|
+
import sys,os,argparse,re,yaml,json,logging,requests,urllib,time
|
|
15
|
+
#
|
|
16
|
+
from .. import umls
|
|
17
|
+
#
|
|
18
|
+
API_HOST="cts.nlm.nih.gov"
|
|
19
|
+
API_BASE_PATH="/fhir/res/CodeSystem"
|
|
20
|
+
API_CODE_SYSTEM="http://www.ama-assn.org/go/cpt"
|
|
21
|
+
API_CODE_VERSION="2025"
|
|
22
|
+
#
|
|
23
|
+
#############################################################################
|
|
24
|
+
def CPTLogin(api_key):
|
|
25
|
+
url_this = "https://cts.nlm.nih.gov/fhir/login"
|
|
26
|
+
headers = {
|
|
27
|
+
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
|
|
28
|
+
'Accept-Language': 'en-US,en;q=0.5',
|
|
29
|
+
'Accept-Encoding': 'gzip, deflate, br, zstd',
|
|
30
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
31
|
+
#'Origin': 'https://cts.nlm.nih.gov',
|
|
32
|
+
'Connection': 'keep-alive',
|
|
33
|
+
'Referer': 'https://cts.nlm.nih.gov/fhir/login.html'
|
|
34
|
+
}
|
|
35
|
+
data = {
|
|
36
|
+
'username':'apikey',
|
|
37
|
+
'password':api_key
|
|
38
|
+
}
|
|
39
|
+
response = requests.post(url_this, headers=headers, data=data)
|
|
40
|
+
if (response.status_code!=200):
|
|
41
|
+
logging.error(f"(status_code={response.status_code};{response.reason};{response.text}): url_this: {url_this}")
|
|
42
|
+
return
|
|
43
|
+
else:
|
|
44
|
+
logging.debug(f"(status_code={response.status_code};{response.reason};{response.text}): url_this: {url_this}")
|
|
45
|
+
|
|
46
|
+
rval = response.json()
|
|
47
|
+
if rval:
|
|
48
|
+
logging.debug(json.dumps(rval, sort_keys=True, indent=2))
|
|
49
|
+
|
|
50
|
+
return
|
|
51
|
+
|
|
52
|
+
#############################################################################
|
|
53
|
+
def GetCPTCodes(ids, api_key, base_url, fout=None):
|
|
54
|
+
"""
|
|
55
|
+
https://cts.nlm.nih.gov/fhir/res/CodeSystem/$lookup?system=http://www.ama-assn.org/go/cpt&version=2025&code=0113U
|
|
56
|
+
|
|
57
|
+
How to include api key in header?
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
headers = {
|
|
62
|
+
"Accept": "application/json"
|
|
63
|
+
}
|
|
64
|
+
n_out=0; df=None;
|
|
65
|
+
for id_this in ids:
|
|
66
|
+
url_this = f"{base_url}&code={id_this}"
|
|
67
|
+
response = requests.get(url_this, headers=headers)
|
|
68
|
+
if (response.status_code!=200):
|
|
69
|
+
logging.error(f"(status_code={response.status_code};{response.reason};{response.text}): url_this: {url_this}")
|
|
70
|
+
continue
|
|
71
|
+
rval = response.json()
|
|
72
|
+
if not rval: continue
|
|
73
|
+
logging.debug(json.dumps(rval, sort_keys=True, indent=2))
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
df_this = pd.DataFrame({'CPT_code':[id_this], 'name': 'TBA'})
|
|
77
|
+
if fout is None: df = pd.concat([df, df_this])
|
|
78
|
+
else: df_this.to_csv(fout, sep="\t", index=False, header=bool(n_out==0))
|
|
79
|
+
n_out+=1
|
|
80
|
+
logging.info(f'n_id: {len(ids)}')
|
|
81
|
+
logging.info(f'n_out: {n_out}')
|
|
82
|
+
if fout is None: return df
|
|
83
|
+
|
|
84
|
+
#############################################################################
|
|
85
|
+
if __name__=='__main__':
|
|
86
|
+
EPILOG = f"""\
|
|
87
|
+
From the AMA website, https://www.ama-assn.org/topics/cpt-codes:
|
|
88
|
+
"Current Procedural Terminology (CPT) codes provide a uniform nomenclature for coding medical procedures and services. Medical CPT codes are critical to streamlining reporting and increasing accuracy and efficiency, as well as for administrative purposes such as claims processing and developing guidelines for medical care review. The AMA develops and manages CPT codes on a rigorous and transparent process led by the CPT Editorial Panel, which ensures codes are issued and updated regularly to reflect current clinical practice and innovation in medicine."
|
|
89
|
+
"""
|
|
90
|
+
parser = argparse.ArgumentParser(description='CPT Client, an UMLS REST API client utility', epilog=EPILOG)
|
|
91
|
+
ops = ['getCodes', 'login']
|
|
92
|
+
parser.add_argument("op", choices=ops, help='OPERATION (select one)')
|
|
93
|
+
parser.add_argument("--ids", help="CPT code IDs (comma-separated) (ex:0153U,81441)")
|
|
94
|
+
parser.add_argument("--idfile", help="input CPT code IDs")
|
|
95
|
+
parser.add_argument("--o", dest="ofile", help="output (TSV)")
|
|
96
|
+
parser.add_argument("--searchQuery", help='string or code')
|
|
97
|
+
parser.add_argument("--skip", default=0, type=int)
|
|
98
|
+
parser.add_argument("--nmax", default=0, type=int)
|
|
99
|
+
#parser.add_argument("--api_version", default=f"{API_VERSION}", help=f"API version {API_VERSION}")
|
|
100
|
+
parser.add_argument("--api_host", default=API_HOST)
|
|
101
|
+
parser.add_argument("--api_base_path", default=API_BASE_PATH)
|
|
102
|
+
parser.add_argument("--api_code_system", default=API_CODE_SYSTEM)
|
|
103
|
+
parser.add_argument("--api_code_version", default=API_CODE_VERSION)
|
|
104
|
+
parser.add_argument("--param_file", default=os.environ['HOME']+"/.umls.yaml")
|
|
105
|
+
parser.add_argument("--api_key", help="API key")
|
|
106
|
+
parser.add_argument("-v", "--verbose", default=0, action="count")
|
|
107
|
+
|
|
108
|
+
args = parser.parse_args()
|
|
109
|
+
|
|
110
|
+
logging.basicConfig(format='%(levelname)s:%(message)s', level=(logging.DEBUG if args.verbose>1 else logging.INFO))
|
|
111
|
+
|
|
112
|
+
base_url = f"https://{args.api_host}{args.api_base_path}/$lookup?system={urllib.parse.quote(args.api_code_system)}&version={args.api_code_version}"
|
|
113
|
+
|
|
114
|
+
fout = open(args.ofile, "w+") if args.ofile else sys.stdout
|
|
115
|
+
|
|
116
|
+
params = umls.ReadParamFile(args.param_file)
|
|
117
|
+
if args.api_key: params['API_KEY'] = args.api_key
|
|
118
|
+
if not params['API_KEY']:
|
|
119
|
+
parser.error('Please specify valid API_KEY via --api_key or --param_file')
|
|
120
|
+
|
|
121
|
+
ids=[];
|
|
122
|
+
if args.idfile:
|
|
123
|
+
fin = open(args.idfile)
|
|
124
|
+
while True:
|
|
125
|
+
line = fin.readline()
|
|
126
|
+
if not line: break
|
|
127
|
+
ids.append(line.rstrip())
|
|
128
|
+
fin.close()
|
|
129
|
+
elif args.ids:
|
|
130
|
+
ids = re.split(r'[,\s]', args.ids)
|
|
131
|
+
if ids: logging.info(f'input IDs: {len(ids)}')
|
|
132
|
+
|
|
133
|
+
t0 = time.time()
|
|
134
|
+
|
|
135
|
+
if args.op == 'getCodes':
|
|
136
|
+
GetCPTCodes(ids, params['API_KEY'], base_url, fout)
|
|
137
|
+
|
|
138
|
+
elif args.op == 'login':
|
|
139
|
+
CPTLogin(params['API_KEY'])
|
|
140
|
+
|
|
141
|
+
else:
|
|
142
|
+
parser.error(f'Invalid operation: {args.op}')
|
|
143
|
+
|
|
144
|
+
logging.info(f"""Elapsed time: {time.strftime('%Hh:%Mm:%Ss',time.gmtime(time.time()-t0))}""")
|
|
@@ -16,84 +16,10 @@ CUI = Concept Unique Identifier
|
|
|
16
16
|
Atom is a term in a source.
|
|
17
17
|
Term-to-concept is many to one.
|
|
18
18
|
|
|
19
|
-
Retrieves information for a known Semantic Type identifier (TUI)
|
|
20
|
-
/semantic-network/{version}/TUI/{id}
|
|
21
|
-
(DOES NOT SEARCH FOR INSTANCES OF THIS TYPE -- RETURNS METADATA ONLY.)
|
|
22
|
-
Example TUIs:
|
|
23
|
-
CHEM|Chemicals & Drugs|T116|Amino Acid, Peptide, or Protein
|
|
24
|
-
CHEM|Chemicals & Drugs|T195|Antibiotic
|
|
25
|
-
CHEM|Chemicals & Drugs|T123|Biologically Active Substance
|
|
26
|
-
CHEM|Chemicals & Drugs|T122|Biomedical or Dental Material
|
|
27
|
-
CHEM|Chemicals & Drugs|T103|Chemical
|
|
28
|
-
CHEM|Chemicals & Drugs|T120|Chemical Viewed Functionally
|
|
29
|
-
CHEM|Chemicals & Drugs|T104|Chemical Viewed Structurally
|
|
30
|
-
CHEM|Chemicals & Drugs|T200|Clinical Drug
|
|
31
|
-
CHEM|Chemicals & Drugs|T126|Enzyme
|
|
32
|
-
CHEM|Chemicals & Drugs|T125|Hormone
|
|
33
|
-
CHEM|Chemicals & Drugs|T129|Immunologic Factor
|
|
34
|
-
CHEM|Chemicals & Drugs|T130|Indicator, Reagent, or Diagnostic Aid
|
|
35
|
-
CHEM|Chemicals & Drugs|T114|Nucleic Acid, Nucleoside, or Nucleotide
|
|
36
|
-
CHEM|Chemicals & Drugs|T109|Organic Chemical
|
|
37
|
-
CHEM|Chemicals & Drugs|T121|Pharmacologic Substance
|
|
38
|
-
CHEM|Chemicals & Drugs|T192|Receptor
|
|
39
|
-
CHEM|Chemicals & Drugs|T127|Vitamin
|
|
40
|
-
DISO|Disorders|T020|Acquired Abnormality
|
|
41
|
-
DISO|Disorders|T190|Anatomical Abnormality
|
|
42
|
-
DISO|Disorders|T049|Cell or Molecular Dysfunction
|
|
43
|
-
DISO|Disorders|T019|Congenital Abnormality
|
|
44
|
-
DISO|Disorders|T047|Disease or Syndrome
|
|
45
|
-
DISO|Disorders|T050|Experimental Model of Disease
|
|
46
|
-
DISO|Disorders|T033|Finding
|
|
47
|
-
DISO|Disorders|T037|Injury or Poisoning
|
|
48
|
-
DISO|Disorders|T048|Mental or Behavioral Dysfunction
|
|
49
|
-
DISO|Disorders|T191|Neoplastic Process
|
|
50
|
-
DISO|Disorders|T046|Pathologic Function
|
|
51
|
-
DISO|Disorders|T184|Sign or Symptom
|
|
52
|
-
GENE|Genes & Molecular Sequences|T087|Amino Acid Sequence
|
|
53
|
-
GENE|Genes & Molecular Sequences|T088|Carbohydrate Sequence
|
|
54
|
-
GENE|Genes & Molecular Sequences|T028|Gene or Genome
|
|
55
|
-
GENE|Genes & Molecular Sequences|T085|Molecular Sequence
|
|
56
|
-
GENE|Genes & Molecular Sequences|T086|Nucleotide Sequence
|
|
57
|
-
|
|
58
19
|
https://github.com/HHS/uts-rest-api
|
|
59
20
|
https://utslogin.nlm.nih.gov
|
|
60
21
|
|
|
61
22
|
https://www.nlm.nih.gov/research/umls/knowledge_sources/metathesaurus/release/abbreviations.html
|
|
62
|
-
Some term types:
|
|
63
|
-
|
|
64
|
-
CE : Entry term for a Supplementary Concept
|
|
65
|
-
ET : Entry term
|
|
66
|
-
FN : Full form of descriptor
|
|
67
|
-
HG : High Level Group Term
|
|
68
|
-
HT : Hierarchical term
|
|
69
|
-
LLT : Lower Level Term
|
|
70
|
-
MH : Main heading
|
|
71
|
-
MTH_FN : MTH Full form of descriptor
|
|
72
|
-
MTH_HG : MTH High Level Group Term
|
|
73
|
-
MTH_HT : MTH Hierarchical term
|
|
74
|
-
MTH_LLT : MTH Lower Level Term
|
|
75
|
-
MTH_OS : MTH System-organ class
|
|
76
|
-
MTH_PT : Metathesaurus preferred term
|
|
77
|
-
MTH_SY : MTH Designated synonym
|
|
78
|
-
NM : Name of Supplementary Concept
|
|
79
|
-
OS : System-organ class
|
|
80
|
-
PCE : Preferred entry term for Supplementary Concept
|
|
81
|
-
PEP : Preferred entry term
|
|
82
|
-
PM : Machine permutation
|
|
83
|
-
PT : Designated preferred name
|
|
84
|
-
PTGB : British preferred term
|
|
85
|
-
SY : Designated synonym
|
|
86
|
-
SYGB : British synonym
|
|
87
|
-
|
|
88
|
-
Some relationships:
|
|
89
|
-
|
|
90
|
-
RB : has a broader relationship
|
|
91
|
-
RL : the relationship is similar or "alike".
|
|
92
|
-
RN : has a narrower relationship
|
|
93
|
-
RO : has relationship other than synonymous, narrower, or broader
|
|
94
|
-
RQ : related and possibly synonymous.
|
|
95
|
-
RU : Related, unspecified
|
|
96
|
-
SY : source asserted synonymy.
|
|
97
23
|
"""
|
|
98
24
|
###
|
|
99
25
|
import sys,os,re,yaml,json,urllib.parse,csv,logging,requests,time
|
|
@@ -46,8 +46,12 @@ if __name__=='__main__':
|
|
|
46
46
|
|
|
47
47
|
logging.basicConfig(format='%(levelname)s:%(message)s', level=(logging.DEBUG if args.verbose>1 else logging.INFO))
|
|
48
48
|
|
|
49
|
-
if args.op in ('selectcols', 'uvalcounts', 'colvalcounts', 'sortbycols'):
|
|
50
|
-
if
|
|
49
|
+
if args.op in ('selectcols', 'selectcols_deduplicate', 'uvalcounts', 'colvalcounts', 'sortbycols'):
|
|
50
|
+
if args.cols:
|
|
51
|
+
logging.info(f"Cols selected: {args.cols}")
|
|
52
|
+
elif args.coltags:
|
|
53
|
+
logging.info(f"Coltags selected: {args.coltags}")
|
|
54
|
+
else:
|
|
51
55
|
parser.error(f'{args.op} requires --cols or --coltags.')
|
|
52
56
|
|
|
53
57
|
logging.info(verstr)
|
|
@@ -69,8 +73,10 @@ if __name__=='__main__':
|
|
|
69
73
|
cols=None; coltags=None;
|
|
70
74
|
if args.cols:
|
|
71
75
|
cols = [(int(col.strip())-1) for col in re.split(r',', args.cols.strip())]
|
|
76
|
+
logging.info(f"Cols selected: {str(cols)}")
|
|
72
77
|
elif args.coltags:
|
|
73
78
|
coltags = [coltag.strip() for coltag in re.split(r',', args.coltags.strip())]
|
|
79
|
+
logging.info(f"Coltags selected: {','.join(coltags)}")
|
|
74
80
|
|
|
75
81
|
search_qrys = [qry.strip() for qry in re.split(r',', args.search_qrys.strip())] if (args.search_qrys is not None) else None
|
|
76
82
|
search_rels = [rel.strip() for rel in re.split(r',', args.search_rels.strip())] if (args.search_rels is not None) else None
|
|
@@ -113,6 +119,7 @@ if __name__=='__main__':
|
|
|
113
119
|
logging.info(f"Input: rows: {df.shape[0]}; cols: {df.shape[1]}")
|
|
114
120
|
subset = coltags if coltags else df.columns[cols].to_list() if cols else None
|
|
115
121
|
df.drop_duplicates(subset=subset, inplace=True)
|
|
122
|
+
df = df[coltags] if coltags else df.iloc[:, cols]
|
|
116
123
|
logging.info(f"Output: rows: {df.shape[0]}; cols: {df.shape[1]}")
|
|
117
124
|
df.to_csv(fout, sep='\t', index=False, header=(not args.noheader))
|
|
118
125
|
|