Epistasis Field GuideEFG拟南芥第一轮 · 试跑Arabidopsis round 1 · trial run
Step 0 · 数据准备Step 0 · Data preparation

后面每一步用的数据从哪里来?Where does the data for every later step come from?

样本、SNP 集、亲缘矩阵和模拟性状 · 1a 已完成 · 面板大小和模拟设置还没有冻结Samples, SNP sets, kinship and simulated traits · 1a done · panel size and simulation settings not yet frozen

先修Before you start
知道什么是 SNP 和品系(总览第 01 节)Know what a SNP and a line are (overview, section 01)
学完能做After this page you can
说出从 1,135 个品系、1,070 万个 SNP 到 936 个品系、P1 和三个 P2 面板,每一步筛掉了什么、结果给哪一步用Say what each step removes on the way from 1,135 lines and 10.7 million SNPs to 936 lines, P1 and the three P2 panels, and which later step uses each set
预计用时Time
约 15 分钟about 15 minutes

后面的步骤需要四样东西:同时有表型和基因型的样本;按用途分开的几套 SNP;描述品系间亲缘的矩阵;以及答案已知、用来评价策略的模拟性状。这一步把它们准备好,并且在看到任何检测结果之前写下各自的规则。The later steps need four things: a sample with both phenotypes and genotypes; several SNP sets for different jobs; a matrix describing relatedness among lines; and simulated traits with known answers for evaluating the strategies. This step prepares them and writes down each rule before any search result is seen.

01 · 输入和来源01 · Inputs and sources

三份公开数据Three public data sets

基因型Genotypes

1001 Genomes v3.1

填补后的 SNP 矩阵:1,135 个品系 × 10,709,949 个 SNP。另用同版本的 VCF 核对等位基因。Imputed SNP matrix: 1,135 lines × 10,709,949 SNPs. The VCF of the same release was used to check alleles.

1001genomes.org · v3.1 · 1001 Genomes Consortium 2016

表型Phenotype

DTF1 · AraPheno 703

16 °C 下从播种到莲座中央出现可见花蕾的天数,下文称"现蕾时间"。936 个品系,每个品系一个值。Days at 16 °C from sowing until visible flower buds appear in the centre of the rosette, called "time to buds" below. 936 lines, one value per line.

arapheno.1001genomes.org · 703 · Grimm et al. 2017

基因注释Gene annotation

Araport11

Ensembl Plants release 63 提供的 GFF3(TAIR10 坐标)。只用 1–5 号染色体上的蛋白编码基因,共 27,420 个。GFF3 from Ensembl Plants release 63 (TAIR10 coordinates). Only protein-coding genes on chromosomes 1–5: 27,420.

plants.ensembl.org · Arabidopsis · release 63

三份数据都是公开下载的,下载后用提供方的校验值(SHA-256 或 MD5)核对过。All three were downloaded from public sources and checked against the providers' checksums (SHA-256 or MD5).

02 · 处理步骤02 · Processing

从 1,070 万个 SNP 到几套用途不同的集合From 10.7 million SNPs to several sets with different jobs

样本这边只有一步:1,135 个品系中有 936 个有 DTF1,全部有基因型,这 936 个就是分析样本。SNP 这边按下图逐步筛选。条形长度按对数尺度画,数字是每一步之后剩下的 SNP 数。On the sample side there is one step: 936 of the 1,135 lines have DTF1, all with genotypes, and these 936 are the analysis sample. SNPs are filtered step by step as below. Bars are on a log scale; each number is how many SNPs remain after that step.

MAF 指次要等位基因频率。P1 用于单 SNP 扫描、亲缘矩阵、主成分和基因内 SNP;P2 的三个候选面板供 SNP 对策略选择,按 20 kb 窗口做 LD 精简。MAF is the minor allele frequency. P1 feeds the single-SNP scan, the kinship matrix, the principal components and the within-gene SNP sets; the three P2 candidate panels are for the SNP-pair strategies, thinned by LD in 20 kb windows.

P1 为什么用 MAF ≥ 0.05Why P1 uses MAF ≥ 0.05

很稀有的 SNP 只在少数品系里出现,单 SNP 检验几乎没有把握,也容易被个别品系左右。0.05 是常见的工作值,排除最稀有的一部分。Very rare SNPs occur in only a few lines, so single-SNP tests have little power and can be driven by single lines. 0.05 is a common working value that drops the rarest variants.

P2 为什么从 MAF ≥ 0.1 开始Why P2 starts from MAF ≥ 0.1

两个 SNP 配对后要分成四格,每格至少 10 个品系才合格。两个都稀有时,"两者都是 1"那一格会很小。从 0.1 开始,四格人数更有保障。A pair splits the lines into four cells, and each needs at least 10 lines to be eligible. When both SNPs are rare, the "both 1" cell gets very small. Starting from 0.1 keeps the cells better filled.

03 · 可核对的输出03 · Checkable outputs

现蕾时间的分布右偏,取对数后基本对称Time to buds is right-skewed and close to symmetric on the log scale

