Off-topic unlisting lists and PubMed
1
0
Entering edit mode
Claire Wilson ▴ 280
@claire-wilson-273
Last seen 10.2 years ago
Hi, This may seem slightly off topic, but relates to one of the Bioconductor tutorials. First of all I have list of significant probe ids (say 5). I then get all the abstracts for these doing: abstracts <- pm.getabst(genes, "hu6800") This gives me a list of length 5 where each entry is a list of objects of class pubMedAbst. I then identify all abstracts with my keyword of interest in using: has.word <- sapply(abstracts, function (x) pm.abstGrep("keyword", x)) which returns a list of length 5, each entry corresponding to a logical vector with the values TRUE or FALSE depending on whether that abstract contained the keyword or not. Now I want to make a new list that only contains the abstracts with the keyword in it. Essentially I need to keep all instances of abstracts that correspond to TRUE in has.word. I have tried many ways of doing this, starting with unlist. Unlist comes back null for abstracts. I eventually ended up with a bulky, loop construct, but wondered if there was an easier way. Many thanks in advance, apologies if this is a bit long winded/directed to the wrong people. Claire -- Claire Wilson, PhD Bioinformatics group Paterson Institute for Cancer Research Christies Hospital NHS Trust Wilmslow Road, Withington Manchester M20 4BX tel: +44 (0)161 446 8218 -------------------------------------------------------- This email is confidential and intended solely for the use of the person(s) ('the intended recipient') to whom it was addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of the Paterson Institute for Cancer Research or the Christie Hospital NHS Trust. It may contain information that is privileged & confidential within the meaning of applicable law. Accordingly any dissemination, distribution, copying, or other use of this message, or any of its contents, by any person other than the intended recipient may constitute a breach of civil or criminal law and is strictly prohibited. If you are NOT the intended recipient please contact the sender and dispose of this e-mail as soon as possible.
Cancer Cancer • 828 views
ADD COMMENT
0
Entering edit mode
Laurent Gautier ★ 2.3k
@laurent-gautier-29
Last seen 10.2 years ago
Hi, I did not follow the tutorials but the following could make the trick. abstracts <- pm.getabst(genes, "hu6800") has.word <- unlist(lapply(abstracts, function (x) pm.abstGrep("keyword", x))) abstracts[has.word] Hopin' it helps, L. On Tue, Apr 29, 2003 at 02:49:46PM +0100, Claire Wilson wrote: > Hi, > > This may seem slightly off topic, but relates to one of the Bioconductor tutorials. First of all I have list of significant probe ids (say 5). I then get all the abstracts for these doing: > abstracts <- pm.getabst(genes, "hu6800") > This gives me a list of length 5 where each entry is a list of objects of class pubMedAbst. I then identify all abstracts with my keyword of interest in using: > has.word <- sapply(abstracts, function (x) pm.abstGrep("keyword", x)) > which returns a list of length 5, each entry corresponding to a logical vector with the values TRUE or FALSE depending on whether that abstract contained the keyword or not. Now I want to make a new list that only contains the abstracts with the keyword in it. Essentially I need to keep all instances of abstracts that correspond to TRUE in has.word. I have tried many ways of doing this, starting with unlist. Unlist comes back null for abstracts. I eventually ended up with a bulky, loop construct, but wondered if there was an easier way. > > Many thanks in advance, apologies if this is a bit long winded/directed to the wrong people. > > Claire > > -- > Claire Wilson, PhD > Bioinformatics group > Paterson Institute for Cancer Research > Christies Hospital NHS Trust > Wilmslow Road, > Withington > Manchester > M20 4BX > tel: +44 (0)161 446 8218 > > -------------------------------------------------------- > > > This email is confidential and intended solely for the use of the person(s) ('the intended recipient') to whom it was addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of the Paterson Institute for Cancer Research or the Christie Hospital NHS Trust. It may contain information that is privileged & confidential within the meaning of applicable law. Accordingly any dissemination, distribution, copying, or other use of this message, or any of its contents, by any person other than the intended recipient may constitute a breach of civil or criminal law and is strictly prohibited. If you are NOT the intended recipient please contact the sender and dispose of this e-mail as soon as possible. > > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > https://www.stat.math.ethz.ch/mailman/listinfo/bioconductor -- -------------------------------------------------------------- currently at the National Yang-Ming University in Taipei, Taiwan -------------------------------------------------------------- Laurent Gautier CBS, Building 208, DTU PhD. Student DK-2800 Lyngby,Denmark tel: +45 45 25 24 89 http://www.cbs.dtu.dk/laurent
ADD COMMENT

Login before adding your answer.

Traffic: 740 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6