Entering edit mode
11 months ago
e.fajeiii
•
0
I faced this error in R after running gene annotation codes, and I don't know how to resolve it...
The code:
df<- read.csv(file="edgeR.ExactTest.Results.G_PBS_T1vsT2.csv",header= T)
genes <- read.table(file = "clipboard", sep = "\t", header=F) # copy your gene ID that needs mapping
geneList = genes[,1]
a<- bitr(geneList, fromType = "SYMBOL", toType = "GENENAME", OrgDb = nt)
a1<- merge(df,a,by="SYMBOL")
write.csv(a1, file="edgeR.ExactTest.Results.G_PBS_T1vsT2.csv")
View(df)
View(a1)
The error:
Warning message:
In read.table(file = "clipboard", sep = "\t", header = F) :
incomplete final line found by readTableHeader on 'clipboard'
> geneList = genes[,1]
> a<- bitr(geneList, fromType = "SYMBOL", toType = "GENENAME", OrgDb = nt)
Error in .testForValidKeys(x, keys, keytype, fks) :
None of the keys entered are valid keys for 'SYMBOL'. Please use the keys method to see a listing of valid arguments.
What OS are you on? Add a
print(genes)
after your clipboard reading statement so we can see what's your clipboard.Also, predicating logic on content from the clipboard is bad and dangerous. Why don't you either ask for user input or use an actual file?
It's saying that your list of genes aren't gene symbols. Can you share the output of
head(geneList)
?