@brainpilot/skills 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/package.json +35 -0
- package/skills/01_Meta-Skills/contribute-skill/SKILL.md +277 -0
- package/skills/01_Meta-Skills/contribute-skills-via-pr/SKILL.md +163 -0
- package/skills/01_Meta-Skills/paper-to-skill/SKILL.md +435 -0
- package/skills/01_Meta-Skills/paper-to-skill/references/extraction-guide.md +286 -0
- package/skills/01_Meta-Skills/paper-to-skill/references/skill-template.md +250 -0
- package/skills/01_Meta-Skills/repo-to-skill/SKILL.md +289 -0
- package/skills/01_Meta-Skills/share-case/SKILL.md +253 -0
- package/skills/01_Meta-Skills/share-usage/README.md +63 -0
- package/skills/01_Meta-Skills/share-usage/SKILL.md +395 -0
- package/skills/01_Meta-Skills/verify-skill/SKILL.md +331 -0
- package/skills/02_Cross-Domain_Foundation/cogsci-power-analysis/SKILL.md +194 -0
- package/skills/02_Cross-Domain_Foundation/cogsci-power-analysis/references/effect-sizes.md +352 -0
- package/skills/02_Cross-Domain_Foundation/cogsci-power-analysis/references/sample-size-guide.md +407 -0
- package/skills/02_Cross-Domain_Foundation/cogsci-statistics/SKILL.md +361 -0
- package/skills/02_Cross-Domain_Foundation/cogsci-statistics/references/common-analyses.md +517 -0
- package/skills/02_Cross-Domain_Foundation/cogsci-visualization/SKILL.md +292 -0
- package/skills/02_Cross-Domain_Foundation/cogsci-visualization/references/plot-recipes.md +709 -0
- package/skills/02_Cross-Domain_Foundation/research-literacy/SKILL.md +286 -0
- package/skills/02_Cross-Domain_Foundation/research-literacy/references/common-assumptions.md +320 -0
- package/skills/02_Cross-Domain_Foundation/research-literacy/references/planning-template.md +143 -0
- package/skills/03_Cognitive_Psychology/alternative-uses-task-designer/SKILL.md +197 -0
- package/skills/03_Cognitive_Psychology/alternative-uses-task-designer/references/instruction-templates.md +60 -0
- package/skills/03_Cognitive_Psychology/cognitive-paradigm-design/SKILL.md +246 -0
- package/skills/03_Cognitive_Psychology/cognitive-paradigm-design/references/classic-paradigms.md +435 -0
- package/skills/03_Cognitive_Psychology/cognitive-paradigm-design/references/design-principles.md +256 -0
- package/skills/03_Cognitive_Psychology/creativity-self-efficacy-mediation/SKILL.md +270 -0
- package/skills/03_Cognitive_Psychology/creativity-self-efficacy-mediation/references/lavaan-templates.md +172 -0
- package/skills/03_Cognitive_Psychology/divergent-thinking-scoring/SKILL.md +238 -0
- package/skills/03_Cognitive_Psychology/divergent-thinking-scoring/references/scoring-rubric.md +143 -0
- package/skills/03_Cognitive_Psychology/drift-diffusion-model/SKILL.md +203 -0
- package/skills/03_Cognitive_Psychology/drift-diffusion-model/references/fitting-guide.md +571 -0
- package/skills/03_Cognitive_Psychology/drift-diffusion-model/references/model-variants.md +427 -0
- package/skills/03_Cognitive_Psychology/evidence-accumulation-selector/SKILL.md +310 -0
- package/skills/03_Cognitive_Psychology/evidence-accumulation-selector/references/ez-diffusion-formulas.md +137 -0
- package/skills/03_Cognitive_Psychology/signal-detection-analysis/SKILL.md +300 -0
- package/skills/03_Cognitive_Psychology/signal-detection-analysis/references/application-guide.md +278 -0
- package/skills/03_Cognitive_Psychology/signal-detection-analysis/references/sdt-formulas.md +318 -0
- package/skills/03_Cognitive_Psychology/visual-search-array-generator/SKILL.md +283 -0
- package/skills/03_Cognitive_Psychology/visual-search-array-generator/references/array-generation-parameters.yaml +111 -0
- package/skills/04_Psycholinguistics/reading-time-analysis/SKILL.md +301 -0
- package/skills/04_Psycholinguistics/reading-time-analysis/references/measure-computation-guide.md +195 -0
- package/skills/04_Psycholinguistics/self-paced-reading-designer/SKILL.md +257 -0
- package/skills/04_Psycholinguistics/self-paced-reading-designer/references/analysis-guide.md +356 -0
- package/skills/04_Psycholinguistics/self-paced-reading-designer/references/region-segmentation.md +266 -0
- package/skills/04_Psycholinguistics/sentence-stimulus-norming/SKILL.md +346 -0
- package/skills/04_Psycholinguistics/sentence-stimulus-norming/references/lexical-databases-guide.md +184 -0
- package/skills/05_EEG_ERP/eeg-paradigm-designer/SKILL.md +226 -0
- package/skills/05_EEG_ERP/eeg-paradigm-designer/references/component-paradigm-map.md +276 -0
- package/skills/05_EEG_ERP/eeg-paradigm-designer/references/timing-parameters.md +244 -0
- package/skills/05_EEG_ERP/eeg-preprocessing-pipeline-guide/SKILL.md +367 -0
- package/skills/05_EEG_ERP/eeg-preprocessing-pipeline-guide/references/parameter-lookup-tables.md +138 -0
- package/skills/05_EEG_ERP/erp-analysis/SKILL.md +185 -0
- package/skills/05_EEG_ERP/erp-analysis/references/erp-components.md +447 -0
- package/skills/05_EEG_ERP/erp-analysis/references/preprocessing-pipeline.md +277 -0
- package/skills/05_EEG_ERP/erp-analysis/references/statistical-approaches.md +351 -0
- package/skills/05_EEG_ERP/mne-python-guide/SKILL.md +174 -0
- package/skills/05_EEG_ERP/mne-python-guide/references/decoding.md +178 -0
- package/skills/05_EEG_ERP/mne-python-guide/references/io_formats.md +160 -0
- package/skills/05_EEG_ERP/mne-python-guide/references/preprocessing.md +259 -0
- package/skills/05_EEG_ERP/mne-python-guide/references/simulation.md +173 -0
- package/skills/05_EEG_ERP/mne-python-guide/references/source_localization.md +234 -0
- package/skills/05_EEG_ERP/mne-python-guide/references/statistics.md +196 -0
- package/skills/05_EEG_ERP/mne-python-guide/references/time_frequency.md +165 -0
- package/skills/05_EEG_ERP/mne-python-guide/references/visualization.md +175 -0
- package/skills/06_fMRI_Neuroimaging/brain-connectivity-modeler/SKILL.md +317 -0
- package/skills/06_fMRI_Neuroimaging/brain-connectivity-modeler/references/method-implementation-guide.md +116 -0
- package/skills/06_fMRI_Neuroimaging/fmri-glm-analysis-guide/SKILL.md +296 -0
- package/skills/06_fMRI_Neuroimaging/fmri-glm-analysis-guide/references/design-matrix-guide.md +214 -0
- package/skills/06_fMRI_Neuroimaging/fmri-glm-analysis-guide/references/statistical-inference.md +288 -0
- package/skills/06_fMRI_Neuroimaging/fmri-preprocessing-pipeline-guide/SKILL.md +274 -0
- package/skills/06_fMRI_Neuroimaging/fmri-preprocessing-pipeline-guide/references/quality-control.md +336 -0
- package/skills/06_fMRI_Neuroimaging/fmri-preprocessing-pipeline-guide/references/step-by-step-pipeline.md +380 -0
- package/skills/06_fMRI_Neuroimaging/fmri-task-design-guide/SKILL.md +264 -0
- package/skills/06_fMRI_Neuroimaging/fmri-task-design-guide/references/design-optimization-examples.md +114 -0
- package/skills/06_fMRI_Neuroimaging/neural-decoding-analysis/SKILL.md +273 -0
- package/skills/06_fMRI_Neuroimaging/neural-decoding-analysis/references/decoding-methods.md +170 -0
- package/skills/06_fMRI_Neuroimaging/neural-decoding-analysis/references/rsa-guide.md +266 -0
- package/skills/06_fMRI_Neuroimaging/pycortex-guide/SKILL.md +123 -0
- package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/database-subjects.md +179 -0
- package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/dataset-types.md +208 -0
- package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/freesurfer-fmriprep.md +162 -0
- package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/mapping-transforms.md +181 -0
- package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/mni-utils.md +207 -0
- package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/surface-analysis.md +219 -0
- package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/visualization.md +251 -0
- package/skills/07_Computational_Modeling/act-r-model-builder/SKILL.md +297 -0
- package/skills/07_Computational_Modeling/act-r-model-builder/references/model-patterns.md +197 -0
- package/skills/07_Computational_Modeling/act-r-model-builder/references/parameter-table.yaml +204 -0
- package/skills/07_Computational_Modeling/bayesian-cognitive-model-builder/SKILL.md +294 -0
- package/skills/07_Computational_Modeling/bayesian-cognitive-model-builder/references/diagnostics-checklist.md +351 -0
- package/skills/07_Computational_Modeling/bayesian-cognitive-model-builder/references/prior-selection-guide.md +241 -0
- package/skills/07_Computational_Modeling/parameter-recovery-checker/SKILL.md +269 -0
- package/skills/07_Computational_Modeling/parameter-recovery-checker/references/recovery-diagnostics.md +207 -0
- package/skills/08_Computational_Neuroscience/brain-connectivity-modeler/SKILL.md +317 -0
- package/skills/08_Computational_Neuroscience/brain-connectivity-modeler/references/method-implementation-guide.md +116 -0
- package/skills/08_Computational_Neuroscience/neural-decoding-analysis/SKILL.md +273 -0
- package/skills/08_Computational_Neuroscience/neural-decoding-analysis/references/decoding-methods.md +170 -0
- package/skills/08_Computational_Neuroscience/neural-decoding-analysis/references/rsa-guide.md +266 -0
- package/skills/08_Computational_Neuroscience/neural-population-analysis-guide/SKILL.md +305 -0
- package/skills/08_Computational_Neuroscience/neural-population-analysis-guide/references/data-requirements.md +60 -0
- package/skills/08_Computational_Neuroscience/neural-population-analysis-guide/references/method-comparison.md +151 -0
- package/skills/08_Computational_Neuroscience/spiking-network-model-builder/SKILL.md +376 -0
- package/skills/08_Computational_Neuroscience/spiking-network-model-builder/references/hh-parameters.md +117 -0
- package/skills/08_Computational_Neuroscience/spiking-network-model-builder/references/network-regimes.md +130 -0
- package/skills/09_Cellular_Molecular_Neuroscience/calcium-imaging-analysis-guide/SKILL.md +258 -0
- package/skills/09_Cellular_Molecular_Neuroscience/calcium-imaging-analysis-guide/references/indicator-parameters.md +242 -0
- package/skills/09_Cellular_Molecular_Neuroscience/calcium-imaging-analysis-guide/references/pipeline-details.md +211 -0
- package/skills/09_Cellular_Molecular_Neuroscience/optogenetics-protocol-designer/SKILL.md +261 -0
- package/skills/09_Cellular_Molecular_Neuroscience/optogenetics-protocol-designer/references/opsin-catalog.md +124 -0
- package/skills/09_Cellular_Molecular_Neuroscience/optogenetics-protocol-designer/references/stimulation-parameters.md +304 -0
- package/skills/10_Clinical_Neuropsychology/lesion-symptom-mapping-guide/SKILL.md +367 -0
- package/skills/10_Clinical_Neuropsychology/lesion-symptom-mapping-guide/references/disconnection-guide.md +152 -0
- package/skills/10_Clinical_Neuropsychology/lesion-symptom-mapping-guide/references/vlsm-pipeline.md +182 -0
- package/skills/10_Clinical_Neuropsychology/neuropsych-battery-selector/SKILL.md +250 -0
- package/skills/10_Clinical_Neuropsychology/neuropsych-battery-selector/references/deficit-profiles.md +302 -0
- package/skills/10_Clinical_Neuropsychology/neuropsych-battery-selector/references/test-catalog.md +304 -0
- package/skills/11_Developmental_Cognition/infant-looking-time-designer/SKILL.md +345 -0
- package/skills/11_Developmental_Cognition/infant-looking-time-designer/references/age-parameters.yaml +186 -0
- package/skills/12_Social_Cognition/tom-task-selector/SKILL.md +379 -0
- package/skills/12_Social_Cognition/tom-task-selector/references/task-database.md +317 -0
- package/skills/13_Visualization/nature-figure/README.md +442 -0
- package/skills/13_Visualization/nature-figure/SKILL.md +60 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-01-bar-charts.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-02-line-trends.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-03-heatmaps.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-04-scatter-bubble.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-05-radar-polar.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-06-distributions.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-07-forest-interval.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-08-area-stacked.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-09-image-plates.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-10-network-matrix.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/Dispersion_motivation.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/Dispersion_observation.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/Dispersion_observation_distillation.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/ImmunoStruct_contrastive.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/ImmunoStruct_results_CEDAR.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/ImmunoStruct_results_IEDB.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/ImmunoStruct_schematic.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/RNAGenScape_schematic.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_CellSpliceNet/figures/ablation.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_CellSpliceNet/figures/comparison.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_CellSpliceNet/plot_ablation.py +86 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_CellSpliceNet/plot_comparison.py +109 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/diffusion_swiss_roll.py +97 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/diffusion_swiss_roll.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/fig2_comparison_GeneRegulatory.pdf +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/fig2_comparison_GeneRegulatory.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/fig2_comparison_Trajectory.pdf +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/fig2_comparison_Trajectory.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/figX_comparison_Ablation.pdf +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/figX_comparison_Ablation.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/plot_comparison_Ablation.py +64 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/plot_comparison_GeneRegulatory.py +74 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/plot_comparison_Trajectory.py +74 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Dispersion/figures/idea.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Dispersion/figures/illustration.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Dispersion/plot_idea.py +76 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Dispersion/plot_illustration.py +404 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_FPGM/figures/freq_prior.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_FPGM/plot_freq_prior.py +146 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/figures/bars_ablation_Cancer.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/figures/bars_ablation_IEDB.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/figures/bars_comparison_Cancer.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/figures/bars_comparison_IEDB.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/plot_bars.py +216 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/raw_data.py +125 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/manifold.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/manifold_holes.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/results_comparison_optimization.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/results_comparison_speed.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/results_sweep.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/plot_comparison.py +228 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/plot_hole_manifold.py +82 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/plot_manifold.py +61 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/plot_sweep.py +77 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_VIGIL/figures/comparison_posttraining.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_VIGIL/figures/comparison_radar.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_VIGIL/plot_comparison_radar.py +173 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_VIGIL/plot_posttraining.py +82 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/brute_force.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/correctness_by_category.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/correctness_by_subcategory.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/rewriting.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/selfcorrection_math.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_brute_force.py +248 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_correctness_by_category.py +132 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_correctness_by_subcategory.py +131 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_rewriting.py +105 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_selfcorrection_math.py +99 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ophthal_review/figures/composition_heatmap.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ophthal_review/figures/trend_by_month.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ophthal_review/plot_composition.py +81 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ophthal_review/plot_trend.py +125 -0
- package/skills/13_Visualization/nature-figure/assets/gallery/fig1-material-mechanism-rich.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/gallery/fig2-spatial-imaging-rich.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/gallery/fig3-in-vivo-efficacy-rich.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/gallery/fig4-single-cell-systems-rich.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/gallery/fig5-validation-perturbation-rich.png +0 -0
- package/skills/13_Visualization/nature-figure/evals/evals.json +37 -0
- package/skills/13_Visualization/nature-figure/manifest.yaml +57 -0
- package/skills/13_Visualization/nature-figure/references/api.md +428 -0
- package/skills/13_Visualization/nature-figure/references/backend-selection.md +100 -0
- package/skills/13_Visualization/nature-figure/references/chart-types.md +281 -0
- package/skills/13_Visualization/nature-figure/references/common-patterns.md +350 -0
- package/skills/13_Visualization/nature-figure/references/demos.md +65 -0
- package/skills/13_Visualization/nature-figure/references/design-theory.md +436 -0
- package/skills/13_Visualization/nature-figure/references/figure-contract.md +93 -0
- package/skills/13_Visualization/nature-figure/references/nature-2026-observations.md +112 -0
- package/skills/13_Visualization/nature-figure/references/qa-contract.md +119 -0
- package/skills/13_Visualization/nature-figure/references/r-template-index.md +66 -0
- package/skills/13_Visualization/nature-figure/references/r-workflow.md +161 -0
- package/skills/13_Visualization/nature-figure/references/tutorials.md +251 -0
- package/skills/13_Visualization/nature-figure/static/core/contract.md +29 -0
- package/skills/13_Visualization/nature-figure/static/core/stance.md +37 -0
- package/skills/13_Visualization/nature-figure/static/fragments/backend/python.md +37 -0
- package/skills/13_Visualization/nature-figure/static/fragments/backend/r.md +44 -0
- package/skills/14_Writing/markdown-report-writing/SKILL.md +306 -0
- package/skills/14_Writing/markdown-report-writing/references/compatibility-matrix.md +72 -0
- package/skills/14_Writing/markdown-report-writing/references/templates.md +299 -0
- package/skills/15_Others/neuroimaging-power-guide/SKILL.md +324 -0
- package/skills/15_Others/neuroimaging-power-guide/references/effect-size-lookup-tables.md +102 -0
- package/skills/15_Others/neuroimaging-sample-size-calculator/SKILL.md +330 -0
- package/skills/15_Others/neuroimaging-sample-size-calculator/references/worked-examples.md +220 -0
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
# nature-figure skill
|
|
2
|
+
|
|
3
|
+
Submission-grade scientific figures for Nature-tier journals and high-impact academic venues,
|
|
4
|
+
with both Python and R plotting tracks.
|
|
5
|
+
|
|
6
|
+
The skill starts from a figure contract: core conclusion, evidence hierarchy, archetype,
|
|
7
|
+
backend choice, journal/export constraints, statistics, and source-data traceability.
|
|
8
|
+
Plotting templates are used only after the scientific logic is clear.
|
|
9
|
+
|
|
10
|
+
Python remains the best-supported low-level layout path through `matplotlib`, `seaborn`,
|
|
11
|
+
`subplot_mosaic`, and `statsmodels`. R is supported through `ggplot2`, `patchwork`,
|
|
12
|
+
`ComplexHeatmap`, `ggrepel`, `svglite`, `cairo_pdf`, and `ragg`. If private template
|
|
13
|
+
collections are used, their paths, filenames, and provenance must not appear in
|
|
14
|
+
user-facing output.
|
|
15
|
+
|
|
16
|
+
Derived from production scripts in [figures4papers](https://github.com/ChenLiu-1996/figures4papers)
|
|
17
|
+
(published in *Nature Machine Intelligence* and top ML/bioinformatics venues).
|
|
18
|
+
The original figures4papers demo scripts and preview images are also bundled under
|
|
19
|
+
`assets/figures4papers/` for pattern-level adaptation.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Example output gallery
|
|
24
|
+
|
|
25
|
+
The images below are simulated data mockups generated with this skill's rules:
|
|
26
|
+
editable SVG-first export, restrained semantic palettes, lowercase panel labels, and
|
|
27
|
+
asymmetric multi-panel information architecture. They are PNG previews for README display;
|
|
28
|
+
production use should still export SVG/PDF from the plotting script.
|
|
29
|
+
|
|
30
|
+
| Figure | Preview | What the skill demonstrates |
|
|
31
|
+
|--------|---------|-----------------------------|
|
|
32
|
+
| Material design and physical validation | <a href="assets/gallery/fig1-material-mechanism-rich.png"><img src="assets/gallery/fig1-material-mechanism-rich.png" width="260" alt="Material design and physical validation"></a> | Schematic-led composite, SEM-like image panel, rheology, release kinetics, retention map, correlation and endpoint quantification |
|
|
33
|
+
| Spatial retention and uptake | <a href="assets/gallery/fig2-spatial-imaging-rich.png"><img src="assets/gallery/fig2-spatial-imaging-rich.png" width="260" alt="Spatial retention and uptake"></a> | Dark microscopy plate, channel rows, zoom crops, depth profiles, uptake histograms, 3D penetration heatmap and image-derived correlation |
|
|
34
|
+
| In vivo efficacy and tolerability | <a href="assets/gallery/fig3-in-vivo-efficacy-rich.png"><img src="assets/gallery/fig3-in-vivo-efficacy-rich.png" width="260" alt="In vivo efficacy and tolerability"></a> | Experimental timeline, longitudinal tumour curves, individual growth traces, waterfall response, forest plot, histology, immune composition and toxicity panels |
|
|
35
|
+
| Single-cell systems figure | <a href="assets/gallery/fig4-single-cell-systems-rich.png"><img src="assets/gallery/fig4-single-cell-systems-rich.png" width="260" alt="Single-cell systems figure"></a> | UMAP-style embedding, composition, marker heatmap, pseudotime, volcano plot, enrichment, ligand-receptor bubble matrix and spatial niche adjacency |
|
|
36
|
+
| Perturbation validation | <a href="assets/gallery/fig5-validation-perturbation-rich.png"><img src="assets/gallery/fig5-validation-perturbation-rich.png" width="260" alt="Perturbation validation"></a> | Mechanistic perturbation timeline, relapse endpoint, polar summary, dose response, synergy matrix, biodistribution, cytokines, flow-like scatter and safety score |
|
|
37
|
+
|
|
38
|
+
**Gallery file policy**
|
|
39
|
+
Keep only lightweight PNG previews in `assets/gallery/`. Do not commit large generated
|
|
40
|
+
SVG/PDF outputs unless they are needed for a tutorial, because real users should regenerate
|
|
41
|
+
editable outputs from source data and scripts.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Chart-type atlas
|
|
46
|
+
|
|
47
|
+
The gallery below classifies the skill by chart family. Each preview is a dense 4 x 4
|
|
48
|
+
atlas of small panels, designed to show the range of visual grammars that can be combined
|
|
49
|
+
inside a larger *Nature*-style result figure.
|
|
50
|
+
|
|
51
|
+
| Type | Preview | Common use |
|
|
52
|
+
|------|---------|------------|
|
|
53
|
+
| Bar charts | <a href="assets/chart-atlas/atlas-01-bar-charts.png"><img src="assets/chart-atlas/atlas-01-bar-charts.png" width="240" alt="Bar chart atlas"></a> | Group comparisons, signed deltas, grouped-within-grouped designs, stacked composition |
|
|
54
|
+
| Line and longitudinal trends | <a href="assets/chart-atlas/atlas-02-line-trends.png"><img src="assets/chart-atlas/atlas-02-line-trends.png" width="240" alt="Line chart atlas"></a> | Time courses, uncertainty ribbons, intervention marks, individual traces |
|
|
55
|
+
| Heatmaps | <a href="assets/chart-atlas/atlas-03-heatmaps.png"><img src="assets/chart-atlas/atlas-03-heatmaps.png" width="240" alt="Heatmap atlas"></a> | Z-score matrices, sequential abundance maps, annotated tables, clustered blocks |
|
|
56
|
+
| Scatter and bubble plots | <a href="assets/chart-atlas/atlas-04-scatter-bubble.png"><img src="assets/chart-atlas/atlas-04-scatter-bubble.png" width="240" alt="Scatter and bubble atlas"></a> | Correlation, clusters, volcano-style tests, quadrant summaries, third-variable bubbles |
|
|
57
|
+
| Radar and polar charts | <a href="assets/chart-atlas/atlas-05-radar-polar.png"><img src="assets/chart-atlas/atlas-05-radar-polar.png" width="240" alt="Radar and polar atlas"></a> | Multi-axis benchmarking, circular summaries, polar histograms, directional density |
|
|
58
|
+
| Distribution plots | <a href="assets/chart-atlas/atlas-06-distributions.png"><img src="assets/chart-atlas/atlas-06-distributions.png" width="240" alt="Distribution plot atlas"></a> | Histograms, violins, boxes, ridgelines and sample-level spread |
|
|
59
|
+
| Forest and interval plots | <a href="assets/chart-atlas/atlas-07-forest-interval.png"><img src="assets/chart-atlas/atlas-07-forest-interval.png" width="240" alt="Forest and interval atlas"></a> | Effect sizes, confidence intervals, point ranges, paired slope comparisons |
|
|
60
|
+
| Area and stacked trends | <a href="assets/chart-atlas/atlas-08-area-stacked.png"><img src="assets/chart-atlas/atlas-08-area-stacked.png" width="240" alt="Area and stacked trend atlas"></a> | Filled trajectories, stacked shares, cumulative curves, stream-like compositions |
|
|
61
|
+
| Image plates | <a href="assets/chart-atlas/atlas-09-image-plates.png"><img src="assets/chart-atlas/atlas-09-image-plates.png" width="240" alt="Image plate atlas"></a> | Microscopy channels, overlays, crops, scale bars and dark-panel layouts |
|
|
62
|
+
| Network and matrix charts | <a href="assets/chart-atlas/atlas-10-network-matrix.png"><img src="assets/chart-atlas/atlas-10-network-matrix.png" width="240" alt="Network and matrix atlas"></a> | Bubble matrices, adjacency maps, node-link diagrams and bipartite interaction panels |
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## File structure
|
|
67
|
+
|
|
68
|
+
The skill uses a router/static-dynamic split (like `nature-writing`, `nature-polishing`, `nature-reader`, and `nature-paper2ppt`): a short `SKILL.md` router plus a `manifest.yaml` that loads the always-on core, the selected backend fragment, and references on demand.
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
nature-figure/
|
|
72
|
+
├── SKILL.md ← short router: backend gate, load fragments
|
|
73
|
+
├── manifest.yaml ← always_load core + backend axis + on-demand references
|
|
74
|
+
├── README.md ← this file
|
|
75
|
+
├── static/
|
|
76
|
+
│ ├── core/ ← always loaded
|
|
77
|
+
│ │ ├── contract.md ← figure contract, backend gate, exclusivity, missing-runtime
|
|
78
|
+
│ │ └── stance.md ← color policy, default stance, privacy, when-to-load
|
|
79
|
+
│ └── fragments/
|
|
80
|
+
│ └── backend/ ← loaded after the Python-or-R gate is resolved
|
|
81
|
+
│ ├── python.md ← Python-only rule + matplotlib quick-start
|
|
82
|
+
│ └── r.md ← R-only rule + ggplot2 quick-start
|
|
83
|
+
├── assets/
|
|
84
|
+
│ ├── gallery/ ← result-figure preview PNGs
|
|
85
|
+
│ ├── chart-atlas/ ← chart-type taxonomy preview PNGs
|
|
86
|
+
│ └── figures4papers/ ← original demo scripts and preview assets
|
|
87
|
+
└── references/ ← opened on demand
|
|
88
|
+
├── figure-contract.md ← core conclusion, evidence hierarchy, panel map
|
|
89
|
+
├── backend-selection.md ← Python vs R decision rules
|
|
90
|
+
├── r-workflow.md ← R scaffold, patchwork, ComplexHeatmap, export
|
|
91
|
+
├── r-template-index.md ← local R template atlas
|
|
92
|
+
├── qa-contract.md ← submission/revision QA checklist
|
|
93
|
+
├── api.md ← PALETTE constants, helper function signatures
|
|
94
|
+
├── design-theory.md ← typography, color theory, layout, export policy
|
|
95
|
+
├── common-patterns.md ← reusable code patterns (bars, legends, heatmaps)
|
|
96
|
+
├── tutorials.md ← end-to-end walkthroughs
|
|
97
|
+
├── chart-types.md ← radar, 3D sphere, scatter, fill_between, log-scale
|
|
98
|
+
└── demos.md ← figures4papers demo map and routing guide
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Backend and contract rules
|
|
104
|
+
|
|
105
|
+
Ask the user to choose **Python or R** unless the backend is already specified.
|
|
106
|
+
If they ask for a recommendation, use `references/backend-selection.md`.
|
|
107
|
+
|
|
108
|
+
After a backend is selected, use it exclusively for plotting, previews, exports,
|
|
109
|
+
and visual QA. If the selected runtime or packages are missing, stop and report the
|
|
110
|
+
blocker; do not render a fallback preview with the other language. This applies in
|
|
111
|
+
both directions: no Python substitute for R, and no R substitute for Python.
|
|
112
|
+
|
|
113
|
+
Before plotting, write or infer the core conclusion, figure archetype, panel map,
|
|
114
|
+
evidence hierarchy, target output, statistics/source-data needs, and export bundle.
|
|
115
|
+
The figure must serve the scientific logic first. Aesthetic polish and template
|
|
116
|
+
matching are secondary.
|
|
117
|
+
|
|
118
|
+
User-facing output must not disclose private local paths, private filenames, internal
|
|
119
|
+
reference documents, template identifiers, or private-material provenance unless the
|
|
120
|
+
user explicitly asks for that audit trail.
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Python mandatory rules
|
|
125
|
+
|
|
126
|
+
### 1. Three required rcParams — editable SVG text
|
|
127
|
+
|
|
128
|
+
```python
|
|
129
|
+
plt.rcParams['font.family'] = 'sans-serif'
|
|
130
|
+
plt.rcParams['font.sans-serif'] = ['Arial', 'DejaVu Sans', 'Liberation Sans']
|
|
131
|
+
plt.rcParams['svg.fonttype'] = 'none'
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
**Why `svg.fonttype = 'none'`**
|
|
135
|
+
Matplotlib's default (`'path'`) converts every glyph to a bezier curve. The result is
|
|
136
|
+
visually identical but every `<text>` element becomes a `<path d="M...">` — unselectable,
|
|
137
|
+
unsearchable, and impossible to realign in Illustrator or Inkscape.
|
|
138
|
+
With `'none'`, text stays as SVG `<text>` nodes. Font substitution happens at render time.
|
|
139
|
+
|
|
140
|
+
**Why three fonts in the stack**
|
|
141
|
+
`Arial` is standard on macOS/Windows. `DejaVu Sans` ships with matplotlib and is the
|
|
142
|
+
Linux fallback. `Liberation Sans` is metric-compatible with Arial on RHEL/Ubuntu.
|
|
143
|
+
The cascade guarantees identical letter-spacing on all platforms.
|
|
144
|
+
|
|
145
|
+
### 2. Primary output format is SVG
|
|
146
|
+
|
|
147
|
+
```python
|
|
148
|
+
fig.savefig('figure.svg', bbox_inches='tight') # primary — editable text
|
|
149
|
+
fig.savefig('figure.png', dpi=300, bbox_inches='tight') # optional raster preview
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Never use PNG alone when the figure will go into a paper or slide deck that requires
|
|
153
|
+
post-hoc text adjustment.
|
|
154
|
+
|
|
155
|
+
### 3. Always close the figure
|
|
156
|
+
|
|
157
|
+
```python
|
|
158
|
+
plt.close(fig)
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Quick-start template
|
|
164
|
+
|
|
165
|
+
```python
|
|
166
|
+
import matplotlib
|
|
167
|
+
matplotlib.use('Agg') # headless / server rendering
|
|
168
|
+
import matplotlib.pyplot as plt
|
|
169
|
+
import matplotlib.gridspec as gridspec
|
|
170
|
+
import numpy as np
|
|
171
|
+
|
|
172
|
+
# ── MANDATORY ─────────────────────────────────────────────────────────────────
|
|
173
|
+
plt.rcParams['font.family'] = 'sans-serif'
|
|
174
|
+
plt.rcParams['font.sans-serif'] = ['Arial', 'DejaVu Sans', 'Liberation Sans']
|
|
175
|
+
plt.rcParams['svg.fonttype'] = 'none'
|
|
176
|
+
|
|
177
|
+
# ── Style ──────────────────────────────────────────────────────────────────────
|
|
178
|
+
plt.rcParams.update({
|
|
179
|
+
'font.size': 12,
|
|
180
|
+
'axes.spines.right': False,
|
|
181
|
+
'axes.spines.top': False,
|
|
182
|
+
'axes.linewidth': 2.0,
|
|
183
|
+
'legend.frameon': False,
|
|
184
|
+
'xtick.major.width': 1.5,
|
|
185
|
+
'ytick.major.width': 1.5,
|
|
186
|
+
})
|
|
187
|
+
|
|
188
|
+
# ── Figure ──────────────────────────────────────────────────────────────────────
|
|
189
|
+
fig, ax = plt.subplots(figsize=(8, 5))
|
|
190
|
+
ax.spines['bottom'].set_linewidth(2)
|
|
191
|
+
ax.spines['left'].set_linewidth(2)
|
|
192
|
+
|
|
193
|
+
# ... your plot code ...
|
|
194
|
+
|
|
195
|
+
fig.tight_layout(pad=2)
|
|
196
|
+
fig.savefig('output.svg', bbox_inches='tight')
|
|
197
|
+
fig.savefig('output.png', dpi=300, bbox_inches='tight')
|
|
198
|
+
plt.close(fig)
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## Color palette
|
|
204
|
+
|
|
205
|
+
```python
|
|
206
|
+
PALETTE = {
|
|
207
|
+
# Primary / hero method
|
|
208
|
+
'blue_main': '#0F4D92',
|
|
209
|
+
'blue_secondary': '#3775BA',
|
|
210
|
+
|
|
211
|
+
# Positive / improvement shades
|
|
212
|
+
'green_1': '#DDF3DE',
|
|
213
|
+
'green_2': '#AADCA9',
|
|
214
|
+
'green_3': '#8BCF8B',
|
|
215
|
+
|
|
216
|
+
# Baseline / contrast
|
|
217
|
+
'red_1': '#F6CFCB',
|
|
218
|
+
'red_2': '#E9A6A1',
|
|
219
|
+
'red_strong': '#B64342',
|
|
220
|
+
|
|
221
|
+
# Neutral support
|
|
222
|
+
'neutral_light': '#CFCECE',
|
|
223
|
+
'neutral_mid': '#767676',
|
|
224
|
+
'neutral_dark': '#4D4D4D',
|
|
225
|
+
'neutral_black': '#272727',
|
|
226
|
+
|
|
227
|
+
# Accent (use sparingly)
|
|
228
|
+
'gold': '#FFD700',
|
|
229
|
+
'teal': '#42949E',
|
|
230
|
+
'violet': '#9A4D8E',
|
|
231
|
+
'magenta': '#EA84DD',
|
|
232
|
+
}
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
**Semantic mapping convention**
|
|
236
|
+
`blue_main` = your method / hero series. `green_3` = positive variants. `red_strong` = baselines.
|
|
237
|
+
`neutral_light` = reference / background. Apply this consistently across every panel in the figure.
|
|
238
|
+
|
|
239
|
+
**Unified palette policy (recommended for recent Nature Machine Intelligence-style layouts)**
|
|
240
|
+
Do not maximize hue separation by default. In dense multi-panel figures, prefer **one coherent baseline family**
|
|
241
|
+
and **one coherent hero family**, then reserve green/red for delta markers or genuinely signed semantics.
|
|
242
|
+
|
|
243
|
+
```python
|
|
244
|
+
PALETTE_NMI_PASTEL = {
|
|
245
|
+
# Baseline / comparison family (cool blue-grey)
|
|
246
|
+
'baseline_dark': '#484878',
|
|
247
|
+
'baseline_mid': '#7884B4',
|
|
248
|
+
'baseline_soft': '#B4C0E4',
|
|
249
|
+
|
|
250
|
+
# Hero / proposed family (lilac → rose)
|
|
251
|
+
'ours_tiny': '#E4E4F0',
|
|
252
|
+
'ours_base': '#E4CCD8',
|
|
253
|
+
'ours_large': '#F0C0CC',
|
|
254
|
+
|
|
255
|
+
# Background blocks for overview / concept panels
|
|
256
|
+
'bg_lilac': '#E0E0F0',
|
|
257
|
+
'bg_aqua': '#E0F0F0',
|
|
258
|
+
'bg_peach': '#F0E0D0',
|
|
259
|
+
|
|
260
|
+
# Neutral support
|
|
261
|
+
'neutral_light': '#D8D8D8',
|
|
262
|
+
'neutral_mid': '#A8A8A8',
|
|
263
|
+
'neutral_dark': '#606060',
|
|
264
|
+
|
|
265
|
+
# Accent only for directional annotations
|
|
266
|
+
'delta_up': '#2E9E44',
|
|
267
|
+
'delta_down': '#E53935',
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
DEFAULT_COLORS_NMI_PASTEL = [
|
|
271
|
+
PALETTE_NMI_PASTEL['baseline_dark'],
|
|
272
|
+
PALETTE_NMI_PASTEL['baseline_mid'],
|
|
273
|
+
PALETTE_NMI_PASTEL['baseline_soft'],
|
|
274
|
+
PALETTE_NMI_PASTEL['ours_tiny'],
|
|
275
|
+
PALETTE_NMI_PASTEL['ours_base'],
|
|
276
|
+
PALETTE_NMI_PASTEL['ours_large'],
|
|
277
|
+
]
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
Use `DEFAULT_COLORS_NMI_PASTEL` when:
|
|
281
|
+
- comparing related model families such as `Tiny / Base / Large`
|
|
282
|
+
- building 1-page result atlases where multiple panels must feel visually unified
|
|
283
|
+
- matching low-saturation editorial styling rather than maximum category separation
|
|
284
|
+
|
|
285
|
+
**Practical rule**
|
|
286
|
+
The same method family keeps the same hue family in every panel. Do not recolor a model from blue-grey in panel `a`
|
|
287
|
+
to green in panel `d` just because that panel needs more contrast.
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
## Supported chart types
|
|
292
|
+
|
|
293
|
+
| Chart | File | Key pattern |
|
|
294
|
+
|-------|------|-------------|
|
|
295
|
+
| Grouped bar | `tutorials.md` | `ax.bar()` with `x + offset`, legend-only last panel |
|
|
296
|
+
| Stacked bar | `common-patterns.md` | iterate `col_order`, accumulate `bottom` |
|
|
297
|
+
| Horizontal ablation bar | `tutorials.md` | `ax.barh()`, alpha-gradient for completeness encoding |
|
|
298
|
+
| Trend / line | `tutorials.md` + `api.md` | `make_trend()`, `fill_between` for uncertainty shadow |
|
|
299
|
+
| Heatmap (sequential) | `api.md` | `make_heatmap()`, `YlOrRd`, cell annotation with luminance check |
|
|
300
|
+
| Heatmap (diverging / z-score) | `design-theory.md §11` | `RdBu_r`, `vmin=-2.5, vmax=2.5` |
|
|
301
|
+
| Bubble scatter | `design-theory.md §11` | x/y = two compartments, `s=` = third variable |
|
|
302
|
+
| Radar / polar | `chart-types.md` | `projection='polar'`, custom spokes, per-spoke normalization |
|
|
303
|
+
| 3D sphere / illustration | `chart-types.md` | Lambertian shading via ray-cast on numpy grid |
|
|
304
|
+
| Fill-between (stacked area) | `chart-types.md` | hatch for print-safe grayscale |
|
|
305
|
+
| Log-scale bar | `chart-types.md` | `set_yscale('log')`, expand top for annotations |
|
|
306
|
+
| Multi-panel GridSpec | `chart-types.md` | `GridSpec(rows, cols)`, `gs[0, :]` for full-width spans |
|
|
307
|
+
|
|
308
|
+
---
|
|
309
|
+
|
|
310
|
+
## Multi-panel information architecture
|
|
311
|
+
|
|
312
|
+
Each panel in a multi-panel figure must answer a **unique** scientific question.
|
|
313
|
+
Covering any one panel should leave a gap that cannot be recovered from the others.
|
|
314
|
+
|
|
315
|
+
### Three-level progressive complexity (recommended)
|
|
316
|
+
|
|
317
|
+
| Level | Question | Encoding |
|
|
318
|
+
|-------|----------|----------|
|
|
319
|
+
| Overview | "What is the landscape?" | Stacked bar, composition |
|
|
320
|
+
| Deviation | "What is distinctive per group?" | Z-score heatmap, diverging cmap |
|
|
321
|
+
| Relationship | "How do variables co-vary?" | Bubble scatter, correlation |
|
|
322
|
+
|
|
323
|
+
### Common redundancy traps
|
|
324
|
+
|
|
325
|
+
| Trap | Example | Fix |
|
|
326
|
+
|------|---------|-----|
|
|
327
|
+
| Absolute + absolute | Stacked bar (%) + heatmap of same % | Replace heatmap with z-score deviation |
|
|
328
|
+
| Subset of parent | Tumor-only ranked bar is just one column of the stacked bar | Swap for scatter: tumor % vs immune % |
|
|
329
|
+
| Two rankings | Two ranked bars on related metrics | Replace one with bubble scatter |
|
|
330
|
+
| Different chart, same data | Pie + stacked bar | Merge or replace with a relationship plot |
|
|
331
|
+
|
|
332
|
+
### Z-score deviation heatmap
|
|
333
|
+
|
|
334
|
+
```python
|
|
335
|
+
z = (heat - heat.mean(axis=0)) / heat.std(axis=0)
|
|
336
|
+
im = ax.imshow(z.values, cmap='RdBu_r', aspect='auto', vmin=-2.5, vmax=2.5)
|
|
337
|
+
cbar.set_label('Z-score vs pan-cohort mean')
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
`RdBu_r`: red = enriched above average, blue = depleted. Orthogonal to absolute % shown in panel a.
|
|
341
|
+
|
|
342
|
+
### Bubble scatter with quadrant labels
|
|
343
|
+
|
|
344
|
+
```python
|
|
345
|
+
ax.scatter(x, y, s=size_var * scale, c=colors, edgecolors='white', linewidth=0.8, alpha=0.9)
|
|
346
|
+
ax.axvline(np.median(x), lw=1.2, ls='--', color='#767676', alpha=0.6)
|
|
347
|
+
ax.axhline(np.median(y), lw=1.2, ls='--', color='#767676', alpha=0.6)
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
Label quadrants at corners with small grey italic text (`fontsize=7.5, color='#888888', style='italic'`).
|
|
351
|
+
|
|
352
|
+
---
|
|
353
|
+
|
|
354
|
+
## Layout rules
|
|
355
|
+
|
|
356
|
+
### Figure sizes
|
|
357
|
+
|
|
358
|
+
| Type | `figsize` |
|
|
359
|
+
|------|-----------|
|
|
360
|
+
| Multi-metric bar (3–4 metrics + legend panel) | `(28–45, 6–12)` |
|
|
361
|
+
| Grand multi-panel (3 panels, 2-row GridSpec) | `(22, 17)` |
|
|
362
|
+
| Compact single bar | `(9–16, 5–8)` |
|
|
363
|
+
| Trend / line multi-panel | `(14, 4)` or `(9, 8)` |
|
|
364
|
+
| Heatmap single | `(8–20, 5–9)` |
|
|
365
|
+
| Radar polar | `(12, 10)` |
|
|
366
|
+
|
|
367
|
+
**Rule**: width ≈ 3–4× height for comparison bar panels.
|
|
368
|
+
|
|
369
|
+
### Panel labels
|
|
370
|
+
|
|
371
|
+
```python
|
|
372
|
+
ax.text(-0.05, 1.06, 'a', transform=ax.transAxes,
|
|
373
|
+
fontsize=22, fontweight='bold', va='top', ha='right')
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
Use lowercase bold (`a`, `b`, `c`) at top-left of each subplot axes, placed via `transAxes`.
|
|
377
|
+
|
|
378
|
+
### Legend
|
|
379
|
+
|
|
380
|
+
- For multi-axis figures: give the legend its own axis (`ax.set_axis_off()`).
|
|
381
|
+
- Always `frameon=False`.
|
|
382
|
+
- When the legend is large, place it `bbox_to_anchor=(0.5, -0.24), loc='upper center'` below the panel.
|
|
383
|
+
|
|
384
|
+
---
|
|
385
|
+
|
|
386
|
+
## Font size hierarchy
|
|
387
|
+
|
|
388
|
+
| Context | `font.size` |
|
|
389
|
+
|---------|-------------|
|
|
390
|
+
| Base (compact subfigures) | 12–16 |
|
|
391
|
+
| Large bar panels (figsize > 28 in) | 24 |
|
|
392
|
+
| Axis labels (large panels) | 32–54 via per-label override |
|
|
393
|
+
| In-bar / in-cell annotations | 6.5–12 |
|
|
394
|
+
| Panel letter labels | 20–22 |
|
|
395
|
+
| Legend | 8–14 |
|
|
396
|
+
|
|
397
|
+
---
|
|
398
|
+
|
|
399
|
+
## Axes & spines rules
|
|
400
|
+
|
|
401
|
+
```python
|
|
402
|
+
plt.rcParams['axes.spines.right'] = False # always off
|
|
403
|
+
plt.rcParams['axes.spines.top'] = False # always off
|
|
404
|
+
plt.rcParams['legend.frameon'] = False
|
|
405
|
+
|
|
406
|
+
ax.spines['bottom'].set_linewidth(2) # thicker for emphasis
|
|
407
|
+
ax.spines['left'].set_linewidth(2)
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
No gridlines by default. Use sparse `set_yticks` to guide the eye.
|
|
411
|
+
Y-limits tightened to data range — never use `0–100` when all values sit in `80–95`.
|
|
412
|
+
|
|
413
|
+
---
|
|
414
|
+
|
|
415
|
+
## In-cell / in-bar text contrast
|
|
416
|
+
|
|
417
|
+
```python
|
|
418
|
+
def luminance_text_color(hex_color):
|
|
419
|
+
c = hex_color.lstrip('#')
|
|
420
|
+
r, g, b = int(c[0:2],16)/255, int(c[2:4],16)/255, int(c[4:6],16)/255
|
|
421
|
+
return 'white' if 0.299*r + 0.587*g + 0.114*b < 0.5 else '#333333'
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
---
|
|
425
|
+
|
|
426
|
+
## Reproduction checklist
|
|
427
|
+
|
|
428
|
+
- [ ] Core conclusion and panel map are clear before styling
|
|
429
|
+
- [ ] Backend is explicitly Python or R
|
|
430
|
+
- [ ] **Lines 1–3**: `font.family`, `font.sans-serif` (three fonts), `svg.fonttype = 'none'`
|
|
431
|
+
- [ ] Primary output is **SVG** (`bbox_inches='tight'`)
|
|
432
|
+
- [ ] Right and top spines off; `legend.frameon = False`
|
|
433
|
+
- [ ] Font size matches final use: 5–7 pt for dense journal output, larger only for slide-sized panels
|
|
434
|
+
- [ ] Colors come from one coherent palette system: either semantic `PALETTE` or unified `PALETTE_NMI_PASTEL`
|
|
435
|
+
- [ ] Related model sizes / variants share a hue family; do not assign unrelated saturated colors to siblings
|
|
436
|
+
- [ ] Green / red reserved for gains, drops, thresholds, or truly signed semantics
|
|
437
|
+
- [ ] Y-limits tightened to data range
|
|
438
|
+
- [ ] Multi-panel figures: each panel answers a **different** question (anti-redundancy checklist passed)
|
|
439
|
+
- [ ] Panel labels (`a`, `b`, `c`) are bold lowercase and sized for final output
|
|
440
|
+
- [ ] Statistics, `n`, source data, and image-integrity notes are documented when manuscript-facing
|
|
441
|
+
- [ ] `tight_layout(pad=2)` before save
|
|
442
|
+
- [ ] `plt.close(fig)` after save
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: nature-figure
|
|
3
|
+
description: >-
|
|
4
|
+
Submission-grade Nature/high-impact journal figure workflow for Python or R. Use whenever the user asks to create, revise, audit, or polish manuscript figures, multi-panel scientific plots, figures4papers-style matplotlib plots, or journal-ready SVG/PDF/TIFF outputs, especially for Nature-family or other high-impact journals. Before plotting, define the figure's conclusion, evidence logic, export needs, and review risks. If the user has not chosen Python or R, ask "Python or R?" and stop. Use only the selected backend for figure generation, previewing, exporting, and QA. Supports matplotlib/seaborn and ggplot2/patchwork/ComplexHeatmap. Not for dashboards or Illustrator/Figma-first infographics. Also trigger on general academic-writing figure needs even without the word "Nature", such as making figures/plots for a paper, scientific/academic plotting, data visualization for a manuscript, and Chinese phrasings like 论文配图、学术写作配图、科研绘图、科研作图、画图、作图、出图、论文图表、可视化.
|
|
5
|
+
version: 2.0.0
|
|
6
|
+
author: Community contribution, refactored into static/dynamic layers
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Nature Figure Making — Router
|
|
10
|
+
|
|
11
|
+
This skill is split into two layers:
|
|
12
|
+
|
|
13
|
+
- A **static layer** under `static/` that holds versioned, reusable content fragments (the figure contract and default stance, plus a per-backend quick-start for Python and R).
|
|
14
|
+
- A **dynamic layer** (this file plus `manifest.yaml`) that detects the plotting backend and loads only the fragment needed for the current job. The large design, API, pattern, and QA material lives in on-demand references.
|
|
15
|
+
|
|
16
|
+
Do not try to apply the figure logic from memory or from this router. Always load fragments from disk as described below.
|
|
17
|
+
|
|
18
|
+
## Routing protocol
|
|
19
|
+
|
|
20
|
+
Follow these five steps every time the skill is invoked.
|
|
21
|
+
|
|
22
|
+
### 1. Load the manifest and the core layer
|
|
23
|
+
|
|
24
|
+
Read [manifest.yaml](manifest.yaml). It declares the `backend` axis, the allowed values, and the file paths each value maps to.
|
|
25
|
+
|
|
26
|
+
Also read every file listed under `always_load` (`static/core/contract.md` and `static/core/stance.md`). These hold the figure contract, the backend gate, the missing-runtime rule, the privacy rule, and the default operating stance that apply to every figure job.
|
|
27
|
+
|
|
28
|
+
### 2. Resolve the backend — a blocking gate
|
|
29
|
+
|
|
30
|
+
Backend selection blocks everything else. Decide the `backend` value only from an explicit user choice or a clearly language-specific input file/workflow:
|
|
31
|
+
|
|
32
|
+
- `python` — matplotlib / seaborn.
|
|
33
|
+
- `r` — ggplot2 / patchwork / ComplexHeatmap.
|
|
34
|
+
|
|
35
|
+
If the user has **not** explicitly chosen, ask exactly one concise question — **Python or R?** — and stop. Do not default, guess, generate mock data, or write scripts before the answer. Only recommend a backend when the user explicitly asks you to choose; then use `references/backend-selection.md`, state the reason, and proceed. Once selected, the backend is **exclusive** for all drawing, previewing, exporting, and visual QA (see `core/contract.md`).
|
|
36
|
+
|
|
37
|
+
### 3. Load the matching backend fragment
|
|
38
|
+
|
|
39
|
+
After the backend is resolved, Read the mapped fragment (`static/fragments/backend/python.md` or `static/fragments/backend/r.md`). It carries the backend-only execution rule and the publication quick-start (rcParams/theme and export helper). Do **not** load the other backend's fragment.
|
|
40
|
+
|
|
41
|
+
### 4. Build the figure using the loaded material
|
|
42
|
+
|
|
43
|
+
Apply the loaded material in this order:
|
|
44
|
+
|
|
45
|
+
1. Figure contract (`core/contract.md`) — write the core conclusion, map the evidence chain, classify the archetype, set the journal/export contract, before any code.
|
|
46
|
+
2. Default stance (`core/stance.md`) — archetype-first composition, hero panel, restrained palette, statistics/integrity as part of the figure.
|
|
47
|
+
3. Backend fragment — the exclusive Python or R quick-start and execution rule.
|
|
48
|
+
|
|
49
|
+
The chart serves the scientific logic; aesthetic polish is subordinate to making the core conclusion clear, defensible, and reviewable.
|
|
50
|
+
|
|
51
|
+
### 5. Reach for references only when needed
|
|
52
|
+
|
|
53
|
+
The files under `references/` are deep references, not defaults. Open them on demand per the `references.on_demand` table in the manifest — for example `references/figure-contract.md` to build the contract, `references/api.md` for the Python palette and helpers, `references/r-workflow.md` for R, `references/design-theory.md` for color/typography/export rationale, `references/common-patterns.md` and `references/chart-types.md` for layout/chart recipes, `references/nature-2026-observations.md` for real Nature page archetypes, `references/qa-contract.md` before final delivery, and `references/tutorials.md` / `references/demos.md` for worked examples.
|
|
54
|
+
|
|
55
|
+
## Why this split
|
|
56
|
+
|
|
57
|
+
- The static layer is versioned and reviewable. The backend gate is now explicit in the manifest rather than buried in prose.
|
|
58
|
+
- The dynamic layer keeps each invocation cheap: only the selected backend's quick-start enters context, and the 2,600+ lines of reference depth load only when a step needs them.
|
|
59
|
+
- The router itself is short on purpose. Update fragments and references, not this file, when adding scope.
|
|
60
|
+
- This structure mirrors `nature-writing`, `nature-polishing`, `nature-reader`, and `nature-paper2ppt`.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/Dispersion_motivation.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/RNAGenScape_schematic.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import numpy as np
|
|
3
|
+
from matplotlib import pyplot as plt
|
|
4
|
+
from matplotlib import gridspec as gridspec
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
data_ablation = {
|
|
8
|
+
'methods': [
|
|
9
|
+
r'CellSpliceNet',
|
|
10
|
+
r'No Expression',
|
|
11
|
+
r'No Structure',
|
|
12
|
+
r'No ROI',
|
|
13
|
+
r'No Sequence',
|
|
14
|
+
],
|
|
15
|
+
'colors': ['#0F4D92', '#B4E6B4', '#AFE6E6', '#FFE080', '#D3D3D3'],
|
|
16
|
+
'result': np.array([0.88, 0.84, 0.82, 0.81, 0.74]),
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
def is_dark(color_in_hex, threshold=128):
|
|
20
|
+
color = color_in_hex.lstrip('#')
|
|
21
|
+
r = int(color[0:2], 16)
|
|
22
|
+
g = int(color[2:4], 16)
|
|
23
|
+
b = int(color[4:6], 16)
|
|
24
|
+
|
|
25
|
+
luminance = 0.299*r + 0.587*g + 0.114*b
|
|
26
|
+
return luminance < threshold
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
if __name__ == '__main__':
|
|
30
|
+
plt.rcParams['font.family'] = 'helvetica'
|
|
31
|
+
plt.rcParams['font.size'] = 24
|
|
32
|
+
plt.rcParams['axes.spines.right'] = False
|
|
33
|
+
plt.rcParams['axes.spines.top'] = False
|
|
34
|
+
plt.rcParams['axes.linewidth'] = 3
|
|
35
|
+
|
|
36
|
+
fig = plt.figure(figsize=(13, 13))
|
|
37
|
+
|
|
38
|
+
ax = fig.add_subplot(1, 1, 1)
|
|
39
|
+
num_methods = len(data_ablation['methods'])
|
|
40
|
+
bars = ax.bar(
|
|
41
|
+
np.arange(num_methods),
|
|
42
|
+
data_ablation['result'],
|
|
43
|
+
color=data_ablation['colors'],
|
|
44
|
+
label=data_ablation['methods'],
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
for i, (bar, value) in enumerate(zip(bars, data_ablation['result'])):
|
|
48
|
+
textcolor = 'white' if is_dark(data_ablation['colors'][i]) else 'black'
|
|
49
|
+
ax.text(bar.get_x() + bar.get_width()/2, bar.get_height() - 0.08,
|
|
50
|
+
f'{value:.2f}', ha='center', va='bottom', fontsize=32, color=textcolor)
|
|
51
|
+
|
|
52
|
+
# Add horizontal reference line at the first bar
|
|
53
|
+
baseline = data_ablation['result'][0] # 0.88
|
|
54
|
+
ax.axhline(y=baseline, color=data_ablation['colors'][0], linestyle='--', linewidth=4, alpha=0.7)
|
|
55
|
+
|
|
56
|
+
# Add arrows and reduction values for bars 2-5 (skip the first bar)
|
|
57
|
+
for i in range(1, num_methods):
|
|
58
|
+
bar = bars[i]
|
|
59
|
+
current_value = data_ablation['result'][i]
|
|
60
|
+
reduction = baseline - current_value
|
|
61
|
+
|
|
62
|
+
# Position for the arrow (right side of the bar)
|
|
63
|
+
x_pos = bar.get_x() + bar.get_width()
|
|
64
|
+
|
|
65
|
+
# Draw arrow from baseline down to bar top (top to bottom)
|
|
66
|
+
ax.annotate('', xy=(x_pos, current_value), xytext=(x_pos, baseline),
|
|
67
|
+
arrowprops=dict(arrowstyle='->', color='red', lw=4))
|
|
68
|
+
|
|
69
|
+
# Add reduction text near the top (at baseline level)
|
|
70
|
+
ax.text(x_pos - 0.3, baseline + 0.005, r'$-$'+f'{reduction:.2f}',
|
|
71
|
+
ha='left', va='bottom', fontsize=24, color='red')
|
|
72
|
+
|
|
73
|
+
ax.set_ylabel('Spearman correlation', fontsize=54, labelpad=12)
|
|
74
|
+
ymax = np.max(data_ablation['result'][:])
|
|
75
|
+
ax.set_ylim([0.0, ymax + 0.5])
|
|
76
|
+
ax.set_yticks([0.0, 0.25, 0.50, 0.75, 1.0])
|
|
77
|
+
ax.tick_params(axis='y', labelsize=36, length=10, width=2)
|
|
78
|
+
ax.set_xticks([])
|
|
79
|
+
|
|
80
|
+
ax.legend(bbox_to_anchor=(0.50, 1.08), loc='upper left', fontsize=36, frameon=False)
|
|
81
|
+
|
|
82
|
+
fig.tight_layout(pad=2)
|
|
83
|
+
|
|
84
|
+
os.makedirs('./figures/', exist_ok=True)
|
|
85
|
+
fig.savefig('./figures/ablation.png', dpi=300)
|
|
86
|
+
plt.close(fig)
|