Biostar Beta. Not for public use.
merge table with gene ID and names
0
Entering edit mode
16 months ago
lessismore • 630
Mexico

Dear all,

i have a technical problem, would like to use the merge function maybe in R to merge two tables, one (one column) with gene IDs and the other (2 columns) with gene IDs + respective gene names. There could be the case where i dont have for certain gene IDs the respective gene names. In this case i want in the merged table the original gene ID.

Could you help me? table1

TMCS09g1008676
TMCS09g1008677
TMCS09g1008678
TMCS09g1008679
TMCS09g1008680
TMCS09g1008681
TMCS09g1008682
TMCS09g1008683

table2

TMCS09g1008676  AMC
TMCS09g1008677  BBV
TMCS09g1008678  
TMCS09g1008679  BBC
TMCS09g1008680  
TMCS09g1008681  AYY
TMCS09g1008682  
TMCS09g1008683

wanted table:

AMC
BBV
TMCS09g1008678
BBC
TMCS09g1008680
AYY
TMCS09g1008682
TMCS09g1008683

thanks in advance

R bash awk • 610 views
ADD COMMENTlink
0
Entering edit mode

Check out the documentation on merge in R https://www.statmethods.net/management/merging.html

ADD REPLYlink
0
Entering edit mode

If the "GeneID" columns are exactly the same in both dataframes, then use cbind.

ADD REPLYlink
0
Entering edit mode

Why is the 3rd row of output "wanted" table is not "BBV" ?

ADD REPLYlink
0
Entering edit mode

yes sorry i corrected

ADD REPLYlink
1
Entering edit mode
2.4 years ago
theobroma22 ♦ 1.1k

Try: result <- merge(t1, t2, by.x = "geneID", by.y = "respectivegenename", all = TRUE)

The native gene IDs may be listed after the "respectivegenenames".

ADD COMMENTlink

Login before adding your answer.

Similar Posts
Loading Similar Posts
Powered by the version 2.3.1