1
$\begingroup$

I have single cell data which I want to annotate with the seurat package, so I ran this code in R:

lung.data <- Read10X(data.dir ="C:/Users/Desktop/SINGLE-CELL/DATA",gene.column = 1)

lung <- CreateSeuratObject(counts = lung.data, project = "lung", min.cells = 3, min.features = 200)

And the output of the features of this seurat object is:

    >rownames(lung)
    [1] "ENSG00000000003" "ENSG00000000419"
 [3] "ENSG00000000457" "ENSG00000000460"
 [5] "ENSG00000000938" "ENSG00000000971"
 [7] "ENSG00000001036" "ENSG00000001084"
 [9] "ENSG00000001167" "ENSG00000001460"
[11] "ENSG00000001461" "ENSG00000001497"
[13] "ENSG00000001561" "ENSG00000001617"
[15] "ENSG00000001626" "ENSG00000001629"
[17] "ENSG00000001630" "ENSG00000001631"
[19] "ENSG00000002016" "ENSG00000002079"

How can I change the row names of this Seurat Object from Ensembl to gene name, knowing that not all the ensemble genes have conversion to gene name, in order to obtain the seurat object with the gene names as row names and cell names as column names?

$\endgroup$
1
  • $\begingroup$ What is a "gene name"? I checked one of your ENSGs and it looks like a human gene, so does that mean you are only working with human sequences? And, if so, do you then mean the HGNC symbol for the gene? Or do you also need to handle other species? $\endgroup$
    – terdon
    Nov 17 at 17:28

1 Answer 1

1
$\begingroup$

I think BioMart will do the gene ID -> gene name conversion you're after: https://www.ensembl.org/info/data/biomart/index.html

To use BioMart to convert the gene IDs to gene names, you can use the BioMaRt bioconductor R package. Installation and running instructions can be found here: ensembl.org/info/data/biomart/biomart_r_package.html

For this query, you will need to use the human genes dataset:

ensembl = useEnsembl(biomart="ensembl", dataset="hsapiens_gene_ensembl")

Then use your list of gene IDs as the 'Filter', with list of IDs as the values:

filters = 'ensembl_gene_id' 

Most human protein-coding genes have an associated HGNC symbol, and these are used in Ensembl. Therefore, you can select the 'gene_name' attribute to retrieve the human gene names, and this will usually correspond to the HGNC gene names, as stored in the Ensembl database.

More information on gene names can be found in the Ensembl documentation: https://ensembl.org/info/genome/genebuild/gene_names.html

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.