softwareDevelopment commited on
Commit
c465223
Β·
verified Β·
1 Parent(s): cb318b3

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +251 -0
README.md ADDED
@@ -0,0 +1,251 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: GWAS Explorer
3
+ emoji: 🧬
4
+ colorFrom: green
5
+ colorTo: blue
6
+ sdk: gradio
7
+ sdk_version: 4.44.0
8
+ app_file: app.py
9
+ pinned: false
10
+ ---
11
+
12
+ # GWAS Explorer β€” User Manual: Settings, What They Mean, What to Pick
13
+
14
+ This is a practical guide, not a code walkthrough. For every setting in the
15
+ app, it explains **what it controls**, **what happens if you set it too
16
+ high/too low**, and **what range to actually use** for a typical rice
17
+ breeding panel.
18
+
19
+ ---
20
+
21
+ ## 1. Before you touch any settings β€” data checks
22
+
23
+ - Genotype coding must be consistent across the whole file: either all
24
+ `0/1/2` or all `-1/0/1`. Don't hand-mix them.
25
+ - Missing data: only `-9`, `-99`, `-999` are read as missing. If your file
26
+ uses a different missing code, recode it before uploading, or it'll be
27
+ silently treated as a real genotype call.
28
+ - MAF filtering happens *before* any model runs β€” a marker dropped here
29
+ never appears in any plot or the Excel output.
30
+
31
+ ---
32
+
33
+ ## 2. Tab 1 β€” Core run settings
34
+
35
+ ### MAF Threshold β€” **default 0.05, typical range 0.03–0.10**
36
+ Drops markers whose minor allele frequency is below this value.
37
+ - **Too low (e.g. 0.01)**: keeps very rare-allele markers, which are
38
+ statistically unstable β€” a handful of individuals can swing the p-value
39
+ a lot, inflating false positives.
40
+ - **Too high (e.g. 0.15+)**: throws away real, usable markers, especially
41
+ in panels with several minor subpopulations.
42
+ - **Recommendation**: 0.05 is a safe default for most diversity/breeding
43
+ panels (100+ lines). Drop to 0.03 if your panel is small (<80 lines) and
44
+ you don't want to lose markers; raise to 0.08–0.10 for very large,
45
+ diverse panels (300+ lines) where rare-allele noise is more of a
46
+ problem.
47
+
48
+ ### Fallback Top-N β€” **default 15, range 10–20**
49
+ Only used if the permutation threshold fails to compute. It's a safety
50
+ net, not a real significance rule β€” don't rely on it to decide anything.
51
+ Leave at default; if it's actually being used, something upstream (usually
52
+ too few markers or too few permutations) needs fixing instead.
53
+
54
+ ### Permutations for LOD threshold β€” **default 100, range 100–200**
55
+ Number of phenotype shuffles used to build the empirical significance
56
+ cutoff (Churchill & Doerge method). This is the real basis for calling a
57
+ marker significant.
58
+ - **Too low (<50)**: threshold estimate is noisy β€” rerunning the pipeline
59
+ can give you a visibly different threshold each time.
60
+ - **Too high (>200, capped internally anyway)**: diminishing returns, just
61
+ slower.
62
+ - **Recommendation**: 100 is fine for exploratory work. Use 200 (the max)
63
+ for a threshold you're going to report/publish β€” it's more stable and
64
+ the app caps compute anyway, so there's no real reason to use fewer.
65
+
66
+ ### Manual LOD threshold β€” **default 0, i.e. off (automatic)**
67
+ Overrides the permutation threshold with a fixed LOD value you set
68
+ yourself.
69
+ - **When to use**: only when you have a specific external reason to fix
70
+ the threshold β€” e.g. matching a threshold used in a companion paper/QTL
71
+ study, or comparing runs on unequal marker sets where the permutation
72
+ threshold isn't comparable across them.
73
+ - **Typical values if you do use it**: LOD 3–4 is the conventional QTL
74
+ mapping range; for GWAS with thousands of markers you'd generally want
75
+ it higher (LOD ~4–6) to stay close to a Bonferroni-equivalent stringency.
76
+ - **Default advice**: leave at 0 and let permutation set it β€” that's the
77
+ statistically defensible choice for a given dataset.
78
+
79
+ ### Minimum PVE % β€” **default 0, i.e. off**
80
+ Extra filter: a marker must explain at least this % of phenotypic variance
81
+ *in addition to* passing the LOD threshold.
82
+ - **When to use**: when you specifically want to report only
83
+ large-effect MTAs (e.g. for marker development / MAS candidates), not
84
+ every marker that's merely statistically significant.
85
+ - **Typical range if enabling**: 5–10% for a moderately polygenic trait;
86
+ 10–15%+ if you specifically want major-effect QTNs only.
87
+ - **Caution**: setting this too high (>20%) on a polygenic trait can wipe
88
+ out every hit β€” most real QTNs for complex traits explain a few percent
89
+ each, not 20%.
90
+
91
+ ---
92
+
93
+ ## 3. Model selection β€” which of the 8 to run
94
+
95
+ You don't need all 8 every time.
96
+
97
+ - **Always include one baseline + one kinship-corrected model** so you can
98
+ see the difference structure correction makes: **OLS + EMMAX** (or MLM)
99
+ is the minimum sensible pair.
100
+ - **MLM vs EMMAX**: MLM adds fixed kinship-PC covariates on top of the
101
+ kinship random effect; EMMAX uses kinship alone. If your panel has clear
102
+ subpopulation structure (e.g. indica/japonica mix), MLM's extra Q
103
+ covariates usually help. If it's a fairly uniform breeding population,
104
+ EMMAX alone is often enough and slightly less conservative.
105
+ - **GEMMA**: the most rigorous single-locus model (per-marker REML), but
106
+ the slowest. Use it as a confirmatory check on your top hits from
107
+ MLM/EMMAX rather than as a first-pass scan on a huge marker set.
108
+ - **FarmCPU / BLINK**: multi-locus methods β€” better power when several
109
+ QTNs are linked or when polygenic background masks individual effects
110
+ under single-locus models. Slower, and iterative, so results can shift
111
+ slightly run-to-run depending on cofactor settings (see below). Good
112
+ second-pass once you know roughly what OLS/MLM/EMMAX are finding.
113
+ - **mrMLM / FASTmrMLM**: also multi-locus, but with an explicit two-stage
114
+ screen β†’ joint-fit β†’ backward-elimination design. Useful if you want an
115
+ independent multi-locus method to cross-check FarmCPU/BLINK hits against
116
+ (different QTN-selection logic β†’ different false-positive profile).
117
+ FASTmrMLM trades some rigor (drops kinship in the joint-fit stage) for
118
+ speed β€” use it for quick multi-locus scans, mrMLM for the more careful
119
+ version.
120
+
121
+ **Practical recommendation for a standard run**: OLS + MLM + EMMAX +
122
+ FarmCPU + GEMMA (the app's default selection) gives you baseline,
123
+ single-locus-corrected, and multi-locus coverage without running
124
+ everything. Add BLINK/mrMLM/FASTmrMLM only when you want to
125
+ cross-validate a specific set of candidate MTAs.
126
+
127
+ ---
128
+
129
+ ## 4. Cofactors / Advanced tab
130
+
131
+ ### FarmCPU & BLINK β€” pseudo-QTN iteration
132
+
133
+ **Max FEM/REM iterations β€” default 8, range 5–12**
134
+ How many rounds of "scan genome β†’ pick pseudo-QTNs β†’ re-check them" the
135
+ method runs before stopping (it also stops early if the QTN set stops
136
+ changing).
137
+ - **Too few (<4)**: may stop before the pseudo-QTN set has converged,
138
+ under-correcting for background genetic effects.
139
+ - **Too many (>12)**: rarely helps β€” if it hasn't converged by ~10
140
+ iterations it usually won't, and you're just adding runtime.
141
+ - **Recommendation**: 8 is a good default; drop to 5–6 for a quick look on
142
+ a large marker set, raise to 10–12 only if you notice the results
143
+ changing meaningfully when you bump it up from 8 (a sign it hadn't
144
+ converged).
145
+
146
+ **FarmCPU bin size (bp) β€” default 1,000,000 (1 Mb), range 500 kb – 2 Mb**
147
+ Genome is chopped into bins this wide; only the single best candidate per
148
+ bin becomes a pseudo-QTN each round.
149
+ - **Too small (e.g. 100 kb)**: can select several near-duplicate
150
+ pseudo-QTNs from the same LD block as if they were independent β€”
151
+ inflates the covariate set with redundant markers.
152
+ - **Too large (e.g. 5 Mb)**: can merge two genuinely distinct, linked QTLs
153
+ into one bin and only keep one of them.
154
+ - **Recommendation**: 1 Mb is a reasonable default for rice (LD generally
155
+ decays within a few hundred kb in most cultivated panels). If your LD
156
+ decay plot (Tab 4) shows LD extending past ~1 Mb, consider widening the
157
+ bin to 1.5–2 Mb; if LD decays very fast (<200 kb), you can narrow it to
158
+ 500 kb.
159
+
160
+ **BLINK LD rΒ² pruning cutoff β€” default 0.7, range 0.5–0.9**
161
+ Two candidates in the same local LD block are treated as redundant (and
162
+ the weaker dropped) once their rΒ² exceeds this.
163
+ - **Too low (e.g. 0.3)**: over-prunes β€” treats markers that aren't really
164
+ redundant as duplicates, potentially discarding a real second QTN that
165
+ happens to sit near a stronger one.
166
+ - **Too high (e.g. 0.95)**: under-prunes β€” keeps near-identical markers as
167
+ separate pseudo-QTNs, which can waste degrees of freedom and slow
168
+ convergence.
169
+ - **Recommendation**: 0.7 is the standard LD-pruning cutoff used in most
170
+ GWAS pipelines (similar to PLINK's common defaults). Only move it if you
171
+ have a specific reason β€” e.g. very high average LD in your panel, where
172
+ 0.8–0.9 avoids over-pruning.
173
+
174
+ ### mrMLM & FASTmrMLM β€” two-stage screening
175
+
176
+ **Stage-1 screening p-value threshold β€” default 0.01, range 0.001–0.05**
177
+ How lenient the initial scan is about calling something a "candidate"
178
+ worth testing jointly in Stage 2.
179
+ - **Too strict (0.001)**: may exclude real but modest-effect QTNs before
180
+ they even get a chance in the joint-fit stage.
181
+ - **Too lenient (0.05)**: floods Stage 2 with weak candidates, most of
182
+ which get backward-eliminated anyway β€” just adds runtime and noise.
183
+ - **Recommendation**: 0.01 is a sensible middle ground; loosen to 0.02–0.05
184
+ if you suspect real signals are being screened out (e.g. a highly
185
+ polygenic trait with many small effects), tighten to 0.001–0.005 for a
186
+ cleaner, more conservative candidate list.
187
+
188
+ **Max candidate QTNs carried into Stage 2 β€” default 20, range 10–30**
189
+ Caps how many Stage-1 candidates get fit jointly.
190
+ - **Too low (<10)**: may cut off real candidates before backward
191
+ elimination gets a chance to sort them out, especially on a trait with
192
+ many markers passing Stage 1.
193
+ - **Too high (>30)**: joint model becomes large and can get numerically
194
+ unstable, especially with a small sample size relative to candidate
195
+ count.
196
+ - **Recommendation**: 20 works for most panels. Scale down toward 10–15 if
197
+ your sample size is small (<100 lines) β€” you don't have the degrees of
198
+ freedom to support a 20-marker joint model reliably.
199
+
200
+ **Stage-2 backward-elimination drop threshold β€” default 0.05, range
201
+ 0.01–0.1**
202
+ In the joint fit, the weakest surviving candidate is dropped (and the
203
+ model refit) if its p-value exceeds this, repeated until everyone left
204
+ clears the bar.
205
+ - **Too strict (0.01)**: can eliminate real co-segregating QTNs that only
206
+ look weak because they're sharing variance with a correlated candidate.
207
+ - **Too lenient (0.1)**: leaves weaker/noisier candidates in the final
208
+ set.
209
+ - **Recommendation**: 0.05 (standard significance level) is the sensible
210
+ default; there's rarely a good reason to move it unless you're
211
+ deliberately being more/less conservative about the final candidate
212
+ list.
213
+
214
+ ### Kinship-PC covariates (per model) β€” default 3 for MLM/mrMLM/FASTmrMLM, 0 for GEMMA; range 0–6
215
+
216
+ Number of top kinship eigenvectors used as fixed "Q" structure covariates.
217
+ - **0**: disables it β€” the model relies on kinship (K) alone, or on the
218
+ method's own structure handling (e.g. GEMMA's per-marker REML).
219
+ - **Too many PCs (8–10)**: starts absorbing real trait-associated genetic
220
+ variance into the covariates, reducing power to detect true
221
+ associations (over-correction).
222
+ - **Recommendation**: 3 PCs is the standard starting point and works for
223
+ most panels with 2–4 broad subpopulations. If a PCA plot (Tab 4) shows
224
+ more than ~3–4 distinct clusters, consider 4–5 PCs. For GEMMA, leaving
225
+ it at 0 is usually right β€” GEMMA's per-marker REML already handles
226
+ structure, and adding PCs on top is somewhat redundant. Never go above
227
+ 6 unless you have a very large, strongly structured panel and have
228
+ checked that it doesn't kill all your signal.
229
+
230
+ ---
231
+
232
+ ## 5. Quick-reference table
233
+
234
+ | Setting | Default | Typical range | Raise it when… | Lower it when… |
235
+ |---|---|---|---|---|
236
+ | MAF threshold | 0.05 | 0.03–0.10 | large/diverse panel, noisy rare alleles | small panel, don't want to lose markers |
237
+ | Permutations | 100 | 100–200 | reporting/publishing a threshold | quick exploratory look |
238
+ | Manual LOD | 0 (off) | 3–6 if used | matching an external threshold | (leave off β€” use automatic) |
239
+ | Min PVE % | 0 (off) | 5–15 if used | want major-effect QTNs only | polygenic trait, don't want to lose real hits |
240
+ | FarmCPU/BLINK iterations | 8 | 5–12 | results still shifting at 8 | quick pass on large data |
241
+ | FarmCPU bin size | 1 Mb | 0.5–2 Mb | slow LD decay | fast LD decay |
242
+ | BLINK LD rΒ² cutoff | 0.7 | 0.5–0.9 | very high panel-wide LD | rarely β€” 0.7 is standard |
243
+ | mrMLM/FASTmrMLM screen p | 0.01 | 0.001–0.05 | suspect missed weak QTNs | want a cleaner candidate list |
244
+ | Max Stage-2 candidates | 20 | 10–30 | large sample, many Stage-1 hits | small sample (<100 lines) |
245
+ | Stage-2 drop threshold | 0.05 | 0.01–0.1 | rarely β€” 0.05 is standard | want stricter final QTN set |
246
+ | Kinship PCs | 3 | 0–6 | >3–4 clusters in PCA plot | simple/uniform panel, or using GEMMA |
247
+
248
+ If in doubt: run once with all defaults, look at the QQ plots (Ξ» close to
249
+ 1 = well-controlled) and the PCA plot (how many clusters?), then adjust
250
+ kinship-PC count and MAF threshold based on what you see β€” those two have
251
+ the biggest practical effect on your results.