Skip to content

Instantly share code, notes, and snippets.

View Close-your-eyes's full-sized avatar

vonSkopnik Close-your-eyes

  • Charité / German Research Center for Rheumatism
  • Berlin
View GitHub Profile
@Close-your-eyes
Close-your-eyes / create_ortholog_table.R
Last active March 4, 2023 10:34
Produce a conversion table of human genes and mouse orthologs using bioMart
## initially based on orthologsBioMART::findOrthologs from https://github.com/vitkl/orthologsBioMART
## boiled down to essentially reproduce and extend this table: ProjecTILs::Hs2Mm.convert.table
features <- c() # select human features to find orthologs for; e.g. rownames(Seurat::GetAssayData(SO, slot = "data", assay = "RNA"))
# use biomart to map orthologs
hs_mart <- biomaRt::useMart("ensembl", dataset="hsapiens_gene_ensembl")
#mm_mart <- biomaRt::useMart("ensembl", dataset="mmusculus_gene_ensembl") # not needed
hs_ids <- biomaRt::getBM(attributes = unique(c("hgnc_symbol", "ensembl_gene_id")),