Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4623278
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:57:51+00:00 2026-05-22T02:57:51+00:00

My collegue Samantha asked a unclear question, so here I ask here question. She

  • 0

My collegue Samantha asked a unclear question, so here I ask here question.
She has a variable goterms, containing all dataframes to be analyzed.

goterms <- c('df1','df2','df3')

The interestedGO variable contains for each goterm a lists with ILMN numbers. So the first list contains the ILMN codes of df1 ans so on.

df1 <- c("ILMN_1665132", "ILMN_1691487", "ILMN_1716446", "ILMN_1769383",
         "ILMN_1772387", "ILMN_1783910", "ILMN_1784863")
df2 <- c("ILMN_1651599", "ILMN_1652693", "ILMN_1652825", "ILMN_1653324",
         "ILMN_1655595", "ILMN_1656057", "ILMN_1659077", "ILMN_1659923",
         "ILMN_1659947", "ILMN_1662322", "ILMN_1662619", "ILMN_1664565",
         "ILMN_1665132", "ILMN_1665738", "ILMN_1665859")
df3 <- c("ILMN_1661695", "ILMN_1665132", "ILMN_1716446", "ILMN_1737314",
         "ILMN_1772387", "ILMN_1784863", "ILMN_1796094", "ILMN_1800317",
         "ILMN_1800512", "ILMN_1807074")
interestedGO <- list(df1,df2,df3)

The xx2 is a comparison set. The xx2 variable contains a subset of all possible ILMN numbers.

xx2 <- c("ILMN_1691487", "ILMN_1716446", "ILMN_1769383","ILMN_1832921")

The x is a sort of reference set. The x variable contains all possible ILMN numbers.

x <- c("ILMN_1665132", "ILMN_1691487", "ILMN_1716446", "ILMN_1769383", "ILMN_1772387",
       "ILMN_1783910", "ILMN_1784863","ILMN_1651599", "ILMN_1652693", "ILMN_1652825",
       "ILMN_1653324", "ILMN_1655595","ILMN_1656057", "ILMN_1659077", "ILMN_1659923",
       "ILMN_1659947", "ILMN_1662322","ILMN_1662619", "ILMN_1664565", "ILMN_1665132",
       "ILMN_1665738", "ILMN_1665859","ILMN_1661695", "ILMN_1665132", "ILMN_1716446",
       "ILMN_1737314", "ILMN_1772387","ILMN_1784863", "ILMN_1796094", "ILMN_1800317",
       "ILMN_1800512", "ILMN_1807074")

With all these variables the goal is to check for each goterm with corresponding ILMN codes if they are in the referenceset xx2. To check for this, the match function is used, and all no matches gives a 0 and the matched values are replaced by 1. To give an handy overview of all the goterms experiments, I want to create a loop like below, that checks for each gene of it is in the reference set x. The final result must be a data.frame that compare the results of each goterm in a data.frame.

test <- list()
for (i in 1:length(goterms)) {
  goilmn <- as.data.frame(interestedGO[i])
  resultILMN <- match(goilmn[,1], xx2, nomatch=0)
  resultILMN[resultILMN!=0] <- 1
  result <- cbind(goilmn, resultILMN)
  colnames(result) <- c('x', 'result')

  zz <- merge(result, x, all=TRUE)
  zz[is.na(zz)] <- 0
  test[[i]] <- matrix(resultloop)
}

The final output will be just like this:

1  ILMN_1651599      0  0  0
2  ILMN_1652693      0  0  0
3  ILMN_1652825      0  0  0
4  ILMN_1653324      0  0  0
5  ILMN_1655595      0  0  0
6  ILMN_1656057      0  0  0
7  ILMN_1659077      0  0  0
8  ILMN_1659923      0  0  0
9  ILMN_1659947      0  0  0
10 ILMN_1661695      0  0  0
11 ILMN_1662322      0  0  0
12 ILMN_1662619      0  0  0
13 ILMN_1664565      0  0  0
14 ILMN_1665132      0  0  0
15 ILMN_1665132      0  0  0
16 ILMN_1665132      0  0  0
17 ILMN_1665738      0  0  0
18 ILMN_1665859      0  0  0
19 ILMN_1691487      0  0  1
20 ILMN_1716446      1  0  1
21 ILMN_1716446      1  0  1
22 ILMN_1737314      0  0  0
23 ILMN_1769383      0  0  1
24 ILMN_1772387      0  0  0
25 ILMN_1772387      0  0  0
26 ILMN_1783910      0  0  0
27 ILMN_1784863      0  0  0
28 ILMN_1784863      0  0  0
29 ILMN_1796094      0  0  0
30 ILMN_1800317      0  0  0
31 ILMN_1800512      0  0  0
32 ILMN_1807074      0  0  0

Can anyone help me with this?
Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T02:57:52+00:00Added an answer on May 22, 2026 at 2:57 am

    Does this work for you?

    data.frame(code=x, sapply(interestedGO, function(curdf){
            ifelse(x %in% xx2, x %in% curdf, 0)
        }))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Colleague has asked the question and we were unable to find it - on
Recently in the code of my collegue I saw an sql query, where she
I'm reviewing a collegue's code, and I see he has several constants defined in
My colleague has created an JAVA_HOME variable somewhere but he could not remember. I
Yesterday I got a question from a collegue about Silverlight's crossdomain access policy mechanism.
I have a collegue who constantly assigns variable and forces their type. For example
NOTE: I didn't write the script in question, my collegue did. Just volunteering to
My collegue suggested me to write a visitor pattern to navigate the AST. Can
A colleague of mine has written a DLL file for me to use called
A colleague of mine asked me to write a homework for him. Although this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.