This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Convert multiple rows value retrieved from ensemble biomart to comma separated list for a common ensemble gene ID.

I have retrieved the gene ontology data from ensemble as a data frame, as shown bellow

Gene ontology data table I retrieved from biomart enter image description here

and I want to add those details to my DEG list which have unique ensemble id in each row , so I want to convert the ensemble dataframe to match this format. where each unique gene id will be linked to multiple GO separated by comma.

This format I want enter image description here

If anyone can suggest some code to do it in R it will be very helpful. Thanks.

ensembl biomart r geneontology

so the ensembl ids in the GO df are not unique?

you can post your data in plain text so that others can help with that

1 answer

Hi, welcome.

There are resources on the World Wide Web that go over how to merge two data-frames. Can you please search?

Key functions from base R are match(), which(), and merge(). Tidyverse provides other —more fancy— functions - see for example: https://dplyr.tidyverse.org/reference/join.html

Kind regards,

Kevin

Log in to answer this question.