@synsci/cli-darwin-x64-baseline 1.1.71 → 1.1.73
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,441 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Generate Kaplan-Meier Survival Curves for Clinical Decision Support Documents
|
|
4
|
+
|
|
5
|
+
This script creates publication-quality survival curves with:
|
|
6
|
+
- Kaplan-Meier survival estimates
|
|
7
|
+
- 95% confidence intervals
|
|
8
|
+
- Log-rank test statistics
|
|
9
|
+
- Hazard ratios with confidence intervals
|
|
10
|
+
- Number at risk tables
|
|
11
|
+
- Median survival annotations
|
|
12
|
+
|
|
13
|
+
Dependencies: lifelines, matplotlib, pandas, numpy
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
import argparse
|
|
17
|
+
from pathlib import Path
|
|
18
|
+
|
|
19
|
+
import matplotlib.pyplot as plt
|
|
20
|
+
import numpy as np
|
|
21
|
+
import pandas as pd
|
|
22
|
+
from lifelines import CoxPHFitter, KaplanMeierFitter
|
|
23
|
+
from lifelines.statistics import logrank_test, multivariate_logrank_test
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def load_survival_data(filepath):
|
|
27
|
+
"""
|
|
28
|
+
Load survival data from CSV file.
|
|
29
|
+
|
|
30
|
+
Expected columns:
|
|
31
|
+
- patient_id: Unique patient identifier
|
|
32
|
+
- time: Survival time (months or days)
|
|
33
|
+
- event: Event indicator (1=event occurred, 0=censored)
|
|
34
|
+
- group: Stratification variable (e.g., 'Biomarker+', 'Biomarker-')
|
|
35
|
+
- Optional: Additional covariates for Cox regression
|
|
36
|
+
|
|
37
|
+
Returns:
|
|
38
|
+
pandas.DataFrame
|
|
39
|
+
"""
|
|
40
|
+
df = pd.read_csv(filepath)
|
|
41
|
+
|
|
42
|
+
# Validate required columns
|
|
43
|
+
required_cols = ['patient_id', 'time', 'event', 'group']
|
|
44
|
+
missing = [col for col in required_cols if col not in df.columns]
|
|
45
|
+
if missing:
|
|
46
|
+
raise ValueError(f"Missing required columns: {missing}")
|
|
47
|
+
|
|
48
|
+
# Convert event to boolean if needed
|
|
49
|
+
df['event'] = df['event'].astype(bool)
|
|
50
|
+
|
|
51
|
+
return df
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def calculate_median_survival(kmf):
|
|
55
|
+
"""Calculate median survival with 95% CI."""
|
|
56
|
+
median = kmf.median_survival_time_
|
|
57
|
+
ci = kmf.confidence_interval_survival_function_
|
|
58
|
+
|
|
59
|
+
# Find time when survival crosses 0.5
|
|
60
|
+
if median == np.inf:
|
|
61
|
+
return None, None, None
|
|
62
|
+
|
|
63
|
+
# Get CI at median
|
|
64
|
+
idx = np.argmin(np.abs(kmf.survival_function_.index - median))
|
|
65
|
+
lower_ci = ci.iloc[idx]['KM_estimate_lower_0.95']
|
|
66
|
+
upper_ci = ci.iloc[idx]['KM_estimate_upper_0.95']
|
|
67
|
+
|
|
68
|
+
return median, lower_ci, upper_ci
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def generate_kaplan_meier_plot(
|
|
72
|
+
data,
|
|
73
|
+
time_col='time',
|
|
74
|
+
event_col='event',
|
|
75
|
+
group_col='group',
|
|
76
|
+
output_path='survival_curve.pdf',
|
|
77
|
+
title='Kaplan-Meier Survival Curve',
|
|
78
|
+
xlabel='Time (months)',
|
|
79
|
+
ylabel='Survival Probability',
|
|
80
|
+
):
|
|
81
|
+
"""
|
|
82
|
+
Generate Kaplan-Meier survival curve comparing groups.
|
|
83
|
+
|
|
84
|
+
Parameters:
|
|
85
|
+
data: DataFrame with survival data
|
|
86
|
+
time_col: Column name for survival time
|
|
87
|
+
event_col: Column name for event indicator
|
|
88
|
+
group_col: Column name for stratification
|
|
89
|
+
output_path: Path to save figure
|
|
90
|
+
title: Plot title
|
|
91
|
+
xlabel: X-axis label (specify units)
|
|
92
|
+
ylabel: Y-axis label
|
|
93
|
+
"""
|
|
94
|
+
|
|
95
|
+
# Create figure and axis
|
|
96
|
+
fig, ax = plt.subplots(figsize=(10, 6))
|
|
97
|
+
|
|
98
|
+
# Get unique groups
|
|
99
|
+
groups = data[group_col].unique()
|
|
100
|
+
|
|
101
|
+
# Colors for groups (colorblind-friendly)
|
|
102
|
+
colors = ['#0173B2', '#DE8F05', '#029E73', '#CC78BC', '#CA9161']
|
|
103
|
+
|
|
104
|
+
kmf_models = {}
|
|
105
|
+
median_survivals = {}
|
|
106
|
+
|
|
107
|
+
# Plot each group
|
|
108
|
+
for i, group in enumerate(groups):
|
|
109
|
+
group_data = data[data[group_col] == group]
|
|
110
|
+
|
|
111
|
+
# Fit Kaplan-Meier
|
|
112
|
+
kmf = KaplanMeierFitter()
|
|
113
|
+
kmf.fit(group_data[time_col], group_data[event_col], label=str(group))
|
|
114
|
+
|
|
115
|
+
# Plot survival curve
|
|
116
|
+
kmf.plot_survival_function(ax=ax, ci_show=True, color=colors[i % len(colors)], linewidth=2, alpha=0.8)
|
|
117
|
+
|
|
118
|
+
# Store model
|
|
119
|
+
kmf_models[group] = kmf
|
|
120
|
+
|
|
121
|
+
# Calculate median survival
|
|
122
|
+
median, lower, upper = calculate_median_survival(kmf)
|
|
123
|
+
median_survivals[group] = (median, lower, upper)
|
|
124
|
+
|
|
125
|
+
# Log-rank test
|
|
126
|
+
if len(groups) == 2:
|
|
127
|
+
group1_data = data[data[group_col] == groups[0]]
|
|
128
|
+
group2_data = data[data[group_col] == groups[1]]
|
|
129
|
+
|
|
130
|
+
results = logrank_test(
|
|
131
|
+
group1_data[time_col], group2_data[time_col], group1_data[event_col], group2_data[event_col]
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
p_value = results.p_value
|
|
135
|
+
test_statistic = results.test_statistic
|
|
136
|
+
|
|
137
|
+
# Add log-rank test result to plot
|
|
138
|
+
ax.text(
|
|
139
|
+
0.02,
|
|
140
|
+
0.15,
|
|
141
|
+
f'Log-rank test:\np = {p_value:.4f}',
|
|
142
|
+
transform=ax.transAxes,
|
|
143
|
+
fontsize=10,
|
|
144
|
+
verticalalignment='top',
|
|
145
|
+
bbox=dict(boxstyle='round', facecolor='wheat', alpha=0.5),
|
|
146
|
+
)
|
|
147
|
+
else:
|
|
148
|
+
# Multivariate log-rank for >2 groups
|
|
149
|
+
results = multivariate_logrank_test(data[time_col], data[group_col], data[event_col])
|
|
150
|
+
p_value = results.p_value
|
|
151
|
+
test_statistic = results.test_statistic
|
|
152
|
+
|
|
153
|
+
ax.text(
|
|
154
|
+
0.02,
|
|
155
|
+
0.15,
|
|
156
|
+
f'Log-rank test:\np = {p_value:.4f}\n({len(groups)} groups)',
|
|
157
|
+
transform=ax.transAxes,
|
|
158
|
+
fontsize=10,
|
|
159
|
+
verticalalignment='top',
|
|
160
|
+
bbox=dict(boxstyle='round', facecolor='wheat', alpha=0.5),
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
# Add median survival annotations
|
|
164
|
+
y_pos = 0.95
|
|
165
|
+
for group, (median, lower, upper) in median_survivals.items():
|
|
166
|
+
if median is not None:
|
|
167
|
+
ax.text(
|
|
168
|
+
0.98,
|
|
169
|
+
y_pos,
|
|
170
|
+
f'{group}: {median:.1f} months (95% CI {lower:.1f}-{upper:.1f})',
|
|
171
|
+
transform=ax.transAxes,
|
|
172
|
+
fontsize=9,
|
|
173
|
+
ha='right',
|
|
174
|
+
verticalalignment='top',
|
|
175
|
+
)
|
|
176
|
+
else:
|
|
177
|
+
ax.text(
|
|
178
|
+
0.98,
|
|
179
|
+
y_pos,
|
|
180
|
+
f'{group}: Not reached',
|
|
181
|
+
transform=ax.transAxes,
|
|
182
|
+
fontsize=9,
|
|
183
|
+
ha='right',
|
|
184
|
+
verticalalignment='top',
|
|
185
|
+
)
|
|
186
|
+
y_pos -= 0.05
|
|
187
|
+
|
|
188
|
+
# Formatting
|
|
189
|
+
ax.set_xlabel(xlabel, fontsize=12, fontweight='bold')
|
|
190
|
+
ax.set_ylabel(ylabel, fontsize=12, fontweight='bold')
|
|
191
|
+
ax.set_title(title, fontsize=14, fontweight='bold', pad=15)
|
|
192
|
+
ax.legend(loc='lower left', frameon=True, fontsize=10)
|
|
193
|
+
ax.grid(True, alpha=0.3, linestyle='--')
|
|
194
|
+
ax.set_ylim([0, 1.05])
|
|
195
|
+
|
|
196
|
+
plt.tight_layout()
|
|
197
|
+
|
|
198
|
+
# Save figure
|
|
199
|
+
plt.savefig(output_path, dpi=300, bbox_inches='tight')
|
|
200
|
+
print(f"Survival curve saved to: {output_path}")
|
|
201
|
+
|
|
202
|
+
# Also save as PNG for easy viewing
|
|
203
|
+
png_path = Path(output_path).with_suffix('.png')
|
|
204
|
+
plt.savefig(png_path, dpi=300, bbox_inches='tight')
|
|
205
|
+
print(f"PNG version saved to: {png_path}")
|
|
206
|
+
|
|
207
|
+
plt.close()
|
|
208
|
+
|
|
209
|
+
return kmf_models, p_value
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
def generate_number_at_risk_table(data, time_col='time', event_col='event', group_col='group', time_points=None):
|
|
213
|
+
"""
|
|
214
|
+
Generate number at risk table for survival analysis.
|
|
215
|
+
|
|
216
|
+
Parameters:
|
|
217
|
+
data: DataFrame with survival data
|
|
218
|
+
time_points: List of time points for risk table (if None, auto-generate)
|
|
219
|
+
|
|
220
|
+
Returns:
|
|
221
|
+
DataFrame with number at risk at each time point
|
|
222
|
+
"""
|
|
223
|
+
|
|
224
|
+
if time_points is None:
|
|
225
|
+
# Auto-generate time points (every 6 months up to max time)
|
|
226
|
+
max_time = data[time_col].max()
|
|
227
|
+
time_points = np.arange(0, max_time + 6, 6)
|
|
228
|
+
|
|
229
|
+
groups = data[group_col].unique()
|
|
230
|
+
risk_table = pd.DataFrame(index=time_points, columns=groups)
|
|
231
|
+
|
|
232
|
+
for group in groups:
|
|
233
|
+
group_data = data[data[group_col] == group]
|
|
234
|
+
|
|
235
|
+
for t in time_points:
|
|
236
|
+
# Number at risk = patients who haven't had event and haven't been censored before time t
|
|
237
|
+
at_risk = len(group_data[group_data[time_col] >= t])
|
|
238
|
+
risk_table.loc[t, group] = at_risk
|
|
239
|
+
|
|
240
|
+
return risk_table
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
def calculate_hazard_ratio(data, time_col='time', event_col='event', group_col='group', reference_group=None):
|
|
244
|
+
"""
|
|
245
|
+
Calculate hazard ratio using Cox proportional hazards regression.
|
|
246
|
+
|
|
247
|
+
Parameters:
|
|
248
|
+
data: DataFrame
|
|
249
|
+
reference_group: Reference group for comparison (if None, uses first group)
|
|
250
|
+
|
|
251
|
+
Returns:
|
|
252
|
+
Hazard ratio, 95% CI, p-value
|
|
253
|
+
"""
|
|
254
|
+
|
|
255
|
+
# Encode group as binary for Cox regression
|
|
256
|
+
groups = data[group_col].unique()
|
|
257
|
+
if len(groups) != 2:
|
|
258
|
+
print("Warning: Cox HR calculation assumes 2 groups. Using first 2 groups.")
|
|
259
|
+
groups = groups[:2]
|
|
260
|
+
|
|
261
|
+
if reference_group is None:
|
|
262
|
+
reference_group = groups[0]
|
|
263
|
+
|
|
264
|
+
# Create binary indicator (1 for comparison group, 0 for reference)
|
|
265
|
+
data_cox = data.copy()
|
|
266
|
+
data_cox['group_binary'] = (data_cox[group_col] != reference_group).astype(int)
|
|
267
|
+
|
|
268
|
+
# Fit Cox model
|
|
269
|
+
cph = CoxPHFitter()
|
|
270
|
+
cph.fit(data_cox[[time_col, event_col, 'group_binary']], duration_col=time_col, event_col=event_col)
|
|
271
|
+
|
|
272
|
+
# Extract results
|
|
273
|
+
hr = np.exp(cph.params_['group_binary'])
|
|
274
|
+
ci = np.exp(cph.confidence_intervals_.loc['group_binary'].values)
|
|
275
|
+
p_value = cph.summary.loc['group_binary', 'p']
|
|
276
|
+
|
|
277
|
+
return hr, ci[0], ci[1], p_value
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
def generate_report(data, output_dir, prefix='survival'):
|
|
281
|
+
"""
|
|
282
|
+
Generate comprehensive survival analysis report.
|
|
283
|
+
|
|
284
|
+
Creates:
|
|
285
|
+
- Kaplan-Meier curves (PDF and PNG)
|
|
286
|
+
- Number at risk table (CSV)
|
|
287
|
+
- Statistical summary (TXT)
|
|
288
|
+
- LaTeX table code (TEX)
|
|
289
|
+
"""
|
|
290
|
+
|
|
291
|
+
output_dir = Path(output_dir)
|
|
292
|
+
output_dir.mkdir(parents=True, exist_ok=True)
|
|
293
|
+
|
|
294
|
+
# Generate survival curve
|
|
295
|
+
kmf_models, logrank_p = generate_kaplan_meier_plot(
|
|
296
|
+
data, output_path=output_dir / f'{prefix}_kaplan_meier.pdf', title='Survival Analysis by Group'
|
|
297
|
+
)
|
|
298
|
+
|
|
299
|
+
# Number at risk table
|
|
300
|
+
risk_table = generate_number_at_risk_table(data)
|
|
301
|
+
risk_table.to_csv(output_dir / f'{prefix}_number_at_risk.csv')
|
|
302
|
+
|
|
303
|
+
# Calculate hazard ratio
|
|
304
|
+
hr, ci_lower, ci_upper, hr_p = calculate_hazard_ratio(data)
|
|
305
|
+
|
|
306
|
+
# Generate statistical summary
|
|
307
|
+
with open(output_dir / f'{prefix}_statistics.txt', 'w') as f:
|
|
308
|
+
f.write("SURVIVAL ANALYSIS STATISTICAL SUMMARY\n")
|
|
309
|
+
f.write("=" * 60 + "\n\n")
|
|
310
|
+
|
|
311
|
+
groups = data['group'].unique()
|
|
312
|
+
for group in groups:
|
|
313
|
+
kmf = kmf_models[group]
|
|
314
|
+
median = kmf.median_survival_time_
|
|
315
|
+
|
|
316
|
+
# Calculate survival rates at common time points
|
|
317
|
+
try:
|
|
318
|
+
surv_12m = kmf.survival_function_at_times(12).values[0]
|
|
319
|
+
surv_24m = kmf.survival_function_at_times(24).values[0] if data['time'].max() >= 24 else None
|
|
320
|
+
except:
|
|
321
|
+
surv_12m = None
|
|
322
|
+
surv_24m = None
|
|
323
|
+
|
|
324
|
+
f.write(f"Group: {group}\n")
|
|
325
|
+
f.write(f" N = {len(data[data['group'] == group])}\n")
|
|
326
|
+
f.write(f" Events = {data[data['group'] == group]['event'].sum()}\n")
|
|
327
|
+
f.write(
|
|
328
|
+
f" Median survival: {median:.1f} months\n" if median != np.inf else " Median survival: Not reached\n"
|
|
329
|
+
)
|
|
330
|
+
if surv_12m is not None:
|
|
331
|
+
f.write(f" 12-month survival rate: {surv_12m * 100:.1f}%\n")
|
|
332
|
+
if surv_24m is not None:
|
|
333
|
+
f.write(f" 24-month survival rate: {surv_24m * 100:.1f}%\n")
|
|
334
|
+
f.write("\n")
|
|
335
|
+
|
|
336
|
+
f.write("Log-Rank Test:\n")
|
|
337
|
+
f.write(f" p-value = {logrank_p:.4f}\n")
|
|
338
|
+
f.write(
|
|
339
|
+
f" Interpretation: {'Significant' if logrank_p < 0.05 else 'Not significant'} difference in survival\n\n"
|
|
340
|
+
)
|
|
341
|
+
|
|
342
|
+
if len(groups) == 2:
|
|
343
|
+
f.write(f"Hazard Ratio ({groups[1]} vs {groups[0]}):\n")
|
|
344
|
+
f.write(f" HR = {hr:.2f} (95% CI {ci_lower:.2f}-{ci_upper:.2f})\n")
|
|
345
|
+
f.write(f" p-value = {hr_p:.4f}\n")
|
|
346
|
+
f.write(
|
|
347
|
+
f" Interpretation: {groups[1]} has {((1 - hr) * 100):.0f}% {'reduction' if hr < 1 else 'increase'} in risk\n"
|
|
348
|
+
)
|
|
349
|
+
|
|
350
|
+
# Generate LaTeX table code
|
|
351
|
+
with open(output_dir / f'{prefix}_latex_table.tex', 'w') as f:
|
|
352
|
+
f.write("% LaTeX table code for survival outcomes\n")
|
|
353
|
+
f.write("\\begin{table}[H]\n")
|
|
354
|
+
f.write("\\centering\n")
|
|
355
|
+
f.write("\\small\n")
|
|
356
|
+
f.write("\\begin{tabular}{lcccc}\n")
|
|
357
|
+
f.write("\\toprule\n")
|
|
358
|
+
f.write(
|
|
359
|
+
"\\textbf{Endpoint} & \\textbf{Group A} & \\textbf{Group B} & \\textbf{HR (95\\% CI)} & \\textbf{p-value} \\\\\n"
|
|
360
|
+
)
|
|
361
|
+
f.write("\\midrule\n")
|
|
362
|
+
|
|
363
|
+
# Add median survival row
|
|
364
|
+
for i, group in enumerate(groups):
|
|
365
|
+
kmf = kmf_models[group]
|
|
366
|
+
median = kmf.median_survival_time_
|
|
367
|
+
if i == 0:
|
|
368
|
+
f.write("Median survival, months (95\\% CI) & ")
|
|
369
|
+
if median != np.inf:
|
|
370
|
+
f.write(f"{median:.1f} & ")
|
|
371
|
+
else:
|
|
372
|
+
f.write("NR & ")
|
|
373
|
+
else:
|
|
374
|
+
if median != np.inf:
|
|
375
|
+
f.write(f"{median:.1f} & ")
|
|
376
|
+
else:
|
|
377
|
+
f.write("NR & ")
|
|
378
|
+
|
|
379
|
+
f.write(f"{hr:.2f} ({ci_lower:.2f}-{ci_upper:.2f}) & {hr_p:.3f} \\\\\n")
|
|
380
|
+
|
|
381
|
+
# Add 12-month survival rate
|
|
382
|
+
f.write("12-month survival rate (\\%) & ")
|
|
383
|
+
for group in groups:
|
|
384
|
+
kmf = kmf_models[group]
|
|
385
|
+
try:
|
|
386
|
+
surv_12m = kmf.survival_function_at_times(12).values[0]
|
|
387
|
+
f.write(f"{surv_12m * 100:.0f}\\% & ")
|
|
388
|
+
except:
|
|
389
|
+
f.write("-- & ")
|
|
390
|
+
f.write("-- & -- \\\\\n")
|
|
391
|
+
|
|
392
|
+
f.write("\\bottomrule\n")
|
|
393
|
+
f.write("\\end{tabular}\n")
|
|
394
|
+
f.write(f"\\caption{{Survival outcomes by group (log-rank p={logrank_p:.3f})}}\n")
|
|
395
|
+
f.write("\\end{table}\n")
|
|
396
|
+
|
|
397
|
+
print(f"\nAnalysis complete! Files saved to {output_dir}/")
|
|
398
|
+
print(f" - Survival curves: {prefix}_kaplan_meier.pdf/png")
|
|
399
|
+
print(f" - Statistics: {prefix}_statistics.txt")
|
|
400
|
+
print(f" - LaTeX table: {prefix}_latex_table.tex")
|
|
401
|
+
print(f" - Risk table: {prefix}_number_at_risk.csv")
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
def main():
|
|
405
|
+
parser = argparse.ArgumentParser(description='Generate Kaplan-Meier survival curves')
|
|
406
|
+
parser.add_argument('input_file', type=str, help='CSV file with survival data')
|
|
407
|
+
parser.add_argument(
|
|
408
|
+
'-o', '--output', type=str, default='survival_output', help='Output directory (default: survival_output)'
|
|
409
|
+
)
|
|
410
|
+
parser.add_argument('-t', '--title', type=str, default='Kaplan-Meier Survival Curve', help='Plot title')
|
|
411
|
+
parser.add_argument('-x', '--xlabel', type=str, default='Time (months)', help='X-axis label')
|
|
412
|
+
parser.add_argument('-y', '--ylabel', type=str, default='Survival Probability', help='Y-axis label')
|
|
413
|
+
parser.add_argument('--time-col', type=str, default='time', help='Column name for time variable')
|
|
414
|
+
parser.add_argument('--event-col', type=str, default='event', help='Column name for event indicator')
|
|
415
|
+
parser.add_argument('--group-col', type=str, default='group', help='Column name for grouping variable')
|
|
416
|
+
|
|
417
|
+
args = parser.parse_args()
|
|
418
|
+
|
|
419
|
+
# Load data
|
|
420
|
+
print(f"Loading data from {args.input_file}...")
|
|
421
|
+
data = load_survival_data(args.input_file)
|
|
422
|
+
print(f"Loaded {len(data)} patients")
|
|
423
|
+
print(f"Groups: {data[args.group_col].value_counts().to_dict()}")
|
|
424
|
+
|
|
425
|
+
# Generate analysis
|
|
426
|
+
generate_report(data, output_dir=args.output, prefix='survival')
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
if __name__ == '__main__':
|
|
430
|
+
main()
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
# Example usage:
|
|
434
|
+
# python generate_survival_analysis.py survival_data.csv -o figures/ -t "PFS by PD-L1 Status"
|
|
435
|
+
#
|
|
436
|
+
# Input CSV format:
|
|
437
|
+
# patient_id,time,event,group
|
|
438
|
+
# PT001,12.3,1,PD-L1+
|
|
439
|
+
# PT002,8.5,1,PD-L1-
|
|
440
|
+
# PT003,18.2,0,PD-L1+
|
|
441
|
+
# ...
|