Bulk Rnaseq Limma Voom logo

Bulk Rnaseq Limma Voom

Community
sagirimo
bulk-rnaseq-limma-voom

Bulk RNA-seq differential expression with limma-voom (and edgeR TMM) in plain Python/numpy/scipy, matching R limma; use for count matrices (including fractional RSEM expected counts) with covariates, moderated t statistics, empirical Bayes prior df/variance, voom weights or LOWESS mean-variance trends when R is unavailable.

Overview

Publishersagirimo
RepositoryBioDSH
Skill namebulk-rnaseq-limma-voom
Stars
65
Forks
2
Bundled files
6
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 6 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by sagirimo on GitHub. Read the source before you install it.

Installation

Install the Bulk Rnaseq Limma Voom AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/sagirimo/BioDSH/tree/main/biodsh-core/skills/bulk-rnaseq-limma-voom
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/sagirimo/BioDSH.git /tmp/BioDSH
mkdir -p .claude/skills
cp -r /tmp/BioDSH/biodsh-core/skills/bulk-rnaseq-limma-voom .claude/skills/bulk-rnaseq-limma-voom
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Bulk Rnaseq Limma Voom in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Bulk Rnaseq Limma Voom on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Bulk Rnaseq Limma Voom is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Bulk RNA-seq differential expression: limma-voom in Python

Use when a bulk RNA-seq count matrix must be analysed with limma-style linear models and you cannot (or must not) call R: voom precision weights, weighted per-gene least squares, empirical Bayes variance moderation (prior df, prior variance, moderated t), BH adjustment, optionally TMM effective library sizes. limma_py.py (next to this file) is a tested implementation that follows the R sources; copy the functions you need into your own script so it stays self-contained.

Steps

  1. Counts and samples. Rows = genes, columns = samples, aligned to the sample table by sample ID, never by position. Keep fractional counts (RSEM expected counts) as floats: do not round, do not treat as integers. Decide the gene set explicitly (all genes, or a filter the specification names) and apply it before voom; all-zero genes are excluded from the voom trend automatically but still get weights.
  2. Library sizes. Default: column sums of the counts used. With TMM: lib = colsums * tmm_factors(counts); compute factors on the same gene set edgeR would see (it drops all-zero rows itself). If the specification defines library size differently (e.g. totals over all genes before filtering), follow it.
  3. Design. Build the design matrix by name: intercept first, then the coefficient of interest, then covariates in the stated order; reference level coded 0. Drop samples with missing covariates only as the specification says, and record how many were dropped and why. Check full column rank (np.linalg.matrix_rank).
  4. voom. v = voom(counts, X, lib_size=lib) gives E (log2-CPM with +0.5 / +1 offsets) and weights. One voom per model when models use different samples or designs.
  5. Fit and moderate. fit = e_bayes(lm_fit(v['E'], X, v['weights'])). Read fit['df_prior'] (may be inf), fit['s2_prior'], fit['s2_post'], fit['t'], fit['df_total'] (capped at the pooled residual df, as limma does), fit['p_value']. Adjust per coefficient with p_adjust_bh, over the genes tested in that model.
  6. Report. Coefficient (log2 fold change), its moderated t and p, BH q, residual df, prior df and variance, number of genes tested and selected, sample counts per group (cases and comparison group), and any sensitivity model.

Pitfalls that change numbers

  • log-CPM is log2((count + 0.5) / (lib + 1) * 1e6); the voom trend x is Amean + mean(log2(lib + 1)) - log2(1e6), y is sqrt(sigma) from an unweighted fit; weights are 1 / trend(log2 fitted count)^4, with constant extrapolation beyond the ends.
  • Span: current limma (3.68) voom uses an adaptive span from the number of genes (span=None here, the default); limma releases before adaptive span used 0.5. If the specification names a span or a limma version, pass it; the choice moves every weight (7% on 4000 genes) and the prior df.
  • R lowess is not statsmodels lowess: it uses delta = 1% of the x range (interpolates between fitted points) and 3 robustness iterations. Use lowess_r; a different smoother changes every weight.
  • Prior df can be infinite (all genes share one variance); then s2_post = s2_prior and df_total equals the pooled residual df. Report it as infinite, not as a large number, if the output asks.
  • df_total is capped at the sum of residual df over genes; t uses the posterior variance, not the gene's own.
  • BH must be computed within each model/coefficient over exactly the tested genes; NaN p-values are left out.
  • contrast() gives exact per-gene SEs; limma's contrasts.fit approximates them for weighted, non-orthogonal designs.
  • Not implemented: eBayes(trend=TRUE), robust=TRUE, duplicateCorrelation, voomWithQualityWeights. Say so if the specification asks for them instead of silently using the plain versions.

Checks before reporting

  • Group sizes and dropped samples match the sample table; design columns are named and in order.
  • Weights are finite and positive; E has no NaN; the number of tested genes equals the gene set chosen in step 1.
  • Signs: the case coefficient is case minus reference.
  • Spot-check one gene by hand: weighted least squares with its weights reproduces its coefficient.

Validation

limma_py.py was compared with R 4.6 limma/edgeR (voom, lmFit, eBayes, calcNormFactors TMM, lowess, p.adjust) on synthetic fractional-count data with a group effect, a continuous covariate and all-zero genes: see VALIDATION.md.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Bulk Rnaseq Limma Voom AI skill do?

Bulk RNA-seq differential expression with limma-voom (and edgeR TMM) in plain Python/numpy/scipy, matching R limma; use for count matrices (including fractional RSEM expected counts) with covariates, moderated t statistics, empirical Bayes prior df/variance, voom weights or LOWESS mean-variance trends when R is unavailable.

Why use Bulk Rnaseq Limma Voom on TypingMind?

Because you install it once and use it with any model. Bulk Rnaseq Limma Voom is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Bulk Rnaseq Limma Voom in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/sagirimo/BioDSH/tree/main/biodsh-core/skills/bulk-rnaseq-limma-voom. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Bulk Rnaseq Limma Voom?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Bulk Rnaseq Limma Voom?

As many as you like. As long as a model supports skills, you can use Bulk Rnaseq Limma Voom with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Bulk Rnaseq Limma Voom AI skill free?

Yes. It is published on GitHub by sagirimo under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