opencode-knowledge-work 0.0.0-stage → 0.1.0
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/LICENSE +212 -0
- package/README.md +124 -2
- package/content/bio-research/.mcp.json +48 -0
- package/content/bio-research/CONNECTORS.md +23 -0
- package/content/bio-research/LICENSE +202 -0
- package/content/bio-research/README.md +83 -0
- package/content/bio-research/skills/bio-research-instrument-data-to-allotrope/LICENSE.txt +201 -0
- package/content/bio-research/skills/bio-research-instrument-data-to-allotrope/SKILL.md +280 -0
- package/content/bio-research/skills/bio-research-instrument-data-to-allotrope/references/asm_schema_overview.md +226 -0
- package/content/bio-research/skills/bio-research-instrument-data-to-allotrope/references/field_classification_guide.md +503 -0
- package/content/bio-research/skills/bio-research-instrument-data-to-allotrope/references/flattening_guide.md +254 -0
- package/content/bio-research/skills/bio-research-instrument-data-to-allotrope/references/supported_instruments.md +151 -0
- package/content/bio-research/skills/bio-research-instrument-data-to-allotrope/requirements.txt +26 -0
- package/content/bio-research/skills/bio-research-instrument-data-to-allotrope/scripts/convert_to_asm.py +543 -0
- package/content/bio-research/skills/bio-research-instrument-data-to-allotrope/scripts/export_parser.py +481 -0
- package/content/bio-research/skills/bio-research-instrument-data-to-allotrope/scripts/flatten_asm.py +254 -0
- package/content/bio-research/skills/bio-research-instrument-data-to-allotrope/scripts/validate_asm.py +1102 -0
- package/content/bio-research/skills/bio-research-nextflow-development/LICENSE.txt +201 -0
- package/content/bio-research/skills/bio-research-nextflow-development/SKILL.md +290 -0
- package/content/bio-research/skills/bio-research-nextflow-development/references/geo-sra-acquisition.md +416 -0
- package/content/bio-research/skills/bio-research-nextflow-development/references/installation.md +96 -0
- package/content/bio-research/skills/bio-research-nextflow-development/references/pipelines/atacseq.md +138 -0
- package/content/bio-research/skills/bio-research-nextflow-development/references/pipelines/rnaseq.md +118 -0
- package/content/bio-research/skills/bio-research-nextflow-development/references/pipelines/sarek.md +145 -0
- package/content/bio-research/skills/bio-research-nextflow-development/references/troubleshooting.md +137 -0
- package/content/bio-research/skills/bio-research-nextflow-development/scripts/check_environment.py +452 -0
- package/content/bio-research/skills/bio-research-nextflow-development/scripts/config/genomes.yaml +148 -0
- package/content/bio-research/skills/bio-research-nextflow-development/scripts/config/pipelines/atacseq.yaml +187 -0
- package/content/bio-research/skills/bio-research-nextflow-development/scripts/config/pipelines/rnaseq.yaml +147 -0
- package/content/bio-research/skills/bio-research-nextflow-development/scripts/config/pipelines/sarek.yaml +233 -0
- package/content/bio-research/skills/bio-research-nextflow-development/scripts/detect_data_type.py +300 -0
- package/content/bio-research/skills/bio-research-nextflow-development/scripts/generate_samplesheet.py +455 -0
- package/content/bio-research/skills/bio-research-nextflow-development/scripts/manage_genomes.py +521 -0
- package/content/bio-research/skills/bio-research-nextflow-development/scripts/sra_geo_fetch.py +732 -0
- package/content/bio-research/skills/bio-research-nextflow-development/scripts/utils/__init__.py +69 -0
- package/content/bio-research/skills/bio-research-nextflow-development/scripts/utils/file_discovery.py +189 -0
- package/content/bio-research/skills/bio-research-nextflow-development/scripts/utils/ncbi_utils.py +808 -0
- package/content/bio-research/skills/bio-research-nextflow-development/scripts/utils/sample_inference.py +290 -0
- package/content/bio-research/skills/bio-research-nextflow-development/scripts/utils/validators.py +256 -0
- package/content/bio-research/skills/bio-research-scientific-problem-selection/LICENSE.txt +201 -0
- package/content/bio-research/skills/bio-research-scientific-problem-selection/SKILL.md +269 -0
- package/content/bio-research/skills/bio-research-scientific-problem-selection/references/01-intuition-pumps.md +264 -0
- package/content/bio-research/skills/bio-research-scientific-problem-selection/references/02-risk-assessment.md +323 -0
- package/content/bio-research/skills/bio-research-scientific-problem-selection/references/03-optimization-function.md +481 -0
- package/content/bio-research/skills/bio-research-scientific-problem-selection/references/04-parameter-strategy.md +396 -0
- package/content/bio-research/skills/bio-research-scientific-problem-selection/references/05-decision-tree.md +85 -0
- package/content/bio-research/skills/bio-research-scientific-problem-selection/references/06-adversity-planning.md +123 -0
- package/content/bio-research/skills/bio-research-scientific-problem-selection/references/07-problem-inversion.md +152 -0
- package/content/bio-research/skills/bio-research-scientific-problem-selection/references/08-integration-synthesis.md +173 -0
- package/content/bio-research/skills/bio-research-scientific-problem-selection/references/09-meta-framework.md +504 -0
- package/content/bio-research/skills/bio-research-scvi-tools/LICENSE.txt +201 -0
- package/content/bio-research/skills/bio-research-scvi-tools/SKILL.md +155 -0
- package/content/bio-research/skills/bio-research-scvi-tools/references/atac_peakvi.md +398 -0
- package/content/bio-research/skills/bio-research-scvi-tools/references/batch_correction_sysvi.md +417 -0
- package/content/bio-research/skills/bio-research-scvi-tools/references/citeseq_totalvi.md +420 -0
- package/content/bio-research/skills/bio-research-scvi-tools/references/data_preparation.md +286 -0
- package/content/bio-research/skills/bio-research-scvi-tools/references/environment_setup.md +254 -0
- package/content/bio-research/skills/bio-research-scvi-tools/references/label_transfer.md +373 -0
- package/content/bio-research/skills/bio-research-scvi-tools/references/multiome_multivi.md +384 -0
- package/content/bio-research/skills/bio-research-scvi-tools/references/rna_velocity_velovi.md +410 -0
- package/content/bio-research/skills/bio-research-scvi-tools/references/scarches_mapping.md +401 -0
- package/content/bio-research/skills/bio-research-scvi-tools/references/scrna_integration.md +429 -0
- package/content/bio-research/skills/bio-research-scvi-tools/references/spatial_deconvolution.md +438 -0
- package/content/bio-research/skills/bio-research-scvi-tools/references/troubleshooting.md +420 -0
- package/content/bio-research/skills/bio-research-scvi-tools/scripts/cluster_embed.py +212 -0
- package/content/bio-research/skills/bio-research-scvi-tools/scripts/differential_expression.py +220 -0
- package/content/bio-research/skills/bio-research-scvi-tools/scripts/integrate_datasets.py +237 -0
- package/content/bio-research/skills/bio-research-scvi-tools/scripts/model_utils.py +634 -0
- package/content/bio-research/skills/bio-research-scvi-tools/scripts/prepare_data.py +169 -0
- package/content/bio-research/skills/bio-research-scvi-tools/scripts/train_model.py +370 -0
- package/content/bio-research/skills/bio-research-scvi-tools/scripts/transfer_labels.py +224 -0
- package/content/bio-research/skills/bio-research-scvi-tools/scripts/validate_adata.py +397 -0
- package/content/bio-research/skills/bio-research-single-cell-rna-qc/LICENSE.txt +201 -0
- package/content/bio-research/skills/bio-research-single-cell-rna-qc/SKILL.md +175 -0
- package/content/bio-research/skills/bio-research-single-cell-rna-qc/references/scverse_qc_guidelines.md +186 -0
- package/content/bio-research/skills/bio-research-single-cell-rna-qc/scripts/qc_analysis.py +232 -0
- package/content/bio-research/skills/bio-research-single-cell-rna-qc/scripts/qc_core.py +233 -0
- package/content/bio-research/skills/bio-research-single-cell-rna-qc/scripts/qc_plotting.py +235 -0
- package/content/bio-research/skills/bio-research-start/SKILL.md +79 -0
- package/content/customer-support/.mcp.json +40 -0
- package/content/customer-support/CONNECTORS.md +19 -0
- package/content/customer-support/LICENSE +202 -0
- package/content/customer-support/README.md +140 -0
- package/content/customer-support/skills/customer-support-customer-escalation/SKILL.md +248 -0
- package/content/customer-support/skills/customer-support-customer-research/SKILL.md +252 -0
- package/content/customer-support/skills/customer-support-draft-response/SKILL.md +418 -0
- package/content/customer-support/skills/customer-support-kb-article/SKILL.md +351 -0
- package/content/customer-support/skills/customer-support-ticket-triage/SKILL.md +275 -0
- package/content/data/.mcp.json +36 -0
- package/content/data/CONNECTORS.md +18 -0
- package/content/data/LICENSE +202 -0
- package/content/data/README.md +121 -0
- package/content/data/skills/data-analyze/SKILL.md +119 -0
- package/content/data/skills/data-build-dashboard/SKILL.md +924 -0
- package/content/data/skills/data-create-viz/SKILL.md +154 -0
- package/content/data/skills/data-data-context-extractor/SKILL.md +227 -0
- package/content/data/skills/data-data-context-extractor/references/domain-template.md +147 -0
- package/content/data/skills/data-data-context-extractor/references/example-output.md +198 -0
- package/content/data/skills/data-data-context-extractor/references/skill-template.md +148 -0
- package/content/data/skills/data-data-context-extractor/references/sql-dialects.md +121 -0
- package/content/data/skills/data-data-context-extractor/scripts/package_data_skill.py +126 -0
- package/content/data/skills/data-data-visualization/SKILL.md +305 -0
- package/content/data/skills/data-explore-data/SKILL.md +325 -0
- package/content/data/skills/data-sql-queries/SKILL.md +428 -0
- package/content/data/skills/data-statistical-analysis/SKILL.md +245 -0
- package/content/data/skills/data-validate-data/SKILL.md +383 -0
- package/content/data/skills/data-write-query/SKILL.md +122 -0
- package/content/design/.mcp.json +44 -0
- package/content/design/CONNECTORS.md +18 -0
- package/content/design/README.md +117 -0
- package/content/design/skills/design-accessibility-review/SKILL.md +128 -0
- package/content/design/skills/design-design-critique/SKILL.md +118 -0
- package/content/design/skills/design-design-handoff/SKILL.md +131 -0
- package/content/design/skills/design-design-system/SKILL.md +190 -0
- package/content/design/skills/design-research-synthesis/SKILL.md +92 -0
- package/content/design/skills/design-user-research/SKILL.md +41 -0
- package/content/design/skills/design-ux-copy/SKILL.md +107 -0
- package/content/engineering/.mcp.json +48 -0
- package/content/engineering/CONNECTORS.md +19 -0
- package/content/engineering/README.md +136 -0
- package/content/engineering/skills/engineering-architecture/SKILL.md +85 -0
- package/content/engineering/skills/engineering-code-review/SKILL.md +118 -0
- package/content/engineering/skills/engineering-debug/SKILL.md +95 -0
- package/content/engineering/skills/engineering-deploy-checklist/SKILL.md +78 -0
- package/content/engineering/skills/engineering-documentation/SKILL.md +49 -0
- package/content/engineering/skills/engineering-incident-response/SKILL.md +158 -0
- package/content/engineering/skills/engineering-standup/SKILL.md +75 -0
- package/content/engineering/skills/engineering-system-design/SKILL.md +42 -0
- package/content/engineering/skills/engineering-tech-debt/SKILL.md +32 -0
- package/content/engineering/skills/engineering-testing-strategy/SKILL.md +33 -0
- package/content/enterprise-search/.mcp.json +36 -0
- package/content/enterprise-search/CONNECTORS.md +21 -0
- package/content/enterprise-search/LICENSE +202 -0
- package/content/enterprise-search/README.md +157 -0
- package/content/enterprise-search/skills/enterprise-search-digest/SKILL.md +173 -0
- package/content/enterprise-search/skills/enterprise-search-knowledge-synthesis/SKILL.md +258 -0
- package/content/enterprise-search/skills/enterprise-search-search/SKILL.md +178 -0
- package/content/enterprise-search/skills/enterprise-search-search-strategy/SKILL.md +222 -0
- package/content/enterprise-search/skills/enterprise-search-source-management/SKILL.md +173 -0
- package/content/finance/.mcp.json +32 -0
- package/content/finance/CONNECTORS.md +20 -0
- package/content/finance/LICENSE +202 -0
- package/content/finance/README.md +92 -0
- package/content/finance/skills/finance-audit-support/SKILL.md +374 -0
- package/content/finance/skills/finance-close-management/SKILL.md +221 -0
- package/content/finance/skills/finance-financial-statements/SKILL.md +335 -0
- package/content/finance/skills/finance-journal-entry/SKILL.md +131 -0
- package/content/finance/skills/finance-journal-entry-prep/SKILL.md +186 -0
- package/content/finance/skills/finance-reconciliation/SKILL.md +175 -0
- package/content/finance/skills/finance-sox-testing/SKILL.md +218 -0
- package/content/finance/skills/finance-variance-analysis/SKILL.md +266 -0
- package/content/human-resources/.mcp.json +28 -0
- package/content/human-resources/CONNECTORS.md +19 -0
- package/content/human-resources/README.md +138 -0
- package/content/human-resources/skills/human-resources-comp-analysis/SKILL.md +92 -0
- package/content/human-resources/skills/human-resources-draft-offer/SKILL.md +82 -0
- package/content/human-resources/skills/human-resources-interview-prep/SKILL.md +37 -0
- package/content/human-resources/skills/human-resources-onboarding/SKILL.md +104 -0
- package/content/human-resources/skills/human-resources-org-planning/SKILL.md +28 -0
- package/content/human-resources/skills/human-resources-people-report/SKILL.md +99 -0
- package/content/human-resources/skills/human-resources-performance-review/SKILL.md +149 -0
- package/content/human-resources/skills/human-resources-policy-lookup/SKILL.md +94 -0
- package/content/human-resources/skills/human-resources-recruiting-pipeline/SKILL.md +31 -0
- package/content/legal/.mcp.json +36 -0
- package/content/legal/CONNECTORS.md +21 -0
- package/content/legal/LICENSE +202 -0
- package/content/legal/README.md +234 -0
- package/content/legal/skills/legal-brief/SKILL.md +208 -0
- package/content/legal/skills/legal-compliance-check/SKILL.md +274 -0
- package/content/legal/skills/legal-legal-response/SKILL.md +457 -0
- package/content/legal/skills/legal-legal-risk-assessment/SKILL.md +265 -0
- package/content/legal/skills/legal-meeting-briefing/SKILL.md +220 -0
- package/content/legal/skills/legal-review-contract/SKILL.md +358 -0
- package/content/legal/skills/legal-signature-request/SKILL.md +104 -0
- package/content/legal/skills/legal-triage-nda/SKILL.md +262 -0
- package/content/legal/skills/legal-vendor-check/SKILL.md +159 -0
- package/content/manifest.json +86 -0
- package/content/marketing/.mcp.json +60 -0
- package/content/marketing/CONNECTORS.md +20 -0
- package/content/marketing/LICENSE +202 -0
- package/content/marketing/README.md +90 -0
- package/content/marketing/skills/marketing-brand-review/SKILL.md +276 -0
- package/content/marketing/skills/marketing-campaign-plan/SKILL.md +308 -0
- package/content/marketing/skills/marketing-competitive-brief/SKILL.md +331 -0
- package/content/marketing/skills/marketing-content-creation/SKILL.md +157 -0
- package/content/marketing/skills/marketing-draft-content/SKILL.md +117 -0
- package/content/marketing/skills/marketing-email-sequence/SKILL.md +220 -0
- package/content/marketing/skills/marketing-performance-report/SKILL.md +392 -0
- package/content/marketing/skills/marketing-seo-audit/SKILL.md +190 -0
- package/content/operations/.mcp.json +32 -0
- package/content/operations/CONNECTORS.md +20 -0
- package/content/operations/README.md +135 -0
- package/content/operations/skills/operations-capacity-plan/SKILL.md +113 -0
- package/content/operations/skills/operations-change-request/SKILL.md +121 -0
- package/content/operations/skills/operations-compliance-tracking/SKILL.md +44 -0
- package/content/operations/skills/operations-process-doc/SKILL.md +82 -0
- package/content/operations/skills/operations-process-optimization/SKILL.md +39 -0
- package/content/operations/skills/operations-risk-assessment/SKILL.md +40 -0
- package/content/operations/skills/operations-runbook/SKILL.md +87 -0
- package/content/operations/skills/operations-status-report/SKILL.md +77 -0
- package/content/operations/skills/operations-vendor-review/SKILL.md +104 -0
- package/content/pdf-viewer/.mcp.json +8 -0
- package/content/pdf-viewer/CONNECTORS.md +15 -0
- package/content/pdf-viewer/LICENSE +202 -0
- package/content/pdf-viewer/README.md +57 -0
- package/content/pdf-viewer/commands/annotate.md +51 -0
- package/content/pdf-viewer/commands/fill-form.md +73 -0
- package/content/pdf-viewer/commands/open.md +34 -0
- package/content/pdf-viewer/commands/sign.md +54 -0
- package/content/pdf-viewer/skills/pdf-viewer-view-pdf/SKILL.md +147 -0
- package/content/product-management/.mcp.json +72 -0
- package/content/product-management/CONNECTORS.md +22 -0
- package/content/product-management/LICENSE +202 -0
- package/content/product-management/README.md +118 -0
- package/content/product-management/commands/brainstorm.md +120 -0
- package/content/product-management/skills/product-management-competitive-brief/SKILL.md +302 -0
- package/content/product-management/skills/product-management-metrics-review/SKILL.md +388 -0
- package/content/product-management/skills/product-management-product-brainstorming/SKILL.md +273 -0
- package/content/product-management/skills/product-management-roadmap-update/SKILL.md +266 -0
- package/content/product-management/skills/product-management-sprint-planning/SKILL.md +94 -0
- package/content/product-management/skills/product-management-stakeholder-update/SKILL.md +352 -0
- package/content/product-management/skills/product-management-synthesize-research/SKILL.md +312 -0
- package/content/product-management/skills/product-management-write-spec/SKILL.md +250 -0
- package/content/productivity/.mcp.json +44 -0
- package/content/productivity/CONNECTORS.md +18 -0
- package/content/productivity/LICENSE +202 -0
- package/content/productivity/README.md +97 -0
- package/content/productivity/skills/dashboard.html +3111 -0
- package/content/productivity/skills/productivity-memory-management/SKILL.md +323 -0
- package/content/productivity/skills/productivity-start/SKILL.md +158 -0
- package/content/productivity/skills/productivity-task-management/SKILL.md +91 -0
- package/content/productivity/skills/productivity-update/SKILL.md +168 -0
- package/content/sales/.mcp.json +100 -0
- package/content/sales/CONNECTORS.md +36 -0
- package/content/sales/LICENSE +202 -0
- package/content/sales/README.md +148 -0
- package/content/sales/skills/sales-account-context/SKILL.md +94 -0
- package/content/sales/skills/sales-account-plan/SKILL.md +95 -0
- package/content/sales/skills/sales-account-research/SKILL.md +99 -0
- package/content/sales/skills/sales-account-tiering/SKILL.md +101 -0
- package/content/sales/skills/sales-call-prep/SKILL.md +111 -0
- package/content/sales/skills/sales-call-summary/SKILL.md +111 -0
- package/content/sales/skills/sales-close-plan/SKILL.md +106 -0
- package/content/sales/skills/sales-competitive-intelligence/SKILL.md +102 -0
- package/content/sales/skills/sales-create-an-asset/SKILL.md +105 -0
- package/content/sales/skills/sales-crm-hygiene-check/SKILL.md +103 -0
- package/content/sales/skills/sales-customer-health/SKILL.md +108 -0
- package/content/sales/skills/sales-customer-voice/SKILL.md +94 -0
- package/content/sales/skills/sales-daily-briefing/SKILL.md +61 -0
- package/content/sales/skills/sales-deal-advance-gap/SKILL.md +102 -0
- package/content/sales/skills/sales-deal-review/SKILL.md +105 -0
- package/content/sales/skills/sales-deal-signals/SKILL.md +96 -0
- package/content/sales/skills/sales-deal-slip-scenario/SKILL.md +101 -0
- package/content/sales/skills/sales-draft-outreach/SKILL.md +116 -0
- package/content/sales/skills/sales-end-of-day/SKILL.md +114 -0
- package/content/sales/skills/sales-expansion-whitespace/SKILL.md +97 -0
- package/content/sales/skills/sales-forecast/SKILL.md +100 -0
- package/content/sales/skills/sales-handle-objection/SKILL.md +93 -0
- package/content/sales/skills/sales-inbox-sweep/SKILL.md +114 -0
- package/content/sales/skills/sales-lead-triage/SKILL.md +105 -0
- package/content/sales/skills/sales-log-activity/SKILL.md +111 -0
- package/content/sales/skills/sales-pipeline-review/SKILL.md +97 -0
- package/content/sales/skills/sales-renewal-radar/SKILL.md +95 -0
- package/content/sales/skills/sales-rep-context/SKILL.md +90 -0
- package/content/sales/skills/sales-route-lead/SKILL.md +111 -0
- package/content/sales/skills/sales-schedule-meeting/SKILL.md +99 -0
- package/content/sales/skills/sales-setup/SKILL.md +195 -0
- package/content/sales/skills/sales-stakeholder-map/SKILL.md +107 -0
- package/content/sales/skills/sales-team-pipeline/SKILL.md +105 -0
- package/content/sales/skills/sales-update-opportunity/SKILL.md +111 -0
- package/content/sales/skills/sales-weekly-wrap/SKILL.md +90 -0
- package/content/sales/skills/sales-win-loss-review/SKILL.md +88 -0
- package/content/small-business/.mcp.json +148 -0
- package/content/small-business/README.md +117 -0
- package/content/small-business/skills/small-business-ad-manager/SKILL.md +128 -0
- package/content/small-business/skills/small-business-ad-manager/reference/ad_copy.md +112 -0
- package/content/small-business/skills/small-business-ad-manager/reference/change_playbook.md +127 -0
- package/content/small-business/skills/small-business-ad-manager/reference/data_sources.md +100 -0
- package/content/small-business/skills/small-business-ad-manager/reference/diagnostics.md +89 -0
- package/content/small-business/skills/small-business-ad-manager/reference/gotchas.md +181 -0
- package/content/small-business/skills/small-business-ap-processor/SKILL.md +158 -0
- package/content/small-business/skills/small-business-ap-processor/reference/coding_rules.md +70 -0
- package/content/small-business/skills/small-business-ap-processor/reference/gotchas.md +131 -0
- package/content/small-business/skills/small-business-ap-processor/reference/intake_and_extraction.md +82 -0
- package/content/small-business/skills/small-business-ap-processor/reference/matching_and_exceptions.md +80 -0
- package/content/small-business/skills/small-business-ap-processor/reference/payment_run.md +77 -0
- package/content/small-business/skills/small-business-brand-style/SKILL.md +106 -0
- package/content/small-business/skills/small-business-build-agent/SKILL.md +105 -0
- package/content/small-business/skills/small-business-build-agent/reference/capture.md +133 -0
- package/content/small-business/skills/small-business-build-agent/reference/gotchas.md +204 -0
- package/content/small-business/skills/small-business-build-agent/reference/skill_authoring.md +165 -0
- package/content/small-business/skills/small-business-build-connector/SKILL.md +102 -0
- package/content/small-business/skills/small-business-build-connector/reference/discovery.md +120 -0
- package/content/small-business/skills/small-business-build-connector/reference/gotchas.md +237 -0
- package/content/small-business/skills/small-business-build-connector/reference/paths.md +106 -0
- package/content/small-business/skills/small-business-build-connector/reference/use-zapier.md +128 -0
- package/content/small-business/skills/small-business-business-pulse/SKILL.md +181 -0
- package/content/small-business/skills/small-business-business-pulse/reference/data_sources.md +173 -0
- package/content/small-business/skills/small-business-business-pulse/reference/gotchas.md +103 -0
- package/content/small-business/skills/small-business-business-pulse/reference/output_template.md +109 -0
- package/content/small-business/skills/small-business-business-pulse/reference/thresholds.md +71 -0
- package/content/small-business/skills/small-business-business-pulse/reference/v2_sources.md +63 -0
- package/content/small-business/skills/small-business-call-list/SKILL.md +82 -0
- package/content/small-business/skills/small-business-canva-creator/SKILL.md +448 -0
- package/content/small-business/skills/small-business-canva-creator/reference/canva-api.md +208 -0
- package/content/small-business/skills/small-business-canva-creator/reference/examples/boutique-brief-campaign.md +181 -0
- package/content/small-business/skills/small-business-canva-creator/reference/gotchas.md +380 -0
- package/content/small-business/skills/small-business-canva-creator/reference/hubspot-staging.md +137 -0
- package/content/small-business/skills/small-business-cash-flow-snapshot/SKILL.md +251 -0
- package/content/small-business/skills/small-business-cash-flow-snapshot/reference/examples/worked-example.md +92 -0
- package/content/small-business/skills/small-business-cash-flow-snapshot/reference/gotchas.md +62 -0
- package/content/small-business/skills/small-business-cash-flow-snapshot/reference/v2_sources.md +84 -0
- package/content/small-business/skills/small-business-close-month/SKILL.md +86 -0
- package/content/small-business/skills/small-business-content-strategy/SKILL.md +152 -0
- package/content/small-business/skills/small-business-content-strategy/reference/examples/retail-boutique-example.md +71 -0
- package/content/small-business/skills/small-business-content-strategy/reference/gotchas.md +104 -0
- package/content/small-business/skills/small-business-content-strategy/reference/v2_sources.md +40 -0
- package/content/small-business/skills/small-business-contract-review/SKILL.md +158 -0
- package/content/small-business/skills/small-business-contract-review/reference/docusign-fetch.md +32 -0
- package/content/small-business/skills/small-business-contract-review/reference/examples/flagged-summary-saas.md +97 -0
- package/content/small-business/skills/small-business-contract-review/reference/gmail-fetch.md +30 -0
- package/content/small-business/skills/small-business-contract-review/reference/gotchas.md +105 -0
- package/content/small-business/skills/small-business-contract-review/reference/m365-fetch.md +60 -0
- package/content/small-business/skills/small-business-crm-autopilot/SKILL.md +162 -0
- package/content/small-business/skills/small-business-crm-autopilot/reference/cleanup-checklist.md +82 -0
- package/content/small-business/skills/small-business-crm-autopilot/reference/examples/cleanup-deal.md +83 -0
- package/content/small-business/skills/small-business-crm-autopilot/reference/examples/log-call-happy-path.md +68 -0
- package/content/small-business/skills/small-business-crm-autopilot/reference/examples/log-email-happy-path.md +50 -0
- package/content/small-business/skills/small-business-crm-autopilot/reference/gotchas.md +110 -0
- package/content/small-business/skills/small-business-crm-autopilot/reference/hubspot-fields.md +62 -0
- package/content/small-business/skills/small-business-crm-autopilot/reference/lightweight_crm.md +125 -0
- package/content/small-business/skills/small-business-crm-autopilot/reference/salesforce-fields.md +122 -0
- package/content/small-business/skills/small-business-crm-autopilot/reference/standing_mode.md +144 -0
- package/content/small-business/skills/small-business-grant-rfp-writer/SKILL.md +162 -0
- package/content/small-business/skills/small-business-grant-rfp-writer/reference/drafting.md +129 -0
- package/content/small-business/skills/small-business-grant-rfp-writer/reference/go_no_go.md +125 -0
- package/content/small-business/skills/small-business-grant-rfp-writer/reference/gotchas.md +180 -0
- package/content/small-business/skills/small-business-grant-rfp-writer/reference/opportunity_sources.md +90 -0
- package/content/small-business/skills/small-business-grant-rfp-writer/reference/org_profile.md +81 -0
- package/content/small-business/skills/small-business-grow-pipeline/SKILL.md +92 -0
- package/content/small-business/skills/small-business-growth-pulse/SKILL.md +143 -0
- package/content/small-business/skills/small-business-growth-pulse/reference/data_sources.md +113 -0
- package/content/small-business/skills/small-business-growth-pulse/reference/gotchas.md +175 -0
- package/content/small-business/skills/small-business-growth-pulse/reference/output_template.md +122 -0
- package/content/small-business/skills/small-business-growth-pulse/reference/thresholds.md +110 -0
- package/content/small-business/skills/small-business-hiring-screener/SKILL.md +137 -0
- package/content/small-business/skills/small-business-hiring-screener/reference/candidate_comms.md +132 -0
- package/content/small-business/skills/small-business-hiring-screener/reference/fair_screening.md +103 -0
- package/content/small-business/skills/small-business-hiring-screener/reference/gotchas.md +183 -0
- package/content/small-business/skills/small-business-hiring-screener/reference/onboarding.md +82 -0
- package/content/small-business/skills/small-business-hiring-screener/reference/rubric.md +122 -0
- package/content/small-business/skills/small-business-inbox-manager/SKILL.md +130 -0
- package/content/small-business/skills/small-business-inbox-manager/reference/digest_format.md +110 -0
- package/content/small-business/skills/small-business-inbox-manager/reference/gotchas.md +220 -0
- package/content/small-business/skills/small-business-inbox-manager/reference/handoffs.md +77 -0
- package/content/small-business/skills/small-business-inbox-manager/reference/reply_drafting.md +116 -0
- package/content/small-business/skills/small-business-inbox-manager/reference/triage_rules.md +72 -0
- package/content/small-business/skills/small-business-inventory-planner/SKILL.md +126 -0
- package/content/small-business/skills/small-business-inventory-planner/reference/data_sources.md +94 -0
- package/content/small-business/skills/small-business-inventory-planner/reference/gotchas.md +153 -0
- package/content/small-business/skills/small-business-inventory-planner/reference/po_drafting.md +92 -0
- package/content/small-business/skills/small-business-inventory-planner/reference/seasonality.md +112 -0
- package/content/small-business/skills/small-business-inventory-planner/reference/velocity_and_reorder.md +154 -0
- package/content/small-business/skills/small-business-invoice-chase/SKILL.md +131 -0
- package/content/small-business/skills/small-business-invoice-chase/reference/examples/firm-reminder.md +28 -0
- package/content/small-business/skills/small-business-invoice-chase/reference/examples/gentle-reminder.md +27 -0
- package/content/small-business/skills/small-business-invoice-chase/reference/gotchas.md +75 -0
- package/content/small-business/skills/small-business-invoice-chase/reference/tone-matching.md +44 -0
- package/content/small-business/skills/small-business-invoice-chase/reference/v2_sources.md +78 -0
- package/content/small-business/skills/small-business-job-post-builder/SKILL.md +204 -0
- package/content/small-business/skills/small-business-job-post-builder/reference/docusign-routing.md +63 -0
- package/content/small-business/skills/small-business-job-post-builder/reference/examples/worked-example.md +110 -0
- package/content/small-business/skills/small-business-job-post-builder/reference/existing-document-merge.md +58 -0
- package/content/small-business/skills/small-business-job-post-builder/reference/gotchas.md +68 -0
- package/content/small-business/skills/small-business-job-post-builder/reference/interview-guide-structure.md +93 -0
- package/content/small-business/skills/small-business-job-post-builder/reference/job-post-structure.md +62 -0
- package/content/small-business/skills/small-business-job-post-builder/reference/offer-letter-template.md +145 -0
- package/content/small-business/skills/small-business-job-post-builder/reference/role-intake.md +73 -0
- package/content/small-business/skills/small-business-lead-finder/SKILL.md +119 -0
- package/content/small-business/skills/small-business-lead-finder/reference/gotchas.md +152 -0
- package/content/small-business/skills/small-business-lead-finder/reference/icp_method.md +97 -0
- package/content/small-business/skills/small-business-lead-finder/reference/output_template.md +124 -0
- package/content/small-business/skills/small-business-lead-finder/reference/scoring.md +92 -0
- package/content/small-business/skills/small-business-lead-finder/reference/sourcing.md +78 -0
- package/content/small-business/skills/small-business-lead-triage/SKILL.md +81 -0
- package/content/small-business/skills/small-business-lead-triage/reference/examples/happy-path-triage.md +68 -0
- package/content/small-business/skills/small-business-lead-triage/reference/gotchas.md +76 -0
- package/content/small-business/skills/small-business-lead-triage/reference/hubspot-scoring.md +169 -0
- package/content/small-business/skills/small-business-marketing-monday/SKILL.md +108 -0
- package/content/small-business/skills/small-business-monday-brief/SKILL.md +97 -0
- package/content/small-business/skills/small-business-month-end-prep/SKILL.md +331 -0
- package/content/small-business/skills/small-business-month-end-prep/reference/close-packet-format.md +127 -0
- package/content/small-business/skills/small-business-month-end-prep/reference/examples/pl-narrative.md +52 -0
- package/content/small-business/skills/small-business-month-end-prep/reference/gotchas.md +113 -0
- package/content/small-business/skills/small-business-month-end-prep/reference/paypal-settlements.md +110 -0
- package/content/small-business/skills/small-business-month-end-prep/reference/quickbooks-reconcile.md +71 -0
- package/content/small-business/skills/small-business-month-end-prep/reference/v2_sources.md +125 -0
- package/content/small-business/skills/small-business-month-end-prep/reference/xero-reconcile.md +175 -0
- package/content/small-business/skills/small-business-month-end-prep/reference/zoho-books-reconcile.md +168 -0
- package/content/small-business/skills/small-business-outreach-composer/SKILL.md +144 -0
- package/content/small-business/skills/small-business-outreach-composer/reference/gotchas.md +213 -0
- package/content/small-business/skills/small-business-outreach-composer/reference/output_template.md +147 -0
- package/content/small-business/skills/small-business-outreach-composer/reference/sequence_patterns.md +99 -0
- package/content/small-business/skills/small-business-outreach-composer/reference/slop_test.md +164 -0
- package/content/small-business/skills/small-business-pay-the-bills/SKILL.md +101 -0
- package/content/small-business/skills/small-business-payroll-prep/SKILL.md +139 -0
- package/content/small-business/skills/small-business-payroll-prep/reference/anomaly_rules.md +99 -0
- package/content/small-business/skills/small-business-payroll-prep/reference/books_sync.md +72 -0
- package/content/small-business/skills/small-business-payroll-prep/reference/gotchas.md +153 -0
- package/content/small-business/skills/small-business-payroll-prep/reference/run_sheet_format.md +90 -0
- package/content/small-business/skills/small-business-payroll-prep/reference/timesheet_intake.md +118 -0
- package/content/small-business/skills/small-business-plan-payroll/SKILL.md +88 -0
- package/content/small-business/skills/small-business-proposal-builder/SKILL.md +168 -0
- package/content/small-business/skills/small-business-proposal-builder/reference/discovery_extraction.md +138 -0
- package/content/small-business/skills/small-business-proposal-builder/reference/gotchas.md +184 -0
- package/content/small-business/skills/small-business-proposal-builder/reference/output_template.md +128 -0
- package/content/small-business/skills/small-business-proposal-builder/reference/pricing_method.md +125 -0
- package/content/small-business/skills/small-business-proposal-builder/reference/proposal_structure.md +120 -0
- package/content/small-business/skills/small-business-reactivate/SKILL.md +109 -0
- package/content/small-business/skills/small-business-report-builder/SKILL.md +142 -0
- package/content/small-business/skills/small-business-report-builder/reference/data_sources.md +168 -0
- package/content/small-business/skills/small-business-report-builder/reference/gotchas.md +155 -0
- package/content/small-business/skills/small-business-report-builder/reference/output_template.md +109 -0
- package/content/small-business/skills/small-business-report-builder/reference/report_spec.md +109 -0
- package/content/small-business/skills/small-business-report-builder/reference/saved_reports.md +50 -0
- package/content/small-business/skills/small-business-report-pack/SKILL.md +83 -0
- package/content/small-business/skills/small-business-restock/SKILL.md +88 -0
- package/content/small-business/skills/small-business-review-reputation/SKILL.md +130 -0
- package/content/small-business/skills/small-business-review-reputation/reference/churn-signals.md +110 -0
- package/content/small-business/skills/small-business-review-reputation/reference/examples/example-report.md +150 -0
- package/content/small-business/skills/small-business-review-reputation/reference/gotchas.md +164 -0
- package/content/small-business/skills/small-business-review-reputation/reference/response-patterns.md +123 -0
- package/content/small-business/skills/small-business-review-reputation/reference/sources.md +116 -0
- package/content/small-business/skills/small-business-seo-ai-visibility/SKILL.md +143 -0
- package/content/small-business/skills/small-business-seo-ai-visibility/reference/ai_visibility.md +173 -0
- package/content/small-business/skills/small-business-seo-ai-visibility/reference/audit_checklist.md +134 -0
- package/content/small-business/skills/small-business-seo-ai-visibility/reference/catalog_refresh.md +126 -0
- package/content/small-business/skills/small-business-seo-ai-visibility/reference/content_rewrite.md +113 -0
- package/content/small-business/skills/small-business-seo-ai-visibility/reference/gotchas.md +211 -0
- package/content/small-business/skills/small-business-smb-onboard/SKILL.md +82 -0
- package/content/small-business/skills/small-business-smb-onboard/reference/examples/happy-path.md +190 -0
- package/content/small-business/skills/small-business-smb-onboard/reference/gotchas.md +111 -0
- package/content/small-business/skills/small-business-smb-onboard/reference/onboard-checklist.md +99 -0
- package/content/small-business/skills/small-business-smb-onboard/reference/website-research.md +82 -0
- package/content/small-business/skills/small-business-smb-router/SKILL.md +216 -0
- package/content/small-business/skills/small-business-smb-router/reference/connector-map.md +96 -0
- package/content/small-business/skills/small-business-social-content-engine/SKILL.md +162 -0
- package/content/small-business/skills/small-business-social-content-engine/reference/calendar.md +116 -0
- package/content/small-business/skills/small-business-social-content-engine/reference/canva-api.md +208 -0
- package/content/small-business/skills/small-business-social-content-engine/reference/examples/okonkwo-campaign.md +190 -0
- package/content/small-business/skills/small-business-social-content-engine/reference/gotchas.md +447 -0
- package/content/small-business/skills/small-business-social-content-engine/reference/publishing.md +166 -0
- package/content/small-business/skills/small-business-social-content-engine/reference/shopify-assets.md +77 -0
- package/content/small-business/skills/small-business-speed-to-lead/SKILL.md +172 -0
- package/content/small-business/skills/small-business-speed-to-lead/reference/approval.md +61 -0
- package/content/small-business/skills/small-business-speed-to-lead/reference/gotchas.md +167 -0
- package/content/small-business/skills/small-business-speed-to-lead/reference/qualification.md +153 -0
- package/content/small-business/skills/small-business-speed-to-lead/reference/response_patterns.md +184 -0
- package/content/small-business/skills/small-business-tax-prep/SKILL.md +85 -0
- package/content/small-business/skills/small-business-tax-season-organizer/SKILL.md +210 -0
- package/content/small-business/skills/small-business-tax-season-organizer/reference/calculation-assumptions.md +177 -0
- package/content/small-business/skills/small-business-tax-season-organizer/reference/connector-queries.md +267 -0
- package/content/small-business/skills/small-business-tax-season-organizer/reference/examples/quarterly-estimate.md +92 -0
- package/content/small-business/skills/small-business-tax-season-organizer/reference/examples/year-end-1099.md +102 -0
- package/content/small-business/skills/small-business-tax-season-organizer/reference/gotchas.md +104 -0
- package/content/small-business/skills/small-business-tax-season-organizer/reference/output-formats.md +68 -0
- package/content/small-business/skills/small-business-ticket-deflector/SKILL.md +164 -0
- package/content/small-business/skills/small-business-ticket-deflector/reference/examples/deny-refund-request.md +98 -0
- package/content/small-business/skills/small-business-ticket-deflector/reference/examples/respond-refund-request.md +77 -0
- package/content/small-business/skills/small-business-ticket-deflector/reference/gotchas.md +57 -0
- package/index.ts +84 -0
- package/package.json +30 -3
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
# Troubleshooting Guide for scvi-tools
|
|
2
|
+
|
|
3
|
+
This reference provides a consolidated guide for diagnosing and resolving common issues across all scvi-tools models.
|
|
4
|
+
|
|
5
|
+
## Quick Diagnosis
|
|
6
|
+
|
|
7
|
+
| Symptom | Likely Cause | Quick Fix |
|
|
8
|
+
|---------|--------------|-----------|
|
|
9
|
+
| "X should contain integers" | Normalized data in X | Use `layer="counts"` in setup |
|
|
10
|
+
| CUDA out of memory | GPU memory exhausted | Reduce `batch_size`, use smaller model |
|
|
11
|
+
| Training loss is NaN | Bad data or learning rate | Check for all-zero cells/genes |
|
|
12
|
+
| Batches not mixing | Too few shared features | Increase HVGs, check gene overlap |
|
|
13
|
+
| Over-correction | Too aggressive integration | Use scANVI with labels |
|
|
14
|
+
| Import error | Missing dependencies | `pip install scvi-tools[all]` |
|
|
15
|
+
|
|
16
|
+
## Data Format Issues
|
|
17
|
+
|
|
18
|
+
### Issue: CITE-seq protein data from Seurat is CLR-normalized
|
|
19
|
+
|
|
20
|
+
**Cause**: Seurat's `NormalizeData(normalization.method = "CLR")` transforms raw ADT counts. totalVI requires raw integer counts for protein data.
|
|
21
|
+
|
|
22
|
+
**Symptoms**:
|
|
23
|
+
- Protein values are not integers
|
|
24
|
+
- Protein values contain negative numbers
|
|
25
|
+
- Model training produces poor results
|
|
26
|
+
|
|
27
|
+
**Solution**:
|
|
28
|
+
```python
|
|
29
|
+
# Check if protein data is normalized
|
|
30
|
+
protein = adata.obsm["protein_expression"]
|
|
31
|
+
print(f"Min value: {protein.min()}") # Should be 0 if raw counts
|
|
32
|
+
print(f"Contains integers: {np.allclose(protein, protein.astype(int))}")
|
|
33
|
+
|
|
34
|
+
# If importing from Seurat, use the raw counts assay, not the normalized one
|
|
35
|
+
# In R/Seurat, export the RNA assay's counts slot, not the data slot
|
|
36
|
+
# GetAssayData(seurat_obj, assay = "ADT", slot = "counts")
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Issue: "layer not found" or "X should contain integers"
|
|
40
|
+
|
|
41
|
+
**Cause**: scvi-tools requires raw integer counts, not normalized data.
|
|
42
|
+
|
|
43
|
+
**Solution**:
|
|
44
|
+
```python
|
|
45
|
+
# Check if X contains integers
|
|
46
|
+
import numpy as np
|
|
47
|
+
print(f"X max: {adata.X.max()}")
|
|
48
|
+
print(f"Contains integers: {np.allclose(adata.X.data, adata.X.data.astype(int))}")
|
|
49
|
+
|
|
50
|
+
# If normalized, recover from raw
|
|
51
|
+
if hasattr(adata, 'raw') and adata.raw is not None:
|
|
52
|
+
adata = adata.raw.to_adata()
|
|
53
|
+
|
|
54
|
+
# Or use existing counts layer
|
|
55
|
+
adata.layers["counts"] = adata.X.copy()
|
|
56
|
+
scvi.model.SCVI.setup_anndata(adata, layer="counts")
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Issue: Sparse matrix errors
|
|
60
|
+
|
|
61
|
+
**Cause**: Incompatible sparse format or dense array expected.
|
|
62
|
+
|
|
63
|
+
**Solution**:
|
|
64
|
+
```python
|
|
65
|
+
from scipy.sparse import csr_matrix
|
|
66
|
+
|
|
67
|
+
# Convert to CSR format (most compatible)
|
|
68
|
+
if hasattr(adata.X, 'toarray'):
|
|
69
|
+
adata.X = csr_matrix(adata.X)
|
|
70
|
+
|
|
71
|
+
# Or convert to dense if small enough
|
|
72
|
+
if adata.n_obs * adata.n_vars < 1e8:
|
|
73
|
+
adata.X = adata.X.toarray()
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Issue: NaN or Inf values in data
|
|
77
|
+
|
|
78
|
+
**Cause**: Missing values or corrupted data.
|
|
79
|
+
|
|
80
|
+
**Solution**:
|
|
81
|
+
```python
|
|
82
|
+
import numpy as np
|
|
83
|
+
|
|
84
|
+
# Check for issues
|
|
85
|
+
X = adata.X.toarray() if hasattr(adata.X, 'toarray') else adata.X
|
|
86
|
+
print(f"NaN count: {np.isnan(X).sum()}")
|
|
87
|
+
print(f"Inf count: {np.isinf(X).sum()}")
|
|
88
|
+
print(f"Negative count: {(X < 0).sum()}")
|
|
89
|
+
|
|
90
|
+
# Replace NaN/Inf with 0
|
|
91
|
+
X = np.nan_to_num(X, nan=0, posinf=0, neginf=0)
|
|
92
|
+
X = np.clip(X, 0, None) # Ensure non-negative
|
|
93
|
+
adata.X = csr_matrix(X)
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Issue: batch_key or labels_key not found
|
|
97
|
+
|
|
98
|
+
**Cause**: Column name mismatch in adata.obs.
|
|
99
|
+
|
|
100
|
+
**Solution**:
|
|
101
|
+
```python
|
|
102
|
+
# List available columns
|
|
103
|
+
print(adata.obs.columns.tolist())
|
|
104
|
+
|
|
105
|
+
# Check for similar names
|
|
106
|
+
for col in adata.obs.columns:
|
|
107
|
+
if 'batch' in col.lower() or 'sample' in col.lower():
|
|
108
|
+
print(f"Potential batch column: {col}")
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## GPU and Memory Issues
|
|
112
|
+
|
|
113
|
+
### Issue: CUDA out of memory
|
|
114
|
+
|
|
115
|
+
**Cause**: Model or batch doesn't fit in GPU memory.
|
|
116
|
+
|
|
117
|
+
**Solutions** (try in order):
|
|
118
|
+
|
|
119
|
+
```python
|
|
120
|
+
# 1. Reduce batch size
|
|
121
|
+
model.train(batch_size=64) # Default is 128
|
|
122
|
+
|
|
123
|
+
# 2. Use smaller model architecture
|
|
124
|
+
model = scvi.model.SCVI(
|
|
125
|
+
adata,
|
|
126
|
+
n_latent=10, # Default is 10-30
|
|
127
|
+
n_layers=1 # Default is 1-2
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
# 3. Subset to fewer genes
|
|
131
|
+
sc.pp.highly_variable_genes(adata, n_top_genes=1500)
|
|
132
|
+
adata = adata[:, adata.var['highly_variable']].copy()
|
|
133
|
+
|
|
134
|
+
# 4. Clear GPU cache between models
|
|
135
|
+
import torch
|
|
136
|
+
torch.cuda.empty_cache()
|
|
137
|
+
|
|
138
|
+
# 5. Use CPU if GPU is too small
|
|
139
|
+
model.train(accelerator="cpu")
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Issue: No GPU detected
|
|
143
|
+
|
|
144
|
+
**Cause**: CUDA not installed or version mismatch.
|
|
145
|
+
|
|
146
|
+
**Diagnosis**:
|
|
147
|
+
```python
|
|
148
|
+
import torch
|
|
149
|
+
print(f"CUDA available: {torch.cuda.is_available()}")
|
|
150
|
+
print(f"PyTorch version: {torch.__version__}")
|
|
151
|
+
print(f"CUDA version: {torch.version.cuda}")
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
**Solution**:
|
|
155
|
+
```bash
|
|
156
|
+
# Check system CUDA
|
|
157
|
+
nvidia-smi
|
|
158
|
+
nvcc --version
|
|
159
|
+
|
|
160
|
+
# Reinstall PyTorch with matching CUDA
|
|
161
|
+
pip install torch --index-url https://download.pytorch.org/whl/cu118 # For CUDA 11.8
|
|
162
|
+
# Or
|
|
163
|
+
pip install torch --index-url https://download.pytorch.org/whl/cu121 # For CUDA 12.1
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Issue: Memory error with large datasets
|
|
167
|
+
|
|
168
|
+
**Cause**: Dataset too large for system RAM.
|
|
169
|
+
|
|
170
|
+
**Solutions**:
|
|
171
|
+
```python
|
|
172
|
+
# 1. Process in chunks (for very large data)
|
|
173
|
+
# Subsample for initial exploration
|
|
174
|
+
adata_sample = adata[np.random.choice(adata.n_obs, 50000, replace=False)].copy()
|
|
175
|
+
|
|
176
|
+
# 2. Use backed mode for AnnData
|
|
177
|
+
adata = sc.read_h5ad("large_data.h5ad", backed='r')
|
|
178
|
+
|
|
179
|
+
# 3. Reduce gene count aggressively
|
|
180
|
+
adata = adata[:, adata.var['highly_variable']].copy()
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## Training Issues
|
|
184
|
+
|
|
185
|
+
### Issue: Training loss is NaN
|
|
186
|
+
|
|
187
|
+
**Cause**: Numerical instability, bad data, or learning rate issues.
|
|
188
|
+
|
|
189
|
+
**Solutions**:
|
|
190
|
+
```python
|
|
191
|
+
# 1. Check for problematic cells/genes
|
|
192
|
+
sc.pp.filter_cells(adata, min_genes=200)
|
|
193
|
+
sc.pp.filter_genes(adata, min_cells=3)
|
|
194
|
+
|
|
195
|
+
# 2. Remove cells with zero counts
|
|
196
|
+
adata = adata[adata.X.sum(axis=1) > 0].copy()
|
|
197
|
+
|
|
198
|
+
# 3. Use gradient clipping (built into scvi-tools)
|
|
199
|
+
model.train(max_epochs=200, early_stopping=True)
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### Issue: Training doesn't converge
|
|
203
|
+
|
|
204
|
+
**Cause**: Insufficient epochs, poor hyperparameters, or data issues.
|
|
205
|
+
|
|
206
|
+
**Solutions**:
|
|
207
|
+
```python
|
|
208
|
+
# 1. Train longer
|
|
209
|
+
model.train(max_epochs=400)
|
|
210
|
+
|
|
211
|
+
# 2. Check training curves
|
|
212
|
+
import matplotlib.pyplot as plt
|
|
213
|
+
plt.plot(model.history['elbo_train'])
|
|
214
|
+
plt.plot(model.history['elbo_validation'])
|
|
215
|
+
plt.xlabel('Epoch')
|
|
216
|
+
plt.ylabel('ELBO')
|
|
217
|
+
plt.legend(['Train', 'Validation'])
|
|
218
|
+
|
|
219
|
+
# 3. Adjust model size for data size
|
|
220
|
+
# Small data (<10k cells): smaller model
|
|
221
|
+
model = scvi.model.SCVI(adata, n_latent=10, n_layers=1, dropout_rate=0.2)
|
|
222
|
+
|
|
223
|
+
# Large data (>100k cells): can use larger model
|
|
224
|
+
model = scvi.model.SCVI(adata, n_latent=30, n_layers=2)
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Issue: Overfitting (validation loss increases)
|
|
228
|
+
|
|
229
|
+
**Cause**: Model too complex or trained too long.
|
|
230
|
+
|
|
231
|
+
**Solutions**:
|
|
232
|
+
```python
|
|
233
|
+
# 1. Enable early stopping
|
|
234
|
+
model.train(early_stopping=True, early_stopping_patience=10)
|
|
235
|
+
|
|
236
|
+
# 2. Add regularization
|
|
237
|
+
model = scvi.model.SCVI(adata, dropout_rate=0.2)
|
|
238
|
+
|
|
239
|
+
# 3. Reduce model complexity
|
|
240
|
+
model = scvi.model.SCVI(adata, n_layers=1)
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
## Integration Issues
|
|
244
|
+
|
|
245
|
+
### Issue: Batches don't mix
|
|
246
|
+
|
|
247
|
+
**Cause**: Too few shared features, strong biological differences, or technical issues.
|
|
248
|
+
|
|
249
|
+
**Solutions**:
|
|
250
|
+
```python
|
|
251
|
+
# 1. Check gene overlap between batches
|
|
252
|
+
for batch in adata.obs['batch'].unique():
|
|
253
|
+
batch_genes = adata[adata.obs['batch'] == batch].var_names
|
|
254
|
+
print(f"{batch}: {len(batch_genes)} genes")
|
|
255
|
+
|
|
256
|
+
# 2. Use more HVGs
|
|
257
|
+
sc.pp.highly_variable_genes(adata, n_top_genes=4000, batch_key="batch")
|
|
258
|
+
|
|
259
|
+
# 3. Train longer
|
|
260
|
+
model.train(max_epochs=400)
|
|
261
|
+
|
|
262
|
+
# 4. Increase latent dimensions
|
|
263
|
+
model = scvi.model.SCVI(adata, n_latent=50)
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### Issue: Over-correction (biological signal lost)
|
|
267
|
+
|
|
268
|
+
**Cause**: Model removes too much variation.
|
|
269
|
+
|
|
270
|
+
**Solutions**:
|
|
271
|
+
```python
|
|
272
|
+
# 1. Use scANVI with cell type labels
|
|
273
|
+
scvi.model.SCANVI.from_scvi_model(scvi_model, labels_key="cell_type")
|
|
274
|
+
|
|
275
|
+
# 2. Reduce model capacity
|
|
276
|
+
model = scvi.model.SCVI(adata, n_latent=10)
|
|
277
|
+
|
|
278
|
+
# 3. Use categorical covariates instead of batch_key
|
|
279
|
+
scvi.model.SCVI.setup_anndata(
|
|
280
|
+
adata,
|
|
281
|
+
layer="counts",
|
|
282
|
+
categorical_covariate_keys=["batch"] # Less aggressive than batch_key
|
|
283
|
+
)
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
### Issue: One batch dominates clusters
|
|
287
|
+
|
|
288
|
+
**Cause**: Unbalanced batch sizes or incomplete integration.
|
|
289
|
+
|
|
290
|
+
**Solutions**:
|
|
291
|
+
```python
|
|
292
|
+
# 1. Check batch distribution
|
|
293
|
+
print(adata.obs['batch'].value_counts())
|
|
294
|
+
|
|
295
|
+
# 2. Subsample to balance
|
|
296
|
+
from sklearn.utils import resample
|
|
297
|
+
balanced = []
|
|
298
|
+
min_size = adata.obs['batch'].value_counts().min()
|
|
299
|
+
for batch in adata.obs['batch'].unique():
|
|
300
|
+
batch_data = adata[adata.obs['batch'] == batch]
|
|
301
|
+
balanced.append(batch_data[np.random.choice(len(batch_data), min_size, replace=False)])
|
|
302
|
+
adata_balanced = sc.concat(balanced)
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
## Model-Specific Issues
|
|
306
|
+
|
|
307
|
+
### scANVI: Poor label transfer
|
|
308
|
+
|
|
309
|
+
**Solutions**:
|
|
310
|
+
```python
|
|
311
|
+
# 1. Check label distribution
|
|
312
|
+
print(adata.obs['cell_type'].value_counts())
|
|
313
|
+
|
|
314
|
+
# 2. Use Unknown for low-confidence cells
|
|
315
|
+
adata.obs.loc[adata.obs['prediction_score'] < 0.5, 'cell_type'] = 'Unknown'
|
|
316
|
+
|
|
317
|
+
# 3. Train scVI longer before scANVI
|
|
318
|
+
scvi_model.train(max_epochs=300)
|
|
319
|
+
scanvi_model = scvi.model.SCANVI.from_scvi_model(scvi_model, labels_key="cell_type")
|
|
320
|
+
scanvi_model.train(max_epochs=100)
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
### totalVI: Noisy protein signal
|
|
324
|
+
|
|
325
|
+
**Solutions**:
|
|
326
|
+
```python
|
|
327
|
+
# 1. Use denoised protein values
|
|
328
|
+
_, protein_denoised = model.get_normalized_expression(return_mean=True)
|
|
329
|
+
|
|
330
|
+
# 2. Check isotype controls
|
|
331
|
+
# Isotype controls should have low expression
|
|
332
|
+
for i, name in enumerate(adata.uns["protein_names"]):
|
|
333
|
+
if 'isotype' in name.lower():
|
|
334
|
+
print(f"{name}: mean={adata.obsm['protein_expression'][:, i].mean():.1f}")
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### PeakVI: Poor clustering
|
|
338
|
+
|
|
339
|
+
**Solutions**:
|
|
340
|
+
```python
|
|
341
|
+
# 1. Use more variable peaks
|
|
342
|
+
from sklearn.feature_selection import VarianceThreshold
|
|
343
|
+
selector = VarianceThreshold(threshold=0.05)
|
|
344
|
+
adata = adata[:, selector.fit(adata.X).get_support()].copy()
|
|
345
|
+
|
|
346
|
+
# 2. Binarize data
|
|
347
|
+
adata.X = (adata.X > 0).astype(np.float32)
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
### MultiVI: Different cell counts between modalities
|
|
351
|
+
|
|
352
|
+
**Solutions**:
|
|
353
|
+
```python
|
|
354
|
+
# Ensure same cells in same order
|
|
355
|
+
common_cells = adata_rna.obs_names.intersection(adata_atac.obs_names)
|
|
356
|
+
adata_rna = adata_rna[common_cells].copy()
|
|
357
|
+
adata_atac = adata_atac[common_cells].copy()
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
### DestVI: Poor deconvolution
|
|
361
|
+
|
|
362
|
+
**Solutions**:
|
|
363
|
+
```python
|
|
364
|
+
# 1. Check gene overlap
|
|
365
|
+
common_genes = adata_ref.var_names.intersection(adata_spatial.var_names)
|
|
366
|
+
print(f"Common genes: {len(common_genes)}") # Should be >1000
|
|
367
|
+
|
|
368
|
+
# 2. Use tissue-matched reference
|
|
369
|
+
# Reference should contain all cell types expected in spatial data
|
|
370
|
+
|
|
371
|
+
# 3. Check reference quality
|
|
372
|
+
print(adata_ref.obs['cell_type'].value_counts())
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
## Version Compatibility
|
|
376
|
+
|
|
377
|
+
### scvi-tools 1.x vs 0.x API changes
|
|
378
|
+
|
|
379
|
+
Key differences:
|
|
380
|
+
```python
|
|
381
|
+
# 0.x API
|
|
382
|
+
scvi.data.setup_anndata(adata, ...)
|
|
383
|
+
|
|
384
|
+
# 1.x API (current)
|
|
385
|
+
scvi.model.SCVI.setup_anndata(adata, ...)
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
### Check versions
|
|
389
|
+
```python
|
|
390
|
+
import scvi
|
|
391
|
+
import scanpy as sc
|
|
392
|
+
import anndata
|
|
393
|
+
import torch
|
|
394
|
+
|
|
395
|
+
print(f"scvi-tools: {scvi.__version__}")
|
|
396
|
+
print(f"scanpy: {sc.__version__}")
|
|
397
|
+
print(f"anndata: {anndata.__version__}")
|
|
398
|
+
print(f"torch: {torch.__version__}")
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
### Recommended versions (as of late 2024)
|
|
402
|
+
```
|
|
403
|
+
scvi-tools>=1.0.0
|
|
404
|
+
scanpy>=1.9.0
|
|
405
|
+
anndata>=0.9.0
|
|
406
|
+
torch>=2.0.0
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
## Getting Help
|
|
410
|
+
|
|
411
|
+
1. **Check documentation**: https://docs.scvi-tools.org/
|
|
412
|
+
2. **GitHub issues**: https://github.com/scverse/scvi-tools/issues
|
|
413
|
+
3. **Discourse forum**: https://discourse.scverse.org/
|
|
414
|
+
4. **Tutorials**: https://docs.scvi-tools.org/en/stable/tutorials/index.html
|
|
415
|
+
|
|
416
|
+
When reporting issues, include:
|
|
417
|
+
- scvi-tools version (`scvi.__version__`)
|
|
418
|
+
- Python version
|
|
419
|
+
- Full error traceback
|
|
420
|
+
- Minimal reproducible example
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Cluster and embed data using scvi-tools latent representation.
|
|
4
|
+
|
|
5
|
+
Computes neighbors, UMAP, and Leiden clustering on the latent space.
|
|
6
|
+
Input should have latent representation from train_model.py.
|
|
7
|
+
|
|
8
|
+
Usage:
|
|
9
|
+
python cluster_embed.py input.h5ad output_dir/
|
|
10
|
+
python cluster_embed.py input.h5ad output_dir/ --resolution 0.5 --use-rep X_scVI
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
import argparse
|
|
14
|
+
import os
|
|
15
|
+
import sys
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def cluster_and_embed(
|
|
19
|
+
adata,
|
|
20
|
+
use_rep=None,
|
|
21
|
+
n_neighbors=15,
|
|
22
|
+
resolution=1.0,
|
|
23
|
+
min_dist=0.3
|
|
24
|
+
):
|
|
25
|
+
"""
|
|
26
|
+
Cluster and compute UMAP embedding.
|
|
27
|
+
|
|
28
|
+
Parameters
|
|
29
|
+
----------
|
|
30
|
+
adata : AnnData
|
|
31
|
+
Data with latent representation in obsm
|
|
32
|
+
use_rep : str, optional
|
|
33
|
+
Key in obsm to use (auto-detects if None)
|
|
34
|
+
n_neighbors : int
|
|
35
|
+
Number of neighbors for graph
|
|
36
|
+
resolution : float
|
|
37
|
+
Leiden clustering resolution
|
|
38
|
+
min_dist : float
|
|
39
|
+
UMAP min_dist parameter
|
|
40
|
+
|
|
41
|
+
Returns
|
|
42
|
+
-------
|
|
43
|
+
AnnData with neighbors, UMAP, and leiden clustering
|
|
44
|
+
"""
|
|
45
|
+
import scanpy as sc
|
|
46
|
+
|
|
47
|
+
# Auto-detect representation
|
|
48
|
+
if use_rep is None:
|
|
49
|
+
candidates = ["X_scANVI", "X_scVI", "X_totalVI", "X_PeakVI", "X_MultiVI"]
|
|
50
|
+
for key in candidates:
|
|
51
|
+
if key in adata.obsm:
|
|
52
|
+
use_rep = key
|
|
53
|
+
break
|
|
54
|
+
|
|
55
|
+
if use_rep is None:
|
|
56
|
+
# Fall back to PCA
|
|
57
|
+
if "X_pca" not in adata.obsm:
|
|
58
|
+
print("No scvi-tools embedding found, computing PCA...")
|
|
59
|
+
sc.pp.pca(adata)
|
|
60
|
+
use_rep = "X_pca"
|
|
61
|
+
|
|
62
|
+
print(f"Using representation: {use_rep}")
|
|
63
|
+
print(f"Embedding shape: {adata.obsm[use_rep].shape}")
|
|
64
|
+
|
|
65
|
+
# Compute neighbors
|
|
66
|
+
print(f"Computing neighbors (n={n_neighbors})...")
|
|
67
|
+
sc.pp.neighbors(adata, use_rep=use_rep, n_neighbors=n_neighbors)
|
|
68
|
+
|
|
69
|
+
# UMAP
|
|
70
|
+
print(f"Computing UMAP (min_dist={min_dist})...")
|
|
71
|
+
sc.tl.umap(adata, min_dist=min_dist)
|
|
72
|
+
|
|
73
|
+
# Leiden clustering
|
|
74
|
+
print(f"Computing Leiden clustering (resolution={resolution})...")
|
|
75
|
+
sc.tl.leiden(adata, resolution=resolution)
|
|
76
|
+
|
|
77
|
+
n_clusters = adata.obs['leiden'].nunique()
|
|
78
|
+
print(f"Found {n_clusters} clusters")
|
|
79
|
+
|
|
80
|
+
return adata
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def plot_results(adata, output_dir, batch_key=None, labels_key=None):
|
|
84
|
+
"""Generate and save visualization plots."""
|
|
85
|
+
import scanpy as sc
|
|
86
|
+
import matplotlib.pyplot as plt
|
|
87
|
+
|
|
88
|
+
plots = []
|
|
89
|
+
|
|
90
|
+
# Always plot clusters
|
|
91
|
+
plots.append(("leiden", "Clusters"))
|
|
92
|
+
|
|
93
|
+
# Plot batch if available
|
|
94
|
+
if batch_key is not None and batch_key in adata.obs.columns:
|
|
95
|
+
plots.append((batch_key, f"Batch ({batch_key})"))
|
|
96
|
+
|
|
97
|
+
# Plot labels if available
|
|
98
|
+
if labels_key is not None and labels_key in adata.obs.columns:
|
|
99
|
+
plots.append((labels_key, f"Labels ({labels_key})"))
|
|
100
|
+
|
|
101
|
+
# Check for common columns
|
|
102
|
+
for col in adata.obs.columns:
|
|
103
|
+
if col not in [p[0] for p in plots]:
|
|
104
|
+
if 'cell' in col.lower() and 'type' in col.lower():
|
|
105
|
+
plots.append((col, col))
|
|
106
|
+
elif 'predict' in col.lower():
|
|
107
|
+
plots.append((col, col))
|
|
108
|
+
|
|
109
|
+
# Limit to 6 plots
|
|
110
|
+
plots = plots[:6]
|
|
111
|
+
|
|
112
|
+
# Create figure
|
|
113
|
+
n_plots = len(plots)
|
|
114
|
+
n_cols = min(3, n_plots)
|
|
115
|
+
n_rows = (n_plots + n_cols - 1) // n_cols
|
|
116
|
+
|
|
117
|
+
fig, axes = plt.subplots(n_rows, n_cols, figsize=(5 * n_cols, 4 * n_rows))
|
|
118
|
+
if n_plots == 1:
|
|
119
|
+
axes = [axes]
|
|
120
|
+
else:
|
|
121
|
+
axes = axes.flatten()
|
|
122
|
+
|
|
123
|
+
for i, (color, title) in enumerate(plots):
|
|
124
|
+
try:
|
|
125
|
+
sc.pl.umap(adata, color=color, ax=axes[i], show=False, title=title)
|
|
126
|
+
except Exception as e:
|
|
127
|
+
axes[i].set_title(f"Could not plot {color}: {e}")
|
|
128
|
+
|
|
129
|
+
# Hide unused axes
|
|
130
|
+
for i in range(len(plots), len(axes)):
|
|
131
|
+
axes[i].set_visible(False)
|
|
132
|
+
|
|
133
|
+
plt.tight_layout()
|
|
134
|
+
|
|
135
|
+
plot_path = os.path.join(output_dir, "umap_clusters.png")
|
|
136
|
+
plt.savefig(plot_path, dpi=150, bbox_inches="tight")
|
|
137
|
+
plt.close()
|
|
138
|
+
print(f"UMAP plot saved to {plot_path}")
|
|
139
|
+
|
|
140
|
+
# Save cluster counts
|
|
141
|
+
cluster_counts = adata.obs['leiden'].value_counts().sort_index()
|
|
142
|
+
counts_path = os.path.join(output_dir, "cluster_counts.csv")
|
|
143
|
+
cluster_counts.to_csv(counts_path)
|
|
144
|
+
print(f"Cluster counts saved to {counts_path}")
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
def main():
|
|
148
|
+
parser = argparse.ArgumentParser(
|
|
149
|
+
description="Cluster and embed using scvi-tools latent space",
|
|
150
|
+
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
151
|
+
epilog="""
|
|
152
|
+
Examples:
|
|
153
|
+
# Basic clustering
|
|
154
|
+
python cluster_embed.py adata_trained.h5ad results/
|
|
155
|
+
|
|
156
|
+
# Custom resolution
|
|
157
|
+
python cluster_embed.py adata_trained.h5ad results/ --resolution 0.5
|
|
158
|
+
|
|
159
|
+
# Specify representation
|
|
160
|
+
python cluster_embed.py adata_trained.h5ad results/ --use-rep X_scANVI
|
|
161
|
+
|
|
162
|
+
# Include batch and label columns in plots
|
|
163
|
+
python cluster_embed.py adata_trained.h5ad results/ --batch-key batch --labels-key cell_type
|
|
164
|
+
"""
|
|
165
|
+
)
|
|
166
|
+
parser.add_argument("input", help="Input h5ad file with latent representation")
|
|
167
|
+
parser.add_argument("output_dir", help="Output directory")
|
|
168
|
+
parser.add_argument("--use-rep", help="Representation key in obsm (auto-detects)")
|
|
169
|
+
parser.add_argument("--n-neighbors", type=int, default=15, help="Neighbors for graph (default: 15)")
|
|
170
|
+
parser.add_argument("--resolution", type=float, default=1.0, help="Leiden resolution (default: 1.0)")
|
|
171
|
+
parser.add_argument("--min-dist", type=float, default=0.3, help="UMAP min_dist (default: 0.3)")
|
|
172
|
+
parser.add_argument("--batch-key", help="Batch column for plotting")
|
|
173
|
+
parser.add_argument("--labels-key", help="Labels column for plotting")
|
|
174
|
+
|
|
175
|
+
args = parser.parse_args()
|
|
176
|
+
|
|
177
|
+
try:
|
|
178
|
+
import scanpy as sc
|
|
179
|
+
except ImportError:
|
|
180
|
+
print("Error: scanpy required. Install with: pip install scanpy")
|
|
181
|
+
sys.exit(1)
|
|
182
|
+
|
|
183
|
+
# Create output directory
|
|
184
|
+
os.makedirs(args.output_dir, exist_ok=True)
|
|
185
|
+
|
|
186
|
+
# Load data
|
|
187
|
+
print(f"Loading {args.input}...")
|
|
188
|
+
adata = sc.read_h5ad(args.input)
|
|
189
|
+
print(f"Data: {adata.shape}")
|
|
190
|
+
|
|
191
|
+
# Cluster and embed
|
|
192
|
+
adata = cluster_and_embed(
|
|
193
|
+
adata,
|
|
194
|
+
use_rep=args.use_rep,
|
|
195
|
+
n_neighbors=args.n_neighbors,
|
|
196
|
+
resolution=args.resolution,
|
|
197
|
+
min_dist=args.min_dist
|
|
198
|
+
)
|
|
199
|
+
|
|
200
|
+
# Save results
|
|
201
|
+
adata_path = os.path.join(args.output_dir, "adata_clustered.h5ad")
|
|
202
|
+
adata.write_h5ad(adata_path)
|
|
203
|
+
print(f"AnnData saved to {adata_path}")
|
|
204
|
+
|
|
205
|
+
# Plot
|
|
206
|
+
plot_results(adata, args.output_dir, args.batch_key, args.labels_key)
|
|
207
|
+
|
|
208
|
+
print("\nDone!")
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
if __name__ == "__main__":
|
|
212
|
+
main()
|