936品系lines
平均 ± 标准差(天)mean ± SD (days)
最小 · 中位 · 最大(天)min · median · max (days)
0.51 / −0.14偏度:原尺度 / 对数尺度skewness: days / log

图里只画了分组计数,没有逐个品系的数值。左端约 24 天处有一群开花最快的品系;按 3 × IQR 规则没有极端值。主分析用原尺度,对数尺度事先定为敏感性分析。The figure shows binned counts only, not per-line values. A cluster of the fastest lines sits at about 24 days; no extreme values by the 3 × IQR rule. The main analysis uses days; the log scale is a pre-specified sensitivity analysis.

亲缘矩阵 KKinship matrix K

用 P1 的 1,812,578 个 SNP 由 GEMMA 计算,936 × 936。核对结果:数值有限、完全对称、行和约为 0;最小特征值约为 0,这是中心化造成的,在混合模型中不影响使用。行顺序与基因型文件、表型表和主成分逐行一致。Computed by GEMMA from the 1,812,578 P1 SNPs, 936 × 936. Checks: all values finite, exactly symmetric, row sums about 0; the smallest eigenvalue is about 0 because of centring, which is harmless in a mixed model. Row order matches the genotype file, the phenotype table and the principal components line by line.

群体结构和连锁Population structure and linkage

主成分用 110,048 个 SNP(P1 按 10 kb、r² 0.2 精简)计算。第一主成分分出东部(约 50–130°E)的品系,第二主成分分出一个约 0–20°E 的群体。平均 r² 在 3–5 kb 内降到 0.2 以下,10–15 kb 降到 0.1 以下,与文献一致。Principal components use 110,048 SNPs (P1 thinned at 10 kb, r² 0.2). PC1 separates eastern lines (about 50–130°E); PC2 separates a group at about 0–20°E. Mean r² falls below 0.2 within 3–5 kb and below 0.1 by 10–15 kb, consistent with the literature.

