find index of GO string
2
0
Entering edit mode
ALok ▴ 170
@alok-2917
Last seen 9.6 years ago
Hi, I have two vectors *res* and *x* res[,1][1:5] [1] GO:0003910 GO:0003980 GO:0004289 GO:0004422 GO:0005085 15 Levels: GO:0000010 GO:0000014 GO:0000033 GO:0000036 ... GO:0080025 > x[,1][1:5] [1] GO:0070060 GO:0051083 GO:0042351 GO:0006189 GO:0051084 100 Levels: GO:0000001 GO:0000002 GO:0000003 GO:0000005 ... GO:0080142 res is the subset of x I want to find the index of res elements in x Any suggestions? Thanks in advance -- ALok Srivastava Ph.D scholar Centre of Computational Biology and Bioinformatics School of Information Technology JNU New Delhi [[alternative HTML version deleted]]
• 918 views
ADD COMMENT
0
Entering edit mode
Artur Veloso ▴ 340
@artur-veloso-2062
Last seen 9.6 years ago
Hi ALoK, couldn't you use something like: sapply(res[,1][1:5],function(y){grep(y,x[,1]) }) Cheers, Artur On Fri, Oct 9, 2009 at 4:08 PM, ALok <foralok@gmail.com> wrote: > Hi, > I have two vectors *res* and *x* > > res[,1][1:5] > [1] GO:0003910 GO:0003980 GO:0004289 GO:0004422 GO:0005085 > 15 Levels: GO:0000010 GO:0000014 GO:0000033 GO:0000036 ... GO:0080025 > > > x[,1][1:5] > [1] GO:0070060 GO:0051083 GO:0042351 GO:0006189 GO:0051084 > 100 Levels: GO:0000001 GO:0000002 GO:0000003 GO:0000005 ... GO:0080142 > > res is the subset of x > I want to find the index of res elements in x > > Any suggestions? > > Thanks in advance > -- > ALok Srivastava > Ph.D scholar > Centre of Computational Biology and Bioinformatics > School of Information Technology > JNU New Delhi > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > -- Artur Veloso PhD student Bioinformatics training track Program in Biomedical Sciences University of Michigan, Ann Arbor MI, 48109, U.S.A. [[alternative HTML version deleted]]
ADD COMMENT
0
Entering edit mode
@sean-davis-490
Last seen 3 months ago
United States
On Fri, Oct 9, 2009 at 4:08 PM, ALok <foralok@gmail.com> wrote: > Hi, > I have two vectors *res* and *x* > > res[,1][1:5] > [1] GO:0003910 GO:0003980 GO:0004289 GO:0004422 GO:0005085 > 15 Levels: GO:0000010 GO:0000014 GO:0000033 GO:0000036 ... GO:0080025 > > > x[,1][1:5] > [1] GO:0070060 GO:0051083 GO:0042351 GO:0006189 GO:0051084 > 100 Levels: GO:0000001 GO:0000002 GO:0000003 GO:0000005 ... GO:0080142 > > res is the subset of x > I want to find the index of res elements in x > > Any suggestions? > > help(match) Sean [[alternative HTML version deleted]]
ADD COMMENT

Login before adding your answer.

Traffic: 806 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