@brainpilot/skills 0.0.11 → 0.0.13
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/package.json +1 -1
- package/skills/01_Meta-Skills/workflow-skill-creator/SKILL.md +288 -0
- package/skills/01_Meta-Skills/workflow-skill-creator/references/cli_script_template.py +217 -0
- package/skills/06_fMRI_Neuroimaging/fmriprep/SKILL.md +256 -0
- package/skills/06_fMRI_Neuroimaging/fmriprep/references/bids-filter.md +287 -0
- package/skills/06_fMRI_Neuroimaging/fmriprep/references/citation.md +284 -0
- package/skills/06_fMRI_Neuroimaging/fmriprep/references/cli-reference.md +260 -0
- package/skills/06_fMRI_Neuroimaging/fmriprep/references/confounds.md +344 -0
- package/skills/06_fMRI_Neuroimaging/fmriprep/references/installation.md +346 -0
- package/skills/06_fMRI_Neuroimaging/fmriprep/references/outputs.md +369 -0
- package/skills/06_fMRI_Neuroimaging/fmriprep/references/sdc-fieldmaps.md +306 -0
- package/skills/06_fMRI_Neuroimaging/fmriprep/references/spaces.md +334 -0
- package/skills/06_fMRI_Neuroimaging/fmriprep/references/troubleshooting-faq.md +419 -0
- package/skills/06_fMRI_Neuroimaging/fmriprep/references/usage-examples.md +465 -0
- package/skills/06_fMRI_Neuroimaging/fmriprep/references/versions-dependencies.md +228 -0
- package/skills/06_fMRI_Neuroimaging/fmriprep/references/workflows.md +392 -0
- package/skills/06_fMRI_Neuroimaging/netneurotools-guide/SKILL.md +212 -0
- package/skills/06_fMRI_Neuroimaging/netneurotools-guide/references/datasets.md +252 -0
- package/skills/06_fMRI_Neuroimaging/netneurotools-guide/references/interface-plotting.md +238 -0
- package/skills/06_fMRI_Neuroimaging/netneurotools-guide/references/metrics.md +236 -0
- package/skills/06_fMRI_Neuroimaging/netneurotools-guide/references/networks.md +273 -0
- package/skills/06_fMRI_Neuroimaging/netneurotools-guide/references/spatial-modularity.md +291 -0
- package/skills/06_fMRI_Neuroimaging/netneurotools-guide/references/stats.md +290 -0
- package/skills/09_Cellular_Molecular_Neuroscience/alphafold-database-fetch-and-analyze/SKILL.md +116 -0
- package/skills/09_Cellular_Molecular_Neuroscience/alphafold-database-fetch-and-analyze/references/citation.bib +58 -0
- package/skills/09_Cellular_Molecular_Neuroscience/alphafold-database-fetch-and-analyze/scripts/analyze_pae.py +212 -0
- package/skills/09_Cellular_Molecular_Neuroscience/alphafold-database-fetch-and-analyze/scripts/analyze_plddt.py +125 -0
- package/skills/09_Cellular_Molecular_Neuroscience/alphafold-database-fetch-and-analyze/scripts/fetch_structure.py +168 -0
- package/skills/09_Cellular_Molecular_Neuroscience/gtex-database/SKILL.md +176 -0
- package/skills/09_Cellular_Molecular_Neuroscience/gtex-database/references/citation.bib +14 -0
- package/skills/09_Cellular_Molecular_Neuroscience/gtex-database/scripts/gtex_cli.py +281 -0
- package/skills/09_Cellular_Molecular_Neuroscience/human-protein-atlas-database/SKILL.md +181 -0
- package/skills/09_Cellular_Molecular_Neuroscience/human-protein-atlas-database/references/citation.bib +14 -0
- package/skills/09_Cellular_Molecular_Neuroscience/human-protein-atlas-database/references/search-api.md +137 -0
- package/skills/09_Cellular_Molecular_Neuroscience/human-protein-atlas-database/scripts/hpa_cli.py +263 -0
- package/skills/09_Cellular_Molecular_Neuroscience/pdb-database/SKILL.md +169 -0
- package/skills/09_Cellular_Molecular_Neuroscience/pdb-database/references/citation.bib +15 -0
- package/skills/09_Cellular_Molecular_Neuroscience/pdb-database/scripts/download_coordinate_files.py +113 -0
- package/skills/09_Cellular_Molecular_Neuroscience/pdb-database/scripts/fetch_pdb_metadata.py +70 -0
- package/skills/09_Cellular_Molecular_Neuroscience/pdb-database/scripts/fetch_schema.py +251 -0
- package/skills/09_Cellular_Molecular_Neuroscience/pdb-database/scripts/search_pdb.py +187 -0
- package/skills/09_Cellular_Molecular_Neuroscience/pymol/SKILL.md +146 -0
- package/skills/09_Cellular_Molecular_Neuroscience/pymol/references/PYMOL_REFERENCE.md +160 -0
- package/skills/09_Cellular_Molecular_Neuroscience/pymol/references/RECIPES.md +348 -0
- package/skills/09_Cellular_Molecular_Neuroscience/pymol/references/citation.bib +6 -0
- package/skills/17_Literature_Databases/literature-search-arxiv/SKILL.md +120 -0
- package/skills/17_Literature_Databases/literature-search-arxiv/references/citation.bib +18 -0
- package/skills/17_Literature_Databases/literature-search-arxiv/references/query_syntax.md +34 -0
- package/skills/17_Literature_Databases/literature-search-arxiv/scripts/download_paper.py +116 -0
- package/skills/17_Literature_Databases/literature-search-arxiv/scripts/download_paper_source.py +98 -0
- package/skills/17_Literature_Databases/literature-search-arxiv/scripts/search_arxiv.py +174 -0
- package/skills/17_Literature_Databases/literature-search-biorxiv/SKILL.md +169 -0
- package/skills/17_Literature_Databases/literature-search-biorxiv/references/citation.bib +12 -0
- package/skills/17_Literature_Databases/literature-search-biorxiv/scripts/search_by_dates.py +297 -0
- package/skills/17_Literature_Databases/literature-search-biorxiv/scripts/search_by_doi.py +72 -0
- package/skills/17_Literature_Databases/literature-search-europepmc/SKILL.md +229 -0
- package/skills/17_Literature_Databases/literature-search-europepmc/references/citation.bib +15 -0
- package/skills/17_Literature_Databases/literature-search-europepmc/scripts/europepmc_api.py +345 -0
- package/skills/17_Literature_Databases/literature-search-openalex/SKILL.md +169 -0
- package/skills/17_Literature_Databases/literature-search-openalex/references/authors.md +78 -0
- package/skills/17_Literature_Databases/literature-search-openalex/references/citation.bib +8 -0
- package/skills/17_Literature_Databases/literature-search-openalex/references/geo_and_language.md +37 -0
- package/skills/17_Literature_Databases/literature-search-openalex/references/institutions.md +64 -0
- package/skills/17_Literature_Databases/literature-search-openalex/references/publishers_funders.md +42 -0
- package/skills/17_Literature_Databases/literature-search-openalex/references/sources.md +79 -0
- package/skills/17_Literature_Databases/literature-search-openalex/references/taxonomy.md +52 -0
- package/skills/17_Literature_Databases/literature-search-openalex/references/topics.md +29 -0
- package/skills/17_Literature_Databases/literature-search-openalex/references/type_values.md +65 -0
- package/skills/17_Literature_Databases/literature-search-openalex/references/works.md +304 -0
- package/skills/17_Literature_Databases/literature-search-openalex/scripts/openalex_cli.py +633 -0
- package/skills/17_Literature_Databases/pubmed-database/SKILL.md +185 -0
- package/skills/17_Literature_Databases/pubmed-database/references/advanced-linking.md +128 -0
- package/skills/17_Literature_Databases/pubmed-database/references/advanced-search.md +98 -0
- package/skills/17_Literature_Databases/pubmed-database/references/bulk-workflows.md +88 -0
- package/skills/17_Literature_Databases/pubmed-database/references/citation-matching.md +155 -0
- package/skills/17_Literature_Databases/pubmed-database/references/citation.bib +15 -0
- package/skills/17_Literature_Databases/pubmed-database/references/cross-database-linking.md +93 -0
- package/skills/17_Literature_Databases/pubmed-database/references/fetch-and-resolve.md +125 -0
- package/skills/17_Literature_Databases/pubmed-database/references/search-and-discovery.md +106 -0
- package/skills/17_Literature_Databases/pubmed-database/references/utilities.md +42 -0
- package/skills/17_Literature_Databases/pubmed-database/scripts/pubmed_api.py +715 -0
- package/skills/18_Genetics_Genomics/alphagenome-single-variant-analysis/SKILL.md +251 -0
- package/skills/18_Genetics_Genomics/alphagenome-single-variant-analysis/pyproject.toml +15 -0
- package/skills/18_Genetics_Genomics/alphagenome-single-variant-analysis/references/citation.bib +12 -0
- package/skills/18_Genetics_Genomics/alphagenome-single-variant-analysis/scripts/analyze_ism.py +334 -0
- package/skills/18_Genetics_Genomics/alphagenome-single-variant-analysis/scripts/generate_ontology_mapping.py +170 -0
- package/skills/18_Genetics_Genomics/alphagenome-single-variant-analysis/scripts/interpret_splicing.py +305 -0
- package/skills/18_Genetics_Genomics/alphagenome-single-variant-analysis/scripts/lookup_gene_info.py +337 -0
- package/skills/18_Genetics_Genomics/alphagenome-single-variant-analysis/scripts/resolve_ontology_terms.py +155 -0
- package/skills/18_Genetics_Genomics/alphagenome-single-variant-analysis/scripts/visualize_genome_tracks.py +402 -0
- package/skills/18_Genetics_Genomics/alphagenome-single-variant-analysis/scripts/visualize_variant_effects.py +1198 -0
- package/skills/18_Genetics_Genomics/clinvar-database/SKILL.md +370 -0
- package/skills/18_Genetics_Genomics/clinvar-database/references/citation.bib +23 -0
- package/skills/18_Genetics_Genomics/clinvar-database/scripts/clinvar_api.py +711 -0
- package/skills/18_Genetics_Genomics/dbsnp-database/SKILL.md +350 -0
- package/skills/18_Genetics_Genomics/dbsnp-database/references/api-notes.md +88 -0
- package/skills/18_Genetics_Genomics/dbsnp-database/references/citation.bib +12 -0
- package/skills/18_Genetics_Genomics/dbsnp-database/scripts/dbsnp_cli.py +625 -0
- package/skills/18_Genetics_Genomics/gnomad-database/SKILL.md +73 -0
- package/skills/18_Genetics_Genomics/gnomad-database/references/citation.bib +14 -0
- package/skills/18_Genetics_Genomics/gnomad-database/scripts/get_gene_constraint.py +90 -0
- package/skills/18_Genetics_Genomics/gnomad-database/scripts/get_variant_frequency.py +181 -0
- package/skills/18_Genetics_Genomics/gnomad-database/scripts/search_variants.py +207 -0
- package/skills/19_Pharmacology/chembl-database/SKILL.md +283 -0
- package/skills/19_Pharmacology/chembl-database/references/api_endpoints.md +97 -0
- package/skills/19_Pharmacology/chembl-database/references/citation.bib +30 -0
- package/skills/19_Pharmacology/chembl-database/scripts/chembl_api.py +657 -0
- package/skills/19_Pharmacology/clinical-trials-database/SKILL.md +378 -0
- package/skills/19_Pharmacology/clinical-trials-database/references/citation.bib +11 -0
- package/skills/19_Pharmacology/clinical-trials-database/references/clinical_trials_api.md +187 -0
- package/skills/19_Pharmacology/clinical-trials-database/references/studies_schema.md +143 -0
- package/skills/19_Pharmacology/clinical-trials-database/scripts/clinical_trials_api.py +373 -0
- package/skills/19_Pharmacology/openfda-database/SKILL.md +225 -0
- package/skills/19_Pharmacology/openfda-database/references/api_endpoints.md +207 -0
- package/skills/19_Pharmacology/openfda-database/references/citation.bib +15 -0
- package/skills/19_Pharmacology/openfda-database/references/recipes.md +150 -0
- package/skills/19_Pharmacology/openfda-database/scripts/openfda_query.py +505 -0
- package/skills/19_Pharmacology/opentargets-database/SKILL.md +198 -0
- package/skills/19_Pharmacology/opentargets-database/references/OpenTargets_GraphQL_Guide.md +216 -0
- package/skills/19_Pharmacology/opentargets-database/references/citation.bib +15 -0
- package/skills/19_Pharmacology/opentargets-database/scripts/query_opentargets.py +533 -0
- package/skills/19_Pharmacology/pubchem-database/SKILL.md +164 -0
- package/skills/19_Pharmacology/pubchem-database/references/citation.bib +15 -0
- package/skills/19_Pharmacology/pubchem-database/references/endpoints.md +71 -0
- package/skills/19_Pharmacology/pubchem-database/references/workflows.md +32 -0
- package/skills/19_Pharmacology/pubchem-database/scripts/pubchem_api.py +327 -0
- package/skills/20_Infrastructure/uv/SKILL.md +30 -0
- package/skills/01_Meta-Skills/academic-research-hub/SKILL.md +0 -108
- package/skills/01_Meta-Skills/academic-research-hub/scripts/requirements.txt +0 -17
- package/skills/01_Meta-Skills/academic-research-hub/scripts/research.py +0 -781
- package/skills/01_Meta-Skills/beautiful-log/SKILL.md +0 -64
- package/skills/01_Meta-Skills/beautiful-log/scripts/beautiful_log.py +0 -274
- package/skills/01_Meta-Skills/ethoclaw-daily-paper/SKILL.md +0 -130
- package/skills/01_Meta-Skills/ethoclaw-daily-paper/assets/config.template.yaml +0 -54
- package/skills/01_Meta-Skills/ethoclaw-daily-paper/assets/top5_digest_template.md +0 -5
- package/skills/01_Meta-Skills/ethoclaw-daily-paper/scripts/build_top5_digest.py +0 -300
- package/skills/01_Meta-Skills/ethoclaw-daily-paper/scripts/common.py +0 -137
- package/skills/01_Meta-Skills/ethoclaw-daily-paper/scripts/merge_results.py +0 -106
- package/skills/01_Meta-Skills/ethoclaw-daily-paper/scripts/run_pipeline.py +0 -177
- package/skills/01_Meta-Skills/ethoclaw-daily-paper/scripts/search_arxiv.py +0 -162
- package/skills/01_Meta-Skills/ethoclaw-daily-paper/scripts/search_pubmed.py +0 -202
- package/skills/01_Meta-Skills/ethoclaw-normalize-tabular/SKILL.md +0 -173
- package/skills/01_Meta-Skills/ethoclaw-normalize-tabular/scripts/normalize_data.py +0 -874
- package/skills/01_Meta-Skills/ethoclaw-pdf-research/SKILL.md +0 -134
- package/skills/01_Meta-Skills/ethoclaw-pdf-research/references/confirmation-prompts.md +0 -31
- package/skills/01_Meta-Skills/ethoclaw-pdf-research/references/output-patterns.md +0 -45
- package/skills/01_Meta-Skills/ethoclaw-pdf-research/scripts/build_markdown_deliverables.py +0 -41
- package/skills/01_Meta-Skills/ethoclaw-pdf-research/scripts/build_research_log.py +0 -84
- package/skills/01_Meta-Skills/ethoclaw-pdf-research/scripts/build_summary_md.py +0 -63
- package/skills/01_Meta-Skills/ethoclaw-pdf-research/scripts/extract_pdf_bundle.py +0 -140
- package/skills/01_Meta-Skills/experiment-controller/SKILL.md +0 -140
- package/skills/01_Meta-Skills/knowledge-graph-builder/SKILL.md +0 -366
- package/skills/01_Meta-Skills/knowledge-graph-builder/scripts/entity_resolution.py +0 -120
- package/skills/01_Meta-Skills/knowledge-graph-builder/scripts/extraction_prompt_template.txt +0 -19
- package/skills/01_Meta-Skills/knowledge-graph-builder/scripts/graph_query.py +0 -106
- package/skills/01_Meta-Skills/knowledge-graph-builder/scripts/hypothesis_cli_reference.py +0 -42
- package/skills/01_Meta-Skills/knowledge-graph-builder/scripts/new_data_source_template.py +0 -116
- package/skills/01_Meta-Skills/knowledge-graph-builder/scripts/requirements.txt +0 -15
- package/skills/01_Meta-Skills/method-design/SKILL.md +0 -61
- package/skills/01_Meta-Skills/multi-search-engine/SKILL.md +0 -119
- package/skills/01_Meta-Skills/research-idea/SKILL.md +0 -65
- package/skills/05_EEG_ERP/eeg-skill/SKILL.md +0 -197
- package/skills/05_EEG_ERP/meg-skill/SKILL.md +0 -188
- package/skills/05_EEG_ERP/meg-skill/scripts/time_frequency.py +0 -223
- package/skills/05_EEG_ERP/mne-eeg-tool/SKILL.md +0 -165
- package/skills/05_EEG_ERP/mne-eeg-tool/scripts/eeg_pipeline_reference.py +0 -231
- package/skills/05_EEG_ERP/seed-iv-skill/SKILL.md +0 -184
- package/skills/05_EEG_ERP/seed-iv-skill/scripts/classify_seed_iv.py +0 -154
- package/skills/05_EEG_ERP/seed-iv-skill/scripts/extract_seed_iv_features.py +0 -190
- package/skills/05_EEG_ERP/seed-iv-skill/scripts/validate_seed_iv.py +0 -102
- package/skills/05_EEG_ERP/seed-vig-skill/SKILL.md +0 -182
- package/skills/05_EEG_ERP/seed-vig-skill/scripts/classify_seed_vig.py +0 -165
- package/skills/05_EEG_ERP/seed-vig-skill/scripts/extract_seed_vig_features.py +0 -185
- package/skills/05_EEG_ERP/seed-vig-skill/scripts/validate_seed_vig.py +0 -88
- package/skills/06_fMRI_Neuroimaging/abcd-skill/SKILL.md +0 -308
- package/skills/06_fMRI_Neuroimaging/abcd-skill/scripts/abcd_qc_summary.py +0 -449
- package/skills/06_fMRI_Neuroimaging/abcd-skill/scripts/extract_abcd_phenotype.py +0 -292
- package/skills/06_fMRI_Neuroimaging/abcd-skill/scripts/reorganize_abcd.py +0 -387
- package/skills/06_fMRI_Neuroimaging/abide-skill/SKILL.md +0 -302
- package/skills/06_fMRI_Neuroimaging/abide-skill/scripts/abide_qc_summary.py +0 -317
- package/skills/06_fMRI_Neuroimaging/abide-skill/scripts/extract_abide_phenotype.py +0 -267
- package/skills/06_fMRI_Neuroimaging/abide-skill/scripts/reorganize_abide.py +0 -387
- package/skills/06_fMRI_Neuroimaging/adhd200-skill/SKILL.md +0 -244
- package/skills/06_fMRI_Neuroimaging/adhd200-skill/scripts/adhd200_qc_summary.py +0 -98
- package/skills/06_fMRI_Neuroimaging/adhd200-skill/scripts/extract_adhd200_phenotype.py +0 -134
- package/skills/06_fMRI_Neuroimaging/adhd200-skill/scripts/reorganize_adhd200.py +0 -206
- package/skills/06_fMRI_Neuroimaging/adni-skill/SKILL.md +0 -358
- package/skills/06_fMRI_Neuroimaging/adni-skill/scripts/generate_adni_task_files.py +0 -1305
- package/skills/06_fMRI_Neuroimaging/adni-skill/scripts/generate_vqa_from_tasks.py +0 -766
- package/skills/06_fMRI_Neuroimaging/adni-skill/scripts/reorganize_adni.py +0 -491
- package/skills/06_fMRI_Neuroimaging/aibl-skill/SKILL.md +0 -295
- package/skills/06_fMRI_Neuroimaging/aibl-skill/scripts/aibl_qc_summary.py +0 -260
- package/skills/06_fMRI_Neuroimaging/aibl-skill/scripts/extract_aibl_phenotype.py +0 -365
- package/skills/06_fMRI_Neuroimaging/aibl-skill/scripts/reorganize_aibl.py +0 -394
- package/skills/06_fMRI_Neuroimaging/aomic-skill/SKILL.md +0 -292
- package/skills/06_fMRI_Neuroimaging/aomic-skill/scripts/aomic_qc_summary.py +0 -258
- package/skills/06_fMRI_Neuroimaging/aomic-skill/scripts/extract_aomic_phenotype.py +0 -284
- package/skills/06_fMRI_Neuroimaging/aomic-skill/scripts/reorganize_aomic.py +0 -322
- package/skills/06_fMRI_Neuroimaging/asl-skill/SKILL.md +0 -168
- package/skills/06_fMRI_Neuroimaging/asl-skill/scripts/compute_cbf.py +0 -224
- package/skills/06_fMRI_Neuroimaging/bids-organizer/SKILL.md +0 -241
- package/skills/06_fMRI_Neuroimaging/bold5000-skill/SKILL.md +0 -186
- package/skills/06_fMRI_Neuroimaging/bold5000-skill/scripts/bold5000_qc_summary.py +0 -96
- package/skills/06_fMRI_Neuroimaging/bold5000-skill/scripts/extract_bold5000_stimulus.py +0 -125
- package/skills/06_fMRI_Neuroimaging/bold5000-skill/scripts/reorganize_bold5000.py +0 -102
- package/skills/06_fMRI_Neuroimaging/camcan-skill/SKILL.md +0 -213
- package/skills/06_fMRI_Neuroimaging/camcan-skill/scripts/camcan_qc_summary.py +0 -131
- package/skills/06_fMRI_Neuroimaging/camcan-skill/scripts/extract_camcan_phenotype.py +0 -145
- package/skills/06_fMRI_Neuroimaging/camcan-skill/scripts/validate_camcan.py +0 -141
- package/skills/06_fMRI_Neuroimaging/cobre-skill/SKILL.md +0 -201
- package/skills/06_fMRI_Neuroimaging/cobre-skill/scripts/cobre_qc_summary.py +0 -95
- package/skills/06_fMRI_Neuroimaging/cobre-skill/scripts/extract_cobre_phenotype.py +0 -104
- package/skills/06_fMRI_Neuroimaging/cobre-skill/scripts/reorganize_cobre.py +0 -140
- package/skills/06_fMRI_Neuroimaging/conn-tool/SKILL.md +0 -180
- package/skills/06_fMRI_Neuroimaging/dcm2nii/SKILL.md +0 -189
- package/skills/06_fMRI_Neuroimaging/dmt-har-med-skill/SKILL.md +0 -183
- package/skills/06_fMRI_Neuroimaging/dmt-har-med-skill/scripts/dmt_har_med_qc_summary.py +0 -96
- package/skills/06_fMRI_Neuroimaging/dmt-har-med-skill/scripts/extract_dmt_har_med_phenotype.py +0 -121
- package/skills/06_fMRI_Neuroimaging/dmt-har-med-skill/scripts/reorganize_dmt_har_med.py +0 -125
- package/skills/06_fMRI_Neuroimaging/dwi-skill/SKILL.md +0 -359
- package/skills/06_fMRI_Neuroimaging/fmri-skill/SKILL.md +0 -371
- package/skills/06_fMRI_Neuroimaging/fmriprep-tool/SKILL.md +0 -228
- package/skills/06_fMRI_Neuroimaging/freesurfer-tool/SKILL.md +0 -286
- package/skills/06_fMRI_Neuroimaging/freesurfer-tool/scripts/freesurfer_processor.py +0 -145
- package/skills/06_fMRI_Neuroimaging/fsl-tool/SKILL.md +0 -208
- package/skills/06_fMRI_Neuroimaging/hbn-skill/SKILL.md +0 -271
- package/skills/06_fMRI_Neuroimaging/hbn-skill/scripts/extract_hbn_phenotype.py +0 -107
- package/skills/06_fMRI_Neuroimaging/hbn-skill/scripts/hbn_qc_summary.py +0 -96
- package/skills/06_fMRI_Neuroimaging/hbn-skill/scripts/reorganize_hbn.py +0 -150
- package/skills/06_fMRI_Neuroimaging/hcpa-skill/SKILL.md +0 -210
- package/skills/06_fMRI_Neuroimaging/hcpa-skill/scripts/extract_hcpa_phenotype.py +0 -146
- package/skills/06_fMRI_Neuroimaging/hcpa-skill/scripts/hcpa_qc_summary.py +0 -120
- package/skills/06_fMRI_Neuroimaging/hcpa-skill/scripts/reorganize_hcpa.py +0 -155
- package/skills/06_fMRI_Neuroimaging/hcpd-skill/SKILL.md +0 -210
- package/skills/06_fMRI_Neuroimaging/hcpd-skill/scripts/extract_hcpd_phenotype.py +0 -148
- package/skills/06_fMRI_Neuroimaging/hcpd-skill/scripts/hcpd_qc_summary.py +0 -125
- package/skills/06_fMRI_Neuroimaging/hcpd-skill/scripts/reorganize_hcpd.py +0 -146
- package/skills/06_fMRI_Neuroimaging/hcpep-skill/SKILL.md +0 -215
- package/skills/06_fMRI_Neuroimaging/hcpep-skill/scripts/extract_hcpep_phenotype.py +0 -157
- package/skills/06_fMRI_Neuroimaging/hcpep-skill/scripts/hcpep_qc_summary.py +0 -143
- package/skills/06_fMRI_Neuroimaging/hcpep-skill/scripts/reorganize_hcpep.py +0 -146
- package/skills/06_fMRI_Neuroimaging/hcppipeline-tool/SKILL.md +0 -217
- package/skills/06_fMRI_Neuroimaging/hcpya-skill/SKILL.md +0 -214
- package/skills/06_fMRI_Neuroimaging/hcpya-skill/scripts/extract_hcpya_phenotype.py +0 -190
- package/skills/06_fMRI_Neuroimaging/hcpya-skill/scripts/hcpya_qc_summary.py +0 -152
- package/skills/06_fMRI_Neuroimaging/hcpya-skill/scripts/reorganize_hcpya.py +0 -203
- package/skills/06_fMRI_Neuroimaging/ixi-skill/SKILL.md +0 -198
- package/skills/06_fMRI_Neuroimaging/ixi-skill/scripts/ixi_qc_summary.py +0 -137
- package/skills/06_fMRI_Neuroimaging/ixi-skill/scripts/reorganize_ixi.py +0 -190
- package/skills/06_fMRI_Neuroimaging/mnd-skill/SKILL.md +0 -191
- package/skills/06_fMRI_Neuroimaging/mnd-skill/scripts/extract_mnd_phenotype.py +0 -143
- package/skills/06_fMRI_Neuroimaging/mnd-skill/scripts/mnd_qc_summary.py +0 -120
- package/skills/06_fMRI_Neuroimaging/mnd-skill/scripts/validate_mnd.py +0 -107
- package/skills/06_fMRI_Neuroimaging/mschallenge-skill/SKILL.md +0 -203
- package/skills/06_fMRI_Neuroimaging/mschallenge-skill/scripts/analyze_lesions.py +0 -119
- package/skills/06_fMRI_Neuroimaging/mschallenge-skill/scripts/longitudinal_lesion.py +0 -148
- package/skills/06_fMRI_Neuroimaging/mschallenge-skill/scripts/mschallenge_qc_summary.py +0 -132
- package/skills/06_fMRI_Neuroimaging/mschallenge-skill/scripts/validate_mschallenge.py +0 -116
- package/skills/06_fMRI_Neuroimaging/nibabel-skill/SKILL.md +0 -184
- package/skills/06_fMRI_Neuroimaging/nibabel-skill/scripts/atlas_coordinate_reference.py +0 -61
- package/skills/06_fMRI_Neuroimaging/nibabel-skill/scripts/freesurfer_io_reference.py +0 -34
- package/skills/06_fMRI_Neuroimaging/nibabel-skill/scripts/nifti_inspection_reference.py +0 -35
- package/skills/06_fMRI_Neuroimaging/nifd-skill/SKILL.md +0 -205
- package/skills/06_fMRI_Neuroimaging/nifd-skill/scripts/extract_nifd_phenotype.py +0 -132
- package/skills/06_fMRI_Neuroimaging/nifd-skill/scripts/nifd_qc_summary.py +0 -111
- package/skills/06_fMRI_Neuroimaging/nifd-skill/scripts/validate_nifd.py +0 -111
- package/skills/06_fMRI_Neuroimaging/nii2dcm/SKILL.md +0 -143
- package/skills/06_fMRI_Neuroimaging/nilearn-tool/SKILL.md +0 -266
- package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/connectome_reference.py +0 -65
- package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/denoise_timeseries_reference.py +0 -58
- package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/hierarchical_parcellation_reference.py +0 -53
- package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/kmeans_parcellation_reference.py +0 -53
- package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/preprocess_bold_reference.py +0 -76
- package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/rest_dictlearning_reference.py +0 -56
- package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/rest_ica_reference.py +0 -59
- package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/second_level_glm_reference.py +0 -58
- package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/spacenet_classifier_reference.py +0 -59
- package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/svm_classifier_reference.py +0 -60
- package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/task_glm_reference.py +0 -63
- package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/zalff_summary_reference.py +0 -109
- package/skills/06_fMRI_Neuroimaging/nsd-skill/SKILL.md +0 -210
- package/skills/06_fMRI_Neuroimaging/nsd-skill/scripts/extract_nsd_stimulus.py +0 -171
- package/skills/06_fMRI_Neuroimaging/nsd-skill/scripts/nsd_qc_summary.py +0 -142
- package/skills/06_fMRI_Neuroimaging/nsd-skill/scripts/validate_nsd.py +0 -142
- package/skills/06_fMRI_Neuroimaging/oasis-skill/SKILL.md +0 -205
- package/skills/06_fMRI_Neuroimaging/oasis-skill/scripts/extract_oasis_phenotype.py +0 -126
- package/skills/06_fMRI_Neuroimaging/oasis-skill/scripts/oasis_qc_summary.py +0 -115
- package/skills/06_fMRI_Neuroimaging/oasis-skill/scripts/validate_oasis.py +0 -119
- package/skills/06_fMRI_Neuroimaging/pet-skill/SKILL.md +0 -173
- package/skills/06_fMRI_Neuroimaging/pet-skill/scripts/compute_suvr.py +0 -202
- package/skills/06_fMRI_Neuroimaging/pnc-skill/SKILL.md +0 -206
- package/skills/06_fMRI_Neuroimaging/pnc-skill/scripts/extract_pnc_phenotype.py +0 -136
- package/skills/06_fMRI_Neuroimaging/pnc-skill/scripts/pnc_qc_summary.py +0 -116
- package/skills/06_fMRI_Neuroimaging/pnc-skill/scripts/validate_pnc.py +0 -120
- package/skills/06_fMRI_Neuroimaging/ppmi-skill/SKILL.md +0 -209
- package/skills/06_fMRI_Neuroimaging/ppmi-skill/scripts/extract_ppmi_phenotype.py +0 -138
- package/skills/06_fMRI_Neuroimaging/ppmi-skill/scripts/ppmi_qc_summary.py +0 -111
- package/skills/06_fMRI_Neuroimaging/ppmi-skill/scripts/validate_ppmi.py +0 -117
- package/skills/06_fMRI_Neuroimaging/qsiprep-tool/SKILL.md +0 -320
- package/skills/06_fMRI_Neuroimaging/rest-mneta-mdd-skill/SKILL.md +0 -215
- package/skills/06_fMRI_Neuroimaging/rest-mneta-mdd-skill/scripts/extract_rest_mdd_phenotype.py +0 -132
- package/skills/06_fMRI_Neuroimaging/rest-mneta-mdd-skill/scripts/harmonize_sites.py +0 -152
- package/skills/06_fMRI_Neuroimaging/rest-mneta-mdd-skill/scripts/rest_mdd_qc_summary.py +0 -124
- package/skills/06_fMRI_Neuroimaging/rest-mneta-mdd-skill/scripts/validate_rest_mdd.py +0 -103
- package/skills/06_fMRI_Neuroimaging/smri-skill/SKILL.md +0 -302
- package/skills/06_fMRI_Neuroimaging/tcp-skill/SKILL.md +0 -204
- package/skills/06_fMRI_Neuroimaging/tcp-skill/scripts/extract_tcp_phenotype.py +0 -139
- package/skills/06_fMRI_Neuroimaging/tcp-skill/scripts/tcp_qc_summary.py +0 -111
- package/skills/06_fMRI_Neuroimaging/tcp-skill/scripts/validate_tcp.py +0 -99
- package/skills/06_fMRI_Neuroimaging/ucla-cnp-skill/SKILL.md +0 -217
- package/skills/06_fMRI_Neuroimaging/ucla-cnp-skill/scripts/extract_ucla_cnp_phenotype.py +0 -145
- package/skills/06_fMRI_Neuroimaging/ucla-cnp-skill/scripts/ucla_cnp_qc_summary.py +0 -111
- package/skills/06_fMRI_Neuroimaging/ucla-cnp-skill/scripts/validate_ucla_cnp.py +0 -113
- package/skills/06_fMRI_Neuroimaging/ukb-skill/SKILL.md +0 -310
- package/skills/06_fMRI_Neuroimaging/ukb-skill/scripts/build_ukb_survival.py +0 -210
- package/skills/06_fMRI_Neuroimaging/ukb-skill/scripts/extract_ukb_cases.py +0 -308
- package/skills/06_fMRI_Neuroimaging/ukb-skill/scripts/extract_ukb_phenotype.py +0 -232
- package/skills/06_fMRI_Neuroimaging/ukb-skill/scripts/ukb_qc_summary.py +0 -158
- package/skills/06_fMRI_Neuroimaging/wmh-segmentation/SKILL.md +0 -133
- package/skills/07_Computational_Modeling/detrending/SKILL.md +0 -118
- package/skills/07_Computational_Modeling/dictlearning/SKILL.md +0 -122
- package/skills/07_Computational_Modeling/filtering/SKILL.md +0 -121
- package/skills/07_Computational_Modeling/glm/SKILL.md +0 -153
- package/skills/07_Computational_Modeling/hierarchical/SKILL.md +0 -121
- package/skills/07_Computational_Modeling/ica/SKILL.md +0 -122
- package/skills/07_Computational_Modeling/kmeans/SKILL.md +0 -119
- package/skills/07_Computational_Modeling/run_models/SKILL.md +0 -427
- package/skills/07_Computational_Modeling/spacenet/SKILL.md +0 -122
- package/skills/07_Computational_Modeling/svm/SKILL.md +0 -120
- package/skills/08_Computational_Neuroscience/brain_gnn/SKILL.md +0 -183
- package/skills/08_Computational_Neuroscience/dipy-tool/SKILL.md +0 -239
- package/skills/08_Computational_Neuroscience/dipy-tool/scripts/dti_metrics_reference.py +0 -70
- package/skills/08_Computational_Neuroscience/dipy-tool/scripts/load_and_mask_reference.py +0 -76
- package/skills/08_Computational_Neuroscience/dipy-tool/scripts/roi_stats_reference.py +0 -59
- package/skills/08_Computational_Neuroscience/fm_app/SKILL.md +0 -195
- package/skills/08_Computational_Neuroscience/neurostorm/SKILL.md +0 -151
- package/skills/13_Visualization/brain-visualization/SKILL.md +0 -191
- package/skills/13_Visualization/brain-visualization/scripts/connectome_reference.py +0 -108
- package/skills/13_Visualization/brain-visualization/scripts/freesurfer_ply_reference.py +0 -54
- package/skills/13_Visualization/brain-visualization/scripts/zalff_summary_reference.py +0 -116
- package/skills/13_Visualization/ethoclaw-paper-figure-layout/SKILL.md +0 -78
- package/skills/13_Visualization/ethoclaw-paper-figure-layout/assets/naturecomm_figures.tex +0 -74
- package/skills/13_Visualization/ethoclaw-paper-figure-layout/scripts/layout_results_foldered.py +0 -579
- package/skills/14_Writing/overleaf-skill/SKILL.md +0 -184
- package/skills/14_Writing/overleaf-skill/scripts/install.sh +0 -30
- package/skills/14_Writing/paper-writing/SKILL.md +0 -146
- package/skills/14_Writing/paper-writing/scripts/data_statement_templates.py +0 -164
- package/skills/14_Writing/paper-writing/scripts/figure_templates.py +0 -315
- package/skills/14_Writing/paper-writing/scripts/nature_figure_style.py +0 -214
- package/skills/14_Writing/paper-writing/scripts/section_phrasebank.py +0 -246
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/SKILL.md +0 -274
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/report_template_en.html +0 -112
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/report_template_en.md +0 -21
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/cluster-section.md +0 -5
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/heatmap-section.md +0 -5
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/integrated-interpretation.md +0 -3
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/overview.md +0 -3
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/project-summary.md +0 -3
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/radar-section.md +0 -5
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/raw-trajectory.md +0 -3
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/sample-check.md +0 -3
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/single-subject-section.md +0 -3
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/stats-section.md +0 -5
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/experiment-types/epm.md +0 -52
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/experiment-types/fst.md +0 -37
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/experiment-types/nor.md +0 -39
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/experiment-types/oft.md +0 -43
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/experiment-types/tcst.md +0 -45
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/experiment-types/tst.md +0 -36
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/input-types.md +0 -59
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/interpretation-guardrails.md +0 -45
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/metadata-schema.md +0 -57
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/report-sections.md +0 -86
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/section-selection-rules.md +0 -169
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/scripts/build_report_manifest.py +0 -27
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/scripts/render_report.py +0 -34
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/scripts/report_utils.py +0 -1121
- package/skills/16_Animal_Behavior/ethoclaw-animal-grounding/SKILL.md +0 -390
- package/skills/16_Animal_Behavior/ethoclaw-animal-grounding/reference_code.py +0 -98
- package/skills/16_Animal_Behavior/ethoclaw-animal-pose-estimation/SKILL.md +0 -336
- package/skills/16_Animal_Behavior/ethoclaw-kinematic-parameter-generator/README.md +0 -21
- package/skills/16_Animal_Behavior/ethoclaw-kinematic-parameter-generator/SKILL.md +0 -41
- package/skills/16_Animal_Behavior/ethoclaw-kinematic-parameter-generator/batch_kinematic_generator.py +0 -663
- package/skills/16_Animal_Behavior/ethoclaw-kinematic-parameter-generator/config.json +0 -19
- package/skills/16_Animal_Behavior/ethoclaw-kinematic-parameter-generator/generate_kinematic_parameter.py +0 -401
- package/skills/16_Animal_Behavior/ethoclaw-kinematic-parameter-generator/kinematic_generator.py +0 -265
- package/skills/16_Animal_Behavior/ethoclaw-multiparameter-clustermap-generate/SKILL.md +0 -72
- package/skills/16_Animal_Behavior/ethoclaw-multiparameter-clustermap-generate/references/config.example.toml +0 -56
- package/skills/16_Animal_Behavior/ethoclaw-multiparameter-clustermap-generate/scripts/cluster_all_params.py +0 -232
- package/skills/16_Animal_Behavior/ethoclaw-multiparameter-clustermap-generate/scripts/cluster_all_params_from_config.py +0 -236
- package/skills/16_Animal_Behavior/ethoclaw-multiparameter-radar-generate/SKILL.md +0 -68
- package/skills/16_Animal_Behavior/ethoclaw-multiparameter-radar-generate/references/notes.md +0 -5
- package/skills/16_Animal_Behavior/ethoclaw-multiparameter-radar-generate/scripts/plot_h5_radar.py +0 -513
- package/skills/16_Animal_Behavior/ethoclaw-multiparameter-violin-stats-generate/SKILL.md +0 -52
- package/skills/16_Animal_Behavior/ethoclaw-multiparameter-violin-stats-generate/config.toml +0 -81
- package/skills/16_Animal_Behavior/ethoclaw-multiparameter-violin-stats-generate/references/stats-rule.md +0 -18
- package/skills/16_Animal_Behavior/ethoclaw-multiparameter-violin-stats-generate/scripts/h5_inspect.py +0 -79
- package/skills/16_Animal_Behavior/ethoclaw-multiparameter-violin-stats-generate/scripts/h5_violin_batch.py +0 -624
- package/skills/16_Animal_Behavior/ethoclaw-multiparameter-violin-stats-generate/scripts/h5_violin_stats.py +0 -438
- package/skills/16_Animal_Behavior/ethoclaw-trajectory-velocity-heatmap-generate/SKILL.md +0 -280
- package/skills/16_Animal_Behavior/ethoclaw-trajectory-velocity-heatmap-generate/core_scripts/heatmap_trajectory.py +0 -790
- package/skills/16_Animal_Behavior/ethoclaw-trajectory-velocity-heatmap-generate/core_scripts/heatmap_velocity.py +0 -855
- package/skills/16_Animal_Behavior/ethoclaw-trajectory-velocity-heatmap-generate/reference_data/reference_2d.csv +0 -101
- package/skills/16_Animal_Behavior/ethoclaw-trajectory-velocity-heatmap-generate/reference_data/reference_2d.h5 +0 -0
- package/skills/16_Animal_Behavior/ethoclaw-trajectory-velocity-heatmap-generate/reference_data/reference_data_readme.md +0 -126
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pymol
|
|
3
|
+
description: >
|
|
4
|
+
Visualize, analyze, and render protein and molecular structures using PyMOL.
|
|
5
|
+
Use when the user wants to create images of protein structures, perform
|
|
6
|
+
structural alignments or superposition, measure distances or contacts,
|
|
7
|
+
highlight binding sites or active site residues, color by B-factor/pLDDT,
|
|
8
|
+
or analyze protein-ligand interactions. Do not use for docking,
|
|
9
|
+
molecular dynamics, or sequence-only analysis.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# PyMOL
|
|
13
|
+
|
|
14
|
+
## Prerequisites
|
|
15
|
+
|
|
16
|
+
1. **`uv`**: Read the `uv` skill and follow its Setup instructions to ensure
|
|
17
|
+
`uv` is installed and on PATH.
|
|
18
|
+
2. **User Notification**: If .licenses/pymol_LICENSE.txt does not already exist
|
|
19
|
+
in the workspace root directory then (1) prominently notify the user to
|
|
20
|
+
check the license at https://www.pymol.org/, then (2) create the file
|
|
21
|
+
recording the notification text and timestamp.
|
|
22
|
+
|
|
23
|
+
## Overview
|
|
24
|
+
|
|
25
|
+
All PyMOL commands run on the host via `uv` with OSMesa software rendering — no
|
|
26
|
+
GPU, display, or X server is needed. Structure files must be downloaded to the
|
|
27
|
+
host before running PyMOL.
|
|
28
|
+
|
|
29
|
+
**Do NOT use when:**
|
|
30
|
+
|
|
31
|
+
- The user wants to run AlphaFold predictions.
|
|
32
|
+
- The user wants docking or molecular dynamics simulations.
|
|
33
|
+
- The user only has a sequence and no structure file — fetch the structure
|
|
34
|
+
first. Check if any other installed skills can retrieve structures from the
|
|
35
|
+
PDB or AlphaFold Database before proceeding.
|
|
36
|
+
|
|
37
|
+
## Setup (Agent Instructions)
|
|
38
|
+
|
|
39
|
+
Ensure that `uv` is installed on the host system. The PyMOL scripts use PEP 0723
|
|
40
|
+
headers to declare their dependencies, and `uv run` will automatically handle
|
|
41
|
+
installing them (including `pymol-open-source-whl`) when the script is executed.
|
|
42
|
+
|
|
43
|
+
## Core Rules
|
|
44
|
+
|
|
45
|
+
- **Output paths must be absolute or relative to the user's project root.**
|
|
46
|
+
Always run PyMOL scripts from the user's project directory.
|
|
47
|
+
- **Software rendering only.** Use `cmd.png()` for output. Never use
|
|
48
|
+
`cmd.draw()` or `cmd.ray()` with hardware acceleration — OSMesa does not
|
|
49
|
+
support it. Set environment variable `PYOPENGL_PLATFORM=osmesa` for headless
|
|
50
|
+
rendering.
|
|
51
|
+
- **Always save a `.pse` session file** alongside any PNG output. This lets
|
|
52
|
+
the user open the session in their local PyMOL for further inspection.
|
|
53
|
+
- **Always call `cmd.quit()`** at the end of every PyMOL script. Omitting it
|
|
54
|
+
causes the process to stop responding.
|
|
55
|
+
- **Init boilerplate is mandatory.** Every PyMOL script must begin with the
|
|
56
|
+
initialization sequence. `from pymol import cmd` must come after
|
|
57
|
+
`finish_launching()`, not before.
|
|
58
|
+
- See [references/PYMOL_REFERENCE.md](references/PYMOL_REFERENCE.md) for
|
|
59
|
+
selection syntax, common commands, and gotchas.
|
|
60
|
+
- **Pre-Flight File Check**: Before writing the PyMOL script or running it,
|
|
61
|
+
you MUST verify that the requested structure file actually exists on the
|
|
62
|
+
host machine.
|
|
63
|
+
- **Verify Structure Load**: After loading a structure with `cmd.load()`,
|
|
64
|
+
always verify it succeeded by checking `cmd.count_atoms("all")`. If the
|
|
65
|
+
result is 0, print an error to stdout and call `cmd.quit()` immediately.
|
|
66
|
+
- **Notification**: If this skill is used, ensure this is mentioned in the
|
|
67
|
+
output.
|
|
68
|
+
|
|
69
|
+
## Quick Start
|
|
70
|
+
|
|
71
|
+
* Ensure structure files are downloaded to a directory in the user's project.
|
|
72
|
+
* Write a PyMOL Python script (e.g., `render.py`) with the required init
|
|
73
|
+
boilerplate and PEP 0723 header.
|
|
74
|
+
* Run it via `uv run`: `bash uv run render.py`
|
|
75
|
+
|
|
76
|
+
### Minimal example script (`render.py`)
|
|
77
|
+
|
|
78
|
+
```python
|
|
79
|
+
# /// script
|
|
80
|
+
# requires-python = ">=3.10, <3.13"
|
|
81
|
+
# dependencies = [
|
|
82
|
+
# "pymol-open-source-whl",
|
|
83
|
+
# ]
|
|
84
|
+
# ///
|
|
85
|
+
|
|
86
|
+
import os
|
|
87
|
+
import sys
|
|
88
|
+
|
|
89
|
+
# Set environment variable for headless rendering
|
|
90
|
+
os.environ["PYOPENGL_PLATFORM"] = "osmesa"
|
|
91
|
+
|
|
92
|
+
import pymol # pytype: disable=import-error
|
|
93
|
+
pymol.pymol_argv = ["pymol", "-cq"]
|
|
94
|
+
pymol.finish_launching()
|
|
95
|
+
|
|
96
|
+
from pymol import cmd # pytype: disable=import-error
|
|
97
|
+
|
|
98
|
+
cmd.load("AF-P00520-F1-model_v4.cif", "structure")
|
|
99
|
+
cmd.show("cartoon")
|
|
100
|
+
cmd.color("green", "ss h")
|
|
101
|
+
cmd.color("yellow", "ss s")
|
|
102
|
+
cmd.color("gray", "ss l+''")
|
|
103
|
+
cmd.orient()
|
|
104
|
+
cmd.set("ray_opaque_background", 1)
|
|
105
|
+
cmd.png("output/render.png", width=1200, height=900, dpi=150)
|
|
106
|
+
cmd.save("output/session.pse")
|
|
107
|
+
cmd.quit()
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Common Recipes
|
|
111
|
+
|
|
112
|
+
See [references/RECIPES.md](references/RECIPES.md) for complete, copy-paste
|
|
113
|
+
ready recipes. Available recipes:
|
|
114
|
+
|
|
115
|
+
- **Cartoon with secondary structure coloring** — basic helix/sheet/loop
|
|
116
|
+
coloring
|
|
117
|
+
- **B-factor (pLDDT) coloring** — continuous spectrum coloring by B-factor
|
|
118
|
+
- **AlphaFold pLDDT coloring** — canonical threshold-based confidence colors
|
|
119
|
+
- **Highlight specific residues** — show active site or key residues as sticks
|
|
120
|
+
- **Surface rendering** — transparent surface over cartoon
|
|
121
|
+
- **Electrostatic surface rendering** — vacuum electrostatics (qualitative)
|
|
122
|
+
- **Multi-chain complex colors** — automatic per-chain coloring
|
|
123
|
+
- **B-factor putty analysis** — tube width proportional to flexibility
|
|
124
|
+
- **Cavity and pocket visualization** — surface cavity detection with ligand
|
|
125
|
+
focus
|
|
126
|
+
- **Multi-structure batch rendering** — render a directory of structures
|
|
127
|
+
- **Measure distance between residues** — CA–CA distance with labels
|
|
128
|
+
- **Zoom into binding pocket** — simple pocket focus
|
|
129
|
+
- **Protein-ligand interaction** — ligand isolation, styled rendering, polar
|
|
130
|
+
contacts
|
|
131
|
+
- **Two-structure superposition with RMSD** — align/cealign with auto-fallback
|
|
132
|
+
- **In silico mutagenesis** — mutate residues with the mutagenesis wizard
|
|
133
|
+
- **Load and modify an existing session** — re-open a `.pse` file
|
|
134
|
+
|
|
135
|
+
## Interpreting Output
|
|
136
|
+
|
|
137
|
+
- The `output/` directory contains PNG images and a `.pse` session file.
|
|
138
|
+
- Any measurements or metrics (distances, RMSD, atom counts) are printed to
|
|
139
|
+
stdout by the PyMOL script. Report these values to the user.
|
|
140
|
+
- Present PNG images to the user and describe the visualization.
|
|
141
|
+
- Tell the user they can open the `.pse` file in their local PyMOL to further
|
|
142
|
+
explore, rotate, or modify the visualization.
|
|
143
|
+
- If the user wants modifications, load the saved `.pse` in a new script and
|
|
144
|
+
re-run.
|
|
145
|
+
- Large sessions with surfaces can exceed the `--max_output_mb` limit (default
|
|
146
|
+
500 MB). Increase it with `--max_output_mb=1000` if needed.
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# PyMOL Quick Reference
|
|
2
|
+
|
|
3
|
+
## Mandatory Initialization Boilerplate
|
|
4
|
+
|
|
5
|
+
Every PyMOL script **must** start with this exact sequence. The order matters —
|
|
6
|
+
reversing the import and `finish_launching()` will crash.
|
|
7
|
+
|
|
8
|
+
```python
|
|
9
|
+
import pymol
|
|
10
|
+
pymol.pymol_argv = ["pymol", "-cq"]
|
|
11
|
+
pymol.finish_launching()
|
|
12
|
+
from pymol import cmd
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
- `-c` = command-line mode (no GUI)
|
|
16
|
+
- `-q` = quiet (suppress startup messages)
|
|
17
|
+
|
|
18
|
+
## Rendering Backend
|
|
19
|
+
|
|
20
|
+
PyMOL runs with **OSMesa** (software rendering). There is no GPU or X display.
|
|
21
|
+
|
|
22
|
+
- Use `cmd.png(path, width, height, dpi)` for output.
|
|
23
|
+
- `cmd.ray()` works but is slow — use it only when you need ray-traced
|
|
24
|
+
quality.
|
|
25
|
+
- Never use `cmd.draw()` (requires hardware OpenGL).
|
|
26
|
+
- Always set `cmd.set("ray_opaque_background", 1)` if you want a white
|
|
27
|
+
background instead of transparent.
|
|
28
|
+
|
|
29
|
+
## Selection Syntax
|
|
30
|
+
|
|
31
|
+
### Identifiers
|
|
32
|
+
|
|
33
|
+
Selector | Example | Selects
|
|
34
|
+
-------------- | ------------------ | ----------------------------------
|
|
35
|
+
`chain` | `chain A` | All atoms in chain A
|
|
36
|
+
`resi` | `resi 100` | Residue number 100
|
|
37
|
+
`resi` (range) | `resi 100-200` | Residues 100 through 200
|
|
38
|
+
`resi` (list) | `resi 100+102+150` | Specific residues
|
|
39
|
+
`resn` | `resn ALA` | All alanine residues
|
|
40
|
+
`name` | `name CA` | All C-alpha atoms
|
|
41
|
+
`ss` | `ss h` | Helices (h), sheets (s), loops (l)
|
|
42
|
+
|
|
43
|
+
### Structure types
|
|
44
|
+
|
|
45
|
+
Selector | Selects
|
|
46
|
+
----------------- | ------------------------------------------
|
|
47
|
+
`polymer.protein` | All protein atoms
|
|
48
|
+
`organic` | Organic ligands (non-polymer, non-solvent)
|
|
49
|
+
`solvent` | Water molecules
|
|
50
|
+
`hetatm` | Heteroatoms (ligands, ions, water)
|
|
51
|
+
`all` | Everything
|
|
52
|
+
|
|
53
|
+
### Logical operators
|
|
54
|
+
|
|
55
|
+
Operator | Example | Meaning
|
|
56
|
+
-------- | -------------------------------- | ------------
|
|
57
|
+
`and` | `chain A and resi 100` | Intersection
|
|
58
|
+
`or` | `resn ALA or resn GLY` | Union
|
|
59
|
+
`not` | `not solvent` | Negation
|
|
60
|
+
`()` | `chain A and (not resi 100-110)` | Grouping
|
|
61
|
+
|
|
62
|
+
### Proximity selectors
|
|
63
|
+
|
|
64
|
+
Selector | Example
|
|
65
|
+
------------------------- | ---------------------------------------------
|
|
66
|
+
`within X of (selection)` | `polymer.protein within 4 of organic`
|
|
67
|
+
`byres (selection)` | `byres (polymer.protein within 4 of organic)`
|
|
68
|
+
`around X` | `resi 100 around 5`
|
|
69
|
+
|
|
70
|
+
### Named selections
|
|
71
|
+
|
|
72
|
+
```python
|
|
73
|
+
cmd.select("binding_site", "byres (polymer.protein within 4 of organic)")
|
|
74
|
+
cmd.select("alpha_carbons", "name CA and polymer.protein")
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## File Paths
|
|
78
|
+
|
|
79
|
+
- When running with `uv run`, files are accessed directly from the host
|
|
80
|
+
filesystem.
|
|
81
|
+
- Paths are relative to the directory where you run the command, or you can
|
|
82
|
+
use absolute paths.
|
|
83
|
+
- Ensure output directories exist before trying to write to them.
|
|
84
|
+
|
|
85
|
+
## Common Commands
|
|
86
|
+
|
|
87
|
+
### Loading structures
|
|
88
|
+
|
|
89
|
+
```python
|
|
90
|
+
cmd.load("data/structure.cif", "myprotein")
|
|
91
|
+
cmd.load("data/structure.pdb", "myprotein")
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Display modes
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
cmd.show("cartoon", "polymer.protein")
|
|
98
|
+
cmd.show("sticks", "resi 100-110")
|
|
99
|
+
cmd.show("surface", "polymer.protein")
|
|
100
|
+
cmd.show("spheres", "resi 50")
|
|
101
|
+
cmd.hide("everything", "solvent")
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Coloring
|
|
105
|
+
|
|
106
|
+
```python
|
|
107
|
+
cmd.color("green", "ss h")
|
|
108
|
+
cmd.color("cyan", "chain A")
|
|
109
|
+
cmd.spectrum("b", "red_white_blue", "polymer.protein")
|
|
110
|
+
cmd.spectrum("count", "rainbow", "polymer.protein")
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Structural operations
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
cmd.align("mobile", "target")
|
|
117
|
+
cmd.super("mobile", "target")
|
|
118
|
+
cmd.select("site", "resi 100-120 and chain A")
|
|
119
|
+
cmd.distance("dist1", "resi 100 and name CA", "resi 200 and name CA")
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Output
|
|
123
|
+
|
|
124
|
+
```python
|
|
125
|
+
cmd.png("output/image.png", width=1200, height=900, dpi=150)
|
|
126
|
+
cmd.save("output/modified.pdb", "myprotein")
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Cleanup (REQUIRED)
|
|
130
|
+
|
|
131
|
+
```python
|
|
132
|
+
cmd.quit()
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Common Pitfalls
|
|
136
|
+
|
|
137
|
+
1. **`cmd.quit()` is mandatory** — without it, the PyMOL process hangs and the
|
|
138
|
+
container will time out.
|
|
139
|
+
2. **Selection case sensitivity** — `"chain a"` is NOT the same as `"chain A"`.
|
|
140
|
+
3. **`cmd.fetch()` will fail** — there is no network inside the container. Use
|
|
141
|
+
`cmd.load()` with pre-downloaded files.
|
|
142
|
+
4. **`cmd.png()` before `cmd.quit()`** — ensure all rendering is done before
|
|
143
|
+
quitting.
|
|
144
|
+
5. **Paths are relative to current directory** — ensure you run the script from
|
|
145
|
+
the correct directory or use absolute paths.
|
|
146
|
+
6. **Container timeout** — the default timeout is **300 seconds** (5 minutes),
|
|
147
|
+
which is sufficient for most rendering tasks. For long operations (e.g.,
|
|
148
|
+
ray-tracing large complexes), increase with `--container_timeout=<seconds>`.
|
|
149
|
+
Do not reduce below 60 seconds.
|
|
150
|
+
7. **Distance objects are NOT selections** — `cmd.distance()` creates a
|
|
151
|
+
measurement object, not an atom selection. Do NOT use `cmd.count_atoms()` on
|
|
152
|
+
distance objects — it will error. Only use `cmd.count_atoms()` on valid atom
|
|
153
|
+
selections (e.g., by residue name, chain, or proximity).
|
|
154
|
+
8. **Selection names must be valid identifiers** — names passed to
|
|
155
|
+
`cmd.select("name", ...)` must be alphanumeric and underscores only, start
|
|
156
|
+
with a letter, and contain no spaces. `binding_site` is valid; `binding
|
|
157
|
+
site` or `1_ligand` will crash PyMOL.
|
|
158
|
+
9. **Multi-state structures (NMR)** — for NMR ensembles or multi-model files,
|
|
159
|
+
restrict distance measurements, alignments, and rendering to `state=1` to
|
|
160
|
+
prevent visual clutter and errors across all states simultaneously.
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
# Common Recipes
|
|
2
|
+
|
|
3
|
+
Copy-paste ready recipes for common PyMOL visualization tasks. Each recipe
|
|
4
|
+
assumes the init boilerplate has already been set up (see
|
|
5
|
+
[PYMOL_REFERENCE.md](PYMOL_REFERENCE.md)).
|
|
6
|
+
|
|
7
|
+
### Cartoon with secondary structure coloring
|
|
8
|
+
|
|
9
|
+
```python
|
|
10
|
+
cmd.load("data/structure.cif", "protein")
|
|
11
|
+
cmd.show("cartoon")
|
|
12
|
+
cmd.color("green", "ss h")
|
|
13
|
+
cmd.color("yellow", "ss s")
|
|
14
|
+
cmd.color("gray", "ss l+''")
|
|
15
|
+
cmd.orient()
|
|
16
|
+
cmd.png("output/cartoon.png", width=1200, height=900, dpi=150)
|
|
17
|
+
cmd.save("output/session.pse")
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### B-factor (pLDDT) coloring
|
|
21
|
+
|
|
22
|
+
```python
|
|
23
|
+
cmd.load("data/AF-P00520-F1-model_v4.cif", "protein")
|
|
24
|
+
cmd.show("cartoon")
|
|
25
|
+
cmd.spectrum("b", "red_white_blue", "polymer.protein")
|
|
26
|
+
cmd.orient()
|
|
27
|
+
cmd.png("output/bfactor.png", width=1200, height=900, dpi=150)
|
|
28
|
+
cmd.save("output/session.pse")
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### AlphaFold pLDDT coloring (canonical thresholds)
|
|
32
|
+
|
|
33
|
+
```python
|
|
34
|
+
cmd.load("data/structure.cif", "protein")
|
|
35
|
+
cmd.show("cartoon")
|
|
36
|
+
# Define AlphaFold's canonical pLDDT colors
|
|
37
|
+
cmd.set_color("af_very_low", [0xFF, 0x7D, 0x45]) # orange, pLDDT < 50
|
|
38
|
+
cmd.set_color("af_low", [0xFF, 0xDB, 0x13]) # yellow, 50 <= pLDDT < 70
|
|
39
|
+
cmd.set_color("af_confident", [0x65, 0xCB, 0xF3]) # light blue, 70 <= pLDDT < 90
|
|
40
|
+
cmd.set_color("af_very_high", [0x00, 0x53, 0xD6]) # dark blue, pLDDT >= 90
|
|
41
|
+
# Apply from lowest to highest threshold
|
|
42
|
+
cmd.color("af_very_low", "polymer.protein")
|
|
43
|
+
cmd.color("af_low", "polymer.protein and b > 50")
|
|
44
|
+
cmd.color("af_confident", "polymer.protein and b > 70")
|
|
45
|
+
cmd.color("af_very_high", "polymer.protein and b > 90")
|
|
46
|
+
cmd.orient()
|
|
47
|
+
cmd.png("output/plddt.png", width=1200, height=900, dpi=150)
|
|
48
|
+
cmd.save("output/session.pse")
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Highlight specific residues
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
cmd.load("data/structure.cif", "protein")
|
|
55
|
+
cmd.show("cartoon")
|
|
56
|
+
cmd.color("gray", "all")
|
|
57
|
+
cmd.select("active_site", "chain A and resi 100+102+150")
|
|
58
|
+
cmd.show("sticks", "active_site")
|
|
59
|
+
cmd.color("red", "active_site")
|
|
60
|
+
cmd.orient()
|
|
61
|
+
cmd.png("output/highlight.png", width=1200, height=900, dpi=150)
|
|
62
|
+
cmd.save("output/session.pse")
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Surface rendering
|
|
66
|
+
|
|
67
|
+
```python
|
|
68
|
+
cmd.load("data/structure.cif", "protein")
|
|
69
|
+
cmd.show("cartoon", "polymer.protein")
|
|
70
|
+
cmd.color("green", "polymer.protein and ss h")
|
|
71
|
+
cmd.color("yellow", "polymer.protein and ss s")
|
|
72
|
+
cmd.color("gray", "polymer.protein and (ss l+'')")
|
|
73
|
+
cmd.show("surface", "polymer.protein")
|
|
74
|
+
cmd.set("surface_color", "white", "polymer.protein")
|
|
75
|
+
cmd.set("transparency", 0.3, "polymer.protein")
|
|
76
|
+
cmd.orient()
|
|
77
|
+
cmd.png("output/surface.png", width=1200, height=900, dpi=150)
|
|
78
|
+
cmd.save("output/session.pse")
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Electrostatic surface rendering
|
|
82
|
+
|
|
83
|
+
```python
|
|
84
|
+
cmd.load("data/structure.cif", "protein")
|
|
85
|
+
cmd.remove("solvent")
|
|
86
|
+
cmd.show("cartoon", "polymer.protein")
|
|
87
|
+
cmd.color("gray80", "polymer.protein")
|
|
88
|
+
util.protein_vacuum_esp("polymer.protein", quiet=0)
|
|
89
|
+
cmd.show("surface", "polymer.protein")
|
|
90
|
+
cmd.set("transparency", 0.0, "polymer.protein")
|
|
91
|
+
cmd.set("two_sided_lighting", 1)
|
|
92
|
+
cmd.orient()
|
|
93
|
+
cmd.png("output/electrostatic.png", width=1200, height=900, dpi=150)
|
|
94
|
+
cmd.save("output/session.pse")
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Multi-chain complex colors
|
|
98
|
+
|
|
99
|
+
```python
|
|
100
|
+
cmd.load("data/complex.cif", "complex")
|
|
101
|
+
cmd.remove("solvent")
|
|
102
|
+
cmd.show("cartoon", "polymer.protein")
|
|
103
|
+
|
|
104
|
+
chain_colors = ["cyan", "salmon", "green", "yellow", "magenta",
|
|
105
|
+
"orange", "slate", "limon", "deeppurple", "wheat"]
|
|
106
|
+
chains = cmd.get_chains("complex")
|
|
107
|
+
print(f"Chains found: {', '.join(chains)}")
|
|
108
|
+
for i, chain in enumerate(chains):
|
|
109
|
+
color = chain_colors[i % len(chain_colors)]
|
|
110
|
+
cmd.color(color, f"chain {chain}")
|
|
111
|
+
print(f" Chain {chain}: {color} ({cmd.count_atoms(f'chain {chain} and name CA')} residues)")
|
|
112
|
+
|
|
113
|
+
cmd.orient()
|
|
114
|
+
cmd.png("output/chains.png", width=1200, height=900, dpi=150)
|
|
115
|
+
cmd.save("output/session.pse")
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### B-factor putty analysis
|
|
119
|
+
|
|
120
|
+
```python
|
|
121
|
+
cmd.load("data/structure.cif", "protein")
|
|
122
|
+
cmd.remove("solvent")
|
|
123
|
+
|
|
124
|
+
cmd.show("cartoon", "polymer.protein")
|
|
125
|
+
cmd.cartoon("putty", "polymer.protein")
|
|
126
|
+
cmd.set("cartoon_putty_scale_min", 0.3)
|
|
127
|
+
cmd.set("cartoon_putty_scale_max", 3.0)
|
|
128
|
+
cmd.set("cartoon_putty_transform", 0)
|
|
129
|
+
cmd.spectrum("b", "blue_white_red", "polymer.protein")
|
|
130
|
+
cmd.orient()
|
|
131
|
+
cmd.png("output/putty.png", width=1200, height=900, dpi=150)
|
|
132
|
+
cmd.save("output/session.pse")
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Cavity and pocket visualization (including ligand focus)
|
|
136
|
+
|
|
137
|
+
```python
|
|
138
|
+
cmd.load("data/structure.cif", "protein")
|
|
139
|
+
cmd.remove("solvent")
|
|
140
|
+
|
|
141
|
+
cmd.show("cartoon", "polymer.protein")
|
|
142
|
+
cmd.color("gray80", "polymer.protein")
|
|
143
|
+
|
|
144
|
+
# If a ligand is present, isolate one to focus the cavity view
|
|
145
|
+
if cmd.count_atoms("organic") > 0:
|
|
146
|
+
# Isolate a single ligand to prevent zoomed-out views on symmetrical complexes
|
|
147
|
+
first_atom = cmd.get_model("organic").atom[0]
|
|
148
|
+
cmd.select("target_ligand", f"organic and chain '{first_atom.chain}' and resi '{first_atom.resi}'")
|
|
149
|
+
|
|
150
|
+
cmd.show("sticks", "target_ligand")
|
|
151
|
+
util.cnc("target_ligand")
|
|
152
|
+
|
|
153
|
+
# Orient on the single ligand and zoom with enough buffer to see the pocket context
|
|
154
|
+
cmd.orient("target_ligand")
|
|
155
|
+
cmd.zoom("target_ligand", buffer=10.0)
|
|
156
|
+
else:
|
|
157
|
+
cmd.orient()
|
|
158
|
+
|
|
159
|
+
cmd.show("surface", "polymer.protein")
|
|
160
|
+
cmd.set("surface_color", "white", "polymer.protein")
|
|
161
|
+
cmd.set("transparency", 0.6, "polymer.protein")
|
|
162
|
+
|
|
163
|
+
cmd.set("surface_cavity_mode", 1)
|
|
164
|
+
cmd.set("surface_cavity_radius", 5.0)
|
|
165
|
+
cmd.set("surface_cavity_cutoff", -1.0)
|
|
166
|
+
cmd.set("cavity_cull", 50)
|
|
167
|
+
|
|
168
|
+
cmd.set("two_sided_lighting", 1)
|
|
169
|
+
cmd.png("output/cavities.png", width=1200, height=900, dpi=150)
|
|
170
|
+
cmd.save("output/session.pse")
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
**`surface_cavity_mode` values:** `0` = no cavity (default), `1` = show cavities
|
|
174
|
+
only, `2` = show outer surface trimmed around cavities.
|
|
175
|
+
|
|
176
|
+
### Multi-structure batch rendering
|
|
177
|
+
|
|
178
|
+
For comparing multiple structures side-by-side or generating consistent renders
|
|
179
|
+
across a set of PDB files. This is common in design campaigns.
|
|
180
|
+
|
|
181
|
+
```python
|
|
182
|
+
import os
|
|
183
|
+
import glob
|
|
184
|
+
|
|
185
|
+
structures = glob.glob("data/*.pdb") + glob.glob("data/*.cif")
|
|
186
|
+
print(f"Found {len(structures)} structures to render")
|
|
187
|
+
|
|
188
|
+
for struct_path in sorted(structures):
|
|
189
|
+
name = os.path.splitext(os.path.basename(struct_path))[0]
|
|
190
|
+
cmd.load(struct_path, name)
|
|
191
|
+
|
|
192
|
+
n_atoms = cmd.count_atoms(name)
|
|
193
|
+
if n_atoms == 0:
|
|
194
|
+
print(f" SKIP {name}: 0 atoms loaded")
|
|
195
|
+
cmd.delete(name)
|
|
196
|
+
continue
|
|
197
|
+
|
|
198
|
+
cmd.show("cartoon", name)
|
|
199
|
+
cmd.color("green", f"{name} and ss h")
|
|
200
|
+
cmd.color("yellow", f"{name} and ss s")
|
|
201
|
+
cmd.color("gray", f"{name} and (ss l+'')")
|
|
202
|
+
cmd.orient(name)
|
|
203
|
+
cmd.png(f"output/{name}.png", width=1200, height=900, dpi=150)
|
|
204
|
+
print(f" Rendered {name} ({n_atoms} atoms)")
|
|
205
|
+
cmd.delete(name)
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Measure distance between residues
|
|
209
|
+
|
|
210
|
+
```python
|
|
211
|
+
cmd.load("data/structure.cif", "protein")
|
|
212
|
+
cmd.show("cartoon")
|
|
213
|
+
cmd.distance("d1", "chain A and resi 10 and name CA", "chain A and resi 50 and name CA")
|
|
214
|
+
print(f"Distance: {cmd.get_distance('chain A and resi 10 and name CA', 'chain A and resi 50 and name CA'):.2f} A")
|
|
215
|
+
cmd.orient()
|
|
216
|
+
cmd.png("output/distance.png", width=1200, height=900, dpi=150)
|
|
217
|
+
cmd.save("output/session.pse")
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### Zoom into binding pocket
|
|
221
|
+
|
|
222
|
+
```python
|
|
223
|
+
cmd.load("data/complex.pdb", "complex")
|
|
224
|
+
cmd.show("cartoon", "polymer.protein")
|
|
225
|
+
cmd.color("gray", "polymer.protein")
|
|
226
|
+
cmd.select("pocket", "byres (polymer.protein within 5.0 of organic)")
|
|
227
|
+
cmd.show("sticks", "pocket")
|
|
228
|
+
cmd.color("cyan", "pocket")
|
|
229
|
+
cmd.zoom("pocket", buffer=3.0)
|
|
230
|
+
cmd.png("output/pocket_zoom.png", width=1200, height=900, dpi=150)
|
|
231
|
+
cmd.save("output/session.pse")
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Protein-ligand interaction
|
|
235
|
+
|
|
236
|
+
```python
|
|
237
|
+
cmd.load("data/complex.pdb", "complex")
|
|
238
|
+
|
|
239
|
+
# Isolate a single ligand to prevent zoomed-out views on symmetrical complexes
|
|
240
|
+
if cmd.count_atoms("organic") > 0:
|
|
241
|
+
first_atom = cmd.get_model("organic").atom[0]
|
|
242
|
+
cmd.select("target_ligand", f"organic and chain '{first_atom.chain}'")
|
|
243
|
+
else:
|
|
244
|
+
raise RuntimeError("No ligand found.")
|
|
245
|
+
|
|
246
|
+
cmd.select("binding_site", "byres (polymer.protein within 4.0 of target_ligand)")
|
|
247
|
+
|
|
248
|
+
# Styled rendering with heteroatom coloring
|
|
249
|
+
cmd.show("cartoon", "polymer.protein")
|
|
250
|
+
cmd.set("cartoon_transparency", 0.4, "polymer.protein")
|
|
251
|
+
cmd.color("gray80", "polymer.protein")
|
|
252
|
+
|
|
253
|
+
cmd.show("sticks", "binding_site")
|
|
254
|
+
util.cbac("binding_site")
|
|
255
|
+
util.cnc("binding_site")
|
|
256
|
+
cmd.show("sticks", "target_ligand")
|
|
257
|
+
util.cbag("target_ligand")
|
|
258
|
+
util.cnc("target_ligand")
|
|
259
|
+
cmd.hide("sticks", "hydro")
|
|
260
|
+
|
|
261
|
+
# Show pocket waters
|
|
262
|
+
cmd.select("pocket_waters", "solvent within 4.0 of target_ligand")
|
|
263
|
+
cmd.show("spheres", "pocket_waters")
|
|
264
|
+
cmd.color("red", "pocket_waters")
|
|
265
|
+
cmd.set("sphere_scale", 0.15, "pocket_waters")
|
|
266
|
+
|
|
267
|
+
# Polar contacts (hydrogen bonds)
|
|
268
|
+
cmd.distance("polar_contacts", "target_ligand", "binding_site", cutoff=3.5, mode=2)
|
|
269
|
+
cmd.set("dash_color", "yellow")
|
|
270
|
+
cmd.set("dash_gap", 0.4)
|
|
271
|
+
cmd.set("dash_radius", 0.08)
|
|
272
|
+
cmd.hide("labels", "polar_contacts")
|
|
273
|
+
|
|
274
|
+
cmd.orient("target_ligand | binding_site")
|
|
275
|
+
cmd.zoom("target_ligand | binding_site", buffer=3.0)
|
|
276
|
+
cmd.png("output/ligand.png", width=1200, height=900, dpi=150)
|
|
277
|
+
cmd.save("output/session.pse")
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### In silico mutagenesis
|
|
281
|
+
|
|
282
|
+
```python
|
|
283
|
+
cmd.load("data/structure.cif", "protein")
|
|
284
|
+
cmd.show("cartoon")
|
|
285
|
+
cmd.wizard("mutagenesis")
|
|
286
|
+
cmd.get_wizard().set_mode("ALA")
|
|
287
|
+
cmd.get_wizard().do_select("chain A and resi 100")
|
|
288
|
+
cmd.get_wizard().apply()
|
|
289
|
+
cmd.set_wizard()
|
|
290
|
+
cmd.orient()
|
|
291
|
+
cmd.png("output/mutant.png", width=1200, height=900, dpi=150)
|
|
292
|
+
cmd.save("output/session.pse")
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
### Two-structure superposition with RMSD
|
|
296
|
+
|
|
297
|
+
PyMOL provides three structural alignment methods:
|
|
298
|
+
|
|
299
|
+
- `align` — sequence-dependent; best when structures share >40% sequence
|
|
300
|
+
identity
|
|
301
|
+
- `super` — sequence-independent superposition; use when structures are
|
|
302
|
+
structurally similar but have poor sequence identity
|
|
303
|
+
- `cealign` — combinatorial extension; use when there is neither sequence nor
|
|
304
|
+
strong structural similarity
|
|
305
|
+
|
|
306
|
+
The recipe below attempts `align` first and falls back to `cealign`
|
|
307
|
+
automatically.
|
|
308
|
+
|
|
309
|
+
```python
|
|
310
|
+
cmd.load("data/structure1.cif", "model1")
|
|
311
|
+
cmd.load("data/structure2.cif", "model2")
|
|
312
|
+
|
|
313
|
+
try:
|
|
314
|
+
result = cmd.align("model2", "model1")
|
|
315
|
+
if result[1] < 20:
|
|
316
|
+
raise ValueError("Poor sequence alignment")
|
|
317
|
+
print(f"Method: align (>40% sequence identity)")
|
|
318
|
+
print(f"RMSD: {result[0]:.3f} A over {result[1]} atoms")
|
|
319
|
+
except Exception:
|
|
320
|
+
result = cmd.cealign("model1", "model2")
|
|
321
|
+
print(f"Method: cealign (low sequence identity fallback)")
|
|
322
|
+
print(f"RMSD: {result['RMSD']:.3f} A over {result['alignment_length']} atoms")
|
|
323
|
+
|
|
324
|
+
cmd.show("cartoon", "all")
|
|
325
|
+
cmd.color("cyan", "model1")
|
|
326
|
+
cmd.color("salmon", "model2")
|
|
327
|
+
cmd.orient()
|
|
328
|
+
cmd.png("output/superposition.png", width=1200, height=900, dpi=150)
|
|
329
|
+
cmd.save("output/session.pse")
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
### Load and modify an existing session
|
|
333
|
+
|
|
334
|
+
```python
|
|
335
|
+
cmd.load("data/previous_session.pse")
|
|
336
|
+
cmd.color("marine", "chain A")
|
|
337
|
+
cmd.show("surface", "chain B")
|
|
338
|
+
cmd.orient()
|
|
339
|
+
cmd.png("output/modified.png", width=1200, height=900, dpi=150)
|
|
340
|
+
cmd.save("output/session.pse")
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
To run any of these recipes, place the code in a Python script with the required
|
|
344
|
+
header and boilerplate (see [SKILL.md](../SKILL.md)) and run it with:
|
|
345
|
+
|
|
346
|
+
```bash
|
|
347
|
+
uv run your_script.py
|
|
348
|
+
```
|