四格合格的 SNP 对数(门槛的分母)Pairs with four eligible cells (the bar's denominator)

面板PanelSNP 数SNPs四格都 ≥ 10 个品系的对Pairs with every cell ≥ 10 lines占全部对Share of all pairs门槛 0.05 ÷ 对数Bar 0.05 ÷ pairs
r² 0.259,7041,742,876,50797.8%2.87 × 10⁻¹¹
r² 0.5183,73016,449,009,28097.5%3.04 × 10⁻¹²
r² 0.8345,627约 5.80 × 10¹⁰(抽样估计)≈ 5.80 × 10¹⁰ (sampled estimate)—≈ 8.6 × 10⁻¹³

r² 0.2 和 r² 0.5 是逐对精确计数;r² 0.8 只用 200 万个随机对估计过。r² 0.2 and r² 0.5 are exact pair counts; r² 0.8 was estimated from 2 million random pairs.

04 · 模拟性状04 · Simulated traits

用真实基因型生成答案已知的性状Traits with known answers, generated from the real genotypes

模拟保留 936 个品系的真实基因型,只合成性状。每个模拟性状由三部分相加:加性背景(随机 1,000 个 P1 SNP,离因果位点对至少 50 kb)、一对 SNP 的互作,以及噪声。互作项是两个因果 SNP 的乘积,先对 10 个主成分和两个 SNP 的主效应回归后取残差,所以两端单独看几乎没有信号。两个因果 SNP 从 P1 中随机抽取,要求 MAF ≥ 0.1、位于不同染色体、四格都至少 20 个品系。The simulations keep the 936 lines' real genotypes and synthesise only the trait. Each simulated trait is the sum of three parts: an additive background (1,000 random P1 SNPs at least 50 kb from the causal pair), an interaction between one SNP pair, and noise. The interaction term is the product of the two causal SNPs, residualised on 10 principal components and the two main effects, so each end shows almost no signal on its own. The two causal SNPs are drawn at random from P1 with MAF ≥ 0.1, on different chromosomes, and with at least 20 lines in every cell.

情景Scenario背景方差Background互作方差Interaction噪声方差Noise已生成的批次Batches generated
S00.5000.500.7 批次 10 个;周末批次 40 个;另 200 个用于 B 的误报校准0.7 batch 10; weekend batch 40; another 200 for calibrating B's false positives
S20.400.100.500.7 批次 10 个;周末批次 40 个0.7 batch 10; weekend batch 40
S30.450.050.50周末批次 40 个weekend batch 40

种子:0.7 批次 20261029,周末批次 20261031。另有 3 个"已覆盖"的实现检查例子:因果位点对直接取自 r² 0.2 面板,只用来检查流程能否找回搜索范围内的已知答案,不计入功效估计。主效 QTN、S1、S4 等情景和正式重复次数还没定。Seeds: 20261029 for the 0.7 batch, 20261031 for the weekend batch. Three further "covered" examples take the causal pair straight from the r² 0.2 panel; they only check that the pipeline recovers a known answer inside its search space and are not counted in power estimates. Scenarios with main-effect QTN, S1, S4 and the formal number of replicates are not yet decided.

05 · 常见错误05 · Common mistakes

复核中发现、已更正的三个问题Three problems found in review and corrected

1

四格合格不等于可以检验Four eligible cells do not make a pair testable

最初把四格人数达标的对直接称为合格集合。复核指出:加入主成分等协变量后,乘积项还必须带来一个独立的新维度(秩检查),否则无法检验。四格计数只是上界。At first, pairs with enough lines in every cell were called the eligible set. Review pointed out that once covariates such as principal components are added, the product term must still add an independent dimension (the rank check), or it cannot be tested. The four-cell count is only an upper bound.

处理:四格计数改称 U_cell,用作门槛分母(偏保守);秩检查在实际检验的对上逐一执行。Correction: the four-cell count is now called U_cell and serves as the bar's denominator, which is conservative; the rank check runs on each pair actually tested.

2

亲缘矩阵没有自带样本编号The kinship matrix carries no sample IDs

GEMMA 输出的 K 只有数字,没有品系编号。如果表型、协变量和 K 的行顺序不一致,模型照样能跑,结果却是错的。GEMMA writes K as numbers only, without line IDs. If the phenotype, covariates and K are in different orders, the model still runs but the results are wrong.

处理:另写一份行号与品系编号的对照表,每次读入 K 都逐行核对顺序。Correction: a separate file maps row numbers to line IDs, and the order is checked row by row every time K is read.

3

因果位点对不在搜索范围内时,模拟验收不了流程If the causal pair is outside the search space, a simulation cannot validate the pipeline

随机抽的 20 个因果 SNP 没有一个在 r² 0.2 面板里。检测找不到真值时,分不清是面板没覆盖还是程序有问题。None of 20 randomly drawn causal SNPs was in the r² 0.2 panel. When a search misses the true pair, it is unclear whether the panel failed to cover it or the program has a bug.

处理:另做 3 个因果位点对在面板内的"已覆盖"例子,专门检查流程实现,不计入功效估计。Correction: three "covered" examples with the causal pair inside the panel were added solely to check the implementation; they are not counted in power estimates.

06 · 练习06 · Exercises

算一算门槛的分母Work out the bar's denominator

r² 0.2 面板有 59,704 个 SNP。先算出全部 SNP 对的数目,再算四格合格的对占多少,最后算出门槛。The r² 0.2 panel has 59,704 SNPs. Work out the number of all SNP pairs, then the share with four eligible cells, then the bar.

python3 -c " m = 59704 pairs = m * (m - 1) // 2 u_cell = 1742876507 print('all pairs', pairs) print('eligible share', round(u_cell / pairs, 4)) print('bar', 0.05 / u_cell) "

应得到 1,782,253,956 对、0.9779 和约 2.87e-11。把 m 换成 183,730,全部对数是多少?和表中 r² 0.5 的合格对数比一比。You should get 1,782,253,956 pairs, 0.9779 and about 2.87e-11. With m = 183,730, how many pairs are there in total? Compare with the r² 0.5 eligible count in the table.

一个因果 SNP 的 MAF 是 0.06。它会出现在哪些 SNP 集里?A causal SNP has MAF 0.06. Which SNP sets can it appear in?

07 · 待决定07 · Open questions
第 48 周 · 用户和导师Week 48 · student and supervisor

P2 面板选哪一个Which P2 panel

r² 0.2、0.5、0.8 三个候选的覆盖率和计算量见 Step 2 第 4 节,比较练习见 Step 5。Coverage and computing for the r² 0.2, 0.5 and 0.8 candidates are in Step 2, section 4; the comparison exercise is in Step 5.

第 48 周Week 48

模拟的正式设置Formal simulation settings

要不要加主效 QTN、S1、S4,以及因果位点对取自开花基因的情景;每个情景重复多少次。Whether to add main-effect QTN, S1, S4 and a scenario with causal pairs in flowering genes, and how many replicates per scenario.

与合作者商定With a collaborator

基因内 SNP 集Within-gene SNP sets

暂定:294 个开花基因,基因 ± 500 bp。待定:开花基因名单和基因内 MAF 下限。Provisional: 294 flowering genes, gene ± 500 bp. Open: the gene list and the within-gene MAF cut-off.

Step 1Step 1

GLM 用几个主成分How many PCs in the GLM

10 个主成分时单 SNP 扫描的 λ 仍为 2.54,要结合 Step 1 的校准检查和导师讨论。With 10 PCs the single-SNP scan still has λ = 2.54; to be settled with Step 1's calibration checks and the supervisor.

本页产物Your output for this page

写下你自己的解释Write your own explanation

写出本项目的集合关系:从全部品系和全部 SNP 开始,每往下一层写一行,写清剩多少、按什么规则筛、给哪一步用。至少写到两个 P2 面板和基因内 SNP。Write out the project's set relations: start from all lines and all SNPs and write one line per level, giving how many remain, the rule applied, and which step uses it. Go at least as far as the two P2 panels and the within-gene SNPs.

状态Status

只保存在这个浏览器里,换设备或清除浏览器数据后会丢失。所有页面的记录可以在总览页的“我的学习记录”里一起导出。Saved in this browser only; it is lost on another device or after clearing browser data. The records of all pages can be exported together under “My learning record” on the overview page. 去导出Go to export