Bioinformática · katucharts.js/bio

Vulcão

type: 'volcano'

Gráfico vulcão — mudança de dobra (x) vs significância estatística (−log10 valor-p, y). Pontos são coloridos por limites de significância: upregulado, downregulado, não significativo.

Edite o JSON à direita e pressione Executar (ou ⌘/Ctrl + Enter) — dados, títulos, categorias e cores se atualizam ao vivo.

Ao Vivo
Vulcão
Editar · JSON

Formato de dados

{ x: log2FC, y: -log10pval, name?: geneName }

Estrutura de dados

O JSON que você passa dentro do gráfico — coloque direto na sua series.

data: [
  { x: 2.5, y: 10.3, name: 'BRCA1' },
  { x: -1.8, y: 4.2, name: 'TP53' },
  { x: 0.8, y: 8.1, name: 'PTEN' }
]

Exemplo

import KatuCharts from 'katucharts.js';
import 'katucharts.js/bio';

KatuCharts.chart('container', {
  series: [{
    type: 'volcano',
    data: [{ x: 2.5, y: 10.3, name: 'BRCA1' }, { x: -1.8, y: 4.2, name: 'TP53' }],
    foldChangeThreshold: 1,
    pValueThreshold: 0.01
  }]
});

Opções específicas do tipo

OpçãoDescrição
thresholds{ foldChange, pValue } cutoffs de classificação.
colors{ upregulated, downregulated, nonsignificant }.
labelTopNRotule os top-N genes mais significativos.

Variações

Rotular genes principais

Anote os pontos mais significativos com labelTopN.

KatuCharts.chart('container', {
  series: [{
    type: 'volcano',
    data: genes,
    foldChangeThreshold: 1,
    pValueThreshold: 0.01,
    labelTopN: 8
  }]
});

Common errors

Why does my vulcão chart render as a line chart?
The chart type was not registered. KatuCharts logs "KatuCharts: unknown series type "<type>", falling back to line" and draws a line chart rather than throwing. Import the module the type belongs to — for example `import 'katucharts.js/bio';` — before creating the chart.
Why do I get "Cannot read properties of null (reading 'appendChild')"?
The container element does not exist when the chart is created. Create the chart after the element is in the DOM: in React that means inside useEffect, not during render.
Why is the chart rendering with zero height?
The container has no height. A div with no content collapses to zero. Give it a height in CSS, or pass `chart: { height: 400 }` in the options.

FAQ

How do I create a vulcão chart in JavaScript?
Install with `npm install katucharts.js`, import the module with `import 'katucharts.js/bio';`, then call KatuCharts.chart(container, { chart: { type: 'volcano' }, series: [...] }).
What data does the volcano plot expect?
Points that are already transformed: { x: log2 fold change, y: −log10(p), name }. Compute −log10 of your p-values (or adjusted p-values) before passing them in; the series does not read DESeq2, edgeR or limma result tables directly.
How are points classified as up-regulated, down-regulated or not significant?
With foldChangeThreshold (default 1) and pValueThreshold (default 0.05) on the series. Dashed threshold lines are drawn at ±foldChangeThreshold and at −log10(pValueThreshold), and the three groups are coloured with upColor, downColor and nsColor.
How do I label the most significant genes?
Set labelTopN on the series, for example labelTopN: 8. Labels use each point's name.
Why does my vulcão chart render as a line chart?
The chart type was not registered. KatuCharts logs "KatuCharts: unknown series type "<type>", falling back to line" and draws a line chart rather than throwing. Import the module the type belongs to — for example `import 'katucharts.js/bio';` — before creating the chart.
Why do I get "Cannot read properties of null (reading 'appendChild')"?
The container element does not exist when the chart is created. Create the chart after the element is in the DOM: in React that means inside useEffect, not during render.
Opções comuns (color, visible, marker, dataLabels, animation, events, zones…) se aplicam a cada tipo — veja Configuração → series. Veja renderizado na galeria.