Error in get("HUGO symbols")
IrisWong opened this issue · 7 comments
Hello @ebecht,
Before I tried to get reulsts on my own microarray data, I've followed the exemplary code to get outcome smoothly. However, after I've loaded a matrix like MCPcounterExampleData, I met "Error in get("HUGO symbols") : object 'HUGO symbols' not found" in use of MCPcounter.estimate function.
Following is the code.
library(devtools)
library(MCPcounter)
data<-read.csv("C:\\Users\\79896\\Desktop\\MCP.csv",header = TRUE,sep = ",",row.names = 1)
matrix=as.matrix(data)
genes=read.table("C:\\Users\\79896\\Desktop\\genes.txt",header = TRUE,sep = "\t",row.names = 1)
result<-MCPcounter.estimate(matrix,featuresType="HUGO_symbols", genes=genes)
There is a snapshot of MCP.csv.
Frankly I'm a beginner of learning R, owning to this, the way I ask may be disturbing in some degree. If you need more information, I am ready anytime.
Thanks for your generosity!
Iris
Hello @IrisWong
I guess that the issue is in genes
. Could you post head(genes)
?
In particular for your use genes
requires at least two columns, one named HUGO symbols
and one named Cell population
.
Also could you let me know what class(genes)
returns? It should be data.frame
Thanks
Etienne
Thanks for posting this information,
As you can see the column names in the genes
data.frame are slightly different from the ones found here
I suggest that you do either of the following:
- Leave the
genes
argument inMCPcounter.estimate
blank. The default value will automatically pull the gene list I linked above.
or
- If for some reason you want your gene list to be read from your local file, you should
- make sure that the dots visible in the column names you posted are not present in the file
MCP.csv
itself (so open it with e.g. Microsoft Excel or a text editor and make sure that "HUGO.symbols" is "HUGO symbols" in the file itself, and that "Cell.population" is "Cell population". In the file you linked above, this is the case. - When this is done/checked, change
genes=read.table("C:\\Users\\79896\\Desktop\\genes.txt",header = TRUE,sep = "\t",row.names = 1)
to
genes=read.table("C:\\Users\\79896\\Desktop\\genes.txt",header = TRUE,sep = "\t",row.names = 1, check.names = FALSE)
This should fix your problem
Thank you
Etienne
I really appreciate your specific reply.
Although a new erro showed up in first method, which is “schannel: failed to receive handshake, SSL/TLS connection failed”, I am still trying to figure it out by learning https://github.com/desktop/desktop/issues/2920.
Also, after checking over in the second (self-customized-genes) way, the error is remerging. Quite confused and discouraged.
Much thanks for your help again,
Iris
@IrisWong programming can be a bit frustrating at first, but the more you do it the easiest it becomes. It's great that you're doing this!
It looks like the genes
data.frame you posted does not have column names. Maybe header = TRUE
was forgotten in genes=read.table("C:\\Users\\79896\\Desktop\\genes.txt",header = TRUE,sep = "\t",row.names = 1, check.names = FALSE)
?
Otherwise, maybe the easiest is to change the column names of the genes
data.frame after it is loaded.
colnames(genes) <- c("ENTREZID", "HUGO symbols", "Cell population")
Then call MCPcounter.estimate
@ebecht
Finally, the easiest method changing the column names worked! I can't express how thrilled I feel when there are not more errors.
Please accept my heartfelt thanks for both the heartwarming encouragement and useful helps!
Gratefully,
Iris
Happy to hear it worked. You're very welcome. Thank you for using our package.
Etienne