Question: Error while adding gene names
0
gravatar for Manoj
6 weeks ago by
Manoj80
United States
Manoj80 wrote:

Hi, I am getting following ERROR. Please correct me in my script.

res$symbol <- mapIds(org.Hs.eg.db, 
                 keys=row.names(res), 
                 column="SYMBOL", 
                 keytype="ENSEMBL",
                 multiVals="first")

ERROR:

Error in .testForValidKeys(x, keys, keytype, fks) : 
  None of the keys entered are valid keys for 'ENSEMBL'. Please use the keys method to see a listing of valid arguments.
rna-seq next-gen genome • 250 views
ADD COMMENTlink modified 6 weeks ago by lieven.sterck8.5k • written 6 weeks ago by Manoj80

Provide example of actual input going into this.

ADD REPLYlink written 6 weeks ago by genomax89k

Here is the input file.

$head(countdata$counts)
              sample1 sample2 sample3 sample4 sample5 sample6
 ENST00000631435.1       0       0       0       0       0       0
 ENST00000415118.1       0       0       0       0       0       0
 ENST00000434970.2       0       0       0       0       0       0
 ENST00000448914.1       0       0       0       0       0       0
 ENST00000632684.1       0       0       0       0       0       0
 ENST00000632524.1       0       0       0       0       0       0
ADD REPLYlink modified 6 weeks ago • written 6 weeks ago by Manoj80

Here are some initial commands that I using before that process:

dds <- DESeq(dds)
res <- results(dds)
mcols(res, use.names=TRUE)
summary(res)
head(res)

I am using library("AnnotationDbi"), library("org.Hs.eg.db").

ADD REPLYlink written 6 weeks ago by Manoj80

these are ENSEMBL IDs. I am converting these into gene id.

ADD REPLYlink written 6 weeks ago by Manoj80

ENSEMBL ID is not helpful at all. Do you think you have protein IDs? Gene IDs?

ADD REPLYlink written 6 weeks ago by swbarnes28.6k

I have no gene IDs. I got these from the output of kallisto pipeline. I am not sure how to convert these ENSEMBL ID to gene ID. Please suggest how I can get gene IDs.

ADD REPLYlink written 6 weeks ago by Manoj80

These are transcript ID's based on the list posted above.

ADD REPLYlink written 6 weeks ago by genomax89k

Yes! do I need to get gene IDs from these transcript IDs first before converting these to genes name?

ADD REPLYlink written 6 weeks ago by Manoj80

You have to understand what you have. Do you understand why your new code works and the old code didn't?

ADD REPLYlink written 6 weeks ago by swbarnes28.6k

Step1: are you absolutely sure that what you have is really gene names?

ADD REPLYlink written 6 weeks ago by swbarnes28.6k

I improved the script as following and it works. However, most of ENSEMBL IDs could not find Gene names.

res$symbol <- mapIds(org.Hs.eg.db, 
                 rownames(res)<-gsub("\\..*","",rownames(res)), 
                 column="SYMBOL", 
                 keytype = "ENSEMBLTRANS",
                 multiVals="first")
ADD REPLYlink modified 6 weeks ago • written 6 weeks ago by Manoj80

Can you explain what you think that gsub line of code is doing?

ADD REPLYlink written 6 weeks ago by swbarnes28.6k

gsub is a function that perform replacement of the first and all matches respectively.

ADD REPLYlink written 6 weeks ago by Manoj80
1

You can't do bioinformatics like this; mindlessly quoting code you do not understand. It is a waste of time for people to help you when you do not understand your own work, and clearly have no interest in expending any energy to do so.

ADD REPLYlink written 6 weeks ago by swbarnes28.6k

Really! It is ridiculous. You did not give even a single line to solve my question and testing my knowledge. It is really pathetic. I don't know what is your problem for your frustration but this is the great community and people providing consistently support. No matter you are beginner or advance user. If you do not have time just do not reply. I do not know how you are proficient in coding you must be publishing one research paper every month (LOL). By the way, this is not my code I am just following DESeq2 tutorial. I know bioinformatics whatever I am required...

I do not know what do you think about research but I am surprised to know about your thought!

ADD REPLYlink modified 6 weeks ago • written 6 weeks ago by Manoj80

Think we all need to take a moment to cool our heads here - it can be frustrating for both sides. Manoj, it can be frustrating for regular members of the site to see questions that lack critical info. Try to take care to provide reproducible, clear, and complete examples of the issue you're facing prior to posting a question. Often, this process will help you figure out the answer yourself, but if not, it'll make it much easier for the community to help you more quickly. And @swbarnes2 somewhat has a point about using code you don't fully understand if you're just following a tutorial and can't determine why it's not working with your data.

Regardless, consider this a reminder to keep things civil.

ADD REPLYlink written 6 weeks ago by jared.andrews077.1k

The question was - "what is that line of code doing?", not "what does the function gsub do?".

You're modifying an object using the assignment operator while passing it as a parameter to a function. Are you sure that the assignment operation will yield the same type as rownames(res) would have?

If you wish to edit the rownames, do that before the function call.

ADD REPLYlink written 6 weeks ago by RamRS30k
4
gravatar for Arup Ghosh
6 weeks ago by
Arup Ghosh2.7k
India
Arup Ghosh2.7k wrote:

Use keytype = "ENSEMBLTRANS".

ADD COMMENTlink written 6 weeks ago by Arup Ghosh2.7k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1640 users visited in the last hour