[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CV017ZRWGR1AGQ252ZB2GD":3,"skill-same:01M7CV017ZRWGR1AGQ252ZB2GD":59},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":29,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":32,"install":33,"resources":46},"01M7CV017ZRWGR1AGQ252ZB2GD","bio-crispr-screens-jacks-analysis",null,"Runs JACKS (Joint Analysis of CRISPR\u002FCas9 Knockout Screens; Allen et al 2019 Genome Research) which models per-sgRNA log-fold-change as the product of a treatment-dependent gene-essentiality term and a treatment-independent guide-efficacy term. Covers the Bayesian decomposition math, the hierarchical efficacy prior shared across screens performed with the same library, when JACKS outperforms MAGeCK (multi-screen joint analysis, libraries with broad efficacy variance) and when it does not (single screen, novel libraries with no prior efficacy), library-reuse efficacy transfer, downstream essentiality interpretation, and the 2.5x sample-size reduction enabled by efficacy-aware testing. Use when running multiple screens with the same library, when guide-level noise is suspected to dominate per-gene signal, when reusing published essentiality reference screens for efficacy priors, or when comparing screens performed across cell lines that share library but differ biologically.","mrsonord2240\u002Fopenscience-specialists","mrsonord2240","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F76487430?v=4","01M7CTEM40S43GSJZ9A3YCCXZK","Samuel Nord","01M7CTEM4K69JD1GBYNHVJ9ZP4",2,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fcrispr-screen-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-crispr-screens-jacks-analysis\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: bio-crispr-screens-jacks-analysis\ndescription: Runs JACKS (Joint Analysis of CRISPR\u002FCas9 Knockout Screens; Allen et al 2019 Genome Research) which models per-sgRNA log-fold-change as the product of a treatment-dependent gene-essentiality term and a treatment-independent guide-efficacy term. Covers the Bayesian decomposition math, the hierarchical efficacy prior shared across screens performed with the same library, when JACKS outperforms MAGeCK (multi-screen joint analysis, libraries with broad efficacy variance) and when it does not (single screen, novel libraries with no prior efficacy), library-reuse efficacy transfer, downstream essentiality interpretation, and the 2.5x sample-size reduction enabled by efficacy-aware testing. Use when running multiple screens with the same library, when guide-level noise is suspected to dominate per-gene signal, when reusing published essentiality reference screens for efficacy priors, or when comparing screens performed across cell lines that share library but differ biologically.\ntool_type: python\nprimary_tool: JACKS\n---\n\n## Version Compatibility\n\nReference examples tested with: JACKS 0.2 (felicityallen\u002FJACKS; checked 2026-09-16), pandas 2.2+, numpy 1.26+, scipy 1.12+, matplotlib 3.8+.\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- CLI: `python run_JACKS.py --help` (run from `JACKS\u002Fjacks\u002F` after clone)\n- Python: from jacks.jacks_io import runJACKS; help(runJACKS)\n- GitHub: install via `git clone https:\u002F\u002Fgithub.com\u002Ffelicityallen\u002FJACKS && cd JACKS\u002Fjacks && pip install .` (setup.py is in `jacks\u002F`, not the repo root; the PyPI `jacks` is an unrelated package)\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.\n\n## JACKS CRISPR Screen Analysis\n\n**\"Analyze CRISPR screens with guide-level efficacy modeling\"** -> Jointly model per-sgRNA log-fold-change across one or more screens as the product of gene essentiality and guide efficacy, sharing efficacy across screens with the same library so that low-quality guides are down-weighted automatically.\n\n- CLI: `python run_JACKS.py countfile replicatefile guidemappingfile [options]` (run from `JACKS\u002Fjacks\u002F` after clone)\n- Python: `from jacks.jacks_io import runJACKS` for programmatic use; lower-level `from jacks.infer import inferJACKS`\n- Output: per-gene effect (`Gene` + one column per cell line) with a matching posterior-std file, per-sgRNA efficacy (`sgrna`, `X1`, `X2`); p-values only with `--ctrl_genes` (see below)\n\n## The JACKS Model (under the hood)\n\n**Why this matters for postdoc-level use:** JACKS decomposes the observed per-sgRNA log-fold-change as:\n\n```\nLFC[i, c] = gene_effect[g(i), c] * guide_efficacy[i] + noise\n```\n\nwhere `i` is sgRNA index, `c` is screen condition, `g(i)` is the gene targeted by sgRNA i. Gene effect varies by condition (different cell lines, different treatments) but guide efficacy is intrinsic to the sgRNA sequence and is treated as constant across screens. The model fits both parameters via variational Bayes with hierarchical priors:\n\n- `guide_efficacy[i] ~ Normal(1, 1)` (Gaussian prior, mean 1, variance 1; `mu0_x`, `var0_x` in `jacks.infer.inferJACKSGene`), shared across all sgRNAs\n- `gene_effect[g, c] ~ Normal(0, 1e4)` per condition (effectively flat; `mu0_w`, `var0_w`), unless `apply_w_hp` replaces it with a prior fitted to that gene's effects across conditions\n- a per-observation noise precision `tau` whose prior weight is `tau_prior_strength=0.5`\n\nThe variational posterior gives expected guide efficacy and gene effect. Gene-level p-values are not a likelihood-ratio test: they compare each gene's effect with pseudo-genes built by resampling the guides of supplied negative-control genes (`--ctrl_genes` plus `n_pseudo` > 0).\n\nInitialisation is fixed (efficacy = 1, gene effect = median LFC) and nothing in the inference is random, so gene effects and efficacies are identical across reruns on the same input. Only the pseudo-gene p-values use Python's `random`; call `random.seed(\u003Cint>)` before `runJACKS` to make them reproducible (checked on JACKS 0.2: two unseeded runs give different p-value files, two seeded runs match byte for byte).\n\n**Critical assumption:** Guide efficacy is treated as cell-line independent within the same chemistry. Allen 2019 reports per-sgRNA Cas9 KO efficacy is consistent across randomly selected batches of cell lines (within-chemistry), supporting library-shared efficacy. **However**, efficacy is NOT shareable across chemistries: Cas9 KO efficacy != CRISPRi knockdown efficiency != CRISPRa activation efficiency. JACKS must be run separately per chemistry; use only within the same chemistry on the same library.\n\n## When JACKS Outperforms MAGeCK and BAGEL2\n\n| Scenario | Advantage | Expected gain (Allen 2019) |\n|----------|-----------|------------------------------|\n| Multi-screen joint analysis (>=3 screens with same library) | Efficacy shared; noise averaged | ~21% lower error vs MAGeCK; 9% vs original BAGEL; 91-99% of cell lines improved (method-dependent) |\n| Reusing public reference screens (DepMap, Project Score) as efficacy prior | Transfer learning | New screens can be smaller; efficacy priors transfer across same-library screens |\n| Libraries with broad efficacy variance (e.g. older GeCKOv2) | Down-weights known weak guides | Larger gain than on Brunello (already efficacy-filtered) |\n| Heterogeneous quality (mixed plasmid quality across screens) | Per-screen noise estimation | Cleaner per-condition gene effects |\n\n## When JACKS Is Not the Right Tool\n\n- **Single screen, no prior efficacy:** JACKS has nothing to leverage; MAGeCK or BAGEL2 work as well.\n- **Single timepoint \u002F two-condition essentiality:** RRA or BAGEL2 simpler and equivalent.\n- **Heavy-selection drug screens:** drugZ explicit for chemogenomic; JACKS less sensitive.\n- **Cancer-cell-line copy-number screens:** Chronos preferred; jointly models CN bias + screen quality; JACKS does neither.\n- **Cross-chemistry sharing (e.g. CRISPRi + Cas9):** Efficacy is chemistry-specific; do not share.\n\n## Run JACKS Joint Analysis\n\n**Goal:** Jointly analyze multiple CRISPR screens performed with the same library and chemistry.\n\n**Approach:** Provide a count matrix with all samples across all screens, a replicate map identifying which samples belong to which screen and condition, and a sgRNA-to-gene map. JACKS learns guide efficacy shared across screens and gene effects per screen.\n\n```python\n# Programmatic invocation\nfrom jacks.jacks_io import runJACKS\n\n# Input file paths\ncounts_path = 'counts.txt'                    # rows=sgRNA; first cols 'sgRNA' (or custom), then sample counts\nreplicate_map_path = 'replicatemap.txt'       # tab-separated with header: Replicate, Sample, Control\nguide_map_path = 'guidemap.txt'               # tab-separated with header: sgRNA, Gene\n\n# Replicate map format (tab-separated WITH header; column names match flags below)\n# Replicate                Sample          Control\n# Screen1_T1               Screen1_T       Screen1_C\n# Screen1_T2               Screen1_T       Screen1_C\n# Screen1_C1               Screen1_C       Screen1_C\n# Screen2_T1               Screen2_T       Screen2_C\n# Screen2_T2               Screen2_T       Screen2_C\n# Screen2_C1               Screen2_C       Screen2_C\n\nrunJACKS(\n    countfile=counts_path,\n    replicatefile=replicate_map_path,\n    guidemappingfile=guide_map_path,\n    rep_hdr='Replicate',\n    sample_hdr='Sample',\n    ctrl_sample_hdr='Control',                # per-sample control specification\n    sgrna_hdr='sgRNA',\n    gene_hdr='Gene',\n    outprefix='jacks_out',\n    apply_w_hp=False,                         # the default and the tool's recommendation; see the variant below\n    # For a p-value file add ctrl_genes='NEGv1.txt' AND n_pseudo=2000: the Python API defaults\n    # n_pseudo=0 (the CLI defaults to 2000), and with n_pseudo=0 no p-value file is written.\n)\n```\n\n**Variant: hierarchical gene-effect prior (deliberate use only).** `apply_w_hp=True` (CLI `--apply_w_hp`) re-fits the gene-effect prior to each gene's effects across conditions, shrinking them towards each other. The JACKS help marks it \"not recommended, use with caution\", and it changes rankings materially: on JACKS' own 13-cell-line Project Score example, per-line Spearman rho between the two settings was 0.75-0.89. Use it only when you intend cross-condition shrinkage, and report which setting you used.\n\n```bash\n# Equivalent CLI run (run from JACKS\u002Fjacks\u002F after clone; --apply_w_hp stays off)\n# --ctrl_sample_hdr names a per-sample control column; use --common_ctrl_sample \u003Cname> for one shared control\npython run_JACKS.py \\\n    counts.txt \\\n    replicatemap.txt \\\n    guidemap.txt \\\n    --rep_hdr Replicate \\\n    --sample_hdr Sample \\\n    --ctrl_sample_hdr Control \\\n    --sgrna_hdr sgRNA \\\n    --gene_hdr Gene \\\n    --outprefix jacks_out\n# Outputs:\n#   jacks_out_gene_JACKS_results.txt      gene effect: header `Gene` + one column per cell line\n#   jacks_out_gene_std_JACKS_results.txt  matching posterior std per gene per cell line\n#   jacks_out_gene_pval_JACKS_results.txt p-values (only with --ctrl_genes; the CLI's --n_pseudo defaults to 2000)\n#   jacks_out_grna_JACKS_results.txt      sgRNA-level: header `sgrna`, `X1`, `X2`\n#   jacks_out_JACKS_results_full.pickle  full posterior for downstream\n```\n\n## Output Interpretation\n\n| Column | Meaning | Direction |\n|--------|---------|-----------|\n| `X1` (gene file) | Posterior mean of gene_effect | Negative = essential (depleted); positive = enriched |\n| gene std file | Posterior std of the gene effect | Lower = more confident; combine as effect\u002Fstd for a z-like statistic |\n| `X1` (sgRNA file) | Posterior mean of guide efficacy | Centred near 1 and unbounded; the reference Avana set spans negative values to >100 |\n| `X2` (sgRNA file) | Second moment E(X^2) of efficacy; std = sqrt(X2 - X1^2) | Confidence in the efficacy estimate |\n\n**Interpretation rule:** A gene is essential if its effect is negative and large relative to its posterior std: divide each cell-line column of the gene file by the same column of the gene std file; effect\u002Fstd \u003C -2 is roughly a 95% credible deviation from zero. The gene file has no `X1`\u002F`X2` columns. Those belong to the sgRNA file, where `X2` is a second moment, not a std. Supply `--ctrl_genes` (with `n_pseudo` > 0 in Python) to also get a p-value file. Sort by effect (most negative first) for essentiality rank.\n\n## Build Library-Wide Efficacy Prior from Reference Screens\n\n**Goal:** Transfer learned efficacy from a large public screen panel to a new small screen.\n\n**Approach:** Run JACKS on the reference panel (e.g. DepMap CRISPR screens with TKOv3 or Brunello), extract per-sgRNA efficacy posterior, and supply it as the prior for a new screen.\n\n```python\ndef extract_efficacy_prior(reference_jacks_results):\n    '''Build per-sgRNA efficacy prior (mean + std) from a large reference screen.'''\n    df = pd.read_csv(reference_jacks_results, sep='\\t')\n    prior = df[['sgrna', 'X1', 'X2']]      # --reffile requires these exact column names; do not rename\n    return prior\n\n# Use in new JACKS run via --reffile \u003Cpath>\n# Reference: Allen 2019 Genome Research 29:464; efficacy-aware testing enables ~2.5x smaller screens (fewer replicates\u002Fguides)\n```\n\n## Per-sgRNA Efficacy Diagnostics\n\n**Goal:** Identify low-efficacy guides for library refinement.\n\n**Approach:** Examine the distribution of inferred efficacies; guides below 0.3 are likely non-functional and should be excluded from re-designed libraries.\n\n```python\nimport pandas as pd\n\ndef efficacy_summary(grna_results_path, guidemap_path, low_threshold=0.3,\n                     sgrna_hdr='sgRNA', gene_hdr='Gene'):\n    '''Summarise per-sgRNA efficacy. The grna file has only sgrna\u002FX1\u002FX2, so genes come from the guide map.'''\n    df = pd.read_csv(grna_results_path, sep='\\t')\n    guidemap = pd.read_csv(guidemap_path, sep='\\t', usecols=[sgrna_hdr, gene_hdr])\n    df = df.merge(guidemap, left_on='sgrna', right_on=sgrna_hdr, how='left')\n    unmapped = df[gene_hdr].isna().sum()\n    if unmapped:\n        raise ValueError(f'{unmapped} sgRNAs in the results are absent from the guide map; check naming')\n    df['low_eff'] = df['X1'] \u003C low_threshold\n    summary = {\n        'total_guides': len(df),\n        'low_efficacy_count': int(df['low_eff'].sum()),\n        'low_efficacy_pct': df['low_eff'].mean() * 100,\n        'median_efficacy': df['X1'].median(),\n        'q25_q75': (df['X1'].quantile(0.25), df['X1'].quantile(0.75)),\n    }\n    # Per-gene proportion of low-efficacy guides\n    by_gene = df.groupby(gene_hdr)['low_eff'].mean().sort_values(ascending=False)\n    summary['genes_with_all_low_eff'] = int((by_gene == 1).sum())  # genes where every guide is weak\n    return summary, by_gene\n```\n\n**Critical:** Genes where every guide is low-efficacy will show no signal regardless of biology. Filter from interpretation; flag for re-design with updated rules (Brunello \u002F TKOv3).\n\n## Comparing JACKS, MAGeCK, BAGEL2\n\n| Property | JACKS | MAGeCK | BAGEL2 |\n|----------|-------|--------|--------|\n| Statistical framework | Variational Bayes | NB GLM + alpha-RRA \u002F MLE | Bayes factor on per-sgRNA fold change |\n| Models guide efficacy | Yes (jointly) | No (optional fixed input) | No |\n| Multi-screen joint | Yes (native) | Limited (MLE design matrix) | No (per-screen) |\n| Speed | Slow (variational inference) | Fast | Fast |\n| Output | gene effect + sgRNA efficacy | beta or RRA score | Bayes Factor |\n| Best for | Multi-screen joint analyses, library calibration | General-purpose, single screen | Essentiality classification |\n| Quantified accuracy gain (Allen 2019) | ~21% lower error vs MAGeCK; 9% vs BAGEL v1 | Reference | Not benchmarked (Allen 2019 compared BAGEL v1) |\n\n**Reconciliation:** Hits identified by JACKS AND MAGeCK are high confidence. JACKS-only hits typically reflect strong gene signals where one or two guides were dragging down MAGeCK; verify the up-weighted high-efficacy guides have the expected sign. MAGeCK-only hits at FDR \u003C0.05 may be single-guide outliers; check sgrna_summary for guide-level dispersion.\n\n## Failure Modes\n\n### Efficacy collapsed near zero for all guides\n\n**Trigger:** Screen used a chemistry the model doesn't support (e.g., CRISPRi screen analyzed with JACKS defaults).\n**Mechanism:** CRISPRi efficacy is fundamentally different from Cas9-KO efficacy; the Gaussian efficacy prior (mean 1, variance 1) assumes Cas9-KO-like guides.\n**Symptom:** Median efficacy \u003C0.2; almost no significant gene effects.\n**Fix:** Do not reuse Cas9-KO efficacies or `--reffile` priors. If a CRISPRi\u002Fa reference panel with the same library exists, run JACKS on it and pass its grna file via `--reffile`. Neither the CLI nor `runJACKS()` exposes the prior hyperparameters; they are keyword arguments of `jacks.infer.inferJACKSGene` (`mu0_x`, `var0_x`, `mu0_w`, `var0_w`, `tau_prior_strength`), which `inferJACKS` looks up at call time, so they can be overridden for one run:\n\n```python\nimport functools\nimport jacks.infer\nfrom jacks.jacks_io import runJACKS\n\n_default_gene_fit = jacks.infer.inferJACKSGene\n# Example: a weaker efficacy prior (larger var0_x) for a chemistry whose efficacies are not centred on 1.\n# Choose values from a matched reference run, not by tuning until hits appear.\njacks.infer.inferJACKSGene = functools.partial(_default_gene_fit, mu0_x=1.0, var0_x=4.0)\ntry:\n    runJACKS('counts.txt', 'replicatemap.txt', 'guidemap.txt', outprefix='jacks_crispri', ctrl_sample_hdr='Control')\nfinally:\n    jacks.infer.inferJACKSGene = _default_gene_fit   # restore for later runs in this session\n```\n\nThis relies on JACKS 0.2 internals, not a public API; re-check `help(jacks.infer.inferJACKSGene)` on other versions.\n\n### Cross-cell-line efficacy disagreement\n\n**Trigger:** Pooling screens across cell lines with very different Cas9 expression \u002F chromatin \u002F fitness baselines.\n**Mechanism:** Efficacy depends on Cas9 expression and chromatin accessibility; sharing across lines averages real per-line differences.\n**Symptom:** Per-line gene effects look noisier than per-line MAGeCK results.\n**Fix:** Use Chronos for multi-cell-line screens with screen-quality modeling; reserve JACKS for screens with matched chemistry + cell type \u002F culture conditions.\n\n### MCMC \u002F variational convergence failure\n\n**Trigger:** A gene's variational updates hit the iteration cap before the lower bound settles (few guides, conflicting guides, very noisy replicates).\n**Mechanism:** Each gene is fitted for at most `n_iter=50` updates and stops early once the lower bound changes by \u003C `tol=0.1`; a gene still moving at iteration 50 is returned as-is.\n**Symptom:** Not run-to-run variation -- inference is deterministic, so reruns on identical input give identical effects. Instead, effects shift when you change `n_iter`, and the DEBUG log (`Iter 50\u002F50 ...`) shows genes ending at the cap.\n**Fix:** The CLI and `runJACKS()` expose no iteration argument. Refit with a higher cap and compare: `jacks.jacks_io.inferJACKS = functools.partial(jacks.infer.inferJACKS, n_iter=500)` before `runJACKS`, then restore it; genes whose effect\u002Fstd changes sign or crosses -2 were not converged. Adding guides per gene or screens also helps.\n\n### sgRNA-to-gene map mismatch\n\n**Trigger:** Guide map and count matrix use different sgRNA naming conventions (e.g. `BRCA1_1` vs `BRCA1.1`).\n**Mechanism:** JACKS builds a sgRNA-to-gene dictionary from the map and keeps only guides found in it; unmatched guides are dropped, not set to NaN.\n**Symptom:** Genes missing from the output rows entirely (no NaN values appear).\n**Fix:** Standardize naming; sanity check `len(jacks_output) == n_genes_expected`.\n\n### Reference efficacy prior from wrong library\n\n**Trigger:** Using DepMap Brunello efficacy as prior for a screen with a custom TKOv3-style library.\n**Mechanism:** Per-sgRNA efficacy is sequence-specific; sgRNAs in one library map to different gene contexts than another.\n**Symptom:** Usually an immediate exception, `\u003CsgRNA> has no sgrna reference in \u003Creffile>`, because JACKS 0.2 requires every guide in the map to be in the reference. That check is by ID only: if the IDs happen to match (e.g. both renamed `GENE_1`, `GENE_2`) the run succeeds silently with the wrong efficacies.\n**Fix:** Match library exactly, by sequence and not only by ID; if no matched reference exists, run without prior.\n\n## Reconciliation: When JACKS and Other Tools Disagree\n\n| Pattern | Likely cause | Action |\n|---------|--------------|--------|\n| JACKS significant, MAGeCK not | One low-efficacy guide dragged MAGeCK; JACKS down-weighted it | Trust JACKS if 3+ high-efficacy guides agree |\n| MAGeCK significant, JACKS not | All guides have similar efficacy; JACKS prior shrinks signal | Verify per-guide LFC consistency in MAGeCK sgrna_summary |\n| JACKS efficacy ~0.5 for all guides | Efficacy prior mismatched to the chemistry, or weak signal overall (`--apply_w_hp` acts on gene effects, not efficacy) | Confirm chemistry and library match; see \"Efficacy collapsed near zero\" for a matched `--reffile` or prior override |\n| Gene effect different sign from MAGeCK | Multi-screen pooling created mean effect different from single-screen | Run per-screen separately to confirm |\n\n## Quantitative Thresholds\n\n| Threshold | Value | Source \u002F Rationale |\n|-----------|-------|--------------------|\n| Hit call | gene effect negative with abs(effect\u002Fstd) > 2 | Bayesian z-equivalent; p-values need --ctrl_genes |\n| Effective gene signal | effect \u003C 0 AND abs(effect\u002Fstd) > 2, from the gene and gene std files | Bayesian z-equivalent |\n| Low-efficacy guide flag | X1 (sgRNA) \u003C0.3 | Operational convention; below this, guide likely non-functional |\n| Reference for prior reuse | DepMap or Project Score panel | Established efficacy distribution |\n| Minimum screens for joint efficacy benefit | 3+ | Below this, single-screen tools (MAGeCK\u002FBAGEL2) equivalent |\n| Iterations for variational inference | at most 50 per gene, early stop at lower-bound change \u003C 0.1 (JACKS 0.2) | Not exposed on the CLI; see convergence failure mode |\n| Cross-library efficacy transfer | Not supported | Different libraries -> different sequences -> different efficacies |\n| Cross-chemistry efficacy transfer | Not supported | Cas9 efficacy != CRISPRi efficacy |\n\n## Common Errors\n\n| Error \u002F symptom | Cause | Solution |\n|-----------------|-------|----------|\n| Genes missing from output | sgRNA-to-gene map mismatch (unmatched guides are dropped) | Verify naming consistency; check `len(gene_results) == n_genes_expected` |\n| Median efficacy \u003C0.2 | Wrong chemistry assumed by prior | Use a matched-chemistry `--reffile` or override the efficacy prior (see Failure Modes) |\n| Lower bound still changing at `Iter 50\u002F50` in the DEBUG log | Iteration cap reached | Refit with a higher `n_iter` (see Failure Modes) and compare effects |\n| p-values differ between runs | Pseudo-genes are sampled with Python `random` | `random.seed(\u003Cint>)` before `runJACKS`; gene effects themselves are deterministic |\n| `\u003CsgRNA> has no sgrna reference in \u003Creffile>` | `--reffile` from a different library | Match library exactly |\n| Library-reuse prior doesn't help | Reference IDs match but sequences or context differ | Match library by sequence |\n\n## References\n\n- Allen F et al. 2019. *Genome Research* 29:464. JACKS; original Bayesian joint analysis paper.\n- Allen F, Parts L (Wellcome Sanger Institute). https:\u002F\u002Fgithub.com\u002Ffelicityallen\u002FJACKS. Official repository.\n- Behan FM et al. 2019. *Nature* 568:511. Project Score CRISPR panel; library-wide reference screen data.\n- Meyers RM et al. 2017. *Nat Genet* 49:1779. Avana CRISPR DepMap; reference panel for efficacy transfer.\n\n## Related Skills\n\n- crispr-screens\u002Fmageck-analysis - MAGeCK RRA\u002FMLE comparison\n- crispr-screens\u002Fbagel-essentiality - Alternative for essentiality without efficacy modeling\n- crispr-screens\u002Flibrary-design - sgRNA design rules informed by JACKS efficacy output\n- crispr-screens\u002Fcopy-number-correction - Chronos preferred for cancer-line multi-screen analyses\n- crispr-screens\u002Fscreen-qc - Pre-JACKS QC; replicate Pearson must pass before joint analysis\n- crispr-screens\u002Fhit-calling - Cross-method decision tree\n- crispr-screens\u002Fbatch-correction - JACKS does not adjust for batch; pre-correct if necessary\n","## Version Compatibility\n\nReference examples tested with: JACKS 0.2 (felicityallen\u002FJACKS; checked 2026-09-16), pandas 2.2+, numpy 1.26+, scipy 1.12+, matplotlib 3.8+.\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- CLI: `python run_JACKS.py --help` (run from `JACKS\u002Fjacks\u002F` after clone)\n- Python: from jacks.jacks_io import runJACKS; help(runJACKS)\n- GitHub: install via `git clone https:\u002F\u002Fgithub.com\u002Ffelicityallen\u002FJACKS && cd JACKS\u002Fjacks && pip install .` (setup.py is in `jacks\u002F`, not the repo root; the PyPI `jacks` is an unrelated package)\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.\n\n## JACKS CRISPR Screen Analysis\n\n**\"Analyze CRISPR screens with guide-level efficacy modeling\"** -> Jointly model per-sgRNA log-fold-change across one or more screens as the product of gene essentiality and guide efficacy, sharing efficacy across screens with the same library so that low-quality guides are down-weighted automatically.\n\n- CLI: `python run_JACKS.py countfile replicatefile guidemappingfile [options]` (run from `JACKS\u002Fjacks\u002F` after clone)\n- Python: `from jacks.jacks_io import runJACKS` for programmatic use; lower-level `from jacks.infer import inferJACKS`\n- Output: per-gene effect (`Gene` + one column per cell line) with a matching posterior-std file, per-sgRNA efficacy (`sgrna`, `X1`, `X2`); p-values only with `--ctrl_genes` (see below)\n\n## The JACKS Model (under the hood)\n\n**Why this matters for postdoc-level use:** JACKS decomposes the observed per-sgRNA log-fold-change as:\n\n```\nLFC[i, c] = gene_effect[g(i), c] * guide_efficacy[i] + noise\n```\n\nwhere `i` is sgRNA index, `c` is screen condition, `g(i)` is the gene targeted by sgRNA i. Gene effect varies by condition (different cell lines, different treatments) but guide efficacy is intrinsic to the sgRNA sequence and is treated as constant across screens. The model fits both parameters via variational Bayes with hierarchical priors:\n\n- `guide_efficacy[i] ~ Normal(1, 1)` (Gaussian prior, mean 1, variance 1; `mu0_x`, `var0_x` in `jacks.infer.inferJACKSGene`), shared across all sgRNAs\n- `gene_effect[g, c] ~ Normal(0, 1e4)` per condition (effectively flat; `mu0_w`, `var0_w`), unless `apply_w_hp` replaces it with a prior fitted to that gene's effects across conditions\n- a per-observation noise precision `tau` whose prior weight is `tau_prior_strength=0.5`\n\nThe variational posterior gives expected guide efficacy and gene effect. Gene-level p-values are not a likelihood-ratio test: they compare each gene's effect with pseudo-genes built by resampling the guides of supplied negative-control genes (`--ctrl_genes` plus `n_pseudo` > 0).\n\nInitialisation is fixed (efficacy = 1, gene effect = median LFC) and nothing in the inference is random, so gene effects and efficacies are identical across reruns on the same input. Only the pseudo-gene p-values use Python's `random`; call `random.seed(\u003Cint>)` before `runJACKS` to make them reproducible (checked on JACKS 0.2: two unseeded runs give different p-value files, two seeded runs match byte for byte).\n\n**Critical assumption:** Guide efficacy is treated as cell-line independent within the same chemistry. Allen 2019 reports per-sgRNA Cas9 KO efficacy is consistent across randomly selected batches of cell lines (within-chemistry), supporting library-shared efficacy. **However**, efficacy is NOT shareable across chemistries: Cas9 KO efficacy != CRISPRi knockdown efficiency != CRISPRa activation efficiency. JACKS must be run separately per chemistry; use only within the same chemistry on the same library.\n\n## When JACKS Outperforms MAGeCK and BAGEL2\n\n| Scenario | Advantage | Expected gain (Allen 2019) |\n|----------|-----------|------------------------------|\n| Multi-screen joint analysis (>=3 screens with same library) | Efficacy shared; noise averaged | ~21% lower error vs MAGeCK; 9% vs original BAGEL; 91-99% of cell lines improved (method-dependent) |\n| Reusing public reference screens (DepMap, Project Score) as efficacy prior | Transfer learning | New screens can be smaller; efficacy priors transfer across same-library screens |\n| Libraries with broad efficacy variance (e.g. older GeCKOv2) | Down-weights known weak guides | Larger gain than on Brunello (already efficacy-filtered) |\n| Heterogeneous quality (mixed plasmid quality across screens) | Per-screen noise estimation | Cleaner per-condition gene effects |\n\n## When JACKS Is Not the Right Tool\n\n- **Single screen, no prior efficacy:** JACKS has nothing to leverage; MAGeCK or BAGEL2 work as well.\n- **Single timepoint \u002F two-condition essentiality:** RRA or BAGEL2 simpler and equivalent.\n- **Heavy-selection drug screens:** drugZ explicit for chemogenomic; JACKS less sensitive.\n- **Cancer-cell-line copy-number screens:** Chronos preferred; jointly models CN bias + screen quality; JACKS does neither.\n- **Cross-chemistry sharing (e.g. CRISPRi + Cas9):** Efficacy is chemistry-specific; do not share.\n\n## Run JACKS Joint Analysis\n\n**Goal:** Jointly analyze multiple CRISPR screens performed with the same library and chemistry.\n\n**Approach:** Provide a count matrix with all samples across all screens, a replicate map identifying which samples belong to which screen and condition, and a sgRNA-to-gene map. JACKS learns guide efficacy shared across screens and gene effects per screen.\n\n```python\n# Programmatic invocation\nfrom jacks.jacks_io import runJACKS\n\n# Input file paths\ncounts_path = 'counts.txt'                    # rows=sgRNA; first cols 'sgRNA' (or custom), then sample counts\nreplicate_map_path = 'replicatemap.txt'       # tab-separated with header: Replicate, Sample, Control\nguide_map_path = 'guidemap.txt'               # tab-separated with header: sgRNA, Gene\n\n# Replicate map format (tab-separated WITH header; column names match flags below)\n# Replicate                Sample          Control\n# Screen1_T1               Screen1_T       Screen1_C\n# Screen1_T2               Screen1_T       Screen1_C\n# Screen1_C1               Screen1_C       Screen1_C\n# Screen2_T1               Screen2_T       Screen2_C\n# Screen2_T2               Screen2_T       Screen2_C\n# Screen2_C1               Screen2_C       Screen2_C\n\nrunJACKS(\n    countfile=counts_path,\n    replicatefile=replicate_map_path,\n    guidemappingfile=guide_map_path,\n    rep_hdr='Replicate',\n    sample_hdr='Sample',\n    ctrl_sample_hdr='Control',                # per-sample control specification\n    sgrna_hdr='sgRNA',\n    gene_hdr='Gene',\n    outprefix='jacks_out',\n    apply_w_hp=False,                         # the default and the tool's recommendation; see the variant below\n    # For a p-value file add ctrl_genes='NEGv1.txt' AND n_pseudo=2000: the Python API defaults\n    # n_pseudo=0 (the CLI defaults to 2000), and with n_pseudo=0 no p-value file is written.\n)\n```\n\n**Variant: hierarchical gene-effect prior (deliberate use only).** `apply_w_hp=True` (CLI `--apply_w_hp`) re-fits the gene-effect prior to each gene's effects across conditions, shrinking them towards each other. The JACKS help marks it \"not recommended, use with caution\", and it changes rankings materially: on JACKS' own 13-cell-line Project Score example, per-line Spearman rho between the two settings was 0.75-0.89. Use it only when you intend cross-condition shrinkage, and report which setting you used.\n\n```bash\n# Equivalent CLI run (run from JACKS\u002Fjacks\u002F after clone; --apply_w_hp stays off)\n# --ctrl_sample_hdr names a per-sample control column; use --common_ctrl_sample \u003Cname> for one shared control\npython run_JACKS.py \\\n    counts.txt \\\n    replicatemap.txt \\\n    guidemap.txt \\\n    --rep_hdr Replicate \\\n    --sample_hdr Sample \\\n    --ctrl_sample_hdr Control \\\n    --sgrna_hdr sgRNA \\\n    --gene_hdr Gene \\\n    --outprefix jacks_out\n# Outputs:\n#   jacks_out_gene_JACKS_results.txt      gene effect: header `Gene` + one column per cell line\n#   jacks_out_gene_std_JACKS_results.txt  matching posterior std per gene per cell line\n#   jacks_out_gene_pval_JACKS_results.txt p-values (only with --ctrl_genes; the CLI's --n_pseudo defaults to 2000)\n#   jacks_out_grna_JACKS_results.txt      sgRNA-level: header `sgrna`, `X1`, `X2`\n#   jacks_out_JACKS_results_full.pickle  full posterior for downstream\n```\n\n## Output Interpretation\n\n| Column | Meaning | Direction |\n|--------|---------|-----------|\n| `X1` (gene file) | Posterior mean of gene_effect | Negative = essential (depleted); positive = enriched |\n| gene std file | Posterior std of the gene effect | Lower = more confident; combine as effect\u002Fstd for a z-like statistic |\n| `X1` (sgRNA file) | Posterior mean of guide efficacy | Centred near 1 and unbounded; the reference Avana set spans negative values to >100 |\n| `X2` (sgRNA file) | Second moment E(X^2) of efficacy; std = sqrt(X2 - X1^2) | Confidence in the efficacy estimate |\n\n**Interpretation rule:** A gene is essential if its effect is negative and large relative to its posterior std: divide each cell-line column of the gene file by the same column of the gene std file; effect\u002Fstd \u003C -2 is roughly a 95% credible deviation from zero. The gene file has no `X1`\u002F`X2` columns. Those belong to the sgRNA file, where `X2` is a second moment, not a std. Supply `--ctrl_genes` (with `n_pseudo` > 0 in Python) to also get a p-value file. Sort by effect (most negative first) for essentiality rank.\n\n## Build Library-Wide Efficacy Prior from Reference Screens\n\n**Goal:** Transfer learned efficacy from a large public screen panel to a new small screen.\n\n**Approach:** Run JACKS on the reference panel (e.g. DepMap CRISPR screens with TKOv3 or Brunello), extract per-sgRNA efficacy posterior, and supply it as the prior for a new screen.\n\n```python\ndef extract_efficacy_prior(reference_jacks_results):\n    '''Build per-sgRNA efficacy prior (mean + std) from a large reference screen.'''\n    df = pd.read_csv(reference_jacks_results, sep='\\t')\n    prior = df[['sgrna', 'X1', 'X2']]      # --reffile requires these exact column names; do not rename\n    return prior\n\n# Use in new JACKS run via --reffile \u003Cpath>\n# Reference: Allen 2019 Genome Research 29:464; efficacy-aware testing enables ~2.5x smaller screens (fewer replicates\u002Fguides)\n```\n\n## Per-sgRNA Efficacy Diagnostics\n\n**Goal:** Identify low-efficacy guides for library refinement.\n\n**Approach:** Examine the distribution of inferred efficacies; guides below 0.3 are likely non-functional and should be excluded from re-designed libraries.\n\n```python\nimport pandas as pd\n\ndef efficacy_summary(grna_results_path, guidemap_path, low_threshold=0.3,\n                     sgrna_hdr='sgRNA', gene_hdr='Gene'):\n    '''Summarise per-sgRNA efficacy. The grna file has only sgrna\u002FX1\u002FX2, so genes come from the guide map.'''\n    df = pd.read_csv(grna_results_path, sep='\\t')\n    guidemap = pd.read_csv(guidemap_path, sep='\\t', usecols=[sgrna_hdr, gene_hdr])\n    df = df.merge(guidemap, left_on='sgrna', right_on=sgrna_hdr, how='left')\n    unmapped = df[gene_hdr].isna().sum()\n    if unmapped:\n        raise ValueError(f'{unmapped} sgRNAs in the results are absent from the guide map; check naming')\n    df['low_eff'] = df['X1'] \u003C low_threshold\n    summary = {\n        'total_guides': len(df),\n        'low_efficacy_count': int(df['low_eff'].sum()),\n        'low_efficacy_pct': df['low_eff'].mean() * 100,\n        'median_efficacy': df['X1'].median(),\n        'q25_q75': (df['X1'].quantile(0.25), df['X1'].quantile(0.75)),\n    }\n    # Per-gene proportion of low-efficacy guides\n    by_gene = df.groupby(gene_hdr)['low_eff'].mean().sort_values(ascending=False)\n    summary['genes_with_all_low_eff'] = int((by_gene == 1).sum())  # genes where every guide is weak\n    return summary, by_gene\n```\n\n**Critical:** Genes where every guide is low-efficacy will show no signal regardless of biology. Filter from interpretation; flag for re-design with updated rules (Brunello \u002F TKOv3).\n\n## Comparing JACKS, MAGeCK, BAGEL2\n\n| Property | JACKS | MAGeCK | BAGEL2 |\n|----------|-------|--------|--------|\n| Statistical framework | Variational Bayes | NB GLM + alpha-RRA \u002F MLE | Bayes factor on per-sgRNA fold change |\n| Models guide efficacy | Yes (jointly) | No (optional fixed input) | No |\n| Multi-screen joint | Yes (native) | Limited (MLE design matrix) | No (per-screen) |\n| Speed | Slow (variational inference) | Fast | Fast |\n| Output | gene effect + sgRNA efficacy | beta or RRA score | Bayes Factor |\n| Best for | Multi-screen joint analyses, library calibration | General-purpose, single screen | Essentiality classification |\n| Quantified accuracy gain (Allen 2019) | ~21% lower error vs MAGeCK; 9% vs BAGEL v1 | Reference | Not benchmarked (Allen 2019 compared BAGEL v1) |\n\n**Reconciliation:** Hits identified by JACKS AND MAGeCK are high confidence. JACKS-only hits typically reflect strong gene signals where one or two guides were dragging down MAGeCK; verify the up-weighted high-efficacy guides have the expected sign. MAGeCK-only hits at FDR \u003C0.05 may be single-guide outliers; check sgrna_summary for guide-level dispersion.\n\n## Failure Modes\n\n### Efficacy collapsed near zero for all guides\n\n**Trigger:** Screen used a chemistry the model doesn't support (e.g., CRISPRi screen analyzed with JACKS defaults).\n**Mechanism:** CRISPRi efficacy is fundamentally different from Cas9-KO efficacy; the Gaussian efficacy prior (mean 1, variance 1) assumes Cas9-KO-like guides.\n**Symptom:** Median efficacy \u003C0.2; almost no significant gene effects.\n**Fix:** Do not reuse Cas9-KO efficacies or `--reffile` priors. If a CRISPRi\u002Fa reference panel with the same library exists, run JACKS on it and pass its grna file via `--reffile`. Neither the CLI nor `runJACKS()` exposes the prior hyperparameters; they are keyword arguments of `jacks.infer.inferJACKSGene` (`mu0_x`, `var0_x`, `mu0_w`, `var0_w`, `tau_prior_strength`), which `inferJACKS` looks up at call time, so they can be overridden for one run:\n\n```python\nimport functools\nimport jacks.infer\nfrom jacks.jacks_io import runJACKS\n\n_default_gene_fit = jacks.infer.inferJACKSGene\n# Example: a weaker efficacy prior (larger var0_x) for a chemistry whose efficacies are not centred on 1.\n# Choose values from a matched reference run, not by tuning until hits appear.\njacks.infer.inferJACKSGene = functools.partial(_default_gene_fit, mu0_x=1.0, var0_x=4.0)\ntry:\n    runJACKS('counts.txt', 'replicatemap.txt', 'guidemap.txt', outprefix='jacks_crispri', ctrl_sample_hdr='Control')\nfinally:\n    jacks.infer.inferJACKSGene = _default_gene_fit   # restore for later runs in this session\n```\n\nThis relies on JACKS 0.2 internals, not a public API; re-check `help(jacks.infer.inferJACKSGene)` on other versions.\n\n### Cross-cell-line efficacy disagreement\n\n**Trigger:** Pooling screens across cell lines with very different Cas9 expression \u002F chromatin \u002F fitness baselines.\n**Mechanism:** Efficacy depends on Cas9 expression and chromatin accessibility; sharing across lines averages real per-line differences.\n**Symptom:** Per-line gene effects look noisier than per-line MAGeCK results.\n**Fix:** Use Chronos for multi-cell-line screens with screen-quality modeling; reserve JACKS for screens with matched chemistry + cell type \u002F culture conditions.\n\n### MCMC \u002F variational convergence failure\n\n**Trigger:** A gene's variational updates hit the iteration cap before the lower bound settles (few guides, conflicting guides, very noisy replicates).\n**Mechanism:** Each gene is fitted for at most `n_iter=50` updates and stops early once the lower bound changes by \u003C `tol=0.1`; a gene still moving at iteration 50 is returned as-is.\n**Symptom:** Not run-to-run variation -- inference is deterministic, so reruns on identical input give identical effects. Instead, effects shift when you change `n_iter`, and the DEBUG log (`Iter 50\u002F50 ...`) shows genes ending at the cap.\n**Fix:** The CLI and `runJACKS()` expose no iteration argument. Refit with a higher cap and compare: `jacks.jacks_io.inferJACKS = functools.partial(jacks.infer.inferJACKS, n_iter=500)` before `runJACKS`, then restore it; genes whose effect\u002Fstd changes sign or crosses -2 were not converged. Adding guides per gene or screens also helps.\n\n### sgRNA-to-gene map mismatch\n\n**Trigger:** Guide map and count matrix use different sgRNA naming conventions (e.g. `BRCA1_1` vs `BRCA1.1`).\n**Mechanism:** JACKS builds a sgRNA-to-gene dictionary from the map and keeps only guides found in it; unmatched guides are dropped, not set to NaN.\n**Symptom:** Genes missing from the output rows entirely (no NaN values appear).\n**Fix:** Standardize naming; sanity check `len(jacks_output) == n_genes_expected`.\n\n### Reference efficacy prior from wrong library\n\n**Trigger:** Using DepMap Brunello efficacy as prior for a screen with a custom TKOv3-style library.\n**Mechanism:** Per-sgRNA efficacy is sequence-specific; sgRNAs in one library map to different gene contexts than another.\n**Symptom:** Usually an immediate exception, `\u003CsgRNA> has no sgrna reference in \u003Creffile>`, because JACKS 0.2 requires every guide in the map to be in the reference. That check is by ID only: if the IDs happen to match (e.g. both renamed `GENE_1`, `GENE_2`) the run succeeds silently with the wrong efficacies.\n**Fix:** Match library exactly, by sequence and not only by ID; if no matched reference exists, run without prior.\n\n## Reconciliation: When JACKS and Other Tools Disagree\n\n| Pattern | Likely cause | Action |\n|---------|--------------|--------|\n| JACKS significant, MAGeCK not | One low-efficacy guide dragged MAGeCK; JACKS down-weighted it | Trust JACKS if 3+ high-efficacy guides agree |\n| MAGeCK significant, JACKS not | All guides have similar efficacy; JACKS prior shrinks signal | Verify per-guide LFC consistency in MAGeCK sgrna_summary |\n| JACKS efficacy ~0.5 for all guides | Efficacy prior mismatched to the chemistry, or weak signal overall (`--apply_w_hp` acts on gene effects, not efficacy) | Confirm chemistry and library match; see \"Efficacy collapsed near zero\" for a matched `--reffile` or prior override |\n| Gene effect different sign from MAGeCK | Multi-screen pooling created mean effect different from single-screen | Run per-screen separately to confirm |\n\n## Quantitative Thresholds\n\n| Threshold | Value | Source \u002F Rationale |\n|-----------|-------|--------------------|\n| Hit call | gene effect negative with abs(effect\u002Fstd) > 2 | Bayesian z-equivalent; p-values need --ctrl_genes |\n| Effective gene signal | effect \u003C 0 AND abs(effect\u002Fstd) > 2, from the gene and gene std files | Bayesian z-equivalent |\n| Low-efficacy guide flag | X1 (sgRNA) \u003C0.3 | Operational convention; below this, guide likely non-functional |\n| Reference for prior reuse | DepMap or Project Score panel | Established efficacy distribution |\n| Minimum screens for joint efficacy benefit | 3+ | Below this, single-screen tools (MAGeCK\u002FBAGEL2) equivalent |\n| Iterations for variational inference | at most 50 per gene, early stop at lower-bound change \u003C 0.1 (JACKS 0.2) | Not exposed on the CLI; see convergence failure mode |\n| Cross-library efficacy transfer | Not supported | Different libraries -> different sequences -> different efficacies |\n| Cross-chemistry efficacy transfer | Not supported | Cas9 efficacy != CRISPRi efficacy |\n\n## Common Errors\n\n| Error \u002F symptom | Cause | Solution |\n|-----------------|-------|----------|\n| Genes missing from output | sgRNA-to-gene map mismatch (unmatched guides are dropped) | Verify naming consistency; check `len(gene_results) == n_genes_expected` |\n| Median efficacy \u003C0.2 | Wrong chemistry assumed by prior | Use a matched-chemistry `--reffile` or override the efficacy prior (see Failure Modes) |\n| Lower bound still changing at `Iter 50\u002F50` in the DEBUG log | Iteration cap reached | Refit with a higher `n_iter` (see Failure Modes) and compare effects |\n| p-values differ between runs | Pseudo-genes are sampled with Python `random` | `random.seed(\u003Cint>)` before `runJACKS`; gene effects themselves are deterministic |\n| `\u003CsgRNA> has no sgrna reference in \u003Creffile>` | `--reffile` from a different library | Match library exactly |\n| Library-reuse prior doesn't help | Reference IDs match but sequences or context differ | Match library by sequence |\n\n## References\n\n- Allen F et al. 2019. *Genome Research* 29:464. JACKS; original Bayesian joint analysis paper.\n- Allen F, Parts L (Wellcome Sanger Institute). https:\u002F\u002Fgithub.com\u002Ffelicityallen\u002FJACKS. Official repository.\n- Behan FM et al. 2019. *Nature* 568:511. Project Score CRISPR panel; library-wide reference screen data.\n- Meyers RM et al. 2017. *Nat Genet* 49:1779. Avana CRISPR DepMap; reference panel for efficacy transfer.\n\n## Related Skills\n\n- crispr-screens\u002Fmageck-analysis - MAGeCK RRA\u002FMLE comparison\n- crispr-screens\u002Fbagel-essentiality - Alternative for essentiality without efficacy modeling\n- crispr-screens\u002Flibrary-design - sgRNA design rules informed by JACKS efficacy output\n- crispr-screens\u002Fcopy-number-correction - Chronos preferred for cancer-line multi-screen analyses\n- crispr-screens\u002Fscreen-qc - Pre-JACKS QC; replicate Pearson must pass before joint analysis\n- crispr-screens\u002Fhit-calling - Cross-method decision tree\n- crispr-screens\u002Fbatch-correction - JACKS does not adjust for batch; pre-correct if necessary\n",{"name":5,"tool_type":24,"description":7,"primary_tool":25},"python","JACKS","main","e0956dc9606356ab78468936b502e55a365282e2","specialists\u002Fcrispr-screen-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-crispr-screens-jacks-analysis",0,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists","https:\u002F\u002Fgithub.com\u002Fmrsonord2240","2026-10-12 03:19:04",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add mrsonord2240\u002Fopenscience-specialists --skill bio-crispr-screens-jacks-analysis",{"tool":39,"command":40},"bunx","bunx skills add mrsonord2240\u002Fopenscience-specialists --skill bio-crispr-screens-jacks-analysis",{"tool":42,"command":43},"pnpm","pnpm dlx skills add mrsonord2240\u002Fopenscience-specialists --skill bio-crispr-screens-jacks-analysis","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fcrispr-screen-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-crispr-screens-jacks-analysis\u002FSKILL.md",true,[47,53],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"examples\u002Frun_jacks.py","SCRIPT","脚本",5338,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fcrispr-screen-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-crispr-screens-jacks-analysis\u002Fexamples\u002Frun_jacks.py",{"path":54,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":57,"sourceHtmlUrl":58},"usage-guide.md","REFERENCE","参考文档",8375,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fcrispr-screen-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-crispr-screens-jacks-analysis\u002Fusage-guide.md",[60,67,74,81,88,95],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M7CW36A6QAGWFE2C008M1XPG","bio-workflows-metabolomics-pipeline","Orchestrates the untargeted LC-MS metabolomics pipeline end-to-end (xcms 4.x feature extraction, QC\u002Fdrift\u002Fnormalization, confidence-stratified annotation, permutation-validated statistics, background-aware pathway mapping), naming what each stage decides and where it silently fails. Use when running a full LC-MS metabolomics study from raw mzML to enriched pathways and needing the honest handoffs between stages. Each stage defers to its component skill for parameters and traps; for stable-isotope flux (a separate branch, not this untargeted flow) see metabolomics\u002Fisotope-tracing.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-workflows-metabolomics-pipeline\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M7CW2Y18623NA2S1Y30FRQW1","bio-metabolomics-xcms-preprocessing","Programmatic untargeted LC-MS feature extraction in R with the modern xcms 4.x MsExperiment\u002FXcmsExperiment API, taking raw mzML to a feature table via CentWave peak detection, retention-time alignment, peak-density correspondence, gap-filling, CAMERA redundancy collapse, and built-in QC feature filtering. Use when converting centroided LC-MS runs into a features-by-samples matrix and deciding centWave\u002Fgrouping\u002Falignment parameters. For drift correction and QC\u002FCV filtering execution see metabolomics\u002Fnormalization-qc; for metabolite identification see metabolomics\u002Fmetabolite-annotation; for the MS-DIAL GUI alternative with MS2Dec deconvolution see metabolomics\u002Fmsdial-preprocessing; for downstream statistics see metabolomics\u002Fstatistical-analysis.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-xcms-preprocessing\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M7CW2M364HVWPNQEKE2WP4PP","bio-metabolomics-statistical-analysis","Decision-grade statistical analysis for metabolomics intensity tables. Covers transformation and scaling (Pareto vs unit-variance as a hidden hypothesis), unsupervised structure (PCA\u002FHCA for QC), permutation-validated PLS-DA\u002FOPLS-DA (R2 vs Q2, double CV, VIP as heuristic), univariate testing (Welch\u002FMann-Whitney\u002FANOVA\u002FLMM with covariate adjustment), and dependence-aware multiple testing. Use when testing which metabolites differ, building or validating a discriminant model, choosing a scaling, or correcting many correlated tests. For sample-wise normalization\u002Fdrift correction see metabolomics\u002Fnormalization-qc; for ML classifiers and selection-inside-CV leakage see machine-learning\u002Fbiomarker-discovery and machine-learning\u002Fmodel-validation; for pathway interpretation see metabolomics\u002Fpathway-mapping; for design\u002Fpower\u002Fmultiplicity regime see experimental-design\u002Fmultiple-testing.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-statistical-analysis\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M7CW2BCBF851WYE03Z8XPEDQ","bio-metabolomics-pathway-mapping","Maps metabolomics results to biological pathways via over-representation (ORA), metabolite-set enrichment (MSEA\u002FQEA), mummichog\u002FPSEA on raw m\u002Fz peaks, and network-diffusion enrichment (FELLA), with correct background-set construction and honest interpretive ceilings. Use when interpreting differential metabolites or an untargeted LC-MS feature table in pathway context, choosing ORA vs MSEA vs mummichog vs topology, or setting the reference\u002Fbackground set. For annotation confidence levels feeding ORA see metabolomics\u002Fmetabolite-annotation; for gene-set concepts see pathway-analysis\u002Fgo-enrichment and pathway-analysis\u002Fgsea; for joint gene+metabolite pathways see multi-omics-integration\u002Fmofa-integration.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-pathway-mapping\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":19},"01M7CW21NSZMCPMF7D9CHJM718","bio-metabolomics-normalization-qc","Designs QC, corrects signal drift, removes batch effects, filters features, normalizes samples, and imputes missing values for untargeted LC-MS\u002FGC-MS metabolomics, framing each step as a measurement model that can create or erase biological signal. Use when processing a peak\u002Ffeature table before statistical analysis, choosing a drift-correction or sample-normalization method, deciding QC RSD vs D-ratio filtering, or handling left-censored missing values. The feature table is produced by metabolomics\u002Fxcms-preprocessing or metabolomics\u002Fmsdial-preprocessing; transformation\u002Fscaling for modeling defers to metabolomics\u002Fstatistical-analysis; cross-study design issues link to experimental-design\u002Fbatch-design.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-normalization-qc\u002FSKILL.md",[],[],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":19},"01M7CW1SWVM0NYHVE6Q7MA3G7R","bio-metabolomics-msdial-preprocessing","Runs the MS-DIAL preprocessing workflow (peak picking, MS2Dec spectral deconvolution, alignment, gap-filling) and imports the alignment-result table into R or Python with honest filtering. Use when preprocessing LC-MS DDA\u002FDIA (SWATH) or GC-MS raw data with MS-DIAL, deciding MS-DIAL vs XCMS, configuring the MSDIALCUI console run, or parsing an MS-DIAL export into a clean feature matrix. For programmatic R peak detection and the feature-table-as-artifact framing see metabolomics\u002Fxcms-preprocessing; for lipid annotation mode see metabolomics\u002Flipidomics; for MSI-level confidence honesty see metabolomics\u002Fmetabolite-annotation; for drift correction and QC see metabolomics\u002Fnormalization-qc.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-msdial-preprocessing\u002FSKILL.md",[],[]]