Off topic:Problem with merge data while trying to convert gene names
1
0
Entering edit mode
5.4 years ago
mintdrink • 0

Hey! This is a follow-up question to one where I asked for help coding (in R) a way to convert gene accession numbers to gene names. Here is my code, where charg is a character vector of the gene accession ID's of the data set resdata:

charg <- resdata$genes
head(charg)

ensembl = useMart("ensembl",dataset="hsapiens_gene_ensembl")

theBM <- getBM(attributes='ensembl_gene_id','hgnc_symbol', 
      filters = 'external_gene_name', 
      values = charg, 
      mart = ensembl)

resdata <- merge.data.frame(resdata, theBM, by.x="genes",by.y="ensembl_gene_id")

Here's some output (where I'm struggling):

> head(charg)
[1] "ENSG00000261150.2"  "ENSG00000164877.18" "ENSG00000120334.15"
[4] "ENSG00000100906.10" "ENSG00000182759.3"  "ENSG00000124145.6" 

> dim(theBM)
[1] 0 1

> head(theBM)
[1] ensembl_gene_id
<0 rows> (or 0-length row.names)

> dim(resdata)
[1] 20381    11
> resdata <- merge.data.frame(resdata, theBM, by.x="genes",by.y="ensembl_gene_id")
> dim(resdata) #after merge
[1]  0 11 #isn't correct -- just row names! where'd my genes go?

Thank you.

r RNA-Seq biomart genome gene • 864 views
ADD COMMENT
This thread is not open. No new answers may be added
Traffic: 3149 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