0

Here , I have two data sets 1. TABLE2 ---- looks like

essemble    Entry   Entry name
ENSP00000011292 P15085  CBPA1
ENSP00000166534 O15460  P4HA2
ENSP00000179259 Q9NQ88  TIGAR
ENSP00000196061 Q02809  PLOD1
ENSP00000196371 P55809  SCOT1
ENSP00000205402 P09622  DLDH
ENSP00000216780 Q16822  PCKGM
ENSP00000216951 P48637  GSHB
ENSP00000217961 P08842  STS
ENSP00000221476 P06732  KCRM
ENSP00000222673 Q02218  ODO1
ENSP00000223127 O60568  PLOD3
ENSP00000226253 P09972  ALDOC
ENSP00000226299 P28838  AMPL
  1. TABLE1 - second data set looks like

9606.ENSP00000011292 9606.ENSP00000011292 9606.ENSP00000011292 9606.ENSP00000166534 9606.ENSP00000166534 9606.ENSP00000196371 9606.ENSP00000196371 9606.ENSP00000196371 9606.ENSP00000196371 9606.ENSP00000196371 9606.ENSP00000196371 9606.ENSP00000196371 9606.ENSP00000196371 9606.ENSP00000205402 9606.ENSP00000205402 9606.ENSP00000205402 9606.ENSP00000205402 9606.ENSP00000216780 9606.ENSP00000216780 9606.ENSP00000216780 9606.ENSP00000216780 9606.ENSP00000216780 9606.ENSP00000216780 9606.ENSP00000216951 9606.ENSP00000216951

MY QUERY IS --- I want to place the TABLE2 Data with Table1 data in which i want to replace the id in TABLE2 with entry name in TABLE1

I try merge option but due to duplicate ids present in data it wont work properly. thn i use for loop but not working code is ---

TABLE2 = unite(uniprot_EN_recon_protein, ess, c("h" , "essemble"), sep = ".", remove = TRUE)
ess_id = TABLE2[,1]
prot_name = TABLE2[,3]


result = data.frame(length(TABLE1))
for(i in 1:length(maine))
{
  c = TABLE1[i]
  d = grep(c  , ess_id)
  if(length(d) != 0)
  {

  result[i,1] = prot_name[d]
  }

}

THANKYOU in Advance

sdabral
  • 11
  • 4
  • Are these gene IDs and you wish to change from the ensemblID type to the gene name type? If this is the case, use dput() to create a reproducible example please. Also, you would like to merge it with which column exactly? The 2nd or the 3rd? – h3ab74 Jan 24 '19 at 14:54
  • I just want to replace essembleID to geneID only. – sdabral Jan 25 '19 at 04:15
  • Ok, please upload a small snippet of the data using dput() so that I can help you. Check out this link: https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – h3ab74 Jan 25 '19 at 16:32
  • My issues was resolve by using match function of r. thankyou – sdabral Jan 28 '19 at 09:47

0 Answers0