Entering edit mode
Sorry, this is probably a very basic question...
I have the following output from DESeq2:
> head(res)
log2 fold change (MLE): Prep r322 vs hp1829
Wald test p-value: Prep r322 vs hp1829
DataFrame with 6 rows and 6 columns
baseMean log2FoldChange lfcSE stat pvalue padj
<numeric> <numeric> <numeric> <numeric> <numeric> <numeric>
ENSG00000223972 0.592269283427995 2.45738005468305 6.19618011312043 0.396595968777528 0.691665425740757 NA
ENSG00000227232 419.788972276199 0.338770334899125 0.382205077243893 0.886357495148993 0.375424915927214 0.725257780579341
ENSG00000238009 0.550554023354792 -0.0363069764959028 5.25663366608541 -0.00690688733554843 0.99448914504777 NA
ENSG00000237683 17.2262590129968 3.85233823390427 1.14138300025536 3.37514947484097 0.000737756082603317 0.0565243632615917
ENSG00000268903 1.54832852250678 2.00990324663306 2.15702435077862 0.931794416649747 0.351442780657832 NA
ENSG00000239906 0.475776197736371 -0.0362637105559594 6.76583280846614 -0.00535982954095205 0.995723495236492 NA
And for these ensembl IDs I have got the gene name via a biomaRt
query:
> head(G_list)
ensembl_gene_id hgnc_symbol ensembl_gene_id_version
1 ENSG00000007923 DNAJC11 ENSG00000007923.11
2 ENSG00000008128 CDK11A ENSG00000008128.18
3 ENSG00000008130 NADK ENSG00000008130.11
4 ENSG00000009724 MASP2 ENSG00000009724.12
5 ENSG00000011021 CLCN6 ENSG00000011021.17
6 ENSG00000028137 TNFRSF1B ENSG00000028137.12
How do I now alter res
so that the results of my DE analysis display the gene name (as given in G_list
) rather than the ensembl ID? I have tried to use merge
but it isn't working.
z <- merge(res,G_list,by.x=rownames(res),by.y="ensembl_gene_id")
Error in fix.by(by.x, x) : 'by' must specify uniquely valid columns