← 返回 Tessera
生信9.2 万 行 × 1212.9 MB3 列有缺失数据 2026-04-17

gene_ref_human

人类基因注释参照表,九万多行——ID 转换、基因类型筛选、按染色体作图都从它起手,也是这批数据里唯一一份"拿来查"而不是"拿来画"的。

Ensembl(经 evanverse::download_gene_ref) · 收录于 2026-04-17

下载 CSV · 12.9 MB
数据预览6
ensembl_idsymbolentrez_idgene_typechromosomestartendstranddescriptionspeciesensembl_versiondownload_date
ENSG00000210049MT-TFNAMt_tRNAMT5776471mitochondrially encoded tRNA-Phe (UUU/C) [Source:HGNC Symbol;Acc:HGNC:7481]human1152026-04-17
ENSG00000211459MT-RNR1NAMt_rRNAMT6481,6011mitochondrially encoded 12S rRNA [Source:HGNC Symbol;Acc:HGNC:7470]human1152026-04-17
ENSG00000210077MT-TVNAMt_tRNAMT1,6021,6701mitochondrially encoded tRNA-Val (GUN) [Source:HGNC Symbol;Acc:HGNC:7500]human1152026-04-17
ENSG00000210082MT-RNR2NAMt_rRNAMT1,6713,2291mitochondrially encoded 16S rRNA [Source:HGNC Symbol;Acc:HGNC:7471]human1152026-04-17
ENSG00000209082MT-TL1NAMt_tRNAMT3,2303,3041mitochondrially encoded tRNA-Leu (UUA/G) 1 [Source:HGNC Symbol;Acc:HGNC:7490]human1152026-04-17
ENSG00000198888MT-ND14,535protein_codingMT3,3074,2621mitochondrially encoded NADH:ubiquinone oxidoreductase core subunit 1 [Source:HGNC Symbol;Acc:HGNC:7455]human1152026-04-17
变量12
字符型7整数5
类型
#变量类型缺失统计
1ensembl_idkey字符型不同值 86369ENSG00000274917 · ENSG00000276700 · ENSG00000275215 · ENSG00000278189 · ENSG00000278233 · ENSG00000288387 · ENSG00000288326 · ENSG00000273730
2symbol字符型40268不同值 41365RNA5-8SN3 · RNA5-8SN1 · RNA5-8SN5 · RNA5-8SN4 · RNA5-8SN2 · RNA5S3 · RNA5S1 · RNA5S2
3entrez_id整数54923min 1q1 中位 146,058均值 3.8e+7q3 max 1.4e+8
4gene_type字符型不同值 38lncRNA · protein_coding · processed_pseudogene · rRNA · unprocessed_pseudogene · misc_RNA · snRNA · miRNA
5chromosome字符型不同值 5281 · 2 · 6 · 11 · 3 · 5 · 7 · 17
6start整数min 1q1 中位 5.3e+7均值 6.8e+7q3 max 2.5e+8
7end整数min 107.0q1 中位 5.3e+7均值 6.8e+7q3 max 2.5e+8
8strand整数min -1q1 中位 1均值 0.0122q3 max 1
9description字符型854不同值 51314novel transcript · Y RNA [Source:RFAM;Acc:RF00019] · TEC · 5.8S ribosomal RNA [Source:RFAM;Acc:RF00002] · novel protein · RNA, 5.8S ribosomal N3 [Source:HGNC Symbol;Acc:HGNC:53525] · RNA, 5.8S ribosomal N1 [Source:HGNC Symbol;Acc:HGNC:53517] · novel pseudogene
10species常量,全表都是 human字符型不同值 1human
11ensembl_version常量,全表都是 115整数min 115.0q1 中位 115.0均值 115.0q3 max 115.0
12download_date常量,这份快照的抓取日字符型不同值 12026-04-17
载入已写好列类型
library(readr)

