BioClients 0.2.11__tar.gz → 0.2.16__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (282) hide show
  1. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/chembl/Client.py +4 -0
  2. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/chembl/Utils.py +70 -19
  3. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/drugcentral/Utils.py +5 -1
  4. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/ensembl/Client.py +14 -6
  5. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/ensembl/Utils.py +56 -7
  6. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/hugo/Client.py +2 -2
  7. BioClients-0.2.16/BioClients/hugo/Utils.py +133 -0
  8. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/medline/genetics/Client.py +1 -0
  9. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/medline/genetics/Utils.py +24 -6
  10. BioClients-0.2.16/BioClients/oncotree/Client.py +73 -0
  11. BioClients-0.2.16/BioClients/oncotree/Utils.py +68 -0
  12. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/pubchem/Utils.py +1 -1
  13. BioClients-0.2.16/BioClients/ubkg/Client.py +111 -0
  14. BioClients-0.2.16/BioClients/ubkg/Utils.py +219 -0
  15. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/umls/Utils.py +2 -2
  16. BioClients-0.2.16/BioClients/util/owl/App.py +31 -0
  17. BioClients-0.2.16/BioClients/util/owl/Utils.py +34 -0
  18. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/util/pandas/App.py +7 -1
  19. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/util/pandas/Utils.py +13 -5
  20. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/util/rdf/App.py +2 -8
  21. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/util/rdf/Utils.py +0 -24
  22. BioClients-0.2.16/BioClients/util/yaml/__init__.py +1 -0
  23. BioClients-0.2.16/BioClients/wikidata/__init__.py +1 -0
  24. BioClients-0.2.16/BioClients/wikipathways/__init__.py +1 -0
  25. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients.egg-info/PKG-INFO +6 -6
  26. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients.egg-info/SOURCES.txt +9 -0
  27. {BioClients-0.2.11 → BioClients-0.2.16}/PKG-INFO +6 -6
  28. {BioClients-0.2.11 → BioClients-0.2.16}/README.md +4 -4
  29. {BioClients-0.2.11 → BioClients-0.2.16}/setup.py +2 -2
  30. BioClients-0.2.11/BioClients/hugo/Utils.py +0 -103
  31. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/__init__.py +0 -0
  32. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/allen/__init__.py +0 -0
  33. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/allen/brain/Client.py +0 -0
  34. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/allen/brain/Utils.py +0 -0
  35. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/allen/brain/__init__.py +0 -0
  36. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/amp/__init__.py +0 -0
  37. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/amp/t2d/Client.py +0 -0
  38. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/amp/t2d/Utils.py +0 -0
  39. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/amp/t2d/__init__.py +0 -0
  40. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/bindingdb/Client.py +0 -0
  41. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/bindingdb/Utils.py +0 -0
  42. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/bindingdb/__init__.py +0 -0
  43. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/biogrid/Client.py +0 -0
  44. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/biogrid/Utils.py +0 -0
  45. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/biogrid/__init__.py +0 -0
  46. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/bioregistry/Client.py +0 -0
  47. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/bioregistry/Utils.py +0 -0
  48. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/bioregistry/__init__.py +0 -0
  49. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/brenda/Client.py +0 -0
  50. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/brenda/Utils.py +0 -0
  51. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/brenda/__init__.py +0 -0
  52. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/cas/Client.py +0 -0
  53. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/cas/Utils.py +0 -0
  54. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/cas/__init__.py +0 -0
  55. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/cdc/Client.py +0 -0
  56. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/cdc/Utils.py +0 -0
  57. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/cdc/__init__.py +0 -0
  58. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/cfde/__init__.py +0 -0
  59. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/cfde/cfchemdb/Client.py +0 -0
  60. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/cfde/cfchemdb/Utils.py +0 -0
  61. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/cfde/cfchemdb/__init__.py +0 -0
  62. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/chebi/Client.py +0 -0
  63. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/chebi/Utils.py +0 -0
  64. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/chebi/__init__.py +0 -0
  65. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/chem2bio2rdf/Client.py +0 -0
  66. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/chem2bio2rdf/Utils.py +0 -0
  67. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/chem2bio2rdf/__init__.py +0 -0
  68. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/chem2bio2rdf/slap/Client.py +0 -0
  69. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/chem2bio2rdf/slap/Utils.py +0 -0
  70. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/chem2bio2rdf/slap/__init__.py +0 -0
  71. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/chembl/FetchByID.py +0 -0
  72. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/chembl/UnichemClient.py +0 -0
  73. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/chembl/__init__.py +0 -0
  74. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/chemidplus/Client.py +0 -0
  75. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/chemidplus/Utils.py +0 -0
  76. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/chemidplus/__init__.py +0 -0
  77. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/clinicaltrials/Client.py +0 -0
  78. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/clinicaltrials/Utils.py +0 -0
  79. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/clinicaltrials/__init__.py +0 -0
  80. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/disgenet/Client.py +0 -0
  81. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/disgenet/Utils.py +0 -0
  82. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/disgenet/__init__.py +0 -0
  83. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/dnorm/Client.py +0 -0
  84. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/dnorm/__init__.py +0 -0
  85. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/drugcentral/Client.py +0 -0
  86. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/drugcentral/Test.py +0 -0
  87. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/drugcentral/__init__.py +0 -0
  88. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/emblebi/__init__.py +0 -0
  89. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/emblebi/identifiers/Client.py +0 -0
  90. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/emblebi/identifiers/Utils.py +0 -0
  91. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/emblebi/identifiers/__init__.py +0 -0
  92. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/emblebi/unichem/Client.py +0 -0
  93. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/emblebi/unichem/Utils.py +0 -0
  94. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/emblebi/unichem/__init__.py +0 -0
  95. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/ensembl/__init__.py +0 -0
  96. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/ensembl/biomart/Client.py +0 -0
  97. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/ensembl/biomart/Utils.py +0 -0
  98. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/ensembl/biomart/__init__.py +0 -0
  99. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/fda/__init__.py +0 -0
  100. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/fda/aer/Client.py +0 -0
  101. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/fda/aer/Utils.py +0 -0
  102. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/fda/aer/__init__.py +0 -0
  103. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/geneontology/Client.py +0 -0
  104. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/geneontology/Utils.py +0 -0
  105. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/geneontology/__init__.py +0 -0
  106. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/glygen/Client.py +0 -0
  107. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/glygen/Utils.py +0 -0
  108. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/glygen/__init__.py +0 -0
  109. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/gtex/Client.py +0 -0
  110. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/gtex/Utils.py +0 -0
  111. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/gtex/__init__.py +0 -0
  112. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/gwascatalog/Client.py +0 -0
  113. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/gwascatalog/Utils.py +0 -0
  114. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/gwascatalog/__init__.py +0 -0
  115. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/hubmap/Client.py +0 -0
  116. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/hubmap/Utils.py +0 -0
  117. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/hubmap/__init__.py +0 -0
  118. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/hugo/__init__.py +0 -0
  119. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/humanbase/Client.py +0 -0
  120. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/humanbase/__init__.py +0 -0
  121. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/icite/Client.py +0 -0
  122. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/icite/Utils.py +0 -0
  123. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/icite/__init__.py +0 -0
  124. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/idg/Client.py +0 -0
  125. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/idg/Utils.py +0 -0
  126. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/idg/__init__.py +0 -0
  127. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/idg/pharos/Client.py +0 -0
  128. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/idg/pharos/Utils.py +0 -0
  129. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/idg/pharos/__init__.py +0 -0
  130. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/idg/rss/Client.py +0 -0
  131. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/idg/rss/Utils.py +0 -0
  132. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/idg/rss/__init__.py +0 -0
  133. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/idg/tcrd/Client.py +0 -0
  134. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/idg/tcrd/Utils.py +0 -0
  135. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/idg/tcrd/__init__.py +0 -0
  136. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/idg/tiga/Client.py +0 -0
  137. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/idg/tiga/Utils.py +0 -0
  138. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/idg/tiga/__init__.py +0 -0
  139. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/idg/tinx/Client.py +0 -0
  140. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/idg/tinx/Utils.py +0 -0
  141. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/idg/tinx/__init__.py +0 -0
  142. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/iuphar/Client.py +0 -0
  143. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/iuphar/Utils.py +0 -0
  144. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/iuphar/__init__.py +0 -0
  145. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/jensenlab/Client.py +0 -0
  146. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/jensenlab/Utils.py +0 -0
  147. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/jensenlab/__init__.py +0 -0
  148. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/lincs/Client.py +0 -0
  149. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/lincs/Client_lincscloud.py +0 -0
  150. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/lincs/Utils.py +0 -0
  151. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/lincs/__init__.py +0 -0
  152. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/lincs/sigcom/Client.py +0 -0
  153. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/lincs/sigcom/Utils.py +0 -0
  154. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/lincs/sigcom/__init__.py +0 -0
  155. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/maayanlab/__init__.py +0 -0
  156. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/maayanlab/archs4/Client.py +0 -0
  157. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/maayanlab/archs4/Utils.py +0 -0
  158. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/maayanlab/archs4/__init__.py +0 -0
  159. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/maayanlab/harmonizome/Client.py +0 -0
  160. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/maayanlab/harmonizome/Utils.py +0 -0
  161. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/maayanlab/harmonizome/__init__.py +0 -0
  162. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/medline/__init__.py +0 -0
  163. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/medline/connect/Client.py +0 -0
  164. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/medline/connect/Utils.py +0 -0
  165. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/medline/connect/__init__.py +0 -0
  166. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/medline/genetics/__init__.py +0 -0
  167. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/mesh/Client.py +0 -0
  168. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/mesh/Utils.py +0 -0
  169. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/mesh/__init__.py +0 -0
  170. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/monarch/Biolink.py +0 -0
  171. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/monarch/Client.py +0 -0
  172. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/monarch/Utils.py +0 -0
  173. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/monarch/__init__.py +0 -0
  174. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/mygene/Client.py +0 -0
  175. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/mygene/Utils.py +0 -0
  176. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/mygene/__init__.py +0 -0
  177. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/ncats/__init__.py +0 -0
  178. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/ncats/gsrs/Client.py +0 -0
  179. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/ncats/gsrs/Utils.py +0 -0
  180. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/ncats/gsrs/__init__.py +0 -0
  181. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/ncbo/Client.py +0 -0
  182. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/ncbo/Utils.py +0 -0
  183. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/ncbo/__init__.py +0 -0
  184. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/omim/Client.py +0 -0
  185. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/omim/__init__.py +0 -0
  186. {BioClients-0.2.11/BioClients/openphacts → BioClients-0.2.16/BioClients/oncotree}/__init__.py +0 -0
  187. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/openphacts/Client.py +0 -0
  188. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/openphacts/Utils.py +0 -0
  189. {BioClients-0.2.11/BioClients/opentargets → BioClients-0.2.16/BioClients/openphacts}/__init__.py +0 -0
  190. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/opentargets/Client.py +0 -0
  191. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/opentargets/Utils.py +0 -0
  192. {BioClients-0.2.11/BioClients/pdb → BioClients-0.2.16/BioClients/opentargets}/__init__.py +0 -0
  193. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/panther/Client.py +0 -0
  194. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/panther/__init__.py +0 -0
  195. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/pdb/Client.py +0 -0
  196. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/pdb/Utils.py +0 -0
  197. {BioClients-0.2.11/BioClients/pubchem/ftp → BioClients-0.2.16/BioClients/pdb}/__init__.py +0 -0
  198. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/pubchem/Client.py +0 -0
  199. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/pubchem/__init__.py +0 -0
  200. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/pubchem/ftp/Client.py +0 -0
  201. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/pubchem/ftp/Utils.py +0 -0
  202. {BioClients-0.2.11/BioClients/pubchem/soap → BioClients-0.2.16/BioClients/pubchem/ftp}/__init__.py +0 -0
  203. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/pubchem/ftp/pubchem_ftp_actives.py +0 -0
  204. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/pubchem/ftp/pubchem_ftp_assay_fetch.py +0 -0
  205. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/pubchem/ftp/pubchem_ftp_assay_results.py +0 -0
  206. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/pubchem/ftp/pubchem_ftp_assay_search.py +0 -0
  207. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/pubchem/ftp/pubchem_ftp_assaysim.py +0 -0
  208. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/pubchem/ftp/pubchem_ftp_compound_assaystats.py +0 -0
  209. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/pubchem/ftp/pubchem_ftp_gini_index.py +0 -0
  210. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/pubchem/rdf/Client.py +0 -0
  211. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/pubchem/rdf/__init__.py +0 -0
  212. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/pubchem/soap/Client.py +0 -0
  213. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/pubchem/soap/Utils.py +0 -0
  214. {BioClients-0.2.11/BioClients/pubtator → BioClients-0.2.16/BioClients/pubchem/soap}/__init__.py +0 -0
  215. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/pubchem/soap/pug_aids2assays.py +0 -0
  216. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/pubchem/soap/pug_ids2mols.py +0 -0
  217. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/pubchem/soap/pug_substance_search.py +0 -0
  218. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/pubmed/App_XML.py +0 -0
  219. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/pubmed/Client.py +0 -0
  220. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/pubmed/Utils.py +0 -0
  221. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/pubmed/Utils_XML.py +0 -0
  222. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/pubmed/__init__.py +0 -0
  223. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/pubtator/Client.py +0 -0
  224. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/pubtator/Utils.py +0 -0
  225. {BioClients-0.2.11/BioClients/rxnorm → BioClients-0.2.16/BioClients/pubtator}/__init__.py +0 -0
  226. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/reactome/Client.py +0 -0
  227. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/reactome/SMBL_utils.py +0 -0
  228. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/reactome/Utils.py +0 -0
  229. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/reactome/__init__.py +0 -0
  230. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/rxnorm/Client.py +0 -0
  231. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/rxnorm/Utils.py +0 -0
  232. {BioClients-0.2.11/BioClients/stringdb → BioClients-0.2.16/BioClients/rxnorm}/__init__.py +0 -0
  233. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/stringdb/Client.py +0 -0
  234. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/stringdb/Utils.py +0 -0
  235. {BioClients-0.2.11/BioClients/tcga → BioClients-0.2.16/BioClients/stringdb}/__init__.py +0 -0
  236. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/tcga/Client.py +0 -0
  237. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/tcga/Utils.py +0 -0
  238. {BioClients-0.2.11/BioClients/umls → BioClients-0.2.16/BioClients/tcga}/__init__.py +0 -0
  239. {BioClients-0.2.11/BioClients/uniprot → BioClients-0.2.16/BioClients/ubkg}/__init__.py +0 -0
  240. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/umls/Client.py +0 -0
  241. {BioClients-0.2.11/BioClients/util/db → BioClients-0.2.16/BioClients/umls}/__init__.py +0 -0
  242. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/uniprot/Client.py +0 -0
  243. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/uniprot/Utils.py +0 -0
  244. {BioClients-0.2.11/BioClients/util/graphql → BioClients-0.2.16/BioClients/uniprot}/__init__.py +0 -0
  245. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/util/__init__.py +0 -0
  246. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/util/db/Utils.py +0 -0
  247. {BioClients-0.2.11/BioClients/util/hdf → BioClients-0.2.16/BioClients/util/db}/__init__.py +0 -0
  248. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/util/graphql/Utils.py +0 -0
  249. {BioClients-0.2.11/BioClients/util/igraph → BioClients-0.2.16/BioClients/util/graphql}/__init__.py +0 -0
  250. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/util/hdf/Utils.py +0 -0
  251. {BioClients-0.2.11/BioClients/util/neo4j → BioClients-0.2.16/BioClients/util/hdf}/__init__.py +0 -0
  252. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/util/igraph/App.py +0 -0
  253. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/util/igraph/Utils.py +0 -0
  254. {BioClients-0.2.11/BioClients/util/obo → BioClients-0.2.16/BioClients/util/igraph}/__init__.py +0 -0
  255. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/util/neo4j/App.py +0 -0
  256. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/util/neo4j/Utils.py +0 -0
  257. {BioClients-0.2.11/BioClients/util/pandas → BioClients-0.2.16/BioClients/util/neo4j}/__init__.py +0 -0
  258. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/util/obo/App.py +0 -0
  259. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/util/obo/Utils.py +0 -0
  260. {BioClients-0.2.11/BioClients/util/rdf → BioClients-0.2.16/BioClients/util/obo}/__init__.py +0 -0
  261. {BioClients-0.2.11/BioClients/util/rest → BioClients-0.2.16/BioClients/util/owl}/__init__.py +0 -0
  262. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/util/pandas/Csv2Html.py +0 -0
  263. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/util/pandas/Csv2Markdown.py +0 -0
  264. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/util/pandas/Csv2Sql.py +0 -0
  265. {BioClients-0.2.11/BioClients/util/sparql → BioClients-0.2.16/BioClients/util/pandas}/__init__.py +0 -0
  266. {BioClients-0.2.11/BioClients/util/xml → BioClients-0.2.16/BioClients/util/rdf}/__init__.py +0 -0
  267. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/util/rest/Utils.py +0 -0
  268. {BioClients-0.2.11/BioClients/util/yaml → BioClients-0.2.16/BioClients/util/rest}/__init__.py +0 -0
  269. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/util/sparql/Client.py +0 -0
  270. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/util/sparql/Utils.py +0 -0
  271. {BioClients-0.2.11/BioClients/wikidata → BioClients-0.2.16/BioClients/util/sparql}/__init__.py +0 -0
  272. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/util/xml/Utils.py +0 -0
  273. {BioClients-0.2.11/BioClients/wikipathways → BioClients-0.2.16/BioClients/util/xml}/__init__.py +0 -0
  274. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/util/yaml/Utils.py +0 -0
  275. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/wikidata/Client.py +0 -0
  276. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/wikidata/Utils.py +0 -0
  277. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/wikipathways/Client.py +0 -0
  278. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients/wikipathways/Utils.py +0 -0
  279. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients.egg-info/dependency_links.txt +0 -0
  280. {BioClients-0.2.11 → BioClients-0.2.16}/BioClients.egg-info/top_level.txt +0 -0
  281. {BioClients-0.2.11 → BioClients-0.2.16}/LICENSE +0 -0
  282. {BioClients-0.2.11 → BioClients-0.2.16}/setup.cfg +0 -0
