I am performing PCA in R and I got top 10 measurements (genes) that contribute for PC1:
loading_scores <- pca$rotation[,1]
gene_scores <- abs(loading_scores) ## get the magnitudes
gene_score_ranked <- sort(gene_scores, decreasing=TRUE)
top_10_genes <- names(gene_score_ranked[1:10])
top_10_genes
output:
[1] "ENSG00000169018.5" "ENSG00000181038.13" "ENSG00000103275.18" "ENSG00000174796.12"
[5] "ENSG00000164087.7"
How can I convert the ouputs from "gene IDs" into gene symbols? so that the outputs be like:
FEM1B
METTL23
UBE2I
etc..
Thanks in advance
for humans, use org.hs.eg.db
yes for humans, but how?