@synsci/cli-darwin-x64 1.1.70 → 1.1.72
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/bin/skills/citation-management/SKILL.md +1109 -0
- package/bin/skills/citation-management/assets/bibtex_template.bib +264 -0
- package/bin/skills/citation-management/assets/citation_checklist.md +386 -0
- package/bin/skills/citation-management/references/bibtex_formatting.md +908 -0
- package/bin/skills/citation-management/references/citation_validation.md +794 -0
- package/bin/skills/citation-management/references/google_scholar_search.md +725 -0
- package/bin/skills/citation-management/references/metadata_extraction.md +870 -0
- package/bin/skills/citation-management/references/pubmed_search.md +839 -0
- package/bin/skills/citation-management/scripts/doi_to_bibtex.py +182 -0
- package/bin/skills/citation-management/scripts/extract_metadata.py +570 -0
- package/bin/skills/citation-management/scripts/format_bibtex.py +349 -0
- package/bin/skills/citation-management/scripts/search_google_scholar.py +251 -0
- package/bin/skills/citation-management/scripts/search_pubmed.py +348 -0
- package/bin/skills/citation-management/scripts/validate_citations.py +494 -0
- package/bin/skills/clinical-decision-support/README.md +129 -0
- package/bin/skills/clinical-decision-support/SKILL.md +506 -0
- package/bin/skills/clinical-decision-support/assets/biomarker_report_template.tex +380 -0
- package/bin/skills/clinical-decision-support/assets/clinical_pathway_template.tex +222 -0
- package/bin/skills/clinical-decision-support/assets/cohort_analysis_template.tex +359 -0
- package/bin/skills/clinical-decision-support/assets/color_schemes.tex +149 -0
- package/bin/skills/clinical-decision-support/assets/example_gbm_cohort.md +208 -0
- package/bin/skills/clinical-decision-support/assets/recommendation_strength_guide.md +328 -0
- package/bin/skills/clinical-decision-support/assets/treatment_recommendation_template.tex +529 -0
- package/bin/skills/clinical-decision-support/references/biomarker_classification.md +719 -0
- package/bin/skills/clinical-decision-support/references/clinical_decision_algorithms.md +604 -0
- package/bin/skills/clinical-decision-support/references/evidence_synthesis.md +840 -0
- package/bin/skills/clinical-decision-support/references/outcome_analysis.md +640 -0
- package/bin/skills/clinical-decision-support/references/patient_cohort_analysis.md +427 -0
- package/bin/skills/clinical-decision-support/references/treatment_recommendations.md +521 -0
- package/bin/skills/clinical-decision-support/scripts/biomarker_classifier.py +383 -0
- package/bin/skills/clinical-decision-support/scripts/build_decision_tree.py +417 -0
- package/bin/skills/clinical-decision-support/scripts/create_cohort_tables.py +509 -0
- package/bin/skills/clinical-decision-support/scripts/generate_survival_analysis.py +441 -0
- package/bin/skills/clinical-decision-support/scripts/validate_cds_document.py +326 -0
- package/bin/skills/clinical-reports/IMPLEMENTATION_SUMMARY.md +641 -0
- package/bin/skills/clinical-reports/README.md +236 -0
- package/bin/skills/clinical-reports/SKILL.md +1127 -0
- package/bin/skills/clinical-reports/assets/case_report_template.md +352 -0
- package/bin/skills/clinical-reports/assets/clinical_trial_csr_template.md +353 -0
- package/bin/skills/clinical-reports/assets/clinical_trial_sae_template.md +359 -0
- package/bin/skills/clinical-reports/assets/consult_note_template.md +305 -0
- package/bin/skills/clinical-reports/assets/discharge_summary_template.md +453 -0
- package/bin/skills/clinical-reports/assets/hipaa_compliance_checklist.md +395 -0
- package/bin/skills/clinical-reports/assets/history_physical_template.md +305 -0
- package/bin/skills/clinical-reports/assets/lab_report_template.md +309 -0
- package/bin/skills/clinical-reports/assets/pathology_report_template.md +249 -0
- package/bin/skills/clinical-reports/assets/quality_checklist.md +338 -0
- package/bin/skills/clinical-reports/assets/radiology_report_template.md +318 -0
- package/bin/skills/clinical-reports/assets/soap_note_template.md +253 -0
- package/bin/skills/clinical-reports/references/case_report_guidelines.md +570 -0
- package/bin/skills/clinical-reports/references/clinical_trial_reporting.md +693 -0
- package/bin/skills/clinical-reports/references/data_presentation.md +530 -0
- package/bin/skills/clinical-reports/references/diagnostic_reports_standards.md +629 -0
- package/bin/skills/clinical-reports/references/medical_terminology.md +588 -0
- package/bin/skills/clinical-reports/references/patient_documentation.md +744 -0
- package/bin/skills/clinical-reports/references/peer_review_standards.md +585 -0
- package/bin/skills/clinical-reports/references/regulatory_compliance.md +577 -0
- package/bin/skills/clinical-reports/scripts/check_deidentification.py +332 -0
- package/bin/skills/clinical-reports/scripts/compliance_checker.py +78 -0
- package/bin/skills/clinical-reports/scripts/extract_clinical_data.py +97 -0
- package/bin/skills/clinical-reports/scripts/format_adverse_events.py +97 -0
- package/bin/skills/clinical-reports/scripts/generate_report_template.py +149 -0
- package/bin/skills/clinical-reports/scripts/terminology_validator.py +126 -0
- package/bin/skills/clinical-reports/scripts/validate_case_report.py +323 -0
- package/bin/skills/clinical-reports/scripts/validate_trial_report.py +88 -0
- package/bin/skills/fireworks-ai/SKILL.md +665 -0
- package/bin/skills/generate-image/SKILL.md +178 -0
- package/bin/skills/generate-image/scripts/generate_image.py +254 -0
- package/bin/skills/groq/SKILL.md +347 -0
- package/bin/skills/hypothesis-generation/SKILL.md +293 -0
- package/bin/skills/hypothesis-generation/assets/FORMATTING_GUIDE.md +672 -0
- package/bin/skills/hypothesis-generation/assets/hypothesis_generation.sty +307 -0
- package/bin/skills/hypothesis-generation/assets/hypothesis_report_template.tex +572 -0
- package/bin/skills/hypothesis-generation/references/experimental_design_patterns.md +329 -0
- package/bin/skills/hypothesis-generation/references/hypothesis_quality_criteria.md +198 -0
- package/bin/skills/hypothesis-generation/references/literature_search_strategies.md +622 -0
- package/bin/skills/latex-posters/README.md +417 -0
- package/bin/skills/latex-posters/SKILL.md +1602 -0
- package/bin/skills/latex-posters/assets/baposter_template.tex +257 -0
- package/bin/skills/latex-posters/assets/beamerposter_template.tex +244 -0
- package/bin/skills/latex-posters/assets/poster_quality_checklist.md +358 -0
- package/bin/skills/latex-posters/assets/tikzposter_template.tex +251 -0
- package/bin/skills/latex-posters/references/latex_poster_packages.md +745 -0
- package/bin/skills/latex-posters/references/poster_content_guide.md +748 -0
- package/bin/skills/latex-posters/references/poster_design_principles.md +806 -0
- package/bin/skills/latex-posters/references/poster_layout_design.md +900 -0
- package/bin/skills/latex-posters/scripts/review_poster.sh +214 -0
- package/bin/skills/literature-review/SKILL.md +641 -0
- package/bin/skills/literature-review/assets/review_template.md +412 -0
- package/bin/skills/literature-review/references/citation_styles.md +166 -0
- package/bin/skills/literature-review/references/database_strategies.md +455 -0
- package/bin/skills/literature-review/scripts/generate_pdf.py +184 -0
- package/bin/skills/literature-review/scripts/search_databases.py +310 -0
- package/bin/skills/literature-review/scripts/verify_citations.py +218 -0
- package/bin/skills/market-research-reports/SKILL.md +904 -0
- package/bin/skills/market-research-reports/assets/FORMATTING_GUIDE.md +428 -0
- package/bin/skills/market-research-reports/assets/market_report_template.tex +1380 -0
- package/bin/skills/market-research-reports/assets/market_research.sty +564 -0
- package/bin/skills/market-research-reports/references/data_analysis_patterns.md +548 -0
- package/bin/skills/market-research-reports/references/report_structure_guide.md +999 -0
- package/bin/skills/market-research-reports/references/visual_generation_guide.md +1077 -0
- package/bin/skills/market-research-reports/scripts/generate_market_visuals.py +472 -0
- package/bin/skills/markitdown/INSTALLATION_GUIDE.md +318 -0
- package/bin/skills/markitdown/LICENSE.txt +22 -0
- package/bin/skills/markitdown/OPENROUTER_INTEGRATION.md +359 -0
- package/bin/skills/markitdown/QUICK_REFERENCE.md +309 -0
- package/bin/skills/markitdown/README.md +184 -0
- package/bin/skills/markitdown/SKILL.md +486 -0
- package/bin/skills/markitdown/SKILL_SUMMARY.md +307 -0
- package/bin/skills/markitdown/assets/example_usage.md +463 -0
- package/bin/skills/markitdown/references/api_reference.md +399 -0
- package/bin/skills/markitdown/references/file_formats.md +542 -0
- package/bin/skills/markitdown/scripts/batch_convert.py +195 -0
- package/bin/skills/markitdown/scripts/convert_literature.py +262 -0
- package/bin/skills/markitdown/scripts/convert_with_ai.py +224 -0
- package/bin/skills/ml-paper-writing/SKILL.md +937 -0
- package/bin/skills/ml-paper-writing/references/checklists.md +361 -0
- package/bin/skills/ml-paper-writing/references/citation-workflow.md +562 -0
- package/bin/skills/ml-paper-writing/references/reviewer-guidelines.md +367 -0
- package/bin/skills/ml-paper-writing/references/sources.md +159 -0
- package/bin/skills/ml-paper-writing/references/writing-guide.md +476 -0
- package/bin/skills/ml-paper-writing/templates/README.md +251 -0
- package/bin/skills/ml-paper-writing/templates/aaai2026/README.md +534 -0
- package/bin/skills/ml-paper-writing/templates/aaai2026/aaai2026-unified-supp.tex +144 -0
- package/bin/skills/ml-paper-writing/templates/aaai2026/aaai2026-unified-template.tex +952 -0
- package/bin/skills/ml-paper-writing/templates/aaai2026/aaai2026.bib +111 -0
- package/bin/skills/ml-paper-writing/templates/aaai2026/aaai2026.bst +1493 -0
- package/bin/skills/ml-paper-writing/templates/aaai2026/aaai2026.sty +315 -0
- package/bin/skills/ml-paper-writing/templates/acl/README.md +50 -0
- package/bin/skills/ml-paper-writing/templates/acl/acl.sty +312 -0
- package/bin/skills/ml-paper-writing/templates/acl/acl_latex.tex +377 -0
- package/bin/skills/ml-paper-writing/templates/acl/acl_lualatex.tex +101 -0
- package/bin/skills/ml-paper-writing/templates/acl/acl_natbib.bst +1940 -0
- package/bin/skills/ml-paper-writing/templates/acl/anthology.bib.txt +26 -0
- package/bin/skills/ml-paper-writing/templates/acl/custom.bib +70 -0
- package/bin/skills/ml-paper-writing/templates/acl/formatting.md +326 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/README.md +3 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/colm2025_conference.bib +11 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/colm2025_conference.bst +1440 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/colm2025_conference.pdf +0 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/colm2025_conference.sty +218 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/colm2025_conference.tex +305 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/fancyhdr.sty +485 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/math_commands.tex +508 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/natbib.sty +1246 -0
- package/bin/skills/ml-paper-writing/templates/iclr2026/fancyhdr.sty +485 -0
- package/bin/skills/ml-paper-writing/templates/iclr2026/iclr2026_conference.bib +24 -0
- package/bin/skills/ml-paper-writing/templates/iclr2026/iclr2026_conference.bst +1440 -0
- package/bin/skills/ml-paper-writing/templates/iclr2026/iclr2026_conference.pdf +0 -0
- package/bin/skills/ml-paper-writing/templates/iclr2026/iclr2026_conference.sty +246 -0
- package/bin/skills/ml-paper-writing/templates/iclr2026/iclr2026_conference.tex +414 -0
- package/bin/skills/ml-paper-writing/templates/iclr2026/math_commands.tex +508 -0
- package/bin/skills/ml-paper-writing/templates/iclr2026/natbib.sty +1246 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/algorithm.sty +79 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/algorithmic.sty +201 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/example_paper.bib +75 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/example_paper.pdf +0 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/example_paper.tex +662 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/fancyhdr.sty +864 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/icml2026.bst +1443 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/icml2026.sty +767 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/icml_numpapers.pdf +0 -0
- package/bin/skills/ml-paper-writing/templates/neurips2025/Makefile +36 -0
- package/bin/skills/ml-paper-writing/templates/neurips2025/extra_pkgs.tex +53 -0
- package/bin/skills/ml-paper-writing/templates/neurips2025/main.tex +38 -0
- package/bin/skills/ml-paper-writing/templates/neurips2025/neurips.sty +382 -0
- package/bin/skills/paper-2-web/SKILL.md +491 -0
- package/bin/skills/paper-2-web/references/installation.md +141 -0
- package/bin/skills/paper-2-web/references/paper2poster.md +346 -0
- package/bin/skills/paper-2-web/references/paper2video.md +305 -0
- package/bin/skills/paper-2-web/references/paper2web.md +187 -0
- package/bin/skills/paper-2-web/references/usage_examples.md +436 -0
- package/bin/skills/peer-review/SKILL.md +702 -0
- package/bin/skills/peer-review/references/calibration_guidelines.md +196 -0
- package/bin/skills/peer-review/references/common_issues.md +552 -0
- package/bin/skills/peer-review/references/paper_mechanics.md +269 -0
- package/bin/skills/peer-review/references/reporting_standards.md +290 -0
- package/bin/skills/peer-review/references/scoring_rubric.md +239 -0
- package/bin/skills/pptx-posters/SKILL.md +410 -0
- package/bin/skills/pptx-posters/assets/poster_html_template.html +257 -0
- package/bin/skills/pptx-posters/assets/poster_quality_checklist.md +358 -0
- package/bin/skills/pptx-posters/references/poster_content_guide.md +748 -0
- package/bin/skills/pptx-posters/references/poster_design_principles.md +806 -0
- package/bin/skills/pptx-posters/references/poster_layout_design.md +900 -0
- package/bin/skills/research-grants/README.md +285 -0
- package/bin/skills/research-grants/SKILL.md +938 -0
- package/bin/skills/research-grants/assets/budget_justification_template.md +453 -0
- package/bin/skills/research-grants/assets/nih_specific_aims_template.md +166 -0
- package/bin/skills/research-grants/assets/nsf_project_summary_template.md +92 -0
- package/bin/skills/research-grants/references/broader_impacts.md +392 -0
- package/bin/skills/research-grants/references/darpa_guidelines.md +636 -0
- package/bin/skills/research-grants/references/doe_guidelines.md +586 -0
- package/bin/skills/research-grants/references/nih_guidelines.md +851 -0
- package/bin/skills/research-grants/references/nsf_guidelines.md +570 -0
- package/bin/skills/research-grants/references/specific_aims_guide.md +458 -0
- package/bin/skills/research-lookup/README.md +156 -0
- package/bin/skills/research-lookup/SKILL.md +606 -0
- package/bin/skills/research-lookup/examples.py +174 -0
- package/bin/skills/research-lookup/lookup.py +187 -0
- package/bin/skills/research-lookup/research_lookup.py +483 -0
- package/bin/skills/research-lookup/scripts/research_lookup.py +483 -0
- package/bin/skills/scholar-evaluation/SKILL.md +289 -0
- package/bin/skills/scholar-evaluation/references/evaluation_framework.md +663 -0
- package/bin/skills/scholar-evaluation/scripts/calculate_scores.py +366 -0
- package/bin/skills/scientific-critical-thinking/SKILL.md +566 -0
- package/bin/skills/scientific-critical-thinking/references/common_biases.md +364 -0
- package/bin/skills/scientific-critical-thinking/references/evidence_hierarchy.md +484 -0
- package/bin/skills/scientific-critical-thinking/references/experimental_design.md +496 -0
- package/bin/skills/scientific-critical-thinking/references/logical_fallacies.md +478 -0
- package/bin/skills/scientific-critical-thinking/references/scientific_method.md +169 -0
- package/bin/skills/scientific-critical-thinking/references/statistical_pitfalls.md +506 -0
- package/bin/skills/scientific-schematics/QUICK_REFERENCE.md +207 -0
- package/bin/skills/scientific-schematics/README.md +327 -0
- package/bin/skills/scientific-schematics/SKILL.md +615 -0
- package/bin/skills/scientific-schematics/example_usage.sh +89 -0
- package/bin/skills/scientific-schematics/references/best_practices.md +559 -0
- package/bin/skills/scientific-schematics/scripts/generate_schematic.py +135 -0
- package/bin/skills/scientific-schematics/scripts/generate_schematic_ai.py +807 -0
- package/bin/skills/scientific-schematics/test_ai_generation.py +243 -0
- package/bin/skills/scientific-slides/SKILL.md +942 -0
- package/bin/skills/scientific-slides/assets/timing_guidelines.md +597 -0
- package/bin/skills/scientific-slides/references/data_visualization_slides.md +708 -0
- package/bin/skills/scientific-slides/references/presentation_structure.md +642 -0
- package/bin/skills/scientific-slides/references/slide_design_principles.md +849 -0
- package/bin/skills/scientific-slides/references/talk_types_guide.md +687 -0
- package/bin/skills/scientific-slides/references/visual_review_workflow.md +775 -0
- package/bin/skills/scientific-slides/scripts/generate_slide_image.py +143 -0
- package/bin/skills/scientific-slides/scripts/generate_slide_image_ai.py +748 -0
- package/bin/skills/scientific-slides/scripts/pdf_to_images.py +201 -0
- package/bin/skills/scientific-slides/scripts/slides_to_pdf.py +220 -0
- package/bin/skills/scientific-slides/scripts/validate_presentation.py +367 -0
- package/bin/skills/scientific-writing/SKILL.md +714 -0
- package/bin/skills/scientific-writing/assets/REPORT_FORMATTING_GUIDE.md +574 -0
- package/bin/skills/scientific-writing/assets/scientific_report.sty +606 -0
- package/bin/skills/scientific-writing/assets/scientific_report_template.tex +449 -0
- package/bin/skills/scientific-writing/references/citation_styles.md +720 -0
- package/bin/skills/scientific-writing/references/figures_tables.md +806 -0
- package/bin/skills/scientific-writing/references/imrad_structure.md +686 -0
- package/bin/skills/scientific-writing/references/professional_report_formatting.md +664 -0
- package/bin/skills/scientific-writing/references/reporting_guidelines.md +748 -0
- package/bin/skills/scientific-writing/references/writing_principles.md +824 -0
- package/bin/skills/tinker/SKILL.md +2 -3
- package/bin/skills/together-ai/SKILL.md +722 -0
- package/bin/skills/treatment-plans/README.md +488 -0
- package/bin/skills/treatment-plans/SKILL.md +1579 -0
- package/bin/skills/treatment-plans/assets/STYLING_QUICK_REFERENCE.md +185 -0
- package/bin/skills/treatment-plans/assets/chronic_disease_management_plan.tex +665 -0
- package/bin/skills/treatment-plans/assets/general_medical_treatment_plan.tex +547 -0
- package/bin/skills/treatment-plans/assets/medical_treatment_plan.sty +222 -0
- package/bin/skills/treatment-plans/assets/mental_health_treatment_plan.tex +774 -0
- package/bin/skills/treatment-plans/assets/one_page_treatment_plan.tex +193 -0
- package/bin/skills/treatment-plans/assets/pain_management_plan.tex +799 -0
- package/bin/skills/treatment-plans/assets/perioperative_care_plan.tex +753 -0
- package/bin/skills/treatment-plans/assets/quality_checklist.md +471 -0
- package/bin/skills/treatment-plans/assets/rehabilitation_treatment_plan.tex +756 -0
- package/bin/skills/treatment-plans/references/goal_setting_frameworks.md +411 -0
- package/bin/skills/treatment-plans/references/intervention_guidelines.md +507 -0
- package/bin/skills/treatment-plans/references/regulatory_compliance.md +476 -0
- package/bin/skills/treatment-plans/references/specialty_specific_guidelines.md +655 -0
- package/bin/skills/treatment-plans/references/treatment_plan_standards.md +485 -0
- package/bin/skills/treatment-plans/scripts/check_completeness.py +322 -0
- package/bin/skills/treatment-plans/scripts/generate_template.py +233 -0
- package/bin/skills/treatment-plans/scripts/timeline_generator.py +385 -0
- package/bin/skills/treatment-plans/scripts/validate_treatment_plan.py +369 -0
- package/bin/skills/unsloth/SKILL.md +565 -47
- package/bin/skills/unsloth/docs/advanced-rl.md +222 -0
- package/bin/skills/unsloth/docs/chat-templates.md +141 -0
- package/bin/skills/unsloth/docs/datasets.md +489 -0
- package/bin/skills/unsloth/docs/docker-extended.md +99 -0
- package/bin/skills/unsloth/docs/dynamic-ggufs-2.0.md +116 -0
- package/bin/skills/unsloth/docs/dynamic-ggufs-aider.md +118 -0
- package/bin/skills/unsloth/docs/faq.md +91 -0
- package/bin/skills/unsloth/docs/fp16-vs-bf16.md +61 -0
- package/bin/skills/unsloth/docs/fp8-rl.md +224 -0
- package/bin/skills/unsloth/docs/glm-4.7-flash.md +997 -0
- package/bin/skills/unsloth/docs/inference-deployment-overview.md +17 -0
- package/bin/skills/unsloth/docs/inference.md +27 -0
- package/bin/skills/unsloth/docs/installation-docker.md +155 -0
- package/bin/skills/unsloth/docs/installation-pip.md +148 -0
- package/bin/skills/unsloth/docs/kernels-packing.md +190 -0
- package/bin/skills/unsloth/docs/kimi-k2.5.md +634 -0
- package/bin/skills/unsloth/docs/lm-studio.md +235 -0
- package/bin/skills/unsloth/docs/lora-hot-swapping.md +75 -0
- package/bin/skills/unsloth/docs/lora-hyperparameters.md +363 -0
- package/bin/skills/unsloth/docs/memory-efficient-rl.md +267 -0
- package/bin/skills/unsloth/docs/model-selection.md +70 -0
- package/bin/skills/unsloth/docs/models.md +532 -0
- package/bin/skills/unsloth/docs/multi-gpu-ddp.md +90 -0
- package/bin/skills/unsloth/docs/notebooks.md +223 -0
- package/bin/skills/unsloth/docs/overview.md +110 -0
- package/bin/skills/unsloth/docs/qwen3-coder-next-extended.md +900 -0
- package/bin/skills/unsloth/docs/qwen3-coder-next.md +900 -0
- package/bin/skills/unsloth/docs/requirements.md +45 -0
- package/bin/skills/unsloth/docs/reward-hacking.md +25 -0
- package/bin/skills/unsloth/docs/saving-to-gguf.md +138 -0
- package/bin/skills/unsloth/docs/saving-to-ollama.md +46 -0
- package/bin/skills/unsloth/docs/sglang-guide.md +278 -0
- package/bin/skills/unsloth/docs/speculative-decoding.md +70 -0
- package/bin/skills/unsloth/docs/tool-calling.md +334 -0
- package/bin/skills/unsloth/docs/troubleshooting-faq.md +204 -0
- package/bin/skills/unsloth/docs/troubleshooting-inference.md +26 -0
- package/bin/skills/unsloth/docs/tts-fine-tuning.md +149 -0
- package/bin/skills/unsloth/docs/tutorial-grpo.md +273 -0
- package/bin/skills/unsloth/docs/tutorial-llama3-ollama.md +356 -0
- package/bin/skills/unsloth/docs/vision-fine-tuning.md +135 -0
- package/bin/skills/unsloth/docs/vision-rl.md +170 -0
- package/bin/skills/unsloth/docs/vllm-engine-arguments.md +43 -0
- package/bin/skills/unsloth/docs/vllm-guide.md +98 -0
- package/bin/skills/venue-templates/SKILL.md +686 -0
- package/bin/skills/venue-templates/assets/examples/cell_summary_example.md +247 -0
- package/bin/skills/venue-templates/assets/examples/medical_structured_abstract.md +313 -0
- package/bin/skills/venue-templates/assets/examples/nature_abstract_examples.md +213 -0
- package/bin/skills/venue-templates/assets/examples/neurips_introduction_example.md +245 -0
- package/bin/skills/venue-templates/assets/grants/nih_specific_aims.tex +235 -0
- package/bin/skills/venue-templates/assets/grants/nsf_proposal_template.tex +375 -0
- package/bin/skills/venue-templates/assets/journals/nature_article.tex +171 -0
- package/bin/skills/venue-templates/assets/journals/neurips_article.tex +283 -0
- package/bin/skills/venue-templates/assets/journals/plos_one.tex +317 -0
- package/bin/skills/venue-templates/assets/posters/beamerposter_academic.tex +311 -0
- package/bin/skills/venue-templates/references/cell_press_style.md +483 -0
- package/bin/skills/venue-templates/references/conferences_formatting.md +564 -0
- package/bin/skills/venue-templates/references/cs_conference_style.md +463 -0
- package/bin/skills/venue-templates/references/grants_requirements.md +787 -0
- package/bin/skills/venue-templates/references/journals_formatting.md +486 -0
- package/bin/skills/venue-templates/references/medical_journal_styles.md +535 -0
- package/bin/skills/venue-templates/references/ml_conference_style.md +556 -0
- package/bin/skills/venue-templates/references/nature_science_style.md +405 -0
- package/bin/skills/venue-templates/references/posters_guidelines.md +628 -0
- package/bin/skills/venue-templates/references/reviewer_expectations.md +417 -0
- package/bin/skills/venue-templates/references/venue_writing_styles.md +321 -0
- package/bin/skills/venue-templates/scripts/customize_template.py +195 -0
- package/bin/skills/venue-templates/scripts/query_template.py +266 -0
- package/bin/skills/venue-templates/scripts/validate_format.py +250 -0
- package/bin/synsc +0 -0
- package/package.json +1 -1
- package/bin/skills/unsloth/references/index.md +0 -7
- package/bin/skills/unsloth/references/llms-full.md +0 -16799
- package/bin/skills/unsloth/references/llms-txt.md +0 -12044
- package/bin/skills/unsloth/references/llms.md +0 -82
|
@@ -0,0 +1,509 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Generate Clinical Cohort Tables for Baseline Characteristics and Outcomes
|
|
4
|
+
|
|
5
|
+
Creates publication-ready tables with:
|
|
6
|
+
- Baseline demographics (Table 1 style)
|
|
7
|
+
- Efficacy outcomes
|
|
8
|
+
- Safety/adverse events
|
|
9
|
+
- Statistical comparisons between groups
|
|
10
|
+
|
|
11
|
+
Dependencies: pandas, numpy, scipy
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
import argparse
|
|
15
|
+
from pathlib import Path
|
|
16
|
+
|
|
17
|
+
import numpy as np
|
|
18
|
+
import pandas as pd
|
|
19
|
+
from scipy import stats
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def calculate_p_value(data, variable, group_col='group', var_type='categorical'):
|
|
23
|
+
"""
|
|
24
|
+
Calculate appropriate p-value for group comparison.
|
|
25
|
+
|
|
26
|
+
Parameters:
|
|
27
|
+
data: DataFrame
|
|
28
|
+
variable: Column name to compare
|
|
29
|
+
group_col: Grouping variable
|
|
30
|
+
var_type: 'categorical', 'continuous_normal', 'continuous_nonnormal'
|
|
31
|
+
|
|
32
|
+
Returns:
|
|
33
|
+
p-value (float)
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
groups = data[group_col].unique()
|
|
37
|
+
|
|
38
|
+
if len(groups) != 2:
|
|
39
|
+
return np.nan # Only handle 2-group comparisons
|
|
40
|
+
|
|
41
|
+
group1_data = data[data[group_col] == groups[0]][variable].dropna()
|
|
42
|
+
group2_data = data[data[group_col] == groups[1]][variable].dropna()
|
|
43
|
+
|
|
44
|
+
if var_type == 'categorical':
|
|
45
|
+
# Chi-square or Fisher's exact test
|
|
46
|
+
contingency = pd.crosstab(data[variable], data[group_col])
|
|
47
|
+
|
|
48
|
+
# Check if Fisher's exact is needed (expected count < 5)
|
|
49
|
+
if contingency.min().min() < 5:
|
|
50
|
+
# Fisher's exact (2x2 only)
|
|
51
|
+
if contingency.shape == (2, 2):
|
|
52
|
+
_, p_value = stats.fisher_exact(contingency)
|
|
53
|
+
else:
|
|
54
|
+
# Use chi-square but note limitation
|
|
55
|
+
_, p_value, _, _ = stats.chi2_contingency(contingency)
|
|
56
|
+
else:
|
|
57
|
+
_, p_value, _, _ = stats.chi2_contingency(contingency)
|
|
58
|
+
|
|
59
|
+
elif var_type == 'continuous_normal':
|
|
60
|
+
# Independent t-test
|
|
61
|
+
_, p_value = stats.ttest_ind(group1_data, group2_data, equal_var=False)
|
|
62
|
+
|
|
63
|
+
elif var_type == 'continuous_nonnormal':
|
|
64
|
+
# Mann-Whitney U test
|
|
65
|
+
_, p_value = stats.mannwhitneyu(group1_data, group2_data, alternative='two-sided')
|
|
66
|
+
|
|
67
|
+
else:
|
|
68
|
+
raise ValueError("var_type must be 'categorical', 'continuous_normal', or 'continuous_nonnormal'")
|
|
69
|
+
|
|
70
|
+
return p_value
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def format_continuous_variable(data, variable, group_col, distribution='normal'):
|
|
74
|
+
"""
|
|
75
|
+
Format continuous variable for table display.
|
|
76
|
+
|
|
77
|
+
Returns:
|
|
78
|
+
Dictionary with formatted strings for each group and p-value
|
|
79
|
+
"""
|
|
80
|
+
|
|
81
|
+
groups = data[group_col].unique()
|
|
82
|
+
results = {}
|
|
83
|
+
|
|
84
|
+
for group in groups:
|
|
85
|
+
group_data = data[data[group_col] == group][variable].dropna()
|
|
86
|
+
|
|
87
|
+
if distribution == 'normal':
|
|
88
|
+
# Mean ± SD
|
|
89
|
+
mean = group_data.mean()
|
|
90
|
+
std = group_data.std()
|
|
91
|
+
results[group] = f"{mean:.1f} ± {std:.1f}"
|
|
92
|
+
else:
|
|
93
|
+
# Median [IQR]
|
|
94
|
+
median = group_data.median()
|
|
95
|
+
q1 = group_data.quantile(0.25)
|
|
96
|
+
q3 = group_data.quantile(0.75)
|
|
97
|
+
results[group] = f"{median:.1f} [{q1:.1f}-{q3:.1f}]"
|
|
98
|
+
|
|
99
|
+
# Calculate p-value
|
|
100
|
+
var_type = 'continuous_normal' if distribution == 'normal' else 'continuous_nonnormal'
|
|
101
|
+
p_value = calculate_p_value(data, variable, group_col, var_type)
|
|
102
|
+
results['p_value'] = f"{p_value:.3f}" if p_value < 0.001 else f"{p_value:.2f}" if p_value < 1.0 else "—"
|
|
103
|
+
|
|
104
|
+
return results
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def format_categorical_variable(data, variable, group_col):
|
|
108
|
+
"""
|
|
109
|
+
Format categorical variable for table display.
|
|
110
|
+
|
|
111
|
+
Returns:
|
|
112
|
+
List of dictionaries for each category with counts and percentages
|
|
113
|
+
"""
|
|
114
|
+
|
|
115
|
+
groups = data[group_col].unique()
|
|
116
|
+
categories = data[variable].dropna().unique()
|
|
117
|
+
|
|
118
|
+
results = []
|
|
119
|
+
|
|
120
|
+
for category in categories:
|
|
121
|
+
row = {'category': category}
|
|
122
|
+
|
|
123
|
+
for group in groups:
|
|
124
|
+
group_data = data[data[group_col] == group]
|
|
125
|
+
count = (group_data[variable] == category).sum()
|
|
126
|
+
total = group_data[variable].notna().sum()
|
|
127
|
+
percentage = (count / total * 100) if total > 0 else 0
|
|
128
|
+
row[group] = f"{count} ({percentage:.0f}%)"
|
|
129
|
+
|
|
130
|
+
results.append(row)
|
|
131
|
+
|
|
132
|
+
# Calculate p-value for overall categorical variable
|
|
133
|
+
p_value = calculate_p_value(data, variable, group_col, 'categorical')
|
|
134
|
+
results[0]['p_value'] = f"{p_value:.3f}" if p_value < 0.001 else f"{p_value:.2f}" if p_value < 1.0 else "—"
|
|
135
|
+
|
|
136
|
+
return results
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
def generate_baseline_table(data, group_col='group', output_file='table1_baseline.csv'):
|
|
140
|
+
"""
|
|
141
|
+
Generate Table 1: Baseline characteristics.
|
|
142
|
+
|
|
143
|
+
Customize the variables list for your specific cohort.
|
|
144
|
+
"""
|
|
145
|
+
|
|
146
|
+
groups = data[group_col].unique()
|
|
147
|
+
|
|
148
|
+
# Initialize results list
|
|
149
|
+
table_rows = []
|
|
150
|
+
|
|
151
|
+
# Header row
|
|
152
|
+
header = {
|
|
153
|
+
'Characteristic': 'Characteristic',
|
|
154
|
+
**{group: f"{group} (n={len(data[data[group_col] == group])})" for group in groups},
|
|
155
|
+
'p_value': 'p-value',
|
|
156
|
+
}
|
|
157
|
+
table_rows.append(header)
|
|
158
|
+
|
|
159
|
+
# Age (continuous)
|
|
160
|
+
if 'age' in data.columns:
|
|
161
|
+
age_results = format_continuous_variable(data, 'age', group_col, distribution='nonnormal')
|
|
162
|
+
row = {'Characteristic': 'Age, years (median [IQR])'}
|
|
163
|
+
for group in groups:
|
|
164
|
+
row[group] = age_results[group]
|
|
165
|
+
row['p_value'] = age_results['p_value']
|
|
166
|
+
table_rows.append(row)
|
|
167
|
+
|
|
168
|
+
# Sex (categorical)
|
|
169
|
+
if 'sex' in data.columns:
|
|
170
|
+
table_rows.append({'Characteristic': 'Sex, n (%)', **{g: '' for g in groups}, 'p_value': ''})
|
|
171
|
+
sex_results = format_categorical_variable(data, 'sex', group_col)
|
|
172
|
+
for sex_row in sex_results:
|
|
173
|
+
row = {'Characteristic': f" {sex_row['category']}"}
|
|
174
|
+
for group in groups:
|
|
175
|
+
row[group] = sex_row[group]
|
|
176
|
+
row['p_value'] = sex_row.get('p_value', '')
|
|
177
|
+
table_rows.append(row)
|
|
178
|
+
|
|
179
|
+
# ECOG Performance Status (categorical)
|
|
180
|
+
if 'ecog_ps' in data.columns:
|
|
181
|
+
table_rows.append({'Characteristic': 'ECOG PS, n (%)', **{g: '' for g in groups}, 'p_value': ''})
|
|
182
|
+
ecog_results = format_categorical_variable(data, 'ecog_ps', group_col)
|
|
183
|
+
for ecog_row in ecog_results:
|
|
184
|
+
row = {'Characteristic': f" {ecog_row['category']}"}
|
|
185
|
+
for group in groups:
|
|
186
|
+
row[group] = ecog_row[group]
|
|
187
|
+
row['p_value'] = ecog_row.get('p_value', '')
|
|
188
|
+
table_rows.append(row)
|
|
189
|
+
|
|
190
|
+
# Convert to DataFrame and save
|
|
191
|
+
df_table = pd.DataFrame(table_rows)
|
|
192
|
+
df_table.to_csv(output_file, index=False)
|
|
193
|
+
print(f"Baseline characteristics table saved to: {output_file}")
|
|
194
|
+
|
|
195
|
+
return df_table
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
def generate_efficacy_table(data, group_col='group', output_file='table2_efficacy.csv'):
|
|
199
|
+
"""
|
|
200
|
+
Generate efficacy outcomes table.
|
|
201
|
+
|
|
202
|
+
Expected columns:
|
|
203
|
+
- best_response: CR, PR, SD, PD
|
|
204
|
+
- Additional binary outcomes (response, disease_control, etc.)
|
|
205
|
+
"""
|
|
206
|
+
|
|
207
|
+
groups = data[group_col].unique()
|
|
208
|
+
table_rows = []
|
|
209
|
+
|
|
210
|
+
# Header
|
|
211
|
+
header = {
|
|
212
|
+
'Outcome': 'Outcome',
|
|
213
|
+
**{group: f"{group} (n={len(data[data[group_col] == group])})" for group in groups},
|
|
214
|
+
'p_value': 'p-value',
|
|
215
|
+
}
|
|
216
|
+
table_rows.append(header)
|
|
217
|
+
|
|
218
|
+
# Objective Response Rate (ORR = CR + PR)
|
|
219
|
+
if 'best_response' in data.columns:
|
|
220
|
+
for group in groups:
|
|
221
|
+
group_data = data[data[group_col] == group]
|
|
222
|
+
cr_pr = ((group_data['best_response'] == 'CR') | (group_data['best_response'] == 'PR')).sum()
|
|
223
|
+
total = len(group_data)
|
|
224
|
+
orr = cr_pr / total * 100
|
|
225
|
+
|
|
226
|
+
# Calculate exact binomial CI (Clopper-Pearson)
|
|
227
|
+
ci_lower, ci_upper = _binomial_ci(cr_pr, total)
|
|
228
|
+
|
|
229
|
+
if group == groups[0]:
|
|
230
|
+
orr_row = {'Outcome': 'ORR, n (%) [95% CI]'}
|
|
231
|
+
|
|
232
|
+
orr_row[group] = f"{cr_pr} ({orr:.0f}%) [{ci_lower:.0f}-{ci_upper:.0f}]"
|
|
233
|
+
|
|
234
|
+
# P-value for ORR difference
|
|
235
|
+
contingency = pd.crosstab(data['best_response'].isin(['CR', 'PR']), data[group_col])
|
|
236
|
+
_, p_value, _, _ = stats.chi2_contingency(contingency)
|
|
237
|
+
orr_row['p_value'] = f"{p_value:.3f}" if p_value >= 0.001 else "<0.001"
|
|
238
|
+
table_rows.append(orr_row)
|
|
239
|
+
|
|
240
|
+
# Individual response categories
|
|
241
|
+
for response in ['CR', 'PR', 'SD', 'PD']:
|
|
242
|
+
row = {'Outcome': f" {response}"}
|
|
243
|
+
for group in groups:
|
|
244
|
+
group_data = data[data[group_col] == group]
|
|
245
|
+
count = (group_data['best_response'] == response).sum()
|
|
246
|
+
total = len(group_data)
|
|
247
|
+
pct = count / total * 100
|
|
248
|
+
row[group] = f"{count} ({pct:.0f}%)"
|
|
249
|
+
row['p_value'] = ''
|
|
250
|
+
table_rows.append(row)
|
|
251
|
+
|
|
252
|
+
# Disease Control Rate (DCR = CR + PR + SD)
|
|
253
|
+
if 'best_response' in data.columns:
|
|
254
|
+
dcr_row = {'Outcome': 'DCR, n (%) [95% CI]'}
|
|
255
|
+
for group in groups:
|
|
256
|
+
group_data = data[data[group_col] == group]
|
|
257
|
+
dcr_count = group_data['best_response'].isin(['CR', 'PR', 'SD']).sum()
|
|
258
|
+
total = len(group_data)
|
|
259
|
+
dcr = dcr_count / total * 100
|
|
260
|
+
ci_lower, ci_upper = _binomial_ci(dcr_count, total)
|
|
261
|
+
dcr_row[group] = f"{dcr_count} ({dcr:.0f}%) [{ci_lower:.0f}-{ci_upper:.0f}]"
|
|
262
|
+
|
|
263
|
+
# P-value
|
|
264
|
+
contingency = pd.crosstab(data['best_response'].isin(['CR', 'PR', 'SD']), data[group_col])
|
|
265
|
+
_, p_value, _, _ = stats.chi2_contingency(contingency)
|
|
266
|
+
dcr_row['p_value'] = f"{p_value:.3f}" if p_value >= 0.001 else "<0.001"
|
|
267
|
+
table_rows.append(dcr_row)
|
|
268
|
+
|
|
269
|
+
# Save table
|
|
270
|
+
df_table = pd.DataFrame(table_rows)
|
|
271
|
+
df_table.to_csv(output_file, index=False)
|
|
272
|
+
print(f"Efficacy table saved to: {output_file}")
|
|
273
|
+
|
|
274
|
+
return df_table
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
def generate_safety_table(data, ae_columns, group_col='group', output_file='table3_safety.csv'):
|
|
278
|
+
"""
|
|
279
|
+
Generate adverse events table.
|
|
280
|
+
|
|
281
|
+
Parameters:
|
|
282
|
+
data: DataFrame with AE data
|
|
283
|
+
ae_columns: List of AE column names (each should have values 0-5 for CTCAE grades)
|
|
284
|
+
group_col: Grouping variable
|
|
285
|
+
output_file: Output CSV path
|
|
286
|
+
"""
|
|
287
|
+
|
|
288
|
+
groups = data[group_col].unique()
|
|
289
|
+
table_rows = []
|
|
290
|
+
|
|
291
|
+
# Header
|
|
292
|
+
header = {
|
|
293
|
+
'Adverse Event': 'Adverse Event',
|
|
294
|
+
**{f'{group}_any': 'Any Grade' for group in groups},
|
|
295
|
+
**{f'{group}_g34': 'Grade 3-4' for group in groups},
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
for ae in ae_columns:
|
|
299
|
+
if ae not in data.columns:
|
|
300
|
+
continue
|
|
301
|
+
|
|
302
|
+
row = {'Adverse Event': ae.replace('_', ' ').title()}
|
|
303
|
+
|
|
304
|
+
for group in groups:
|
|
305
|
+
group_data = data[data[group_col] == group][ae].dropna()
|
|
306
|
+
total = len(group_data)
|
|
307
|
+
|
|
308
|
+
# Any grade (Grade 1-5)
|
|
309
|
+
any_grade = (group_data > 0).sum()
|
|
310
|
+
any_pct = any_grade / total * 100 if total > 0 else 0
|
|
311
|
+
row[f'{group}_any'] = f"{any_grade} ({any_pct:.0f}%)"
|
|
312
|
+
|
|
313
|
+
# Grade 3-4
|
|
314
|
+
grade_34 = (group_data >= 3).sum()
|
|
315
|
+
g34_pct = grade_34 / total * 100 if total > 0 else 0
|
|
316
|
+
row[f'{group}_g34'] = f"{grade_34} ({g34_pct:.0f}%)"
|
|
317
|
+
|
|
318
|
+
table_rows.append(row)
|
|
319
|
+
|
|
320
|
+
# Save table
|
|
321
|
+
df_table = pd.DataFrame(table_rows)
|
|
322
|
+
df_table.to_csv(output_file, index=False)
|
|
323
|
+
print(f"Safety table saved to: {output_file}")
|
|
324
|
+
|
|
325
|
+
return df_table
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
def generate_latex_table(df, caption, label='table'):
|
|
329
|
+
"""
|
|
330
|
+
Convert DataFrame to LaTeX table code.
|
|
331
|
+
|
|
332
|
+
Returns:
|
|
333
|
+
String with LaTeX table code
|
|
334
|
+
"""
|
|
335
|
+
|
|
336
|
+
latex_code = "\\begin{table}[H]\n"
|
|
337
|
+
latex_code += "\\centering\n"
|
|
338
|
+
latex_code += "\\small\n"
|
|
339
|
+
latex_code += "\\begin{tabular}{" + "l" * len(df.columns) + "}\n"
|
|
340
|
+
latex_code += "\\toprule\n"
|
|
341
|
+
|
|
342
|
+
# Header
|
|
343
|
+
header_row = " & ".join([f"\\textbf{{{col}}}" for col in df.columns])
|
|
344
|
+
latex_code += header_row + " \\\\\n"
|
|
345
|
+
latex_code += "\\midrule\n"
|
|
346
|
+
|
|
347
|
+
# Data rows
|
|
348
|
+
for _, row in df.iterrows():
|
|
349
|
+
# Handle indentation for subcategories (lines starting with spaces)
|
|
350
|
+
first_col = str(row.iloc[0])
|
|
351
|
+
if first_col.startswith(' '):
|
|
352
|
+
first_col = '\\quad ' + first_col.strip()
|
|
353
|
+
|
|
354
|
+
data_row = [first_col] + [str(val) if pd.notna(val) else '—' for val in row.iloc[1:]]
|
|
355
|
+
latex_code += " & ".join(data_row) + " \\\\\n"
|
|
356
|
+
|
|
357
|
+
latex_code += "\\bottomrule\n"
|
|
358
|
+
latex_code += "\\end{tabular}\n"
|
|
359
|
+
latex_code += f"\\caption{{{caption}}}\n"
|
|
360
|
+
latex_code += f"\\label{{tab:{label}}}\n"
|
|
361
|
+
latex_code += "\\end{table}\n"
|
|
362
|
+
|
|
363
|
+
return latex_code
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
def _binomial_ci(successes, trials, confidence=0.95):
|
|
367
|
+
"""
|
|
368
|
+
Calculate exact binomial confidence interval (Clopper-Pearson method).
|
|
369
|
+
|
|
370
|
+
Returns:
|
|
371
|
+
Lower and upper bounds as percentages
|
|
372
|
+
"""
|
|
373
|
+
|
|
374
|
+
if trials == 0:
|
|
375
|
+
return 0.0, 0.0
|
|
376
|
+
|
|
377
|
+
alpha = 1 - confidence
|
|
378
|
+
|
|
379
|
+
# Use beta distribution
|
|
380
|
+
from scipy.stats import beta
|
|
381
|
+
|
|
382
|
+
if successes == 0:
|
|
383
|
+
lower = 0.0
|
|
384
|
+
else:
|
|
385
|
+
lower = beta.ppf(alpha / 2, successes, trials - successes + 1)
|
|
386
|
+
|
|
387
|
+
if successes == trials:
|
|
388
|
+
upper = 1.0
|
|
389
|
+
else:
|
|
390
|
+
upper = beta.ppf(1 - alpha / 2, successes + 1, trials - successes)
|
|
391
|
+
|
|
392
|
+
return lower * 100, upper * 100
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
def create_example_data():
|
|
396
|
+
"""Create example dataset for testing."""
|
|
397
|
+
|
|
398
|
+
np.random.seed(42)
|
|
399
|
+
n = 100
|
|
400
|
+
|
|
401
|
+
data = pd.DataFrame(
|
|
402
|
+
{
|
|
403
|
+
'patient_id': [f'PT{i:03d}' for i in range(1, n + 1)],
|
|
404
|
+
'group': np.random.choice(['Biomarker+', 'Biomarker-'], n),
|
|
405
|
+
'age': np.random.normal(62, 10, n),
|
|
406
|
+
'sex': np.random.choice(['Male', 'Female'], n),
|
|
407
|
+
'ecog_ps': np.random.choice(['0-1', '2'], n, p=[0.8, 0.2]),
|
|
408
|
+
'stage': np.random.choice(['III', 'IV'], n, p=[0.3, 0.7]),
|
|
409
|
+
'best_response': np.random.choice(['CR', 'PR', 'SD', 'PD'], n, p=[0.05, 0.35, 0.40, 0.20]),
|
|
410
|
+
'fatigue_grade': np.random.choice([0, 1, 2, 3], n, p=[0.3, 0.4, 0.2, 0.1]),
|
|
411
|
+
'nausea_grade': np.random.choice([0, 1, 2, 3], n, p=[0.4, 0.35, 0.20, 0.05]),
|
|
412
|
+
'neutropenia_grade': np.random.choice([0, 1, 2, 3, 4], n, p=[0.5, 0.2, 0.15, 0.10, 0.05]),
|
|
413
|
+
}
|
|
414
|
+
)
|
|
415
|
+
|
|
416
|
+
return data
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
def main():
|
|
420
|
+
parser = argparse.ArgumentParser(description='Generate clinical cohort tables')
|
|
421
|
+
parser.add_argument(
|
|
422
|
+
'input_file',
|
|
423
|
+
type=str,
|
|
424
|
+
nargs='?',
|
|
425
|
+
default=None,
|
|
426
|
+
help='CSV file with cohort data (if not provided, uses example data)',
|
|
427
|
+
)
|
|
428
|
+
parser.add_argument('-o', '--output-dir', type=str, default='tables', help='Output directory (default: tables)')
|
|
429
|
+
parser.add_argument('--group-col', type=str, default='group', help='Column name for grouping variable')
|
|
430
|
+
parser.add_argument('--example', action='store_true', help='Generate tables using example data')
|
|
431
|
+
|
|
432
|
+
args = parser.parse_args()
|
|
433
|
+
|
|
434
|
+
# Create output directory
|
|
435
|
+
output_dir = Path(args.output_dir)
|
|
436
|
+
output_dir.mkdir(parents=True, exist_ok=True)
|
|
437
|
+
|
|
438
|
+
# Load or create data
|
|
439
|
+
if args.example or args.input_file is None:
|
|
440
|
+
print("Generating example dataset...")
|
|
441
|
+
data = create_example_data()
|
|
442
|
+
else:
|
|
443
|
+
print(f"Loading data from {args.input_file}...")
|
|
444
|
+
data = pd.read_csv(args.input_file)
|
|
445
|
+
|
|
446
|
+
print(f"Dataset: {len(data)} patients, {len(data[args.group_col].unique())} groups")
|
|
447
|
+
print(f"Groups: {data[args.group_col].value_counts().to_dict()}")
|
|
448
|
+
|
|
449
|
+
# Generate Table 1: Baseline characteristics
|
|
450
|
+
print("\nGenerating baseline characteristics table...")
|
|
451
|
+
baseline_table = generate_baseline_table(
|
|
452
|
+
data, group_col=args.group_col, output_file=output_dir / 'table1_baseline.csv'
|
|
453
|
+
)
|
|
454
|
+
|
|
455
|
+
# Generate LaTeX code for baseline table
|
|
456
|
+
latex_code = generate_latex_table(
|
|
457
|
+
baseline_table, caption="Baseline patient demographics and clinical characteristics", label="baseline"
|
|
458
|
+
)
|
|
459
|
+
with open(output_dir / 'table1_baseline.tex', 'w') as f:
|
|
460
|
+
f.write(latex_code)
|
|
461
|
+
print(f"LaTeX code saved to: {output_dir}/table1_baseline.tex")
|
|
462
|
+
|
|
463
|
+
# Generate Table 2: Efficacy outcomes
|
|
464
|
+
if 'best_response' in data.columns:
|
|
465
|
+
print("\nGenerating efficacy outcomes table...")
|
|
466
|
+
efficacy_table = generate_efficacy_table(
|
|
467
|
+
data, group_col=args.group_col, output_file=output_dir / 'table2_efficacy.csv'
|
|
468
|
+
)
|
|
469
|
+
|
|
470
|
+
latex_code = generate_latex_table(
|
|
471
|
+
efficacy_table, caption="Treatment efficacy outcomes by group", label="efficacy"
|
|
472
|
+
)
|
|
473
|
+
with open(output_dir / 'table2_efficacy.tex', 'w') as f:
|
|
474
|
+
f.write(latex_code)
|
|
475
|
+
|
|
476
|
+
# Generate Table 3: Safety (identify AE columns)
|
|
477
|
+
ae_columns = [col for col in data.columns if col.endswith('_grade')]
|
|
478
|
+
if ae_columns:
|
|
479
|
+
print("\nGenerating safety table...")
|
|
480
|
+
safety_table = generate_safety_table(
|
|
481
|
+
data, ae_columns=ae_columns, group_col=args.group_col, output_file=output_dir / 'table3_safety.csv'
|
|
482
|
+
)
|
|
483
|
+
|
|
484
|
+
latex_code = generate_latex_table(
|
|
485
|
+
safety_table, caption="Treatment-emergent adverse events by group (CTCAE v5.0)", label="safety"
|
|
486
|
+
)
|
|
487
|
+
with open(output_dir / 'table3_safety.tex', 'w') as f:
|
|
488
|
+
f.write(latex_code)
|
|
489
|
+
|
|
490
|
+
print(f"\nAll tables generated successfully in {output_dir}/")
|
|
491
|
+
print("Files created:")
|
|
492
|
+
print(" - table1_baseline.csv / .tex")
|
|
493
|
+
print(" - table2_efficacy.csv / .tex (if response data available)")
|
|
494
|
+
print(" - table3_safety.csv / .tex (if AE data available)")
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
if __name__ == '__main__':
|
|
498
|
+
main()
|
|
499
|
+
|
|
500
|
+
|
|
501
|
+
# Example usage:
|
|
502
|
+
# python create_cohort_tables.py cohort_data.csv -o tables/
|
|
503
|
+
# python create_cohort_tables.py --example # Generate example tables
|
|
504
|
+
#
|
|
505
|
+
# Input CSV format:
|
|
506
|
+
# patient_id,group,age,sex,ecog_ps,stage,best_response,fatigue_grade,nausea_grade,...
|
|
507
|
+
# PT001,Biomarker+,65,Male,0-1,IV,PR,1,0,...
|
|
508
|
+
# PT002,Biomarker-,58,Female,0-1,III,SD,2,1,...
|
|
509
|
+
# ...
|