Pubmed

Home | 


  • Fields:
  • Journals [ta]:
  • Endocrinology:
  • Diabetes:
  • Publication Type [pt]:
  • Other:

Links

Pubmed Direct Access

http://www.ncbi.nlm.nih.gov/entrez/query/static/link.html

ESearch

http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?
db=pubmed&term=asthma[mh]+OR+hay+fever[mh]&mindate=2000&maxdate=2008/03/08&
retstart=0&retmax=400&retmode=xml

Search Fields [ src ]

Affiliation [AD] Article Identifier [AID] All Fields [ALL] Author [AU]

Comment Corrections

{ hascommentin | hascommenton | haserratumin | haserratumfor | hascorrectedrepublishedin | hascorrectedrepublishedfrom | haspartialretractionin | haspartialretractionof | hasrepublishedin | hasrepublishedfrom | hasretractionin | hasretractionof | hasupdatein | hasupdateof | hassummaryforpatientsin | hasoriginalreportin }

Corporate Author [CN] EC/RN Number [RN] Entrez Date [EDAT]

Filter [FILTER][SB]

{loall|free+full+text|full+text}[FILTER] (or: [SB])

First Author Name [1AU] Full Author Name [FAU] Full Investigator Name [FIR]

Grant Number [GR] Investigator [IR] Issue [IP] Journal Title [TA] Language [LA]

Last Author [LASTAU] Location ID [LID] MeSH Date [MHDA] MeSH Major Topic [MAJR]

MeSH Subheadings [SH] MeSH Terms [MH] NLM Unique ID [JID] Other Term [OT]

Owner Pagination [PG] Personal Name as Subject [PS] Pharmacological Action MeSH Terms [PA]

Place of Publication [PL] Publication Date [DP]

Publication Type[PT]

{ Addresses | Bibliography | Biography | Case Report | Classical Article | Clinical Conference | Clinical Trial [includes all types and phases of clinical trials] | Clinical Trial, Phase I | Clinical Trial, Phase II | Clinical Trial, Phase III | Clinical Trial, Phase IV | Controlled Clinical Trial | Multicenter Study | Randomized Controlled Trial | Comment | Congresses | Corrected and Republished Article | Consensus Development Conference | Consensus Development Conference, NIH | Dictionary | Directory | Duplicate Publication | Editorial | Evaluation Studies | Festschrift | Government Publications | Guideline | Practice Guideline | Historical Article | Interactive Tutorial | Interview | Introductory Journal Article | Journal Article | Legal Cases | Legislation | Letter | Meta-Analysis | Multicenter Study | News | Newspaper Article | Overall | Patient Education Handout | Periodical Index | Practice Guideline | Published Erratum | Retraction of Publication | Retracted Publication | Review | Consensus Development Conference | Consensus Development Conference, NIH | Randomized Controlled Trial | Scientific Integrity Review | Technical Report | Twin Study | Validation Studies }

Secondary Source ID [SI] Subset [SB] Substance Name [NM] Text Words [TW]

Title [TI] Title/Abstract [TIAB] Transliterated Title [TT] UID [PMID] Volume [VI]

EFetch

http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?
db=pubmed&id=11877539, 11822933,11871444&retstart=0&retmax=400&retmode=xml&
rettype=abstract # citation | medline | full (omim)
retmode=xml& # text | html

R code

match("XML",.packages(all=T),nomatch=0)>0
ls()
loc=paste("C:\\Documents and Settings\\",Sys.info()["login"],"
\\My Documents\\R\\",sep="");loc
#-----------------------------------------------------------------------
term="BMJ[ta]+diabetes+mellitus[mh]+hasabstract"
retstart=0;retmax=400;retmode="xml" # xml | text | html
rettype="medline" # abstract | citation | medline | full (omim)

u.search=paste("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?",
"db=pubmed&","term=",term,"&",#"mindate=2000&","maxdate=2008/03/08&",
"retstart=",retstart,"&","retmax=",retmax,"&","retmode=",retmode,sep="")
u.search
#-----------------------------------------------------------------------
loc.id=paste(loc,"id=",term,".txt",sep="")
download.file(u,destfile=loc.id)
id<-readLines(loc.id)
id<-id[grep("<Id>",id,perl=T)]
id=sub("\t\t<Id>(.*)</Id>","
\\1",id)
ids=paste(id,sep=",",collapse=",")
ids=paste(id,collapse=",");ids
#-----------------------------------------------------------------------

u.fetch=paste("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?",
"db=pubmed&id=",ids,"&","retstart=",retstart,"&retmax=",retmax,
"&rettype=medline&","retmode=",retmode,sep="")
loc.art=paste(loc,"ar=",term,".xml",sep="")
download.file(u.fetch,loc.art)
x=readLines(loc.art);strwrap(x[1:100])

#-----------------------------------------------------------------------
library(XML)
xm<-xmlTreeParse(x,useInternalNodes=TRUE)
xm.ab<-sapply(getNodeSet(xm,"//Abstract/AbstractText"),xmlValue)
xm.ti<-sapply(getNodeSet(xm,"//ArticleTitle"),xmlValue)
xm.mh<-sapply(getNodeSet(xm,"//MeshHeading/DescriptorName"),xmlValue)
xm.pmid<-sapply(getNodeSet(xm,"//MedlineCitation/PMID"),xmlValue)
length(xm.mh) # 5345
#-----------------------------------------------------------------------
rev(sort(table(xm.mh)))[1:30]
freq<-sort(table(strsplit(paste(tolower(ab),collapse=" "),split=c(" "))))
freq=rev(freq)
freq[1:100]