Drkcore

25 08 2017 Python Tweet

Gene symbolでpubmed検索をする

Gene symbolでpubmed検索をしたい場合には[sym]というオプションを付ければいいらしい。

あとはeutilに投げればXMLが返ってくるのでXPathでゴニョればいい。

例えばトポイソメラーゼIIでガン関連の文献がいくつあるかを調べたい場合にはこんな感じ。

import requests
from urllib import quote_plus
import xml.etree.ElementTree as ET

base_url = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term="
query = "TOP2A[sym] AND Cancer"

url = "{0}{1}".format(base_url, quote_plus(query))
r = requests.get(url)

root = ET.fromstring(r.content)
print root.find("Count").text

About

  • もう5年目(wishlistありマス♡)
  • 最近はPythonとDeepLearning
  • 日本酒自粛中
  • ドラムンベースからミニマルまで
  • ポケモンGOゆるめ

Tag

Python Deep Learning javascript chemoinformatics Emacs sake and more...

Ad

© kzfm 2003-2021