Entering edit mode
3.5 years ago
Bine
▴
90
Dear all,
So far I was able to fetch the Gene Name and Gene Entrez for my genes of interest with
> top0$Gene_Name <- mapIds(org.Hs.eg.db,
> keys=ens.str,
> column="SYMBOL",
> keytype="ENSEMBL",
> multiVals="first")
top0$Gene_Entrez <- mapIds(org.Hs.eg.db,
keys=ens.str,
column="ENTREZID",
keytype="ENSEMBL",
multiVals="first")
But I am struggling to get the Chromosome information for these ones. Does anyone has an idea how I could do that?
Thank you very much, Bine
Thank you but running this gives me
Any idea why I am getting this error?
It worked now!!! I dont know why i got this error earlier.
Thank you so much :) :)
Probably you forgot to load the package
One additional question on this: I am now getting the following error with above code. Do you know what could be the reason?
Thanks so much, Bine
I am not sure about this error, it seems a very generalized error to me.
Could you run the command without assigning it to any variable?
Thank you very much. Interestingly the error does not appear then. But somehow I need to add these values to my "list".. I wonder how else I could do that..
If you don't mind can I see your complete code?
I mean at least from the list declaration to the assignment of annotation dataframe.
Ah it seems that my "list" has 50 rows whereas my "annotLookup" list
has 49 rows.
But annotLookup should have 50 rows since I said
I dont understand why it has only 49...
Do you have an idea?
Thanks so much!
Honestly, I do not have any clue why you are doing this,
And for creating a list of annotations I would use something like this:
If you are using for loop and I assume you have a list of ens_ids then,
OR you can run this operation using apply family functions (lapply).
I do this ens.str <- substr(top0$Gene_ID, 1, 50) to limit my list to the top 50 genes. The list is much longer.
I still dont understand why I only get 49 then... I am still not able to combine list and annotLookup due to the difference (49/50).
The same happens if I use another variable. I have only 48 genes in annotLookup, even though I am asking for the top 50 genes...
I guess to select the top 50 genes
substr
would not help you.substr
is for getting the substring of a character vector, it will trim the string to a specified length.What I think about getting the less number of records (i mean less than the input ids) is, there could be few Ensemble Ids that are obsolete. Did you check the assembly version you are using?
Please use
ADD REPLY
when responding to existing comments to keep threads in logical order.