@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
package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/plot_bars.py
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import numpy as np
|
|
3
|
+
from matplotlib import pyplot as plt
|
|
4
|
+
from raw_data import data_comparison_IEDB, data_ablation_IEDB, data_comparison_Cancer, data_ablation_Cancer
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def decode_ablation(data_dict):
|
|
8
|
+
binary_list = data_dict['ablations']
|
|
9
|
+
component_str = data_dict['components']
|
|
10
|
+
decoded_list = []
|
|
11
|
+
for binary_code in binary_list:
|
|
12
|
+
assert len(binary_code) == len(component_str)
|
|
13
|
+
decoded_str = []
|
|
14
|
+
for i, c in enumerate(binary_code):
|
|
15
|
+
if c == '1':
|
|
16
|
+
decoded_str.append(component_str[i])
|
|
17
|
+
decoded_list.append(' + '.join(decoded_str))
|
|
18
|
+
return decoded_list
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
if __name__ == '__main__':
|
|
22
|
+
plt.rcParams['font.family'] = 'helvetica'
|
|
23
|
+
plt.rcParams['font.size'] = 24
|
|
24
|
+
plt.rcParams['axes.spines.right'] = False
|
|
25
|
+
plt.rcParams['axes.spines.top'] = False
|
|
26
|
+
plt.rcParams['axes.linewidth'] = 3
|
|
27
|
+
plt.rcParams['svg.fonttype'] = 'none'
|
|
28
|
+
|
|
29
|
+
fig = plt.figure(figsize=(28, 6))
|
|
30
|
+
|
|
31
|
+
ax = fig.add_subplot(1, 4, 1)
|
|
32
|
+
ax.bar(range(len(data_comparison_IEDB['mean'])),
|
|
33
|
+
data_comparison_IEDB['mean'][:, 0],
|
|
34
|
+
yerr=data_comparison_IEDB['std'][:, 0],
|
|
35
|
+
capsize=5,
|
|
36
|
+
color=data_comparison_IEDB['colors'],
|
|
37
|
+
label=data_comparison_IEDB['methods'])
|
|
38
|
+
handles, labels = ax.get_legend_handles_labels()
|
|
39
|
+
ax.set_xticks([])
|
|
40
|
+
ax.set_ylim([0.5, 0.9])
|
|
41
|
+
ax.set_ylabel(data_comparison_IEDB['metrics'][0], fontsize=32)
|
|
42
|
+
|
|
43
|
+
ax = fig.add_subplot(1, 4, 2)
|
|
44
|
+
ax.bar(range(len(data_comparison_IEDB['mean'])),
|
|
45
|
+
data_comparison_IEDB['mean'][:, 1],
|
|
46
|
+
yerr=data_comparison_IEDB['std'][:, 1],
|
|
47
|
+
capsize=5,
|
|
48
|
+
color=data_comparison_IEDB['colors'])
|
|
49
|
+
ax.set_xticks([])
|
|
50
|
+
ax.set_ylim([0.15, 0.75])
|
|
51
|
+
ax.set_ylabel(data_comparison_IEDB['metrics'][1], fontsize=32)
|
|
52
|
+
|
|
53
|
+
ax = fig.add_subplot(1, 4, 3)
|
|
54
|
+
ax.bar(range(len(data_comparison_IEDB['mean'])),
|
|
55
|
+
data_comparison_IEDB['mean'][:, 2],
|
|
56
|
+
yerr=data_comparison_IEDB['std'][:, 2],
|
|
57
|
+
capsize=5,
|
|
58
|
+
color=data_comparison_IEDB['colors'])
|
|
59
|
+
ax.set_xticks([])
|
|
60
|
+
ax.set_ylim([0.18, 0.55])
|
|
61
|
+
ax.set_ylabel(data_comparison_IEDB['metrics'][2], fontsize=32)
|
|
62
|
+
|
|
63
|
+
ax = fig.add_subplot(1, 4, 4)
|
|
64
|
+
ax.legend(handles, labels)
|
|
65
|
+
ax.set_axis_off()
|
|
66
|
+
|
|
67
|
+
fig.tight_layout(pad=2)
|
|
68
|
+
|
|
69
|
+
os.makedirs('./figures/', exist_ok=True)
|
|
70
|
+
fig.savefig('./figures/bars_comparison_IEDB.png', dpi=600)
|
|
71
|
+
plt.close(fig)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
fig = plt.figure(figsize=(24, 8))
|
|
75
|
+
|
|
76
|
+
ax = fig.add_subplot(1, 3, 1)
|
|
77
|
+
ax.barh(range(len(data_ablation_IEDB['mean'][:, 0])),
|
|
78
|
+
data_ablation_IEDB['mean'][:, 0],
|
|
79
|
+
xerr=data_ablation_IEDB['std'][:, 0],
|
|
80
|
+
color=[(0.215686, 0.458824, 0.729412, alpha) for alpha in np.linspace(0.2, 1.0, 12)],
|
|
81
|
+
ecolor='k',
|
|
82
|
+
capsize=5,
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
ax.set_yticks(range(len(data_ablation_IEDB['ablations'])))
|
|
86
|
+
ax.set_yticklabels(decode_ablation(data_ablation_IEDB))
|
|
87
|
+
ax.set_xlim([0.75, 0.9])
|
|
88
|
+
ax.set_xticks([0.75, 0.8, 0.85, 0.9])
|
|
89
|
+
ax.set_xticklabels([0.75, 0.8, 0.85, 0.9])
|
|
90
|
+
ax.set_xlabel(data_ablation_IEDB['metrics'][0], fontsize=32)
|
|
91
|
+
|
|
92
|
+
ax = fig.add_subplot(1, 3, 2)
|
|
93
|
+
ax.barh(range(len(data_ablation_IEDB['mean'][:, 1])),
|
|
94
|
+
data_ablation_IEDB['mean'][:, 1],
|
|
95
|
+
xerr=data_ablation_IEDB['std'][:, 1],
|
|
96
|
+
color=[(0.215686, 0.458824, 0.729412, alpha) for alpha in np.linspace(0.2, 1.0, 12)],
|
|
97
|
+
ecolor='k',
|
|
98
|
+
capsize=5,
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
ax.set_yticks([])
|
|
102
|
+
ax.set_xlim([0.4, 0.72])
|
|
103
|
+
ax.set_xticks([0.4, 0.5, 0.6, 0.7])
|
|
104
|
+
ax.set_xticklabels([0.4, 0.5, 0.6, 0.7])
|
|
105
|
+
ax.set_xlabel(data_ablation_IEDB['metrics'][1], fontsize=32)
|
|
106
|
+
|
|
107
|
+
ax = fig.add_subplot(1, 3, 3)
|
|
108
|
+
ax.barh(range(len(data_ablation_IEDB['mean'][:, 2])),
|
|
109
|
+
data_ablation_IEDB['mean'][:, 2],
|
|
110
|
+
xerr=data_ablation_IEDB['std'][:, 2],
|
|
111
|
+
color=[(0.215686, 0.458824, 0.729412, alpha) for alpha in np.linspace(0.2, 1.0, 12)],
|
|
112
|
+
ecolor='k',
|
|
113
|
+
capsize=5,
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
ax.set_yticks([])
|
|
117
|
+
ax.set_xlim([0.4, 0.55])
|
|
118
|
+
ax.set_xticks([0.4, 0.45, 0.5, 0.55])
|
|
119
|
+
ax.set_xticklabels([0.4, 0.45, 0.5, 0.55])
|
|
120
|
+
ax.set_xlabel(data_ablation_IEDB['metrics'][2], fontsize=32)
|
|
121
|
+
|
|
122
|
+
fig.tight_layout(pad=2)
|
|
123
|
+
os.makedirs('./figures/', exist_ok=True)
|
|
124
|
+
fig.savefig('./figures/bars_ablation_IEDB.png', dpi=600)
|
|
125
|
+
plt.close(fig)
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
fig = plt.figure(figsize=(28, 6))
|
|
129
|
+
|
|
130
|
+
ax = fig.add_subplot(1, 4, 1)
|
|
131
|
+
ax.bar(range(len(data_comparison_Cancer['mean'])),
|
|
132
|
+
data_comparison_Cancer['mean'][:, 0],
|
|
133
|
+
yerr=data_comparison_Cancer['std'][:, 0],
|
|
134
|
+
capsize=5,
|
|
135
|
+
color=data_comparison_Cancer['colors'],
|
|
136
|
+
label=data_comparison_Cancer['methods'])
|
|
137
|
+
handles, labels = ax.get_legend_handles_labels()
|
|
138
|
+
ax.set_xticks([])
|
|
139
|
+
ax.set_ylim([0.5, 0.82])
|
|
140
|
+
ax.set_ylabel(data_comparison_Cancer['metrics'][0], fontsize=32)
|
|
141
|
+
|
|
142
|
+
ax = fig.add_subplot(1, 4, 2)
|
|
143
|
+
ax.bar(range(len(data_comparison_Cancer['mean'])),
|
|
144
|
+
data_comparison_Cancer['mean'][:, 1],
|
|
145
|
+
yerr=data_comparison_Cancer['std'][:, 1],
|
|
146
|
+
capsize=5,
|
|
147
|
+
color=data_comparison_Cancer['colors'])
|
|
148
|
+
ax.set_xticks([])
|
|
149
|
+
ax.set_ylim([0.16, 0.52])
|
|
150
|
+
ax.set_ylabel(data_comparison_Cancer['metrics'][1], fontsize=32)
|
|
151
|
+
|
|
152
|
+
ax = fig.add_subplot(1, 4, 3)
|
|
153
|
+
ax.bar(range(len(data_comparison_Cancer['mean'])),
|
|
154
|
+
data_comparison_Cancer['mean'][:, 2],
|
|
155
|
+
yerr=data_comparison_Cancer['std'][:, 2],
|
|
156
|
+
capsize=5,
|
|
157
|
+
color=data_comparison_Cancer['colors'])
|
|
158
|
+
ax.set_xticks([])
|
|
159
|
+
ax.set_ylim([0.14, 0.44])
|
|
160
|
+
ax.set_ylabel(data_comparison_Cancer['metrics'][2], fontsize=32)
|
|
161
|
+
|
|
162
|
+
ax = fig.add_subplot(1, 4, 4)
|
|
163
|
+
ax.legend(handles, labels)
|
|
164
|
+
ax.set_axis_off()
|
|
165
|
+
|
|
166
|
+
fig.tight_layout(pad=2)
|
|
167
|
+
|
|
168
|
+
os.makedirs('./figures/', exist_ok=True)
|
|
169
|
+
fig.savefig('./figures/bars_comparison_Cancer.png', dpi=600)
|
|
170
|
+
plt.close(fig)
|
|
171
|
+
|
|
172
|
+
fig = plt.figure(figsize=(28, 6))
|
|
173
|
+
|
|
174
|
+
items_shown = [6, 4, 0] # transfer + contrastive, transfer, none
|
|
175
|
+
|
|
176
|
+
ax = fig.add_subplot(1, 4, 1)
|
|
177
|
+
ax.bar(range(len(items_shown)),
|
|
178
|
+
data_ablation_Cancer['mean'][:, 0][items_shown],
|
|
179
|
+
yerr=data_ablation_Cancer['std'][:, 0][items_shown],
|
|
180
|
+
capsize=5,
|
|
181
|
+
color=[(0.215686, 0.458824, 0.729412, alpha) for alpha in [1.0, 0.7, 0.4]],
|
|
182
|
+
label=['ImmunoStruct', 'No Contrastive Learning',
|
|
183
|
+
'No Contrastive Learning &\nNo Transfer Learning'])
|
|
184
|
+
handles, labels = ax.get_legend_handles_labels()
|
|
185
|
+
ax.set_xticks([])
|
|
186
|
+
ax.set_ylim([0.68, 0.80])
|
|
187
|
+
ax.set_ylabel(data_ablation_Cancer['metrics'][0], fontsize=32)
|
|
188
|
+
|
|
189
|
+
ax = fig.add_subplot(1, 4, 2)
|
|
190
|
+
ax.bar(range(len(items_shown)),
|
|
191
|
+
data_ablation_Cancer['mean'][:, 1][items_shown],
|
|
192
|
+
yerr=data_ablation_Cancer['std'][:, 1][items_shown],
|
|
193
|
+
capsize=5,
|
|
194
|
+
color=[(0.215686, 0.458824, 0.729412, alpha) for alpha in [1.0, 0.7, 0.4]])
|
|
195
|
+
ax.set_xticks([])
|
|
196
|
+
ax.set_ylim([0.30, 0.52])
|
|
197
|
+
ax.set_ylabel(data_ablation_Cancer['metrics'][1], fontsize=32)
|
|
198
|
+
|
|
199
|
+
ax = fig.add_subplot(1, 4, 3)
|
|
200
|
+
ax.bar(range(len(items_shown)),
|
|
201
|
+
data_ablation_Cancer['mean'][:, 2][items_shown],
|
|
202
|
+
yerr=data_ablation_Cancer['std'][:, 2][items_shown],
|
|
203
|
+
capsize=5,
|
|
204
|
+
color=[(0.215686, 0.458824, 0.729412, alpha) for alpha in [1.0, 0.7, 0.4]])
|
|
205
|
+
ax.set_xticks([])
|
|
206
|
+
ax.set_ylim([0.29, 0.43])
|
|
207
|
+
ax.set_ylabel(data_ablation_Cancer['metrics'][2], fontsize=32)
|
|
208
|
+
|
|
209
|
+
ax = fig.add_subplot(1, 4, 4)
|
|
210
|
+
ax.legend(handles, labels)
|
|
211
|
+
ax.set_axis_off()
|
|
212
|
+
|
|
213
|
+
fig.tight_layout(pad=2)
|
|
214
|
+
os.makedirs('./figures/', exist_ok=True)
|
|
215
|
+
fig.savefig('./figures/bars_ablation_Cancer.png', dpi=600)
|
|
216
|
+
plt.close(fig)
|
package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/raw_data.py
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
data_comparison_IEDB = {
|
|
5
|
+
'methods': [r'Prime-2.1', r'NetMHCpan', r'MHCnuggets', r'MHCflurry', r'DeepNeo',
|
|
6
|
+
r'BigMHC-EL', r'BigMHC-IM', r'BigMHC$_\text{retrained}$', r'ImmunoStruct (ours)'],
|
|
7
|
+
'colors': ['#CFCECE', '#F4EEAC', '#FBDFE2', '#D9B9D4', '#DAA87C', '#DDF3DE', '#AADCA9', '#8BCF8B', '#3775BA'],
|
|
8
|
+
'metrics': ['AUROC', 'AUPRC', 'Mean PPVn'],
|
|
9
|
+
'mean': np.array([
|
|
10
|
+
[0.538, 0.212, 0.207],
|
|
11
|
+
[0.537, 0.214, 0.220],
|
|
12
|
+
[0.546, 0.246, 0.233],
|
|
13
|
+
[0.577, 0.260, 0.273],
|
|
14
|
+
[0.767, 0.438, 0.411],
|
|
15
|
+
[0.588, 0.269, 0.290],
|
|
16
|
+
[0.684, 0.319, 0.333],
|
|
17
|
+
[0.793, 0.462, 0.445],
|
|
18
|
+
[0.882, 0.696, 0.514],
|
|
19
|
+
]),
|
|
20
|
+
'std': np.array([
|
|
21
|
+
[0.012, 0.031, 0.028 / np.sqrt(5)],
|
|
22
|
+
[0.027, 0.020, 0.018 / np.sqrt(5)],
|
|
23
|
+
[0.023, 0.019, 0.031 / np.sqrt(5)],
|
|
24
|
+
[0.021, 0.026, 0.028 / np.sqrt(5)],
|
|
25
|
+
[0.032, 0.024, 0.017 / np.sqrt(5)],
|
|
26
|
+
[0.018, 0.016, 0.024 / np.sqrt(5)],
|
|
27
|
+
[0.028, 0.048, 0.034 / np.sqrt(5)],
|
|
28
|
+
[0.013, 0.027, 0.009 / np.sqrt(5)],
|
|
29
|
+
[0.005, 0.020, 0.021 / np.sqrt(5)],
|
|
30
|
+
]),
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
data_ablation_IEDB = {
|
|
34
|
+
'ablations': ['10000', '01000', '11000', '01100', '11100', '11110',
|
|
35
|
+
'10001', '01001', '11001', '01101', '11101', '11111'],
|
|
36
|
+
'components': ['Structure', 'Sequence', 'Bchems', 'MMA', 'Transfer Learning'],
|
|
37
|
+
'metrics': ['AUROC', 'AUPRC', 'Mean PPVn'],
|
|
38
|
+
'mean': np.array([
|
|
39
|
+
[0.775, 0.442, 0.433],
|
|
40
|
+
[0.842, 0.553, 0.430],
|
|
41
|
+
[0.840, 0.547, 0.444],
|
|
42
|
+
[0.842, 0.554, 0.419],
|
|
43
|
+
[0.840, 0.547, 0.440],
|
|
44
|
+
[0.860, 0.615, 0.462],
|
|
45
|
+
[0.805, 0.497, 0.414],
|
|
46
|
+
[0.845, 0.568, 0.427],
|
|
47
|
+
[0.844, 0.569, 0.440],
|
|
48
|
+
[0.844, 0.561, 0.442],
|
|
49
|
+
[0.840, 0.554, 0.441],
|
|
50
|
+
[0.882, 0.696, 0.514],
|
|
51
|
+
]),
|
|
52
|
+
'std': np.array([
|
|
53
|
+
[0.012, 0.022, 0.020 / np.sqrt(5)],
|
|
54
|
+
[0.006, 0.014, 0.009 / np.sqrt(5)],
|
|
55
|
+
[0.007, 0.024, 0.028 / np.sqrt(5)],
|
|
56
|
+
[0.006, 0.020, 0.017 / np.sqrt(5)],
|
|
57
|
+
[0.006, 0.018, 0.032 / np.sqrt(5)],
|
|
58
|
+
[0.013, 0.045, 0.015 / np.sqrt(5)],
|
|
59
|
+
[0.006, 0.022, 0.027 / np.sqrt(5)],
|
|
60
|
+
[0.007, 0.024, 0.017 / np.sqrt(5)],
|
|
61
|
+
[0.005, 0.014, 0.035 / np.sqrt(5)],
|
|
62
|
+
[0.006, 0.017, 0.024 / np.sqrt(5)],
|
|
63
|
+
[0.006, 0.028, 0.029 / np.sqrt(5)],
|
|
64
|
+
[0.005, 0.020, 0.021 / np.sqrt(5)],
|
|
65
|
+
]),
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
data_comparison_Cancer = {
|
|
70
|
+
'methods': [r'Prime-2.1', r'NetMHCpan', r'MHCnuggets', r'MHCflurry', r'DeepNeo',
|
|
71
|
+
r'BigMHC-EL', r'BigMHC-IM', r'BigMHC$_\text{retrained}$', r'NeoaPred',
|
|
72
|
+
r'ImmunoStruct (ours)'],
|
|
73
|
+
'colors': ['#CFCECE', '#F4EEAC', '#FBDFE2', '#D9B9D4', '#DAA87C', '#DDF3DE', '#AADCA9', '#8BCF8B', "#92E3F9", '#3775BA'],
|
|
74
|
+
'metrics': ['AUROC', 'AUPRC', 'Mean PPVn'],
|
|
75
|
+
'mean': np.array([
|
|
76
|
+
[0.645, 0.259, 0.295],
|
|
77
|
+
[0.559, 0.210, 0.211],
|
|
78
|
+
[0.530, 0.210, 0.175],
|
|
79
|
+
[0.658, 0.304, 0.329],
|
|
80
|
+
[0.535, 0.261, 0.222],
|
|
81
|
+
[0.632, 0.248, 0.245],
|
|
82
|
+
[0.771, 0.373, 0.357],
|
|
83
|
+
[0.682, 0.310, 0.325],
|
|
84
|
+
[0.556, 0.267, 0.292],
|
|
85
|
+
[0.771, 0.433, 0.364],
|
|
86
|
+
]),
|
|
87
|
+
'std': np.array([
|
|
88
|
+
[0.026, 0.023, 0.029 / np.sqrt(5)],
|
|
89
|
+
[0.049, 0.037, 0.045 / np.sqrt(5)],
|
|
90
|
+
[0.014, 0.017, 0.023 / np.sqrt(5)],
|
|
91
|
+
[0.015, 0.032, 0.030 / np.sqrt(5)],
|
|
92
|
+
[0.016, 0.053, 0.070 / np.sqrt(5)],
|
|
93
|
+
[0.034, 0.039, 0.042 / np.sqrt(5)],
|
|
94
|
+
[0.040, 0.062, 0.036 / np.sqrt(5)],
|
|
95
|
+
[0.012, 0.020, 0.030 / np.sqrt(5)],
|
|
96
|
+
[0.016, 0.022, 0.081 / np.sqrt(5)],
|
|
97
|
+
[0.024, 0.069, 0.127 / np.sqrt(5)],
|
|
98
|
+
]),
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
data_ablation_Cancer = {
|
|
102
|
+
'coeffs': [[False, 0], [False, 0.001], [False, 0.01], [False, 0.1],
|
|
103
|
+
[True, 0], [True, 0.001], [True, 0.01], [True, 0.1]],
|
|
104
|
+
'metrics': ['AUROC', 'AUPRC', 'Mean PPVn'],
|
|
105
|
+
'mean': np.array([
|
|
106
|
+
[0.723, 0.391, 0.358],
|
|
107
|
+
[0.712, 0.370, 0.331],
|
|
108
|
+
[0.727, 0.405, 0.387],
|
|
109
|
+
[0.700, 0.413, 0.354],
|
|
110
|
+
[0.756, 0.426, 0.362],
|
|
111
|
+
[0.762, 0.418, 0.351],
|
|
112
|
+
[0.771, 0.433, 0.365],
|
|
113
|
+
[0.725, 0.406, 0.348],
|
|
114
|
+
]),
|
|
115
|
+
'std': np.array([
|
|
116
|
+
[0.027, 0.068, 0.096 / np.sqrt(5)],
|
|
117
|
+
[0.040, 0.077, 0.114 / np.sqrt(5)],
|
|
118
|
+
[0.037, 0.080, 0.111 / np.sqrt(5)],
|
|
119
|
+
[0.036, 0.081, 0.109 / np.sqrt(5)],
|
|
120
|
+
[0.031, 0.068, 0.103 / np.sqrt(5)],
|
|
121
|
+
[0.024, 0.064, 0.151 / np.sqrt(5)],
|
|
122
|
+
[0.024, 0.069, 0.127 / np.sqrt(5)],
|
|
123
|
+
[0.035, 0.079, 0.129 / np.sqrt(5)],
|
|
124
|
+
]),
|
|
125
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import numpy as np
|
|
3
|
+
import matplotlib as mpl
|
|
4
|
+
import matplotlib.pyplot as plt
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
summary_label = r'\textit{Improvement}'
|
|
8
|
+
options = ['VAE', 'DDPM', 'LDM', 'FM',
|
|
9
|
+
'DiffAb', 'IgLM', 'NOS-C', 'NOS-D',
|
|
10
|
+
'OAE + gradient ascent',
|
|
11
|
+
'OAE + MCMC',
|
|
12
|
+
'OAE + hill climbing',
|
|
13
|
+
'OAE + stochastic hill climbing',
|
|
14
|
+
r'$\texttt{RNAGenScape}$ \textbf{(ours)}',
|
|
15
|
+
summary_label]
|
|
16
|
+
colors = ["#cdcdcd", "#767676", "#4d4d4d", "#272727",
|
|
17
|
+
"#c4ece7", "#ecc4c4", "#ecc4e7", "#ea84dd",
|
|
18
|
+
"#d5e29b", "#bdd35c", "#9fbc1d", "#8ead03",
|
|
19
|
+
"#0f4d92"]
|
|
20
|
+
xlabel = np.arange(len(options))
|
|
21
|
+
xticks = []
|
|
22
|
+
results_inference = [0.13, 0.91, 0.74, 5.82, 41.04, 157.57, 0.99, 0.96,
|
|
23
|
+
0.50, 10.93, 81.52, 99.66, 0.57]
|
|
24
|
+
results_openvaccine_delta_pos = [-0.23, -0.33, -0.07, -0.34, 0.06, 0.24, 0.09, 0.18,
|
|
25
|
+
-0.01, -0.11, 0.40, -0.12, 0.54]
|
|
26
|
+
results_openvaccine_pct_pos = [42.1, 33.8, 47.5, 32.5, 55.0, 63.1, 54.6, 58.3,
|
|
27
|
+
51.0, 45.1, 69.2, 43.5, 77.5]
|
|
28
|
+
results_openvaccine_delta_neg = [-0.23, -0.33, -0.07, -0.34, 0.11, 0.01, -2.25, -0.29,
|
|
29
|
+
-0.19, -0.19, -0.29, -0.15, -2.81]
|
|
30
|
+
results_openvaccine_pct_neg = [57.9, 66.2, 52.5, 67.5, 44.0, 49.6, 90.6, 65.4,
|
|
31
|
+
61.3, 57.7, 64.2, 60.0, 97.9]
|
|
32
|
+
results_zebrafish_delta_pos = [-0.01, 0.29, -0.95, 0.32, -0.21, -0.57, 0.03, 0.31,
|
|
33
|
+
-1.21, -0.20, 0.76, 0.32, 0.77]
|
|
34
|
+
results_zebrafish_pct_pos = [49.4, 58.2, 22.5, 59.8, 36.3, 32., 51.1, 57.9,
|
|
35
|
+
18.0, 44.3, 74.4, 60.3, 75.0]
|
|
36
|
+
results_zebrafish_delta_neg = [-0.01, 0.29, -0.95, 0.32, -0.21, -0.83, -1.07, 0.38,
|
|
37
|
+
-0.33, -0.37, -0.87, -0.80, -1.29]
|
|
38
|
+
results_zebrafish_pct_neg = [50.6, 41.8, 77.5, 40.2, 60.8, 74.3, 80.8, 40.2,
|
|
39
|
+
66.5, 60.1, 75.2, 73.7, 85.1]
|
|
40
|
+
results_ribosome_delta_pos = [-0.24, -0.11, -0.24, -0.10, -0.05, 0.63, 0.08, -0.09,
|
|
41
|
+
0.43, -0.19, 0.53, 0.19, 0.63]
|
|
42
|
+
results_ribosome_pct_pos = [41.7, 45.9, 41.8, 46.4, 45.0, 80.5, 53.6, 46.5,
|
|
43
|
+
73.6, 43.0, 83.0, 60.4, 81.4]
|
|
44
|
+
results_ribosome_delta_neg = [-0.24, -0.11, -0.24, -0.10, -0.04, -0.51, 0.10, -0.10,
|
|
45
|
+
-0.05, -0.10, -0.06, -0.05, -0.58]
|
|
46
|
+
results_ribosome_pct_neg = [58.3, 54.1, 58.2, 53.6, 54.2, 65.5, 46.0, 53.6,
|
|
47
|
+
55.7, 54.2, 56.1, 55.2, 67.8]
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
if __name__ == '__main__':
|
|
51
|
+
PLOT_DE_NOVO_SPEED = False
|
|
52
|
+
|
|
53
|
+
plt.rcParams['text.usetex'] = True
|
|
54
|
+
plt.rcParams['font.family'] = 'helvetica'
|
|
55
|
+
plt.rcParams['font.size'] = 16
|
|
56
|
+
plt.rcParams['axes.spines.right'] = False
|
|
57
|
+
plt.rcParams['axes.spines.top'] = False
|
|
58
|
+
plt.rcParams['axes.linewidth'] = 2
|
|
59
|
+
|
|
60
|
+
fig = plt.figure(figsize=(9, 5))
|
|
61
|
+
ax = fig.add_subplot(1, 1, 1)
|
|
62
|
+
|
|
63
|
+
if PLOT_DE_NOVO_SPEED:
|
|
64
|
+
ax.bar(np.arange(len(options)), 1 / np.array(results_inference), color=colors, label=options)
|
|
65
|
+
ax.hlines(y=1 / results_inference[-1], xmin=-1, xmax=len(options), color=colors[-1], linestyle='--')
|
|
66
|
+
ax.set_xlim([-1, len(options)])
|
|
67
|
+
ax.legend(loc='upper right', frameon=False, fontsize=12)
|
|
68
|
+
ax.set_xticks([])
|
|
69
|
+
ax.set_ylabel('Inference Throughput ' + r'$\uparrow$' +'\n(samples / ms)', fontsize=18)
|
|
70
|
+
|
|
71
|
+
# Add braces.
|
|
72
|
+
ymin, ymax = ax.get_ylim()
|
|
73
|
+
ax.set_ylim(ymin - 1, ymax)
|
|
74
|
+
len_de_novo = 4
|
|
75
|
+
mid_de_novo = 0 + (len_de_novo - 0) / 2
|
|
76
|
+
start_opt = len_de_novo + 1
|
|
77
|
+
end_opt = len(options) - 1
|
|
78
|
+
mid_opt = (start_opt + end_opt) / 2
|
|
79
|
+
ax.text(mid_de_novo, ymin - 0.3,
|
|
80
|
+
r'$\underbrace{\rule{5cm}{0pt}}_{\textrm{\textit{de\ novo}\ generative\ models}}$',
|
|
81
|
+
ha='center', va='top', fontsize=14)
|
|
82
|
+
ax.text(mid_opt, ymin - 0.3,
|
|
83
|
+
r'$\underbrace{\rule{9.2cm}{0pt}}_{\textrm{property\ optimization\ methods}}$',
|
|
84
|
+
ha='center', va='top', fontsize=14)
|
|
85
|
+
ax.spines['bottom'].set_position(('data', 0))
|
|
86
|
+
ax.xaxis.set_ticks_position('bottom')
|
|
87
|
+
ax.spines['bottom'].set_linewidth(2)
|
|
88
|
+
ax.spines['left'].set_bounds(0, ymax)
|
|
89
|
+
|
|
90
|
+
else:
|
|
91
|
+
# speed_values = 1 / np.array(results_inference[4:])
|
|
92
|
+
# options_speed = options[4:-1]
|
|
93
|
+
# ax.bar(np.arange(len(options_speed)), speed_values, color=colors[4:], label=options_speed)
|
|
94
|
+
speed_values = 1 / np.array(results_inference[4:8] + [results_inference[-1]])
|
|
95
|
+
options_speed = options[4:8] + [options[-2]]
|
|
96
|
+
ax.bar(np.arange(len(options_speed)), speed_values, color=colors[4:8] + [colors[-1]], label=options_speed)
|
|
97
|
+
ax.set_xlim([-1, len(options_speed)])
|
|
98
|
+
ax.legend(loc='upper left', frameon=False, fontsize=16, ncol=1)
|
|
99
|
+
ax.set_xticks([])
|
|
100
|
+
ax.set_ylabel('Inference Throughput ' + r'$\uparrow$' +'\n(samples / ms)', fontsize=18)
|
|
101
|
+
ax.set_yscale('log')
|
|
102
|
+
ymin, ymax = ax.get_ylim()
|
|
103
|
+
ax.set_ylim(ymin, ymax * 20)
|
|
104
|
+
|
|
105
|
+
# Add numbers on top of bars
|
|
106
|
+
for i, val in enumerate(speed_values):
|
|
107
|
+
ax.text(i, val * 1.1, f'{val:.3f}', ha='center', va='bottom', fontsize=16)
|
|
108
|
+
|
|
109
|
+
fig.tight_layout(pad=1)
|
|
110
|
+
os.makedirs('./figures', exist_ok=True)
|
|
111
|
+
fig.savefig('./figures/results_comparison_speed.png', dpi=300)
|
|
112
|
+
plt.close(fig)
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
fig = plt.figure(figsize=(20, 9))
|
|
116
|
+
ax = fig.add_subplot(1, 2, 1)
|
|
117
|
+
improvements = np.stack([results_openvaccine_delta_pos, results_openvaccine_delta_neg,
|
|
118
|
+
results_zebrafish_delta_pos, results_zebrafish_delta_neg,
|
|
119
|
+
results_ribosome_delta_pos, results_ribosome_delta_neg], axis=1)
|
|
120
|
+
base_improvements = improvements[:-1]
|
|
121
|
+
best_improvements = []
|
|
122
|
+
for j in range(base_improvements.shape[1]):
|
|
123
|
+
col = base_improvements[:, j]
|
|
124
|
+
best_improvements.append(col.max() if j % 2 == 0 else col.min())
|
|
125
|
+
best_improvements = np.array(best_improvements)
|
|
126
|
+
denom = np.where(best_improvements == 0, np.nan, best_improvements)
|
|
127
|
+
improvement_over_best = 100 * (improvements[-1] - best_improvements) / denom
|
|
128
|
+
improvements = np.vstack([improvements, improvement_over_best])
|
|
129
|
+
improvements_display = improvements.copy()
|
|
130
|
+
improvements_display[-1, :] = np.nan
|
|
131
|
+
n_rows, n_cols = improvements.shape
|
|
132
|
+
vmin, vmax = improvements[:-1].min(0), improvements[:-1].max(0)
|
|
133
|
+
cmap_red, cmap_blue = plt.cm.Reds, plt.cm.Blues_r
|
|
134
|
+
for j in range(n_cols):
|
|
135
|
+
cmap = cmap_red if j % 2 == 0 else cmap_blue
|
|
136
|
+
cmap = cmap.copy()
|
|
137
|
+
cmap.set_bad(color="white")
|
|
138
|
+
norm = mpl.colors.Normalize(vmin=vmin[j] if j % 2 == 1 else 0, vmax=vmax[j] if j % 2 == 0 else 0)
|
|
139
|
+
ax.imshow(improvements_display[:, j:j+1], cmap=cmap, norm=norm,
|
|
140
|
+
aspect="auto", extent=[j - 0.5, j + 0.5, 0, n_rows], origin="lower")
|
|
141
|
+
for (i, j), val in np.ndenumerate(improvements):
|
|
142
|
+
if i == n_rows - 1:
|
|
143
|
+
color = "forestgreen" if val >= 0 else "darkred"
|
|
144
|
+
label = f"{val:+.1f} \\%"
|
|
145
|
+
fontsize = 16
|
|
146
|
+
else:
|
|
147
|
+
cmap = cmap_red if j % 2 == 0 else cmap_blue
|
|
148
|
+
norm = mpl.colors.Normalize(vmin=vmin[j] if j % 2 == 1 else 0, vmax=vmax[j] if j % 2 == 0 else 0)
|
|
149
|
+
r, g, b, _ = cmap(norm(val))
|
|
150
|
+
lum = 0.299 * r + 0.587 * g + 0.114 * b
|
|
151
|
+
color = "white" if lum < 0.5 else "black"
|
|
152
|
+
label = f"{val:.2f}"
|
|
153
|
+
fontsize = 14
|
|
154
|
+
ax.text(j, i + 0.5, label, ha="center", va="center", fontsize=fontsize, color=color)
|
|
155
|
+
ax.set_title('Median change in property', fontsize=32, pad=24)
|
|
156
|
+
ax.set_xlim(-0.5, n_cols - 0.5)
|
|
157
|
+
ax.set_xticks(np.arange(n_cols))
|
|
158
|
+
ax.set_xticklabels([r'$\texttt{OpenVaccine}~(+)$', r'$\texttt{OpenVaccine}~(-)$',
|
|
159
|
+
r'$\texttt{Zebrafish}~(+)$', r'$\texttt{Zebrafish}~(-)$',
|
|
160
|
+
r'$\texttt{Ribosome}~(+)$', r'$\texttt{Ribosome}~(-)$'],
|
|
161
|
+
fontsize=20, rotation=30)
|
|
162
|
+
ax.tick_params(axis='x', which='both', bottom=False, top=False, length=0)
|
|
163
|
+
ax.set_yticks(np.arange(n_rows) + 0.5)
|
|
164
|
+
ax.set_yticklabels(options, rotation=0, fontsize=20, ha='right')
|
|
165
|
+
for tick in ax.get_yticklabels():
|
|
166
|
+
if r'$\texttt{RNAGenScape}$' in tick.get_text():
|
|
167
|
+
tick.set_fontsize(24)
|
|
168
|
+
ax.set_frame_on(False)
|
|
169
|
+
ax.invert_yaxis()
|
|
170
|
+
# n_rows, n_cols = improvements.shape
|
|
171
|
+
# rect = patches.Rectangle((-0.5, n_rows - 1), n_cols, 1, fill=False, edgecolor='black', linewidth=3)
|
|
172
|
+
# rect.set_clip_on(False)
|
|
173
|
+
# ax.add_patch(rect)
|
|
174
|
+
|
|
175
|
+
ax = fig.add_subplot(1, 2, 2)
|
|
176
|
+
percentages = np.stack([results_openvaccine_pct_pos, results_openvaccine_pct_neg,
|
|
177
|
+
results_zebrafish_pct_pos, results_zebrafish_pct_neg,
|
|
178
|
+
results_ribosome_pct_pos, results_ribosome_pct_neg], axis=1)
|
|
179
|
+
base_percentages = percentages[:-1]
|
|
180
|
+
best_percentages = base_percentages.max(0)
|
|
181
|
+
pct_improvement_over_best = 100 * (percentages[-1] - best_percentages) / best_percentages
|
|
182
|
+
percentages = np.vstack([percentages, pct_improvement_over_best])
|
|
183
|
+
percentages_display = percentages.copy()
|
|
184
|
+
percentages_display[-1, :] = np.nan
|
|
185
|
+
n_rows, n_cols = percentages.shape
|
|
186
|
+
vmin, vmax = percentages[:-1].min(0), percentages[:-1].max(0)
|
|
187
|
+
cmap_red = plt.cm.Reds.copy()
|
|
188
|
+
cmap_red.set_bad(color="white")
|
|
189
|
+
for j in range(n_cols):
|
|
190
|
+
norm = mpl.colors.Normalize(vmin=max(50, vmin[j]), vmax=vmax[j])
|
|
191
|
+
ax.imshow(percentages_display[:, j:j+1], cmap=cmap_red, norm=norm,
|
|
192
|
+
aspect="auto", extent=[j - 0.5, j + 0.5, 0, n_rows], origin="lower")
|
|
193
|
+
for (i, j), val in np.ndenumerate(percentages):
|
|
194
|
+
if i == n_rows - 1:
|
|
195
|
+
color = "forestgreen" if val >= 0 else "darkred"
|
|
196
|
+
label = f"{val:+.1f} \\%"
|
|
197
|
+
fontsize = 16
|
|
198
|
+
else:
|
|
199
|
+
norm = mpl.colors.Normalize(vmin=max(50, vmin[j]), vmax=vmax[j])
|
|
200
|
+
r, g, b, _ = cmap_red(norm(val))
|
|
201
|
+
lum = 0.299 * r + 0.587 * g + 0.114 * b
|
|
202
|
+
color = "white" if lum < 0.5 else "black"
|
|
203
|
+
label = f"{val:.1f} \\%"
|
|
204
|
+
fontsize = 14
|
|
205
|
+
ax.text(j, i + 0.5, label, ha="center", va="center",
|
|
206
|
+
fontsize=fontsize, color=color)
|
|
207
|
+
ax.set_title('Success rate', fontsize=32, pad=24)
|
|
208
|
+
ax.set_xlim(-0.5, n_cols - 0.5)
|
|
209
|
+
ax.set_xticks(np.arange(n_cols))
|
|
210
|
+
ax.set_xticklabels([r'$\texttt{OpenVaccine}~(+)$', r'$\texttt{OpenVaccine}~(-)$',
|
|
211
|
+
r'$\texttt{Zebrafish}~(+)$', r'$\texttt{Zebrafish}~(-)$',
|
|
212
|
+
r'$\texttt{Ribosome}~(+)$', r'$\texttt{Ribosome}~(-)$'],
|
|
213
|
+
fontsize=20, rotation=30)
|
|
214
|
+
ax.tick_params(axis='x', which='both', bottom=False, top=False, length=0)
|
|
215
|
+
ax.set_yticks([])
|
|
216
|
+
# ax.set_yticks(np.arange(n_rows) + 0.5)
|
|
217
|
+
# ax.set_yticklabels(options, fontsize=16, ha='right')
|
|
218
|
+
ax.set_frame_on(False)
|
|
219
|
+
ax.invert_yaxis()
|
|
220
|
+
# rect = patches.Rectangle((-0.5, n_rows - 1), n_cols, 1,
|
|
221
|
+
# fill=False, edgecolor='black', linewidth=3)
|
|
222
|
+
# rect.set_clip_on(False)
|
|
223
|
+
# ax.add_patch(rect)
|
|
224
|
+
|
|
225
|
+
fig.tight_layout(pad=2)
|
|
226
|
+
os.makedirs('./figures', exist_ok=True)
|
|
227
|
+
fig.savefig('./figures/results_comparison_optimization.png', dpi=300)
|
|
228
|
+
plt.close(fig)
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import numpy as np
|
|
3
|
+
import matplotlib.pyplot as plt
|
|
4
|
+
from matplotlib.colors import LinearSegmentedColormap
|
|
5
|
+
|
|
6
|
+
def function(x, y):
|
|
7
|
+
z = 0.6 * np.exp(-((x - 1)**2 + (y + 1)**2))
|
|
8
|
+
z += 0.5 * np.exp(-((x - 1)**2 + (y - 4)**2))
|
|
9
|
+
z += 0.3 * np.exp(-((x - 2)**2 + (y - 2)**2))
|
|
10
|
+
z += 0.2 * np.exp(-((x + 3)**2 + (y + 1)**2))
|
|
11
|
+
z += 0.3 * np.exp(-((x + 1)**2 + (y + 1)**2))
|
|
12
|
+
z -= 0.1 * np.exp(-((x + 1)**2 + (y - 2)**2))
|
|
13
|
+
z += 0.3 * np.exp(-((x + 2)**2 + (y - 2)**2))
|
|
14
|
+
z += 0.3 * np.exp(-((x + 2)**2 + (y - 1)**2))
|
|
15
|
+
return z
|
|
16
|
+
|
|
17
|
+
x = np.linspace(-3, 3, 200)
|
|
18
|
+
y = np.linspace(-3, 3, 200)
|
|
19
|
+
X, Y = np.meshgrid(x, y)
|
|
20
|
+
Z = function(X, Y)
|
|
21
|
+
|
|
22
|
+
peak_i, peak_j = np.unravel_index(np.argmax(Z), Z.shape)
|
|
23
|
+
x_peak, y_peak = X[peak_i, peak_j], Y[peak_i, peak_j]
|
|
24
|
+
|
|
25
|
+
rng = np.random.default_rng(42)
|
|
26
|
+
num_patches = 30
|
|
27
|
+
r = 0.3
|
|
28
|
+
r_forbid = 0.9
|
|
29
|
+
pad = r + 0.1
|
|
30
|
+
|
|
31
|
+
centers = []
|
|
32
|
+
attempts = 0
|
|
33
|
+
while len(centers) < num_patches and attempts < 5000:
|
|
34
|
+
cx = rng.uniform(x.min()+pad, x.max()-pad)
|
|
35
|
+
cy = rng.uniform(y.min()+pad, y.max()-pad)
|
|
36
|
+
if (cx - x_peak)**2 + (cy - y_peak)**2 < r_forbid**2:
|
|
37
|
+
attempts += 1
|
|
38
|
+
continue
|
|
39
|
+
ok = True
|
|
40
|
+
for px, py in centers:
|
|
41
|
+
if (cx - px)**2 + (cy - py)**2 < (1.6*r)**2:
|
|
42
|
+
ok = False
|
|
43
|
+
break
|
|
44
|
+
if ok:
|
|
45
|
+
centers.append((cx, cy))
|
|
46
|
+
attempts += 1
|
|
47
|
+
|
|
48
|
+
mask = np.zeros_like(Z, dtype=bool)
|
|
49
|
+
for cx, cy in centers:
|
|
50
|
+
mask |= (X - cx)**2 + (Y - cy)**2 <= r**2
|
|
51
|
+
|
|
52
|
+
cmap = LinearSegmentedColormap.from_list(
|
|
53
|
+
"softgreen", ["#e9f5ec", "#d9f0e1", "#c9e5d3", "#a9cbb8", "#7f9e8a", "#4f5c4f"], N=256
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
norm = plt.Normalize(Z.min(), Z.max())
|
|
57
|
+
facecolors = cmap(norm(Z))
|
|
58
|
+
facecolors_with_gray = facecolors.copy()
|
|
59
|
+
facecolors_with_gray[mask] = [0.7, 0.7, 0.7, 0.5]
|
|
60
|
+
|
|
61
|
+
fig = plt.figure(figsize=(14, 6))
|
|
62
|
+
for i, (fc, title) in enumerate([(facecolors, "Smooth Manifold"),
|
|
63
|
+
(facecolors_with_gray, "Manifold with Gray Patches")], 1):
|
|
64
|
+
ax = fig.add_subplot(1, 2, i, projection="3d")
|
|
65
|
+
ax.plot_surface(
|
|
66
|
+
X, Y, Z,
|
|
67
|
+
facecolors=fc,
|
|
68
|
+
rstride=4, cstride=4,
|
|
69
|
+
linewidth=0.05, edgecolor="k",
|
|
70
|
+
antialiased=True, shade=False, alpha=0.95
|
|
71
|
+
)
|
|
72
|
+
ax.set_title(title, fontsize=14)
|
|
73
|
+
ax.set_xticks([]); ax.set_yticks([]); ax.set_zticks([])
|
|
74
|
+
for a in (ax.xaxis, ax.yaxis, ax.zaxis):
|
|
75
|
+
a.pane.set_visible(False)
|
|
76
|
+
a.line.set_color((0,0,0,0))
|
|
77
|
+
ax.set_box_aspect([1, 1, 0.5])
|
|
78
|
+
ax.view_init(elev=20, azim=50)
|
|
79
|
+
|
|
80
|
+
fig.tight_layout(pad=2)
|
|
81
|
+
os.makedirs("./figures", exist_ok=True)
|
|
82
|
+
fig.savefig("./figures/manifold_holes.png", dpi=300)
|