Bulk Rnaseq Limma Voomのロゴ

Bulk Rnaseq Limma Voom

コミュニティ
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.

概要

公開者sagirimo
リポジトリBioDSH
スキル名bulk-rnaseq-limma-voom
スター
65
フォーク
2
同梱ファイル
6
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 6個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    sagirimoがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Bulk Rnaseq Limma Voom」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/sagirimo/BioDSH/tree/main/biodsh-core/skills/bulk-rnaseq-limma-voom
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

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
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでBulk Rnaseq Limma Voomを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にBulk Rnaseq Limma Voomを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Bulk Rnaseq Limma Voomは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

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.

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「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.

TypingMindでBulk Rnaseq Limma Voomを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Bulk Rnaseq Limma Voomはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにBulk Rnaseq Limma Voomをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/sagirimo/BioDSH/tree/main/biodsh-core/skills/bulk-rnaseq-limma-voomを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Bulk Rnaseq Limma Voomを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Bulk Rnaseq Limma Voomで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもBulk Rnaseq Limma Voomを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Bulk Rnaseq Limma Voom」は無料ですか?

はい。sagirimoがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