@@ -71,6 +71,7 @@ if __name__=='__main__':
71
71
  "get_activity_by_assay",
72
72
  "get_activity_by_target",
73
73
  "get_activity_properties",
74
+ "get_drug_indications",
74
75
  "get_document"]
75
76
  parser.add_argument("op", choices=ops, help='OPERATION (select one)')
76
77
  parser.add_argument("--ids", help="input IDs (e.g. mol, assay, target, document)")
@@ -169,6 +170,9 @@ if __name__=='__main__':
169
170
  elif args.op == "get_activity_properties":
170
171
  chembl.GetActivityProperties(ids, args.skip, args.nmax, base_url, fout)
171
172
 
173
+ elif args.op == "get_drug_indications":
174
+ chembl.GetDrugIndications(ids, args.skip, args.nmax, base_url, fout)
175
+
172
176
  elif args.op == "get_target":
173
177
  chembl.GetTarget(ids, base_url, fout)
174
178
 
@@ -161,32 +161,35 @@ def ListTargets(skip, nmax, api_host=API_HOST, api_base_path=API_BASE_PATH, fout
161
161
 
162
162
  #############################################################################
163
163
  def GetTarget(ids, base_url=BASE_URL, fout=None):
164
- '''One row per target. Ignore synonyms. If one-component, single protein, include UniProt accession.'''
164
+ '''One row per target. If one-component, single protein, include UniProt accession, and gene symbol.'''
165
165
  n_tgt=0; n_cmt=0; n_out=0; tags=None; df=None; tq=None;
166
+ tags_tgt = ["target_chembl_id", "target_type", "organism", "tax_id", "pref_name", "species_group_flag"]
167
+ tags_cmt = ["accession", "gene_symbol"]
168
+
166
169
  for id_this in ids:
167
170
  response = requests.get(f"{base_url}/target/{id_this}.json")
168
171
  if response.status_code != 200:
169
172
  logging.error(f"status_code: {response.status_code}")
170
173
  continue
171
174
  result = response.json()
175
+ logging.debug(json.dumps(result, sort_keys=True, indent=2))
172
176
  n_tgt+=1
173
177
  if not tq: tq = tqdm.tqdm(total=len(ids), unit="tgts")
174
178
  tq.update()
175
- if n_tgt==1 or not tags:
176
- tags = sorted(result.keys())
177
- for tag in tags[:]:
178
- if type(result[tag]) in (dict, list, tuple):
179
- tags.remove(tag)
180
- logging.debug(f'Ignoring field ({type(result[tag])}): "{tag}"')
181
- tags.extend(["component_count", "accession"])
182
- fout.write('\t'.join(tags)+'\n')
183
- logging.debug(json.dumps(result,sort_keys=True,indent=2))
184
- vals = [str(result[tag]) if tag in result else "" for tag in tags]
179
+ if n_tgt==1:
180
+ fout.write('\t'.join(tags_tgt+["accession"]+tags_cmt)+'\n')
181
+ vals = [str(result[tag]) if tag in result else "" for tag in tags_tgt]
185
182
  if "target_components" in result and result["target_components"]:
186
183
  cmts = result["target_components"]
187
184
  n_cmt+=len(cmts)
188
185
  vals.append(f"{len(cmts)}")
189
186
  vals.append(str(cmts[0]["accession"]) if len(cmts)==1 else "")
187
+ gene_symbol = ""
188
+ if "target_component_synonyms" in cmts[0]:
189
+ for syn in cmts[0]["target_component_synonyms"]:
190
+ if syn["syn_type"] == "GENE_SYMBOL":
191
+ gene_symbol = syn["component_synonym"]
192
+ vals.append(gene_symbol)
190
193
  else:
191
194
  logging.debug(f"no-component target: {vals[0]}")
192
195
  vals.extend(["", ""])
@@ -364,7 +367,9 @@ def ListProteinClasses(api_host=API_HOST, api_base_path=API_BASE_PATH, fout=None
364
367
 
365
368
  #############################################################################
366
369
  def ListDrugIndications(skip, nmax, api_host=API_HOST, api_base_path=API_BASE_PATH, fout=None):
367
- n_efo=0; n_out=0; tags=None; df=None; tq=None;
370
+ """From ClinicalTrials.gov, DailyMed, ATC"""
371
+ n_out=0; tags=None; df=None; tq=None; efos=set(); ref_types=set();
372
+ tags_ind_ref = ["ref_type", "ref_id", "ref_url"]
368
373
  url_next = f"{api_base_path}/drug_indication.json?limit={NCHUNK}&offset={skip}"
369
374
  while True:
370
375
  response = requests.get(f"https://{api_host}{url_next}")
@@ -378,20 +383,66 @@ def ListDrugIndications(skip, nmax, api_host=API_HOST, api_base_path=API_BASE_PA
378
383
  if not tags:
379
384
  tags = [tag for tag in list(din.keys()) if type(din[tag]) not in (dict, list)]
380
385
  logging.debug(json.dumps(din, sort_keys=True, indent=2))
381
- if "efo_id" in din and din["efo_id"]: n_efo+=1
382
- df_this = pd.DataFrame({tag:[(din[tag] if tag in din else None)] for tag in tags})
383
- if fout is None: df = pd.concat([df, df_this])
384
- else: df_this.to_csv(fout, "\t", index=False, header=bool(n_out==0))
385
- n_out+=df_this.shape[0]
386
+ ind_refs = din["indication_refs"] if "indication_refs" in din else []
387
+ if not ind_refs: continue
388
+ for ind_ref in ind_refs:
389
+ if "efo_id" in din and din["efo_id"]: efos.add(din["efo_id"])
390
+ if "ref_type" in ind_ref and ind_ref["ref_type"]: ref_types.add(ind_ref["ref_type"])
391
+ df_this = pd.concat([
392
+ pd.DataFrame({tag:[(din[tag] if tag in din else None)] for tag in tags}),
393
+ pd.DataFrame({tag:[(ind_ref[tag] if tag in ind_ref else None)] for tag in tags_ind_ref}),
394
+ ], axis=1)
395
+ if fout is None: df = pd.concat([df, df_this])
396
+ else: df_this.to_csv(fout, "\t", index=False, header=bool(n_out==0))
397
+ n_out+=1
386
398
  if tq is not None: tq.update()
387
399
  if nmax and n_out>=nmax: break
388
400
  if nmax and n_out>=nmax: break
389
401
  total_count = result["page_meta"]["total_count"] if "page_meta" in result and "total_count" in result["page_meta"] else None
390
- if not tq: tq = tqdm.tqdm(total=total_count, unit="inds")
402
+ if not tq: tq = tqdm.tqdm(total=total_count)
391
403
  url_next = result["page_meta"]["next"] if "page_meta" in result and "next" in result["page_meta"] else None
392
404
  if not url_next: break
393
405
  if tq is not None: tq.close()
394
- logging.info(f"n_out: {n_out}; n_efo: {n_efo}")
406
+ logging.info(f"n_out: {n_out}; n_efo: {len(efos)}")
407
+ logging.info(f"ref_types: {list(ref_types)}")
408
+ return df
409
+
410
+ #############################################################################
411
+ def GetDrugIndications(ids, skip=0, nmax=None, base_url=BASE_URL, fout=None):
412
+ n_out=0; tags=None; df=None; tq=None; efos=set(); ref_types=set();
413
+ tags_ind_ref = ["ref_type", "ref_id", "ref_url"]
414
+ for i,id_this in enumerate(ids):
415
+ if not tq: tq = tqdm.tqdm(total=len(ids)-skip)
416
+ if i<skip: continue
417
+ response = requests.get(f"{base_url}/drug_indication.json?molecule_chembl_id={id_this}")
418
+ if response.status_code != 200:
419
+ logging.error(f"status_code: {response.status_code}")
420
+ break
421
+ result = response.json()
422
+ logging.debug(json.dumps(result, sort_keys=True, indent=2))
423
+ dins = result["drug_indications"] if "drug_indications" in result else []
424
+ for din in dins:
425
+ if not tags:
426
+ tags = [tag for tag in list(din.keys()) if type(din[tag]) not in (dict, list)]
427
+ logging.debug(json.dumps(din, sort_keys=True, indent=2))
428
+ ind_refs = din["indication_refs"] if "indication_refs" in din else []
429
+ if not ind_refs: continue
430
+ for ind_ref in ind_refs:
431
+ if "efo_id" in din and din["efo_id"]: efos.add(din["efo_id"])
432
+ if "ref_type" in ind_ref and ind_ref["ref_type"]: ref_types.add(ind_ref["ref_type"])
433
+ df_this = pd.concat([
434
+ pd.DataFrame({tag:[(din[tag] if tag in din else None)] for tag in tags}),
435
+ pd.DataFrame({tag:[(ind_ref[tag] if tag in ind_ref else None)] for tag in tags_ind_ref}),
436
+ ], axis=1)
437
+ if fout is None: df = pd.concat([df, df_this])
438
+ else: df_this.to_csv(fout, "\t", index=False, header=bool(n_out==0))
439
+ n_out+=1
440
+ if tq is not None: tq.update()
441
+ if nmax and n_out>=nmax: break
442
+ if nmax and n_out>=nmax: break
443
+ if tq is not None: tq.close()
444
+ logging.info(f"n_out: {n_out}; n_efo: {len(efos)}")
445
+ logging.info(f"ref_types: {list(ref_types)}")
395
446
  return df
396
447
 
397
448
  #############################################################################
@@ -628,9 +628,13 @@ SELECT DISTINCT
628
628
  atf.struct_id,
629
629
  atf.target_id,
630
630
  atf.target_name,
631
+ atf.accession,
632
+ atf.tdl,
631
633
  atf.gene,
632
634
  atf.action_type,
633
635
  atf.act_source,
636
+ atf.act_value,
637
+ atf.act_unit,
634
638
  atf.act_type,
635
639
  atf.act_comment,
636
640
  atf.relation,
@@ -652,7 +656,7 @@ WHERE
652
656
  logging.debug(sql.format(id_this))
653
657
  df_this = pd.read_sql(sql.format(id_this), dbcon)
654
658
  if fout is None: df = pd.concat([df, df_this])
655
- else: df_this.to_csv(fout, "\t", index=False)
659
+ else: df_this.to_csv(fout, "\t", index=False, header=bool(n_out==0))
656
660
  n_out += df_this.shape[0]
657
661
  logging.info(f"n_out: {n_out}")
658
662
  return df
@@ -2,6 +2,9 @@
2
2
  """
3
3
  Access to Ensembl REST API.
4
4
  http://rest.ensembl.org/documentation/info/lookup
5
+ Mostly by gene, except Variant Effect Predictor (VEP) by SNP.
6
+ https://ensembl.org/info/docs/tools/vep/
7
+ https://rest.ensembl.org/documentation/info/vep_id_get
5
8
  """
6
9
  import sys,os,re,argparse,time,json,logging
7
10
 
@@ -10,13 +13,15 @@ from .. import ensembl
10
13
  ##############################################################################
11
14
  if __name__=='__main__':
12
15
  parser = argparse.ArgumentParser(prog=sys.argv[0], description="Ensembl REST API client", epilog="Example IDs: ENSG00000157764, ENSG00000160785")
13
- ops = ["list_species", "get_xrefs", "get_info", "show_version"]
16
+ ops = ["list_species", "get_xrefs", "get_info", "get_vep", "show_version"]
14
17
  parser.add_argument("op", choices=ops, help='operation')
15
- parser.add_argument("--ids", help="Ensembl_IDs, comma-separated (ex:ENSG00000000003)")
16
- parser.add_argument("--i", dest="ifile", help="input file, Ensembl_IDs")
18
+ parser.add_argument("--ids", help="Ensembl_IDs, comma-separated (ex:ENSG00000000003), or SNP IDs, comma-separated (ex:rs56116432)")
19
+ parser.add_argument("--i", dest="ifile", help="input file, Ensembl IDs or SNP IDs")
17
20
  parser.add_argument("--api_host", default=ensembl.API_HOST)
18
21
  parser.add_argument("--api_base_path", default=ensembl.API_BASE_PATH)
19
22
  parser.add_argument("--o", dest="ofile", help="output (TSV)")
23
+ parser.add_argument("--skip", type=int, default=0)
24
+ parser.add_argument("--nmax", type=int)
20
25
  parser.add_argument("-v", "--verbose", action="count", default=0)
21
26
  parser.add_argument("-q", "--quiet", action="count", default=0)
22
27
  args = parser.parse_args()
@@ -24,7 +29,7 @@ if __name__=='__main__':
24
29
  # logging.PROGRESS = 15 (custom)
25
30
  logging.basicConfig(format='%(levelname)s:%(message)s', level=(logging.DEBUG if args.verbose>0 else logging.ERROR if args.quiet else 15))
26
31
 
27
- base_url='http://'+args.api_host+args.api_base_path
32
+ base_url = 'http://'+args.api_host+args.api_base_path
28
33
 
29
34
  fout = open(args.ofile, "w") if args.ofile else sys.stdout
30
35
 
@@ -52,10 +57,13 @@ if __name__=='__main__':
52
57
  ensembl.ListSpecies(base_url, fout)
53
58
 
54
59
  elif args.op=='get_info':
55
- ensembl.GetInfo(ids, base_url, fout)
60
+ ensembl.GetInfo(ids, args.skip, args.nmax, base_url, fout)
56
61
 
57
62
  elif args.op=='get_xrefs':
58
- ensembl.GetXrefs(ids, base_url, fout)
63
+ ensembl.GetXrefs(ids, args.skip, args.nmax, base_url, fout)
64
+
65
+ elif args.op=='get_vep':
66
+ ensembl.GetVariantEffectPredictions(ids, args.skip, args.nmax, base_url, fout)
59
67
 
60
68
  elif args.op=='show_version':
61
69
  ensembl.ShowVersion(base_url, fout)
@@ -38,14 +38,21 @@ def ListSpecies(base_url=BASE_URL, fout=None):
38
38
  return df
39
39
 
40
40
  ##############################################################################
41
- def GetInfo(ids, base_url=BASE_URL, fout=None):
41
+ def GetInfo(ids, skip=0, nmax=None, base_url=BASE_URL, fout=None):
42
42
  n_out=0; n_err=0; tags=[]; df=None; tq=None;
43
43
  quiet = bool(logging.getLogger().getEffectiveLevel()>15)
44
- for id_this in ids:
44
+ for i,id_this in enumerate(ids):
45
+ if i<skip: continue
46
+ if tq is None and not quiet: tq = tqdm.tqdm(total=len(ids)-skip)
45
47
  if tq is not None: tq.update()
46
48
  url_this = base_url+'/lookup/id/'+id_this+'?content-type=application/json&expand=0'
47
49
  logging.debug(url_this)
48
- rval = requests.get(url_this, headers={"Content-Type":"application/json"})
50
+ try:
51
+ rval = requests.get(url_this, headers={"Content-Type":"application/json"})
52
+ except Exception as e:
53
+ logging.error(f"{e}")
54
+ n_err+=1
55
+ continue
49
56
  if not rval.ok:
50
57
  logging.error(f'{rval.status_code} : "{id_this}"')
51
58
  n_err+=1
@@ -59,16 +66,18 @@ def GetInfo(ids, base_url=BASE_URL, fout=None):
59
66
  df_this.to_csv(fout, "\t", index=False, header=bool(n_out==0))
60
67
  n_out += 1
61
68
  if fout is None: df = pd.concat([df, df_this])
62
- if tq is None and not quiet: tq = tqdm.tqdm(total=len(ids), unit="genes")
69
+ if nmax and i>=(nmax-skip): break
63
70
  if tq is not None: tq.close()
64
71
  logging.info(f"n_ids: {len(ids)}; n_out: {n_out}; n_err: {n_err}")
65
72
  if fout is None: return df
66
73
 
67
74
  ##############################################################################
68
- def GetXrefs(ids, base_url=BASE_URL, fout=None):
75
+ def GetXrefs(ids, skip=0, nmax=None, base_url=BASE_URL, fout=None):
69
76
  n_out=0; n_err=0; tags=None; dbcounts={}; df=pd.DataFrame(); tq=None;
70
77
  quiet = bool(logging.getLogger().getEffectiveLevel()>15)
71
- for id_this in ids:
78
+ for i,id_this in enumerate(ids):
79
+ if i<skip: continue
80
+ if tq is None and not quiet: tq = tqdm.tqdm(total=len(ids)-skip)
72
81
  if tq is not None: tq.update()
73
82
  url_this = base_url+'/xrefs/id/'+id_this
74
83
  rval = requests.get(url_this, headers={"Content-Type":"application/json"})
@@ -87,7 +96,7 @@ def GetXrefs(ids, base_url=BASE_URL, fout=None):
87
96
  if fout is None: df = pd.concat([df, df_this])
88
97
  else: df_this.to_csv(fout, "\t", index=False)
89
98
  n_out+=1
90
- if tq is None and not quiet: tq = tqdm.tqdm(total=len(ids), unit="genes")
99
+ if nmax and i>=(nmax-skip): break
91
100
  if tq is not None: tq.close()
92
101
  for key in sorted(dbcounts.keys()):
93
102
  logging.info(f"Xref counts, db = {key:12s}: {dbcounts[key]:5d}")
@@ -95,3 +104,43 @@ def GetXrefs(ids, base_url=BASE_URL, fout=None):
95
104
  if fout is None: return df
96
105
 
97
106
  ##############################################################################
107
+ def GetVariantEffectPredictions(ids, skip=0, nmax=None, base_url=BASE_URL, fout=None):
108
+ n_out=0; n_err=0; tags=None; tags_tc=None; dbcounts={}; df=pd.DataFrame(); tq=None;
109
+ quiet = bool(logging.getLogger().getEffectiveLevel()>15)
110
+ for i,id_this in enumerate(ids):
111
+ if i<skip: continue
112
+ if tq is None and not quiet: tq = tqdm.tqdm(total=len(ids)-skip)
113
+ if tq is not None: tq.update()
114
+ url_this = base_url+'/vep/human/id/'+id_this
115
+ rval = requests.get(url_this, headers={"Content-Type":"application/json"})
116
+ if not rval.ok:
117
+ logging.error(f'{rval.status_code} : "{id_this}"')
118
+ n_err+=1
119
+ continue
120
+ result = rval.json()
121
+ if not result or len(result)==0:
122
+ logging.error(f"No result.")
123
+ n_err+=1
124
+ continue
125
+ vep = result[0]
126
+ logging.debug(json.dumps(vep, indent=2))
127
+ if not tags:
128
+ tags = [tag for tag in vep.keys() if type(vep[tag]) not in (list, dict)] #Only simple metadata.
129
+ df_this_base = pd.DataFrame({tags[j]:([str(vep[tags[j]])] if tags[j] in vep else ['']) for j in range(len(tags))})
130
+ transcript_consequences = vep["transcript_consequences"] if "transcript_consequences" in vep else []
131
+ #colocated_variants = vep["colocated_variants"] if "colocated_variants" in vep else []
132
+ for tc in transcript_consequences:
133
+ if not tags_tc:
134
+ tags_tc = [tag for tag in tc.keys() if type(tc[tag]) not in (list, dict)] #Only simple metadata.
135
+ logging.debug(f"tags_tc: {tags_tc}")
136
+ df_this_tc = pd.DataFrame({tag:([str(tc[tag])] if tag in tc else ['']) for tag in tags_tc})
137
+ df_this = pd.concat([df_this_base, df_this_tc], axis=1)
138
+ if fout is None: df = pd.concat([df, df_this])
139
+ else: df_this.to_csv(fout, "\t", index=False)
140
+ n_out+=1
141
+ if nmax and i>=(nmax-skip): break
142
+ if tq is not None: tq.close()
143
+ logging.info(f"n_ids: {len(ids)}; n_out: {n_out}; n_err: {n_err}")
144
+ if fout is None: return df
145
+
146
+ ##############################################################################
@@ -11,7 +11,7 @@ from .. import hugo
11
11
  #
12
12
  ##############################################################################
13
13
  if __name__=='__main__':
14
- FTYPES=['SYMBOL', 'ALIAS_SYMBOL', 'HGNC_ID', 'UNIPROT', 'ENTREZ_ID', 'ENSEMBL_GENE_ID', 'VEGA_ID'];
14
+ FTYPES=['SYMBOL', 'ALIAS_SYMBOL', 'PREV_SYMBOL', 'HGNC_ID', 'UNIPROT', 'ENTREZ_ID', 'ENSEMBL_GENE_ID', 'VEGA_ID'];
15
15
  epilog='''\
16
16
  SYMBOL: HGNC gene symbol (e.g. ZNF3),
17
17
  ALIAS_SYMBOL: synonym gene symbol (e.g. AAA1),
@@ -26,7 +26,7 @@ if __name__=='__main__':
26
26
  parser.add_argument("--o", dest="ofile", help="output (TSV)")
27
27
  parser.add_argument("--i", dest="ifile", help="query file")
28
28
  parser.add_argument("--query", help="gene query")
29
- parser.add_argument("--ftypes", default="SYMBOL,ALIAS_SYMBOL", help="comma-separated list")
29
+ parser.add_argument("--ftypes", default="SYMBOL,ALIAS_SYMBOL,PREV_SYMBOL", help="comma-separated list")
30
30
  parser.add_argument("--ftypes_all", action="store_true", help="(could be slow)")
31
31
  parser.add_argument("--rawquery", action="store_true")
32
32
  parser.add_argument("--nmax", type=int, default=None, help="max records")
@@ -0,0 +1,133 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Utility functions for HUGO REST API.
4
+ See: https://www.genenames.org/help/rest-web-service-help
5
+ """
6
+ import sys,os,re,requests,json,time,logging,tqdm
7
+ import pandas as pd
8
+
9
+ #
10
+ API_HOST="rest.genenames.org"
11
+ API_BASE_PATH=""
12
+ BASE_URL="http://"+API_HOST+API_BASE_PATH
13
+ #
14
+ HEADERS={"Accept":"application/json"}
15
+ #
16
+ ##############################################################################
17
+ def Info(base_url=BASE_URL, fout=None):
18
+ response = requests.get(base_url+"/info", headers=HEADERS)
19
+ result = response.json()
20
+ logging.debug(json.dumps(result, sort_keys=True, indent=2))
21
+ if "searchableFields" in result:
22
+ for f in result["searchableFields"]:
23
+ print(f"{f}")
24
+ if "storedFields" in result:
25
+ for f in result["storedFields"]:
26
+ print(f"{f}")
27
+
28
+ ##############################################################################
29
+ def ListSearchableFields(base_url=BASE_URL, fout=None):
30
+ response = requests.get(base_url+'/info', headers=HEADERS)
31
+ result = response.json()
32
+ fields = result['searchableFields'] if 'searchableFields' in result else None
33
+ fields.sort()
34
+ df = pd.DataFrame({'fields':fields})
35
+ if fout: df.to_csv(fout, "\t", index=False)
36
+ return df
37
+
38
+ ##############################################################################
39
+ def ListStoredFields(base_url=BASE_URL, fout=None):
40
+ response = requests.get(base_url+'/info', headers=HEADERS)
41
+ result = response.json()
42
+ fields = result['storedFields'] if 'storedFields' in result else None
43
+ fields.sort()
44
+ df = pd.DataFrame({'fields':fields})
45
+ if fout: df.to_csv(fout, "\t", index=False)
46
+ return df
47
+
48
+ ##############################################################################
49
+ def GetGenes(qrys, ftypes, skip=0, base_url=BASE_URL, fout=None):
50
+ '''The API can return multiple hits for each query, though should not
51
+ for exact SYMBOL fetch. One case is for RPS15P5, status "Entry Withdrawn".'''
52
+ n_in=0; n_found=0; n_notfound=0; n_ambig=0; n_out=0;
53
+ tags=None; df=None; tq=None;
54
+ logging.debug(f"ftypes[{len(ftypes)}]: {str(ftypes)}")
55
+ for qry in qrys:
56
+ if not tq: tq = tqdm.tqdm(total=len(qrys)-skip)
57
+ tq.update()
58
+ n_in+=1
59
+ if n_in<skip: continue
60
+ logging.debug(f"{n_in}. query: {qry}")
61
+ numFound=0; genes=[];
62
+ ftype_hit=None
63
+ for ftype in ftypes:
64
+ response = requests.get(base_url+f"/fetch/{ftype.lower()}/{qry}", headers=HEADERS)
65
+ result = response.json()
66
+ logging.debug(json.dumps(result, indent=2))
67
+ if result is None: continue
68
+ ftype_hit=ftype
69
+ numFound = result['response']['numFound'] if 'numFound' in result['response'] else 0
70
+ genes = result['response']['docs']
71
+ if numFound>0:
72
+ logging.debug(f"Not found: {ftype_hit} = {qry}")
73
+ break
74
+ if numFound==0:
75
+ n_notfound+=1
76
+ logging.debug(f"Not found: {ftype_hit} = {qry}")
77
+ continue
78
+ elif numFound>0:
79
+ n_found+=1
80
+ if len(genes)>1:
81
+ logging.warning(f"Multiple ({len(genes)}) hits, {ftype_hit} = {qry} (Duplicate may be status=withdrawn.)")
82
+ n_ambig+=1
83
+ for gene in genes:
84
+ gene_data = {'query':[qry], 'field':[ftype_hit]}
85
+ for tag in gene.keys():
86
+ if tag in ("prev_symbol", "prev_name", "alias_symbol"):
87
+ gene_data[tag] = [";".join(gene[tag])]
88
+ elif type(gene[tag]) in (list, dict):
89
+ continue
90
+ elif tags is not None and tag not in tags:
91
+ continue
92
+ else:
93
+ gene_data[tag] = [gene[tag]]
94
+ if not tags:
95
+ tags = gene_data.keys()
96
+ logging.debug(f"tags: {tags}")
97
+ for tag in (set(tags) - set(gene_data.keys())):
98
+ gene_data[tag] = [None] #add missing fields
99
+ df_this = pd.DataFrame(gene_data)
100
+ df_this = df_this[tags] #reorder cols
101
+ if fout: df_this.to_csv(fout, "\t", index=False, header=bool(n_out==0))
102
+ else: df = pd.concat([df, df_this])
103
+ n_out+=1
104
+ if tq is not None: tq.close()
105
+ logging.info(f"queries: {n_in-skip}; n_found: {n_found}; n_notfound: {n_notfound}; n_ambig: {n_ambig}; n_out: {n_out}")
106
+ return df
107
+
108
+ ##############################################################################
109
+ def SearchGenes(qrys, ftypes, base_url=BASE_URL, fout=None):
110
+ n_in=0; n_found=0; tags=[]; df=None;
111
+ for qry in qrys:
112
+ n_in+=1
113
+ logging.debug(f"{n_in}. query: {qry}")
114
+ found_this=False
115
+ for ftype in ftypes:
116
+ url = (base_url+'/search{}/*{}*'.format((('/'+ftype.lower()) if ftype else ''), qry))
117
+ response = requests.get(url, headers=HEADERS)
118
+ result = response.json()
119
+ numFound = result['response']['numFound'] if 'numFound' in result['response'] else 0
120
+ if numFound==0: continue
121
+ found_this=True
122
+ docs = result['response']['docs'] if 'docs' in result['response'] else []
123
+ for doc in docs:
124
+ logging.debug(json.dumps(doc, sort_keys=True, indent=2)+'\n')
125
+ if not tags: tags = list(doc.keys())
126
+ data_this = {'query':qry, 'field':ftype}
127
+ data_this.update({tags[j]:[doc[tags[j]]] for j in range(len(tags))})
128
+ df = pd.concat([df, pd.DataFrame(data_this)])
129
+ if found_this: n_found+=1
130
+ if fout: df.to_csv(fout, "\t", index=False)
131
+ logging.info(f"queries: {n_in}; found: {n_found}")
132
+ return df
133
+
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env python3
2
2
  ##############################################################################
3
3
  ### Medline Plus Genetics
4
+ ### (Formerly Genetics Home Reference)
4
5
  ### https://medlineplus.gov/about/developers/geneticsdatafilesapi/
5
6
  ### https://medlineplus.gov/download/ghr-summaries.xml
6
7
  ##############################################################################
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env python3
2
2
  ##############################################################################
3
3
  ### Medline Plus Genetics
4
+ ### (Formerly Genetics Home Reference, http://ghr.nlm.nih.gov/)
4
5
  ### https://medlineplus.gov/about/developers/geneticsdatafilesapi/
5
6
  ### https://medlineplus.gov/download/ghr-summaries.xml
6
7
  ##############################################################################
@@ -76,18 +77,21 @@ def ListGenes(summary_url=SUMMARY_URL, fout=None):
76
77
  else: df_this.to_csv(fout, "\t", index=False, header=bool(n_out==0))
77
78
  n_out += df_this.shape[0]
78
79
  logging.info(f"n_out: {n_out}")
79
- if fout is None: return df
80
+ return df
80
81
 
81
82
  ##############################################################################
82
83
  def GetConditionGenes(ids, base_url=DOWNLOAD_BASE_URL, fout=None):
83
84
  """IDs must be terms as in condition URLs, e.g. "alzheimer-disease", from
84
85
  https://medlineplus.gov/download/genetics/condition/alzheimer-disease.json
86
+ GTR = Genetics Testing Registry, but the IDs are UMLS CUIs.
85
87
  """
86
- n_out=0; tags=None; df=pd.DataFrame();
88
+ n_out=0; n_err=0; tags=None; df=pd.DataFrame();
89
+ xref_tags = ["ICD-10-CM", "MeSH", "OMIM", "SNOMED CT", "GTR"]
87
90
  for id_this in ids:
88
91
  response = requests.get(f"{base_url}/genetics/condition/{id_this}.json")
89
92
  if response.status_code != 200:
90
93
  logging.error(f"Condition ID not found [{response.status_code}]: '{id_this}'")
94
+ n_err+=1
91
95
  continue
92
96
  rval_txt = response.content.decode("utf-8")
93
97
  logging.debug(rval_txt)
@@ -95,15 +99,29 @@ https://medlineplus.gov/download/genetics/condition/alzheimer-disease.json
95
99
  logging.debug(json.dumps(rval, indent=2))
96
100
  name = rval["name"]
97
101
  ghr_page = rval["ghr_page"]
102
+
103
+ df_condition = pd.DataFrame({"id":[id_this], "name":[name]})
104
+
105
+ xrefs = rval["db-key-list"] if "db-key-list" in rval else []
106
+ xrefs_grouped = {tag:set() for tag in xref_tags}
107
+ for xref in xrefs:
108
+ if xref["db-key"]["db"] in xref_tags:
109
+ xrefs_grouped[xref["db-key"]["db"]].add(xref["db-key"]["key"])
110
+ df_xrefs = pd.DataFrame({tag:[','.join(list(xrefs_grouped[tag]))] for tag in xref_tags})
111
+
112
+ df_condition = pd.concat([df_condition, df_xrefs], axis=1)
113
+
98
114
  genes = rval["related-gene-list"] if "related-gene-list" in rval else []
99
115
  for gene in genes:
100
- df_this = pd.DataFrame({"id":[id_this], "name":[name],
101
- "gene-symbol":[gene["related-gene"]["gene-symbol"]],
116
+ df_gene = pd.DataFrame({"gene-symbol":[gene["related-gene"]["gene-symbol"]],
102
117
  "ghr-page":[gene["related-gene"]["ghr-page"]]})
118
+ df_this = pd.concat([df_condition, df_gene], axis=1)
119
+
103
120
  if fout is None: df = pd.concat([df, df_this])
104
121
  else: df_this.to_csv(fout, "\t", index=False, header=bool(n_out==0))
105
122
  n_out += df_this.shape[0]
106
- logging.info(f"n_out: {n_out}")
107
- if fout is None: return df
123
+
124
+ logging.info(f"n_out: {n_out}; n_err: {n_err}")
125
+ return df
108
126
 
109
127
  ##############################################################################
@@ -0,0 +1,73 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ See: https://oncotree.mskcc.org/
4
+ See: https://oncotree.mskcc.org/#/home
5
+ """
6
+ ###
7
+ import sys,os,re,argparse,time,json,logging
8
+ import pandas as pd
9
+ #
10
+ from .. import oncotree
11
+ #
12
+ ##############################################################################
13
+ if __name__=='__main__':
14
+ QUERY_TYPES = ["umls", "name", "nci", "level", "code", "mainType"]
15
+ epilog='''\
16
+ '''
17
+ parser = argparse.ArgumentParser(description='Oncotree REST API client', epilog=epilog)
18
+ ops = ['search', 'get', 'info', 'list_versions', 'list_main_types', 'list_tumor_types']
19
+ parser.add_argument("op", choices=ops, help='OPERATION')
20
+ parser.add_argument("--o", dest="ofile", help="output (TSV)")
21
+ parser.add_argument("--i", dest="ifile", help="ID file")
22
+ parser.add_argument("--ids", help="IDs, comma-separated")
23
+ parser.add_argument("--query", help="search query")
24
+ parser.add_argument("--query_type", choices=QUERY_TYPES, help=f"query type, one of: {QUERY_TYPES}")
25
+ parser.add_argument("--exact_match", action="store_true", help="search criterion")
26
+ parser.add_argument("--query_levels", default="2,3,4,5", help=f"query levels, 1-5, comma-separated list")
27
+ parser.add_argument("--nmax", type=int, default=None, help="max records")
28
+ parser.add_argument("--skip", type=int, default=0, help="skip 1st SKIP queries")
29
+ parser.add_argument("--api_host", default=oncotree.API_HOST)
30
+ parser.add_argument("--api_base_path", default=oncotree.API_BASE_PATH)
31
+ parser.add_argument("-v", "--verbose", default=0, action="count")
32
+ args = parser.parse_args()
33
+
34
+ logging.basicConfig(format='%(levelname)s:%(message)s', level=(logging.DEBUG if args.verbose>1 else logging.INFO))
35
+
36
+ BASE_URL='http://'+args.api_host+args.api_base_path
37
+
38
+ fout = open(args.ofile,"w") if args.ofile else sys.stdout
39
+
40
+ t0=time.time()
41
+
42
+ ids=[];
43
+ if args.ifile:
44
+ with open(args.ifile) as fin:
45
+ while True:
46
+ line = fin.readline()
47
+ if not line: break
48
+ if line.rstrip(): ids.append(line.rstrip())
49
+ elif args.ids:
50
+ ids = re.split('[, ]+', args.ids.strip())
51
+
52
+ if args.op == "info":
53
+ oncotree.Info(BASE_URL, fout)
54
+
55
+ elif args.op == "get":
56
+ oncotree.Get(ids, args.skip, BASE_URL, fout)
57
+
58
+ elif args.op == "list_versions":
59
+ oncotree.ListVersions(BASE_URL, fout)
60
+
61
+ elif args.op == "list_main_types":
62
+ oncotree.ListMainTypes(BASE_URL, fout)
63
+
64
+ elif args.op == "list_tumor_types":
65
+ oncotree.ListTumorTypes(BASE_URL, fout)
66
+
67
+ elif args.op == "search":
68
+ oncotree.SearchTumorTypes(args.query, args.query_type, args.exact_match, args.query_levels, BASE_URL, fout)
69
+
70
+ else:
71
+ parser.error(f"Invalid operation: {args.op}")
72
+
73
+ logging.info(('elapsed time: %s'%(time.strftime('%Hh:%Mm:%Ss', time.gmtime(time.time()-t0)))))