Python 根据标记下载所有NCBI PubMed ID

Python 根据标记下载所有NCBI PubMed ID,python,ncbi,Python,Ncbi,我能够读入论文的PubMed ID,并使用以下代码返回关于该论文的一组记录: from Bio import Entrez from Bio import Medline Entrez.email = "Your.Name.Here@example.org" pubmed_rec = Entrez.efetch(db='pubmed',id=19053980,retmode='text',rettype='medline') records = Medline.parse(p

我能够读入论文的PubMed ID,并使用以下代码返回关于该论文的一组记录:

from Bio import Entrez
from Bio import Medline
Entrez.email = "Your.Name.Here@example.org"
pubmed_rec = Entrez.efetch(db='pubmed',id=19053980,retmode='text',rettype='medline')
records = Medline.parse(pubmed_rec)
for rec in records:
    print(rec)
输出为:

{'PMID': '19053980', 'OWN': 'NLM', 'STAT': 'MEDLINE', 'DCOM': '20090706', 'LR': '20091015', 'IS': '1365-2036 (Electronic) 0269-2813 (Linking)', 'VI': '29', 'IP': '5', 'DP': '2009 Mar 1', 'TI': 'Clinical trial: the effects of a trans-galactooligosaccharide prebiotic on faecal microbiota and symptoms in irritable bowel syndrome.', 'PG': '508-18', 'LID': '10.1111/j.1365-2036.2008.03911.x [doi]', 'AB': 'BACKGROUND: Gut microflora-mucosal interactions may be involved in the pathogenesis of irritable bowel syndrome (IBS). AIM: To investigate the efficacy of a novel prebiotic trans-galactooligosaccharide in changing the colonic microflora and improve the symptoms in IBS sufferers. METHODS: In all, 44 patients with Rome II positive IBS completed a 12-week single centre parallel crossover controlled clinical trial. Patients were randomized to receive either 3.5 g/d prebiotic, 7 g/d prebiotic or 7 g/d placebo. IBS symptoms were monitored weekly and scored according to a 7-point Likert scale. Changes in faecal microflora, stool frequency and form (Bristol stool scale) subjective global assessment (SGA), anxiety and depression and QOL scores were also monitored. RESULTS: The prebiotic significantly enhanced faecal bifidobacteria (3.5 g/d P < 0.005; 7 g/d P < 0.001). Placebo was without effect on the clinical parameters monitored, while the prebiotic at 3.5 g/d significantly changed stool consistency (P < 0.05), improved flatulence (P < 0.05) bloating (P < 0.05), composite score of symptoms (P < 0.05) and SGA (P < 0.05). The prebiotic at 7 g/d significantly improved SGA (P < 0.05) and anxiety scores (P < 0.05). CONCLUSION: The galactooligosaccharide acted as a prebiotic in specifically stimulating gut bifidobacteria in IBS patients and is effective in alleviating symptoms. These findings suggest that the prebiotic has potential as a therapeutic agent in IBS.', 'FAU': ['Silk, D B A', 'Davis, A', 'Vulevic, J', 'Tzortzis, G', 'Gibson, G R'], 'AU': ['Silk DB', 'Davis A', 'Vulevic J', 'Tzortzis G', 'Gibson GR'], 'AD': ['Department of Academic Surgery, Imperial College Healthcare NHS Trust, London, UK. David.Silk@nwlh.nhs.uk'], 'LA': ['eng'], 'PT': ['Journal Article', 'Randomized Controlled Trial', "Research Support, Non-U.S. Gov't"], 'DEP': '20081202', 'PL': 'England', 'TA': 'Aliment Pharmacol Ther', 'JT': 'Alimentary pharmacology & therapeutics', 'JID': '8707234', 'RN': ['0 (Oligosaccharides)'], 'SB': 'IM', 'CIN': ['Expert Rev Gastroenterol Hepatol. 2009 Oct;3(5):487-92. PMID: 19817670'], 'MH': ['Adult', 'Aged', 'Bifidobacterium/*drug effects/growth & development', 'Colony Count, Microbial', 'Feces/*microbiology', 'Female', 'Humans', 'Irritable Bowel Syndrome/*diet therapy', 'Male', 'Middle Aged', 'Oligosaccharides/*administration & dosage/metabolism', 'Probiotics/*therapeutic use', 'Quality of Life', 'Statistics as Topic', 'Treatment Outcome'], 'EDAT': '2008/12/05 09:00', 'MHDA': '2009/07/07 09:00', 'CRDT': ['2008/12/05 09:00'], 'PHST': ['2008/12/05 09:00 [pubmed]', '2009/07/07 09:00 [medline]', '2008/12/05 09:00 [entrez]'], 'AID': ['APT3911 [pii]', '10.1111/j.1365-2036.2008.03911.x [doi]'], 'PST': 'ppublish', 'SO': 'Aliment Pharmacol Ther. 2009 Mar 1;29(5):508-18. doi: 10.1111/j.1365-2036.2008.03911.x. Epub 2008 Dec 2.'}
我现在想得到一份PMID中所有随机对照试验的列表,而不是提供单独的PubMed ID

i、 e.我想输入查询“PT=随机对照试验”标签,并返回所有PubMed ID”

我试图将id=19053980改为“pt=随机对照试验”,但这显然不是关键

我如何返回带有随机对照试验标签的所有PMID列表,以及我自己如何找到这个答案?我找到了所有代码的列表,但我不清楚如何使用这些代码。

您可以使用和。我在下面添加了代码

来自Bio import Entrez
来自生物进口医疗线
term=“临床试验[网格术语]”
Entrez.email=“A.N。Other@example.com“#总是告诉NCBI你是谁
handle=Entrez.esearch(db=“pubmed”,term=term,retmax=5)
esearch_record=Entrez.read(句柄)
handle.close()
打印(f“找到的记录:{esearch_记录['Count']}”)
所有pmid=esearch\u记录[“IdList”]
句柄=Entrez.efetch(
db=“pubmed”,
id=所有PMID,
rettype=“medline”,
retmode=“text”)
records=Medline.parse(句柄)
记录中的记录:
打印(记录[“PMID”])
输出为

Records found: 349991
33288887
33275561
33273736
33149899
33264530
以下是pubmed网站上相同查询的链接:


为了找到这个答案,我做了两件事。首先,我使用pubmed的网站搜索临床试验,并找到合适的网状词。第二,转到biopython的教程和pubmed的control+f。

谢谢,我真的很感激,但是这种方法不会引用我上面的例子,因为临床试验没有在mesh术语中列出?”MH':[‘成人’、‘老年’、‘双歧杆菌/*药物作用/生长发育’、‘菌落计数、微生物’、‘粪便/*微生物学’、‘女性’、‘人类’、‘肠易激综合征/*饮食疗法’、‘男性’、‘中年’、‘低聚糖/*给药量/代谢’、‘益生菌/*治疗用途’、‘生活质量’、‘主题统计’、‘治疗Ou’tcome']所以我想我需要一个查看PT变量的方法?很抱歉,我没有意识到你做得有多容易,所以我可以自己更改它(你可以更改:term=“临床试验[出版物类型]”)
Records found: 349991
33288887
33275561
33273736
33149899
33264530