gene_ref_human <- read_csv(
  "https://assets.evanzhou.org/tessera/csv/gene_ref_human.csv",
  col_types = cols(
    ensembl_id      = col_character(),
    symbol          = col_character(),
    entrez_id       = col_integer(),
    gene_type       = col_character(),
    chromosome      = col_character(),
    start           = col_integer(),
    end             = col_integer(),
    strand          = col_integer(),
    description     = col_character(),
    species         = col_character(),
    ensembl_version = col_integer(),
    download_date   = col_character()
  )
)
URLhttps://assets.evanzhou.org/tessera/csv/gene_ref_human.csv

来源

Ensembl 的人类基因注释,用 evanverse::download_gene_ref("human") 导出,脚本只做两件事:核对十二个列都在,然后按固定顺序写出 CSV。所以这份数据的口径完全等于 Ensembl release 115 的口径。

用之前要知道的

四件事会实际影响用法:

ensembl_id 不是唯一键。 91703 行里只有 86369 个不同的 ID——5334 行是扇出来的,原因只有一个:同一个 Ensembl 基因映射到多个 Entrez ID(除 entrez_id 外其余列完全相同)。拿它做 join 会静默地把左表放大,而且不报错。只要 Entrez 那一列,就先 distinct(ensembl_id, .keep_all = TRUE);要保留全部映射,就明确知道自己在做一对多。

上面变量表里 ensembl_id 那行的"不同值"就是这个数——它和总行数对不上,一眼能看出来。

symbol 缺 40268 个。 四成多的条目没有基因符号——大量 lncRNA、假基因、TEC 条目在 Ensembl 里只有 ID 没有 symbol。拿 symbol 做 ID 转换会静默丢掉这四成,这是这份数据最大的坑。做映射前先看有效行数。

entrez_id 缺 54923 个。 六成。Ensembl 到 Entrez 的映射本来就不是满射,别指望 join 得上。

chromosome 有 528 个不同值。 不是 25 个——除了 1–22、X、Y、MT,还有几百条 scaffold(KI270728.1 那种)。按染色体作图前必须先筛掉 scaffold,否则 x 轴会长出几百个刻度。这一列也因此是字符型不是整数,排序时 "10" 会排在 "2" 前面。

species / ensembl_version / download_date 三列是常量,join 时无用,但留着能让人知道这份快照的来路。

适用图形

它主要是查表用的,能画的图不多但有几个很典型:

图形结构 用途
排序条形图 gene_type 的构成——38 类,protein_coding 只占一小部分
染色体密度图 chromosome 分组、用 start 定位的基因密度
直方图 基因长度(end − start)的分布,跨度极大,要取对数

gene_type 有 38 类,超出任何一套定性配色的容量——画之前先合并成几大类(编码 / 假基因 / 非编码 RNA / 其他),否则颜色不够用,图也读不了。

生成脚本R · 38
# Generate the human gene reference dataset for Tessera.
# Run from the repository root:
# Rscript assets/toy/bioinformatics/gene_ref_human.R

out_dir <- file.path("assets", "toy", "bioinformatics")
out_csv <- file.path(out_dir, "gene_ref_human.csv")

dir.create(out_dir, recursive = TRUE, showWarnings = FALSE)

gene_ref <- evanverse::download_gene_ref("human")

expected_cols <- c(
  "ensembl_id",
  "symbol",
  "entrez_id",
  "gene_type",
  "chromosome",
  "start",
  "end",
  "strand",
  "description",
  "species",
  "ensembl_version",
  "download_date"
)

missing_cols <- setdiff(expected_cols, names(gene_ref))
if (length(missing_cols) > 0L) {
  stop(
    "download_gene_ref() output is missing columns: ",
    paste(missing_cols, collapse = ", ")
  )
}

gene_ref <- gene_ref[, expected_cols]
utils::write.csv(gene_ref, out_csv, row.names = FALSE, na = "")

message("Wrote ", out_csv, " with ", nrow(gene_ref), " rows and ", ncol(gene_ref), " columns.")

表中统计由 scripts/profile_dataset.py 于 2026-08-03 数出。