Turn any AI agent into an AI Scientist. The #1 Agent Skills library for science, used by 250,000+ scientists worldwide. 177 ready-to-use validated skills plus 100+ scientific databases covering biology, chemistry, medicine, and drug discovery. Compatible with Cursor, Claude Code, Codex, Pi, Antigravity, and the open Agent Skills standard.
Python agent-skillsai-scientistbioinformaticschemoinformaticsclaudeclaude-skillsclaudecodeclinical-researchcomputational-biologydata-analysisdrug-discoverygenomicsmaterials-sciencemetabolomicsproteomicsscientific-computingscientific-visualization
chore: update scientific-agent-skills version to 2.42.0
Timothy Kassisab90165e0e86
diff --git a/docs/scientific-skills.md b/docs/scientific-skills.mdindex 1724cbfd..0b202036 100644--- a/docs/scientific-skills.md+++ b/docs/scientific-skills.md@@ -38,7 +38,7 @@### Bioinformatics & Genomics- **AnnData** - Python package for handling annotated data matrices, specifically designed for single-cell genomics data. Provides efficient storage and manipulation of high-dimensional data with associated annotations (observations/cells and variables/genes). Key features include: HDF5-based h5ad file format for efficient I/O and compression, integration with pandas DataFrames for metadata, support for sparse matrices (scipy.sparse) for memory efficiency, layered data organization (X for main data matrix, obs for observation annotations, var for variable annotations, obsm/varm for multi-dimensional annotations, obsp/varp for pairwise matrices), and seamless integration with Scanpy, scvi-tools, and other single-cell analysis packages. Supports lazy loading, chunked operations, and conversion to/from other formats (CSV, HDF5, Zarr). Use cases: single-cell RNA-seq data management, multi-modal single-cell data (RNA+ATAC, CITE-seq), spatial transcriptomics, and any high-dimensional annotated data requiring efficient storage and manipulation-- **Arboreto** - Python package for efficient gene regulatory network (GRN) inference from single-cell RNA-seq data using ensemble tree-based methods. Implements GRNBoost2 (gradient boosting-based network inference) and GENIE3 (random forest-based inference) algorithms optimized for large-scale single-cell datasets. Key features include: parallel processing for scalability, support for sparse matrices and large datasets (millions of cells), integration with Scanpy/AnnData workflows, customizable hyperparameters, and output formats compatible with network analysis tools. Provides ranked lists of potential regulatory interactions (transcription factor-target gene pairs) with confidence scores. Use cases: identifying transcription factor-target relationships, reconstructing gene regulatory networks from single-cell data, understanding cell-type-specific regulatory programs, and inferring causal relationships in gene expression+- **Arboreto** - Scalable Python GRN inference (Aerts Lab) using GRNBoost2 (gradient boosting) and GENIE3 (random forest) with Dask distributed execution. Accepts pandas DataFrames, dense NumPy arrays, or sparse CSC matrices (cells × genes). Features: local multi-core and cluster scheduling, TF-restricted search, `limit` for top-N links, and `diy()` for custom regressors. Core engine for pySCENIC (cisTarget pruning and regulon activity are downstream). Use for bulk or single-cell expression matrices when inferring TF–target regulatory links from co-expression patterns- **BioPython** - Comprehensive Python library for computational biology and bioinformatics providing tools for sequence manipulation, database access, and biological data analysis. Key features include: sequence objects (Seq, SeqRecord, SeqIO) for DNA/RNA/protein sequences with biological alphabet validation, file format parsers (FASTA, FASTQ, GenBank, EMBL, Swiss-Prot, PDB, SAM/BAM, VCF, GFF), NCBI database access (Entrez Programming Utilities for PubMed, GenBank, BLAST, taxonomy), BLAST integration (running searches, parsing results), sequence alignment (pairwise and multiple sequence alignment with Bio.Align), phylogenetics (tree construction and manipulation with Bio.Phylo), population genetics (Hardy-Weinberg, F-statistics), protein structure analysis (PDB parsing, structure calculations), and statistical analysis tools. Supports integration with NumPy, pandas, and other scientific Python libraries. Use cases: sequence analysis, database queries, phylogenetic analysis, sequence alignment, file format conversion, and general bioinformatics workflows- **BioServices** - Python library providing unified programmatic access to 40+ biological web services and databases. Supports major bioinformatics resources including KEGG (pathway and compound data), UniProt (protein sequences and annotations), ChEBI (chemical entities), ChEMBL (bioactive molecules), Reactome (pathways), IntAct (protein interactions), BioModels (biological models), and many others. Features consistent API across different services, automatic result caching, error handling and retry logic, support for both REST and SOAP web services, and conversion of results to Python objects (dictionaries, lists, BioPython objects). Handles authentication, rate limiting, and API versioning. Use cases: automated data retrieval from multiple biological databases, building bioinformatics pipelines, database integration workflows, and programmatic access to biological web resources without manual web browsing- **Cellxgene Census** - Python package for querying and analyzing large-scale single-cell RNA-seq data from the CZ CELLxGENE Discover census. Provides access to 50M+ cells across 1,000+ datasets with standardized annotations and metadata. Key features include: efficient data access using TileDB-SOMA format for scalable queries, integration with AnnData and Scanpy for downstream analysis, cell metadata filtering and querying, gene expression retrieval, and support for both human and mouse data. Enables subsetting datasets by cell type, tissue, disease, or other metadata before downloading, reducing data transfer and memory requirements. Supports local caching and batch operations. Use cases: large-scale single-cell analysis, cell-type discovery, cross-dataset comparisons, reference dataset construction, and exploratory analysis of public single-cell data@@ -64,7 +64,7 @@### Cheminformatics & Drug Discovery- **Datamol** - Python library for molecular manipulation and featurization built on RDKit with enhanced workflows and performance optimizations. Provides utilities for molecular I/O (reading/writing SMILES, SDF, MOL files), molecular standardization and sanitization, molecular transformations (tautomer enumeration, stereoisomer generation), molecular featurization (descriptors, fingerprints, graph representations), parallel processing for large datasets, and integration with machine learning pipelines. Features include: optimized RDKit operations, caching for repeated computations, molecular filtering and preprocessing, and seamless integration with pandas DataFrames. Designed for drug discovery and cheminformatics workflows requiring efficient processing of large compound libraries. Use cases: molecular preprocessing for ML models, compound library management, molecular similarity searches, and cheminformatics data pipelines-- **DeepChem** - Deep learning framework for molecular machine learning and drug discovery built on TensorFlow and PyTorch. Provides implementations of graph neural networks (GCN, GAT, MPNN, AttentiveFP) for molecular property prediction, molecular featurization (molecular graphs, fingerprints, descriptors), pre-trained models, and MoleculeNet benchmark suite (50+ datasets for molecular property prediction, toxicity, ADMET). Key features include: support for both TensorFlow and PyTorch backends, distributed training, hyperparameter optimization, model interpretation tools, and integration with RDKit. Includes datasets for quantum chemistry, toxicity prediction, ADMET properties, and binding affinity prediction. Use cases: molecular property prediction, drug discovery, ADMET prediction, toxicity screening, and molecular machine learning research+- **DeepChem** - Molecular machine learning library (PyPI 2.8.0; Python 3.7–3.11) with TensorFlow, PyTorch, and JAX backends. Graph neural networks (GCN, GAT, MPNN, AttentiveFP), 30+ MoleculeNet benchmarks, diverse featurizers (fingerprints, descriptors, graphs), and pretrained models (ChemBERTa, GROVER, MolFormer). Install backend-specific extras (`deepchem[torch]`, `[tensorflow]`, `[jax]`). Use for ADMET/toxicity prediction, materials properties, and transfer learning on small datasets- **DiffDock** - State-of-the-art diffusion-based molecular docking method for predicting protein-ligand binding poses and binding affinities. Uses diffusion models to generate diverse, high-quality binding poses without requiring exhaustive search. Key features include: fast inference compared to traditional docking methods, generation of multiple diverse poses, confidence scoring for predictions, and support for flexible ligand docking. Provides pre-trained models and Python API for integration into drug discovery pipelines. Achieves superior performance on standard benchmarks (PDBbind, CASF) compared to traditional docking methods. Use cases: virtual screening, lead optimization, binding pose prediction, structure-based drug design, and initial pose generation for refinement with more expensive methods- **MedChem** - Python library for molecular filtering and prioritization in drug discovery (datamol-io). Apply literature-derived drug-likeness rules (Lipinski, Veber, CNS, lead-like), named structural alert catalogs (PAINS, Brenk, NIBR), complexity thresholds against ZINC-derived percentiles, chemical group detection, and a custom query language for multi-criteria filtering. Returns pandas DataFrames from rule/structural filters and boolean masks from the functional API. Integrates with datamol/RDKit and supports parallel processing. Use cases: compound library triage, hit-to-lead filtering, PAINS deprioritization, screening-deck curation, and lead optimization workflows- **Molfeat** - Comprehensive Python library providing 100+ molecular featurizers for converting molecules into numerical representations suitable for machine learning. Includes molecular fingerprints (ECFP, MACCS, RDKit, Pharmacophore), molecular descriptors (2D/3D descriptors, constitutional, topological, electronic), graph-based representations (molecular graphs, line graphs), and pre-trained models (MolBERT, ChemBERTa, Uni-Mol embeddings). Features unified API across different featurizer types, caching for performance, parallel processing, and integration with popular ML frameworks (scikit-learn, PyTorch, TensorFlow). Supports both traditional cheminformatics descriptors and modern learned representations. Use cases: molecular property prediction, virtual screening, molecular similarity searches, and preparing molecular data for machine learning models@@ -153,7 +153,7 @@### Scientific Communication & Publishing- **BGPT Paper Search** - Search scientific papers and retrieve structured experimental data extracted from full-text studies via the BGPT MCP server. Returns 25+ fields per paper including methods, results, sample sizes, quality scores, and conclusions. Use for literature reviews, evidence synthesis, and finding experimental details not available in abstracts alone-- **pyzotero** - Python client for the Zotero Web API v3. Programmatically manage Zotero reference libraries: retrieve, create, update, and delete items, collections, tags, and attachments. Export citations as BibTeX, CSL-JSON, and formatted bibliography HTML. Supports user and group libraries, local mode for offline access, paginated retrieval with `everything()`, full-text content indexing, saved search management, and file upload/download. Includes a CLI for searching your local Zotero library. Use cases: building research automation pipelines that integrate with Zotero, bulk importing references, exporting bibliographies programmatically, managing large reference collections, syncing library metadata, and enriching bibliographic data.+- **pyzotero** - Python client for the Zotero Web API v3. Programmatically manage Zotero reference libraries: retrieve, create, update, and delete items, collections, tags, and attachments. Export citations as BibTeX, CSL-JSON, and formatted bibliography HTML. Supports user and group libraries, local mode for offline access, paginated retrieval with `everything()`, full-text content indexing, saved search management, and file upload/download. Optional CLI and built-in MCP server (pyzotero 1.12+) for searching local Zotero 7 libraries including full-text PDF search and Semantic Scholar integration. Use cases: building research automation pipelines that integrate with Zotero, bulk importing references, exporting bibliographies programmatically, managing large reference collections, syncing library metadata, enriching bibliographic data, and connecting LLM agents to a local Zotero library.- **Citation Management** - Comprehensive citation management for academic research. Search Google Scholar and PubMed for papers, extract accurate metadata from multiple sources (CrossRef, PubMed, arXiv), validate citations, and generate properly formatted BibTeX entries. Features include converting DOIs, PMIDs, or arXiv IDs to BibTeX, cleaning and formatting bibliography files, finding highly cited papers, checking for duplicates, and ensuring consistent citation formatting. Use cases: building bibliographies for manuscripts, verifying citation accuracy, citation deduplication, and maintaining reference databases- **Generate Image** - AI-powered image generation and editing for scientific illustrations, schematics, and visualizations using OpenRouter's image generation models. Supports multiple models including google/gemini-3-pro-image-preview (high quality, recommended default) and black-forest-labs/flux.2-pro (fast, high quality). Key features include: text-to-image generation from detailed prompts, image editing capabilities (modify existing images with natural language instructions), automatic base64 encoding/decoding, PNG output with configurable paths, and comprehensive error handling. Requires OpenRouter API key (via .env file or environment variable). Use cases: generating scientific diagrams and illustrations, creating publication-quality figures, editing existing images (changing colors, adding elements, removing backgrounds), producing schematics for papers and presentations, visualizing experimental setups, creating graphical abstracts, and generating conceptual illustrations for scientific communication- **Infographics** - Create professional infographics using Nano Banana Pro AI with smart iterative refinement. Uses Gemini 3 Pro for quality review. Integrates research-lookup and web search for accurate data. Supports 10 infographic types, 8 industry styles, and colorblind-safe palettesdiff --git a/scientific-skills/anndata/SKILL.md b/scientific-skills/anndata/SKILL.mdindex 1cbde7a7..6946a0a6 100644--- a/scientific-skills/anndata/SKILL.md+++ b/scientific-skills/anndata/SKILL.md@@ -25,11 +25,16 @@ Use this skill when:## Installation+Requires Python 3.11+ (anndata 0.11+ dropped 3.9). Current stable release: 0.12.x.+```bashuv pip install anndata-# With optional dependencies-uv pip install anndata[dev,test,doc]+# Lazy I/O and dask-backed operations+uv pip install "anndata[dask,lazy]"++# Development / docs (contributors)+uv pip install "anndata[dev,test,doc]"```## Quick Start@@ -59,16 +64,21 @@ adata = ad.AnnData(X=X, obs=obs, var=var)### Reading data```python-# Read h5ad file+# Native formats (read_h5ad/read_zarr remain at top-level)adata = ad.read_h5ad('data.h5ad')+adata = ad.read_h5ad('large_data.h5ad', backed='r') # lazy load for large files+adata = ad.read_zarr('data.zarr')++# Other formats: prefer anndata.io (top-level imports are deprecated)+from anndata.io import read_csv, read_loom, read_mtx-# Read with backed mode (for large files)-adata = ad.read_h5ad('large_data.h5ad', backed='r')+adata = read_csv('data.csv')+adata = read_loom('data.loom')-# Read other formats-adata = ad.read_csv('data.csv')-adata = ad.read_loom('data.loom')-adata = ad.read_10x_h5('filtered_feature_bc_matrix.h5')+# 10X Genomics: use scanpy (not anndata) — see scanpy skill+import scanpy as sc+adata = sc.read_10x_h5('filtered_feature_bc_matrix.h5')+adata = sc.read_10x_mtx('filtered_feature_bc_matrix/')```### Writing data@@ -126,15 +136,18 @@ Read and write data in various formats with support for compression, backed modeCommon commands:```python+from anndata.io import read_mtx+# Read/write h5adadata = ad.read_h5ad('data.h5ad', backed='r')adata.write_h5ad('output.h5ad', compression='gzip')-# Read 10X data-adata = ad.read_10x_h5('filtered_feature_bc_matrix.h5')+# 10X Genomics (via scanpy)+import scanpy as sc+adata = sc.read_10x_h5('filtered_feature_bc_matrix.h5')# Read MTX format-adata = ad.read_mtx('matrix.mtx').T+adata = read_mtx('matrix.mtx').T```### 3. Concatenation@@ -287,8 +300,8 @@ for batch in dataloader:import anndata as adimport scanpy as sc-# 1. Load data-adata = ad.read_10x_h5('filtered_feature_bc_matrix.h5')+# 1. Load data (10X via scanpy; anndata handles h5ad/zarr natively)+adata = sc.read_10x_h5('filtered_feature_bc_matrix.h5')# 2. Quality controladata.obs['n_genes'] = (adata.X > 0).sum(axis=1)@@ -375,7 +388,9 @@ Use compression and appropriate formats:adata.strings_to_categoricals()adata.write_h5ad('file.h5ad', compression='gzip')-# Use Zarr for cloud storage+# Use Zarr for cloud storage (v3 optional since anndata 0.12)+import anndata+anndata.settings.zarr_write_format = 3 # default is 2adata.write_zarr('file.zarr', chunks=(1000, 1000))```diff --git a/scientific-skills/anndata/references/best_practices.md b/scientific-skills/anndata/references/best_practices.mdindex 50747402..91244c76 100644--- a/scientific-skills/anndata/references/best_practices.md+++ b/scientific-skills/anndata/references/best_practices.md@@ -7,7 +7,7 @@ Guidelines for efficient and effective use of AnnData.### Use sparse matrices for sparse data```pythonimport numpy as np-from scipy.sparse import csr_matrix+from scipy.sparse import csr_matrix, csc_matriximport anndata as ad# Check data sparsity@@ -15,7 +15,7 @@ data = np.random.rand(1000, 2000)sparsity = 1 - np.count_nonzero(data) / data.sizeprint(f"Sparsity: {sparsity:.2%}")-# Convert to sparse if >50% zeros+# Convert to sparse if >50% zeros (anndata 0.12+ requires csr or csc)if sparsity > 0.5:adata = ad.AnnData(X=csr_matrix(data))else:@@ -107,10 +107,15 @@ adata.write_h5ad('data.h5ad', compression='gzip')**Zarr - Cloud and parallel access**```python+import anndata++# Default is Zarr v2; opt into v3 for cloud workflows (anndata 0.12+)+anndata.settings.zarr_write_format = 3+anndata.settings.auto_shard_zarr_v3 = Trueadata.write_zarr('data.zarr', chunks=(100, 100))```- Excellent for cloud storage (S3, GCS)-- Supports parallel I/O+- Supports parallel I/O and Zarr v3 sharding (0.12+)- Good compression- Best for: Large datasets, cloud workflows, parallel processing@@ -329,16 +334,15 @@ adata.uns['neighbors'] = {### Version tracking```python-import anndata-import scanpy-import numpy+import sys+from importlib.metadata import version-# Store versions+# Store package versions (anndata.__version__ deprecated in 0.12.3)adata.uns['versions'] = {- 'anndata': anndata.__version__,- 'scanpy': scanpy.__version__,- 'numpy': numpy.__version__,- 'python': sys.version+ 'anndata': version('anndata'),+ 'scanpy': version('scanpy'),+ 'numpy': version('numpy'),+ 'python': sys.version,}```@@ -486,7 +490,7 @@ Complete best-practices workflow:```pythonimport anndata as adimport numpy as np-from scipy.sparse import csr_matrix+from scipy.sparse import csr_matrix, issparse# 1. Load with backed mode if largeadata = ad.read_h5ad('data.h5ad', backed='r')@@ -500,7 +504,7 @@ high_quality = adata[adata.obs['quality_score'] > 0.8]# 4. Load filtered subset to memoryadata = high_quality.to_memory()-# 5. Convert to optimal storage types+# 5. Convert to optimal storage types (csr/csc sparse only since 0.12)adata.strings_to_categoricals()if not issparse(adata.X):density = np.count_nonzero(adata.X) / adata.X.sizediff --git a/scientific-skills/anndata/references/io_operations.md b/scientific-skills/anndata/references/io_operations.mdindex 9f4892a1..5528c92f 100644--- a/scientific-skills/anndata/references/io_operations.md+++ b/scientific-skills/anndata/references/io_operations.md@@ -2,6 +2,13 @@AnnData provides comprehensive I/O functionality for reading and writing data in various formats.+Since anndata 0.11, most `read_*` and `write_*` functions live in `anndata.io`. Top-level `read_h5ad` and `read_zarr` remain at `anndata` without deprecation warnings; other top-level imports still work but emit `FutureWarning`.++```python+import anndata as ad+from anndata.io import read_csv, read_mtx, read_loom, read_elem, write_elem+```+## Native Formats### H5AD (HDF5-based)@@ -71,6 +78,17 @@ adata.write_zarr('data.zarr', chunks=(100, 100))adata = ad.read_zarr('data.zarr')```+#### Zarr v3 (anndata 0.12+)+```python+import anndata++# Default writes Zarr v2; opt into v3 and optional auto-sharding+anndata.settings.zarr_write_format = 3+anndata.settings.auto_shard_zarr_v3 = True # shards="auto" for v3 arrays++adata.write_zarr('data.zarr', chunks=(1000, 1000))+```+#### Remote Zarr access```pythonimport fsspec@@ -88,35 +106,41 @@ adata = ad.read_zarr(store)### CSV/TSV```python+from anndata.io import read_csv+# Read CSV (genes as columns, cells as rows)-adata = ad.read_csv('data.csv')+adata = read_csv('data.csv')# Read with custom delimiter-adata = ad.read_csv('data.tsv', delimiter='\t')+adata = read_csv('data.tsv', delimiter='\t')# Specify that first column is row names-adata = ad.read_csv('data.csv', first_column_names=True)+adata = read_csv('data.csv', first_column_names=True)```### Excel```python+from anndata.io import read_excel+# Read Excel file-adata = ad.read_excel('data.xlsx')+adata = read_excel('data.xlsx')# Read specific sheet-adata = ad.read_excel('data.xlsx', sheet='Sheet1')+adata = read_excel('data.xlsx', sheet='Sheet1')```### Matrix Market (MTX)Common format for sparse matrices in genomics.```python+from anndata.io import read_mtx+# Read MTX with associated files# Requires: matrix.mtx, genes.tsv, barcodes.tsv-adata = ad.read_mtx('matrix.mtx')+adata = read_mtx('matrix.mtx')# Read with custom gene and barcode files-adata = ad.read_mtx(+adata = read_mtx('matrix.mtx',var_names='genes.tsv',obs_names='barcodes.tsv'@@ -127,24 +151,30 @@ adata = adata.T```### 10X Genomics formats+10X readers are provided by **scanpy**, not anndata. After loading, the result is a standard `AnnData` object.+```python+import scanpy as sc+# Read 10X h5 format-adata = ad.read_10x_h5('filtered_feature_bc_matrix.h5')+adata = sc.read_10x_h5('filtered_feature_bc_matrix.h5')# Read 10X MTX directory-adata = ad.read_10x_mtx('filtered_feature_bc_matrix/')+adata = sc.read_10x_mtx('filtered_feature_bc_matrix/')# Specify genome if multiple present-adata = ad.read_10x_h5('data.h5', genome='GRCh38')+adata = sc.read_10x_h5('data.h5', genome='GRCh38')```### Loom```python+from anndata.io import read_loom+# Read Loom file-adata = ad.read_loom('data.loom')+adata = read_loom('data.loom')# Read with specific observation and variable annotations-adata = ad.read_loom(+adata = read_loom('data.loom',obs_names='CellID',var_names='Gene'@@ -153,11 +183,13 @@ adata = ad.read_loom(### Text files```python+from anndata.io import read_text+# Read generic text file-adata = ad.read_text('data.txt', delimiter='\t')+adata = read_text('data.txt', delimiter='\t')# Read with custom parameters-adata = ad.read_text(+adata = read_text('data.txt',delimiter=',',first_column_names=True,@@ -167,14 +199,18 @@ adata = ad.read_text(### UMI tools```python+from anndata.io import read_umi_tools+# Read UMI tools format-adata = ad.read_umi_tools('counts.tsv')+adata = read_umi_tools('counts.tsv')```### HDF5 (generic)```python+from anndata.io import read_hdf+# Read from HDF5 file (not h5ad format)-adata = ad.read_hdf('data.h5', key='dataset')+adata = read_hdf('data.h5', key='dataset')```## Alternative Output Formats@@ -202,25 +238,23 @@ adata.write_loom('output.loom')## Reading Specific Elements-For fine-grained control, read specific elements from storage:+For fine-grained control, read specific elements from an open store:```python-from anndata import read_elem--# Read just observation annotations-obs = read_elem('data.h5ad/obs')--# Read specific layer-layer = read_elem('data.h5ad/layers/normalized')+import h5py+from anndata.io import read_elem-# Read unstructured data element-params = read_elem('data.h5ad/uns/pca_params')+# Read just observation annotations from an h5ad file+with h5py.File('data.h5ad', 'r') as f:+ obs = read_elem(f['obs'])+ layer = read_elem(f['layers/normalized'])+ params = read_elem(f['uns/pca'])```## Writing Specific Elements```python-from anndata import write_elem+from anndata.io import write_elemimport h5py# Write element to existing file@@ -233,25 +267,27 @@ with h5py.File('data.h5ad', 'a') as f:For very large datasets, use lazy reading to avoid loading entire datasets:```python+import h5pyfrom anndata.experimental import read_elem_lazy-# Lazy read (returns dask array or similar)-X_lazy = read_elem_lazy('large_data.h5ad/X')--# Compute only when needed-subset = X_lazy[:100, :100].compute()+# Lazy read from an open store (returns dask-backed array)+with h5py.File('large_data.h5ad', 'r') as f:+ X_lazy = read_elem_lazy(f['X'])+ subset = X_lazy[:100, :100].compute()```## Common I/O Patterns### Convert between formats```python+from anndata.io import read_mtx, read_csv+# MTX to H5AD-adata = ad.read_mtx('matrix.mtx').T+adata = read_mtx('matrix.mtx').Tadata.write_h5ad('data.h5ad')# CSV to H5AD-adata = ad.read_csv('data.csv')+adata = read_csv('data.csv')adata.write_h5ad('data.h5ad')# H5AD to Zarrdiff --git a/scientific-skills/arboreto/SKILL.md b/scientific-skills/arboreto/SKILL.mdindex 8d0eb3d9..508ea8d6 100644--- a/scientific-skills/arboreto/SKILL.md+++ b/scientific-skills/arboreto/SKILL.md@@ -10,10 +10,12 @@ metadata:## Overview-Arboreto is a computational library for inferring gene regulatory networks (GRNs) from gene expression data using parallelized algorithms that scale from single machines to multi-node clusters.+Arboreto is a Python library from [Aerts Lab](https://github.com/aertslab/arboreto) for inferring gene regulatory networks (GRNs) from gene expression data. It parallelizes tree-based ensemble regression (GRNBoost2, GENIE3) with [Dask](https://distributed.dask.org/) across local cores or remote clusters.**Core capability**: Identify which transcription factors (TFs) regulate which target genes based on expression patterns across observations (cells, samples, conditions).+**Upstream**: PyPI **0.1.6** (2021-02-09, latest). Docs: [arboreto.readthedocs.io](https://arboreto.readthedocs.io/en/latest/). Primary downstream consumer: [pySCENIC](https://github.com/aertslab/pySCENIC).+## Quick StartInstall arboreto:@@ -53,7 +55,7 @@ For standard GRN inference workflows including:**Use the ready-to-run script**: `scripts/basic_grn_inference.py` for standard inference tasks:```bash-python scripts/basic_grn_inference.py expression_data.tsv output_network.tsv --tf-file tfs.txt --seed 777+python scripts/basic_grn_inference.py expression_data.tsv output_network.tsv --tf-file tfs.txt --seed 777 --limit 5000```### 2. Algorithm Selection@@ -121,7 +123,15 @@ network = grnboost2(expression_data=matrix, client_or_address=client)uv pip install arboreto```-**Dependencies**: scipy, scikit-learn, numpy, pandas, dask, distributed+Conda (Bioconda):++```bash+conda install -c bioconda arboreto+```++**Dependencies** (from upstream `requirements.txt`): `dask[complete]`, `distributed`, `numpy`, `pandas`, `scikit-learn`, `scipy`++**Input formats**: pandas DataFrame, dense `numpy.ndarray`, or sparse `scipy.sparse.csc_matrix` (rows = observations, columns = genes). For array/matrix inputs, pass `gene_names` explicitly.## Common Use Cases@@ -187,21 +197,28 @@ Arboreto returns a DataFrame with regulatory links:| `importance` | Regulatory importance score (higher = stronger) |**Filtering strategy**:-- Top N links per target gene-- Importance threshold (e.g., > 0.5)-- Statistical significance testing (permutation tests)+- `limit=N` at inference time (return top N links globally)+- Post-hoc importance threshold (e.g., > 0.5)+- Top links per target via `groupby('target')`+- Statistical significance testing (permutation tests, external tools)## Integration with pySCENIC-Arboreto is a core component of the SCENIC pipeline for single-cell regulatory network analysis:+Arboreto powers the GRN inference step in [pySCENIC](https://github.com/aertslab/pySCENIC). pySCENIC 0.11+ passes sparse expression matrices to `grnboost2` / `genie3`; pySCENIC 0.12+ defaults to `arboreto_with_multiprocessing.py` (no Dask) for compatibility — use standalone arboreto when you need Dask scaling.```python-# Step 1: Use arboreto for GRN inference+# Standalone: infer co-expression modules before pySCENIC cisTarget pruningfrom arboreto.algo import grnboost2-network = grnboost2(expression_data=sc_data, tf_names=tf_list)-# Step 2: Use pySCENIC for regulon identification and activity scoring-# (See pySCENIC documentation for downstream analysis)+network = grnboost2(expression_data=expression_df, tf_names=tf_list, limit=5000)++# Downstream: pySCENIC ctx pruning, regulon definition, AUCell (see pySCENIC docs)+```++Convert AnnData to a DataFrame for arboreto directly:++```python+expression_df = adata.to_df() # cells x genes```## Reproducibility@@ -225,8 +242,14 @@ if __name__ == '__main__':net = grnboost2(expression_data=matrix, client_or_address=client, seed=seed)networks.append(net)- # Combine networks and filter consensus links- consensus = analyze_consensus(networks)+ # Consensus: links recurring across runs (example: mean importance per TF-target pair)+ import pandas as pd+ combined = pd.concat(networks)+ consensus = (+ combined.groupby(['TF', 'target'], as_index=False)['importance']+ .mean()+ .query('importance > 0.5')+ )```## Troubleshooting@@ -235,7 +258,9 @@ if __name__ == '__main__':**Slow performance**: Use GRNBoost2 instead of GENIE3, enable distributed client, filter TF list-**Dask errors**: Ensure `if __name__ == '__main__':` guard is present in scripts+**Dask errors**: Ensure `if __name__ == '__main__':` guard is present in scripts (required on Windows/macOS with spawn-based multiprocessing)++**Empty results**: Check data format (genes as columns), verify TF names match column names in the expression matrix-**Empty results**: Check data format (genes as columns), verify TF names match gene names+**Sparse data**: Use `scipy.sparse.csc_matrix` and pass matching `gene_names`; supported since arboreto 0.1.6 / pySCENIC 0.11diff --git a/scientific-skills/arboreto/references/algorithms.md b/scientific-skills/arboreto/references/algorithms.mdindex b3b794f4..3a569a59 100644--- a/scientific-skills/arboreto/references/algorithms.md+++ b/scientific-skills/arboreto/references/algorithms.md@@ -1,6 +1,6 @@# GRN Inference Algorithms-Arboreto provides two algorithms for gene regulatory network (GRN) inference, both based on the multiple regression approach.+Arboreto provides two high-level algorithms for gene regulatory network (GRN) inference, both based on the multiple regression approach.## Algorithm Overview@@ -32,19 +32,22 @@ from arboreto.algo import grnboost2network = grnboost2(expression_data=expression_matrix,tf_names=tf_names,- seed=42 # For reproducibility+ seed=42,+ limit=5000,)```-### Parameters+### Parameters (`grnboost2`)```pythongrnboost2(- expression_data, # Required: pandas DataFrame or numpy array- gene_names=None, # Required for numpy arrays- tf_names='all', # List of TF names or 'all'- verbose=False, # Print progress messages- client_or_address='local', # Dask client or scheduler address- seed=None # Random seed for reproducibility+ expression_data, # DataFrame, ndarray, or scipy.sparse.csc_matrix+ gene_names=None, # Required for ndarray/sparse inputs+ tf_names='all', # TF list, None/'all' → all genes as regulators+ client_or_address='local', # 'local', scheduler address, or Dask Client+ early_stop_window_length=25, # Early-stopping window (GRNBoost2 only)+ limit=None, # Return top N links globally+ seed=None, # Random seed; None = non-deterministic+ verbose=False,)```@@ -58,7 +61,7 @@ grnboost2(- **Validation**: To validate GRNBoost2 results### Technical Details-- **Method**: Random Forest or ExtraTrees regression+- **Method**: Random Forest regression (ExtraTrees available via `diy`)- **Foundation**: Original multiple regression GRN inference strategy- **Trade-off**: More computationally expensive but well-established@@ -69,19 +72,20 @@ from arboreto.algo import genie3network = genie3(expression_data=expression_matrix,tf_names=tf_names,- seed=42+ seed=42,)```-### Parameters+### Parameters (`genie3`)```pythongenie3(- expression_data, # Required: pandas DataFrame or numpy array- gene_names=None, # Required for numpy arrays- tf_names='all', # List of TF names or 'all'- verbose=False, # Print progress messages- client_or_address='local', # Dask client or scheduler address- seed=None # Random seed for reproducibility+ expression_data,+ gene_names=None,+ tf_names='all',+ client_or_address='local',+ limit=None,+ seed=None,+ verbose=False,)```@@ -90,49 +94,59 @@ genie3(| Feature | GRNBoost2 | GENIE3 ||---------|-----------|--------|| **Speed** | Fast (optimized for large data) | Slower |-| **Method** | Gradient boosting | Random Forest |+| **Method** | Gradient boosting (GBM) | Random Forest || **Best for** | Large-scale data (10k+ observations) | Small-medium datasets || **Output format** | Same | Same || **Inference strategy** | Multiple regression | Multiple regression || **Recommended** | Yes (default choice) | For comparison/validation |+| **Early stopping** | Yes (`early_stop_window_length`) | No |-## Advanced: Custom Regressor Parameters+## Advanced: Custom Regressors with `diy`-For advanced users, pass custom scikit-learn regressor parameters:+For custom scikit-learn regressor settings, use `diy()` (not `grnboost2`/`genie3` kwargs):```python-from sklearn.ensemble import GradientBoostingRegressor, RandomForestRegressor+from arboreto.algo import diy+from arboreto.core import SGBM_KWARGS, RF_KWARGS-# Custom GRNBoost2 parameters-custom_grnboost2 = grnboost2(+# Custom GRNBoost2-style run+custom_gbm = diy(expression_data=expression_matrix,- regressor_type='GBM',+ regressor_type='GBM', # 'RF', 'GBM', or 'ET'regressor_kwargs={+ **SGBM_KWARGS,'n_estimators': 100,'max_depth': 5,- 'learning_rate': 0.1- }+ 'learning_rate': 0.1,+ },+ tf_names=tf_names,+ seed=42,)-# Custom GENIE3 parameters-custom_genie3 = genie3(+# Custom GENIE3-style run+custom_rf = diy(expression_data=expression_matrix,regressor_type='RF',regressor_kwargs={+ **RF_KWARGS,'n_estimators': 1000,- 'max_features': 'sqrt'- }+ 'max_features': 'sqrt',+ },+ tf_names=tf_names,)```+Import default kwargs from `arboreto.core` and override only the keys you need.+## Choosing the Right Algorithm**Decision guide**:-1. **Start with GRNBoost2** - It's faster and handles large datasets better+1. **Start with GRNBoost2** — faster and better suited to large single-cell datasets2. **Use GENIE3 if**:- Comparing with existing GENIE3 publications- Dataset is small-medium sized- Validating GRNBoost2 results+3. **Use `diy()` if** you need non-default regressor hyperparameters-Both algorithms produce comparable regulatory networks with the same output format, making them interchangeable for most analyses.+Both algorithms produce comparable regulatory networks with the same output format.diff --git a/scientific-skills/arboreto/references/basic_inference.md b/scientific-skills/arboreto/references/basic_inference.mdindex 4befdead..a31b6a89 100644--- a/scientific-skills/arboreto/references/basic_inference.md+++ b/scientific-skills/arboreto/references/basic_inference.md@@ -34,6 +34,24 @@ with open('expression_data.tsv') as f:assert expression_matrix.shape[1] == len(gene_names)```+### Sparse CSC Matrix (arboreto 0.1.6+)+- **Format**: `scipy.sparse.csc_matrix` with shape (observations, genes)+- **Requirement**: Provide `gene_names` matching column order (same as NumPy)+- **Use case**: Large single-cell matrices; also used by pySCENIC 0.11+ when `--sparse` is enabled++Example:+```python+import scipy.sparse as sp+from arboreto.algo import grnboost2++# expression_sparse: csc_matrix, cells x genes+network = grnboost2(+ expression_data=expression_sparse,+ gene_names=gene_names,+ tf_names=tf_names,+)+```+## Transcription Factors (TFs)Optionally provide a list of transcription factor names to restrict regulatory inference:@@ -48,7 +66,7 @@ tf_names = load_tf_names('transcription_factors.txt')tf_names = ['TF1', 'TF2', 'TF3']```-If not provided, all genes are considered potential regulators.+If `tf_names` is `None` or `'all'`, all `gene_names` are treated as potential regulators.## Basic Inference Workflow@@ -124,7 +142,7 @@ TF1 gene8 0.621## Setting Random Seed-For reproducible results, provide a seed parameter:+For reproducible results, pass an explicit `seed` (`None` uses random seeds per regressor):```pythonnetwork = grnboost2(@@ -134,6 +152,18 @@ network = grnboost2()```+## Limiting Output Size++Return only the top N regulatory links globally:++```python+network = grnboost2(+ expression_data=expression_matrix,+ tf_names=tf_names,+ limit=5000,+)+```+## Algorithm SelectionUse `grnboost2()` for most cases (faster, handles large datasets):diff --git a/scientific-skills/arboreto/scripts/basic_grn_inference.py b/scientific-skills/arboreto/scripts/basic_grn_inference.pyindex e659ce15..7b50c822 100644--- a/scientific-skills/arboreto/scripts/basic_grn_inference.py+++ b/scientific-skills/arboreto/scripts/basic_grn_inference.py@@ -6,13 +6,14 @@ This script demonstrates the standard workflow for inferring gene regulatorynetworks from expression data using GRNBoost2.Usage:- python basic_grn_inference.py <expression_file> <output_file> [--tf-file TF_FILE] [--seed SEED]+ python basic_grn_inference.py <expression_file> <output_file> [--tf-file TF_FILE] [--seed SEED] [--limit LIMIT]Arguments:expression_file: Path to expression matrix (TSV format, genes as columns)output_file: Path for output network (TSV format)--tf-file: Optional path to transcription factors file (one per line)--seed: Random seed for reproducibility (default: 777)+ --limit: Return only the top N regulatory links (optional)"""import argparse@@ -21,7 +22,7 @@ from arboreto.algo import grnboost2from arboreto.utils import load_tf_names-def run_grn_inference(expression_file, output_file, tf_file=None, seed=777):+def run_grn_inference(expression_file, output_file, tf_file=None, seed=777, limit=None):"""Run GRN inference using GRNBoost2.@@ -30,6 +31,7 @@ def run_grn_inference(expression_file, output_file, tf_file=None, seed=777):output_file: Path for output network filetf_file: Optional path to TF names fileseed: Random seed for reproducibility+ limit: Optional cap on number of regulatory links returned"""print(f"Loading expression data from {expression_file}...")expression_data = pd.read_csv(expression_file, sep='\t')@@ -51,6 +53,7 @@ def run_grn_inference(expression_file, output_file, tf_file=None, seed=777):expression_data=expression_data,tf_names=tf_names,seed=seed,+ limit=limit,verbose=True)@@ -86,6 +89,12 @@ if __name__ == '__main__':type=int,default=777)+ parser.add_argument(+ '--limit',+ help='Return only the top N regulatory links',+ type=int,+ default=None+ )args = parser.parse_args()@@ -93,5 +102,6 @@ if __name__ == '__main__':expression_file=args.expression_file,output_file=args.output_file,tf_file=args.tf_file,- seed=args.seed+ seed=args.seed,+ limit=args.limit)diff --git a/scientific-skills/bioservices/SKILL.md b/scientific-skills/bioservices/SKILL.mdindex 242add85..561c2e48 100644--- a/scientific-skills/bioservices/SKILL.md+++ b/scientific-skills/bioservices/SKILL.md@@ -2,6 +2,8 @@name: bioservicesdescription: Unified Python interface to 40+ bioinformatics services. Use when querying multiple databases (UniProt, KEGG, ChEMBL, Reactome) in a single workflow with consistent API. Best for cross-database analysis, ID mapping across services. For quick single-database lookups use gget; for sequence/file manipulation use biopython.license: GPLv3 license+allowed-tools: [Read, Write, Edit, Bash]+compatibility: Requires Python 3.9–3.12 and internet access to 40+ bioinformatics web APIs. NCBI BLAST requires a contact email (`NCBI_EMAIL` env var or explicit parameter).metadata:skill-author: K-Dense Inc.---@@ -12,6 +14,8 @@ metadata:BioServices is a Python package providing programmatic access to approximately 40 bioinformatics web services and databases. Retrieve biological data, perform cross-database queries, map identifiers, analyze sequences, and integrate multiple biological resources in Python workflows. The package handles both REST and SOAP/WSDL protocols transparently.+**Version note:** Examples target **bioservices 1.16.0** (PyPI, Mar 2026). Requires **Python 3.9–3.12**. UniProt REST changes in mid-2022 (bioservices ≥1.10) mainly affect tabular `columns` names — see upstream `_legacy_names` if parsing breaks. ChEMBL wrappers changed at 1.6.0 (2018 API); use `get_similarity`, `get_substructure`, `get_molecule` instead of pre-1.6 method names.+## When to Use This SkillThis skill should be used when:@@ -122,12 +126,14 @@ Reference: `references/identifier_mapping.md` for complete cross-database mappin### 4. Sequence Analysis-Run BLAST searches and sequence alignments:+Run BLAST searches and sequence alignments. NCBI requires a contact email — prefer the `NCBI_EMAIL` environment variable (same convention as BioPython Entrez and other repo skills):```python+import osfrom bioservices import NCBIblasts = NCBIblast(verbose=False)+email = os.environ["NCBI_EMAIL"] # set before running: export [email protected]# Run BLASTP against UniProtKBjobid = s.run(@@ -135,7 +141,7 @@ jobid = s.run(sequence=protein_sequence,stype="protein",database="uniprotkb",- email="[email protected]" # Required by NCBI+ email=email,)# Check job status and retrieve results@@ -219,6 +225,9 @@ BioServices excels at combining multiple services for comprehensive analysis. CoExecute a full protein characterization workflow:```bash+export [email protected]+python scripts/protein_analysis_workflow.py ZAP70_HUMAN+# Or pass email as optional second argument if NCBI_EMAIL is unsetpython scripts/protein_analysis_workflow.py ZAP70_HUMAN [email protected]```@@ -345,10 +354,27 @@ Load references when working with specific services or complex integration tasks## Installation```bash-uv pip install bioservices+uv pip install "bioservices==1.16.0"+```++Dependencies are installed automatically. Upstream CI tests Python 3.9–3.12 ([PyPI](https://pypi.org/project/bioservices/), [docs](https://bioservices.readthedocs.io/)).++## Credentials++Most services need no API key. Exceptions:++| Service | Requirement |+|---------|-------------|+| NCBI BLAST | Contact email via `NCBI_EMAIL` or `email=` in `NCBIblast.run()` |+| Some EBI services | Optional; check service docs if rate-limited |++Set once per shell session:++```bash+export [email protected]```-Dependencies are automatically managed. Package is tested on Python 3.9-3.12.+Use a real institutional or lab address — NCBI may contact you about heavy BLAST usage.## Additional Informationdiff --git a/scientific-skills/bioservices/references/services_reference.md b/scientific-skills/bioservices/references/services_reference.mdindex bd000a02..f4a8e599 100644--- a/scientific-skills/bioservices/references/services_reference.md+++ b/scientific-skills/bioservices/references/services_reference.md@@ -1,6 +1,6 @@# BioServices: Complete Services Reference-This document provides a comprehensive reference for all major services available in BioServices, including key methods, parameters, and use cases.+This document provides a comprehensive reference for all major services available in BioServices, including key methods, parameters, and use cases. Targets **bioservices 1.16.0** ([Read the Docs](https://bioservices.readthedocs.io/), [GitHub](https://github.com/cokelaer/bioservices)).## Protein & Gene Resources@@ -39,6 +39,8 @@ u = UniProt(verbose=False)**Common columns:** id, entry name, genes, organism, protein names, length, sequence, go-id, ec, pathway, interactor+**UniProt API note (≥1.10):** UniProt updated its REST API in June 2022. User-facing methods are largely unchanged, but tabular `columns` names may differ from older examples. If column parsing fails, check upstream `_legacy_names` in the UniProt module docs.+**Use cases:**- Protein sequence retrieval for BLAST- Functional annotation lookup@@ -269,7 +271,7 @@ s = NCBIblast(verbose=False)- `program`: "blastp", "blastn", "blastx", "tblastn", "tblastx"- `stype`: "protein" or "dna"- `database`: "uniprotkb", "pdb", "refseq_protein", etc.- - `email`: Required by NCBI+ - `email`: Required by NCBI — set `NCBI_EMAIL` in the environment or pass explicitly- Returns: Job ID- `getStatus(jobid)`diff --git a/scientific-skills/bioservices/references/workflow_patterns.md b/scientific-skills/bioservices/references/workflow_patterns.mdindex 0e79ef80..88666569 100644--- a/scientific-skills/bioservices/references/workflow_patterns.md+++ b/scientific-skills/bioservices/references/workflow_patterns.md@@ -64,10 +64,12 @@ sequence_only = "".join(seq_lines[1:]) # Skip FASTA header### Step 3: BLAST Similarity Search```python-from bioservices import NCBIblast+import osimport time+from bioservices import NCBIblasts = NCBIblast(verbose=False)+email = os.environ["NCBI_EMAIL"] # export [email protected]# Submit BLAST jobjobid = s.run(@@ -75,7 +77,7 @@ jobid = s.run(sequence=sequence_only,stype="protein",database="uniprotkb",- email="[email protected]"+ email=email,)print(f"BLAST Job ID: {jobid}")diff --git a/scientific-skills/bioservices/scripts/protein_analysis_workflow.py b/scientific-skills/bioservices/scripts/protein_analysis_workflow.pyindex 79734237..6b9a8d77 100755--- a/scientific-skills/bioservices/scripts/protein_analysis_workflow.py+++ b/scientific-skills/bioservices/scripts/protein_analysis_workflow.py@@ -11,20 +11,34 @@ This script performs a comprehensive protein analysis pipeline:6. GO annotation retrievalUsage:- python protein_analysis_workflow.py PROTEIN_NAME EMAIL [--skip-blast]+ export [email protected]+ python protein_analysis_workflow.py PROTEIN_NAME [EMAIL] [--skip-blast]Examples:- python protein_analysis_workflow.py ZAP70_HUMAN [email protected]+ python protein_analysis_workflow.py ZAP70_HUMANpython protein_analysis_workflow.py P43403 [email protected] --skip-blastNote: BLAST searches can take several minutes. Use --skip-blast to skip this step.+Email is read from NCBI_EMAIL when the optional EMAIL argument is omitted."""+import os+import reimport sysimport timeimport argparsefrom bioservices import UniProt, KEGG, NCBIblast, PSICQUIC, QuickGO+_EMAIL_RE = re.compile(r"^[^@\s]+@[^@\s]+\.[^@\s]+$")+++def resolve_ncbi_email(cli_email=None):+ """Return a validated NCBI contact email from CLI or NCBI_EMAIL."""+ email = (cli_email or os.environ.get("NCBI_EMAIL", "")).strip()+ if email and _EMAIL_RE.match(email):+ return email+ return None+def search_protein(query):"""Search UniProt for protein and retrieve basic information."""@@ -123,8 +137,8 @@ def run_blast(sequence, email, skip=False):print("⊘ Skipped (--skip-blast flag)")return None- if not email or "@" not in email:- print("⊘ Skipped (valid email required for BLAST)")+ if not email:+ print("⊘ Skipped (set NCBI_EMAIL or pass email for BLAST)")return Nonetry:@@ -350,12 +364,18 @@ def main():formatter_class=argparse.RawDescriptionHelpFormatter,epilog="""Examples:- python protein_analysis_workflow.py ZAP70_HUMAN [email protected]+ export [email protected]+ python protein_analysis_workflow.py ZAP70_HUMANpython protein_analysis_workflow.py P43403 [email protected] --skip-blast""")parser.add_argument("protein", help="Protein name or UniProt ID")- parser.add_argument("email", help="Email address (required for BLAST)")+ parser.add_argument(+ "email",+ nargs="?",+ default=None,+ help="NCBI contact email (optional if NCBI_EMAIL is set)",+ )parser.add_argument("--skip-blast", action="store_true",help="Skip BLAST search (faster)")@@ -377,8 +397,9 @@ Examples:print("\n⚠ Warning: Could not retrieve sequence")# Step 3: BLAST search+ ncbi_email = resolve_ncbi_email(args.email)if sequence:- blast_results = run_blast(sequence, args.email, args.skip_blast)+ blast_results = run_blast(sequence, ncbi_email, args.skip_blast)# Step 4: Pathway discoverykegg = KEGG()diff --git a/scientific-skills/cirq/SKILL.md b/scientific-skills/cirq/SKILL.mdindex 492d6498..e0ce4d91 100644--- a/scientific-skills/cirq/SKILL.md+++ b/scientific-skills/cirq/SKILL.md@@ -2,6 +2,7 @@name: cirqdescription: Google quantum computing framework. Use when targeting Google Quantum AI hardware, designing noise-aware circuits, or running quantum characterization experiments. Best for Google hardware, noise modeling, and low-level circuit design. For IBM hardware use qiskit; for quantum ML with autodiff use pennylane; for physics simulations use qutip.license: Apache-2.0 license+allowed-tools: Read Write Edit Bashmetadata:skill-author: K-Dense Inc.---@@ -10,30 +11,44 @@ metadata:Cirq is Google Quantum AI's open-source framework for designing, simulating, and running quantum circuits on quantum computers and simulators.+## When to Use This Skill++Use this skill when:+- Building, simulating, or optimizing NISQ circuits in Python+- Running jobs on Google Quantum AI processors (via `cirq-google`) or partner backends (IonQ, Azure Quantum, AQT, Pasqal)+- Modeling noise, compiling to hardware gatesets, or designing characterization experiments+- Using parameter sweeps, transformers, or the ReCirq experiment patterns++For IBM hardware use **qiskit**; for quantum ML with autodiff use **pennylane**; for physics simulations use **qutip**.+## Installation+Requires Python 3.11+. Current stable release: **1.6.1** (August 2025). Vendor packages share the same version number.+```bash-uv pip install cirq+uv pip install "cirq==1.6.1"```-For hardware integration:+For hardware integration (pin matching versions for reproducibility):```bash-# Google Quantum Engine-uv pip install cirq-google+# Google Quantum Engine (requires approved GCP project access)+uv pip install "cirq-google==1.6.1"# IonQ-uv pip install cirq-ionq+uv pip install "cirq-ionq==1.6.1"# AQT (Alpine Quantum Technologies)-uv pip install cirq-aqt+uv pip install "cirq-aqt==1.6.1"# Pasqal-uv pip install cirq-pasqal+uv pip install "cirq-pasqal==1.6.1"-# Azure Quantum-uv pip install azure-quantum cirq+# Azure Quantum (IonQ, Honeywell/Quantinuum backends)+uv pip install "azure-quantum[cirq]"```+For latest features during development, omit version pins; for production or hardware runs, pin all packages to the same Cirq release.+## Quick Start### Basic Circuit@@ -135,13 +150,13 @@ For information about running circuits on real quantum hardware from various pro- **[references/hardware.md](references/hardware.md)** - Complete guide to hardware integrationSupported providers:-- **Google Quantum AI** (cirq-google) - Sycamore, Weber processors-- **IonQ** (cirq-ionq) - Trapped ion quantum computers-- **Azure Quantum** (azure-quantum) - IonQ and Honeywell backends-- **AQT** (cirq-aqt) - Alpine Quantum Technologies-- **Pasqal** (cirq-pasqal) - Neutral atom quantum computers+- **Google Quantum AI** (`cirq-google`) — Sycamore, Weber, Willow processors via Quantum Engine (restricted access; requires approved GCP project)+- **IonQ** (`cirq-ionq`) — trapped-ion QPUs and simulators+- **Azure Quantum** (`azure-quantum[cirq]`) — IonQ and Honeywell/Quantinuum backends+- **AQT** (`cirq-aqt`) — Alpine Quantum Technologies+- **Pasqal** (`cirq-pasqal`) — neutral-atom devices-Topics include device representation, qubit selection, authentication, job management, and circuit optimization for hardware.+Topics include device representation, qubit selection, authentication, job management, and circuit optimization for hardware. See [Access and authentication](https://quantumai.google/cirq/google/access) for Google Cloud setup.### Noise ModelingFor information about modeling noise, noisy simulation, characterization, and error mitigation, see:@@ -215,28 +230,37 @@ result = variational_algorithm(my_ansatz, my_cost, [0.0, 0.0])### Hardware Execution Template```python-def run_on_hardware(circuit, provider='google', device_name='weber', repetitions=1000):+import os++def run_on_hardware(circuit, provider='google', processor_id=None, repetitions=1000):"""Template for running on quantum hardware."""if provider == 'google':- import cirq_google- engine = cirq_google.get_engine()- processor = engine.get_processor(device_name)- job = processor.run(circuit, repetitions=repetitions)- return job.results()[0]+ import cirq_google as cg++ project_id = os.environ['GOOGLE_CLOUD_PROJECT']+ engine = cg.Engine(project_id=project_id)++ # List available processors: engine.list_processors()+ processor_id = processor_id or 'weber' # use your assigned processor_id+ sampler = engine.get_sampler(processor_id=processor_id)+ return sampler.run(circuit, repetitions=repetitions)elif provider == 'ionq':- import cirq_ionq- service = cirq_ionq.Service()- result = service.run(circuit, repetitions=repetitions, target='qpu')- return result+ import cirq_ionq as ionq++ # Requires IONQ_API_KEY in environment+ service = ionq.Service()+ return service.run(circuit, repetitions=repetitions, target='qpu')elif provider == 'azure':from azure.quantum.cirq import AzureQuantumService- # Setup workspace...- service = AzureQuantumService(workspace)- result = service.run(circuit, repetitions=repetitions, target='ionq.qpu')- return result++ service = AzureQuantumService(+ resource_id=os.environ['AZURE_QUANTUM_RESOURCE_ID'],+ location=os.environ['AZURE_QUANTUM_LOCATION'],+ )+ return service.run(circuit, repetitions=repetitions, target='ionq.qpu')else:raise ValueError(f"Unknown provider: {provider}")@@ -319,7 +343,8 @@ results = noise_comparison_study(circuit, noise_levels)- **Official Documentation**: https://quantumai.google/cirq- **API Reference**: https://quantumai.google/reference/python/cirq- **Tutorials**: https://quantumai.google/cirq/tutorials-- **Examples**: https://github.com/quantumlib/Cirq/tree/master/examples+- **Examples**: https://github.com/quantumlib/Cirq/tree/main/examples+- **Version policy**: https://quantumai.google/cirq/dev/versions- **ReCirq**: https://github.com/quantumlib/ReCirq## Common Issuesdiff --git a/scientific-skills/cirq/references/hardware.md b/scientific-skills/cirq/references/hardware.mdindex 5c293498..e354b290 100644--- a/scientific-skills/cirq/references/hardware.md+++ b/scientific-skills/cirq/references/hardware.md@@ -61,7 +61,11 @@ except ValueError as e:import cirq_google# Get calibration metrics-processor = cirq_google.get_engine().get_processor('weber')+import os+import cirq_google as cg++engine = cg.Engine(project_id=os.environ['GOOGLE_CLOUD_PROJECT'])+processor = engine.get_processor('weber')calibration = processor.get_current_calibration()# Find qubits with lowest error rates@@ -107,31 +111,40 @@ def select_connected_qubits(device, n_qubits):### Google Quantum AI (Cirq-Google)+Google hardware access is restricted to approved users. You need a Google Cloud project with the [Quantum Engine API enabled](https://console.cloud.google.com/apis/library/quantum.googleapis.com) and Application Default Credentials configured.+#### Setup```python-import cirq_google+import cirq_google as cg-# Authenticate (requires Google Cloud project)-# Set environment variable: GOOGLE_CLOUD_PROJECT=your-project-id+# Authenticate via Application Default Credentials:+# gcloud auth application-default login+# Set your GCP project ID:+# export GOOGLE_CLOUD_PROJECT=your-project-id-# Get quantum engine-engine = cirq_google.get_engine()+import os+project_id = os.environ['GOOGLE_CLOUD_PROJECT']+engine = cg.Engine(project_id=project_id)-# List available processors-processors = engine.list_processors()-for processor in processors:+# List available processors (also visible in Cloud Console)+for processor in engine.list_processors():print(f"Processor: {processor.processor_id}")```#### Running on Google Hardware```python-# Create circuit for Google device-import cirq_google+import cirq+import cirq_google as cg+import os-# Get processor-processor = engine.get_processor('weber')+project_id = os.environ['GOOGLE_CLOUD_PROJECT']+engine = cg.Engine(project_id=project_id)++# Select a processor you have access to (e.g. weber, sycamore, willow)+processor_id = 'weber'+processor = engine.get_processor(processor_id)device = processor.get_device()# Create circuit on device qubits@@ -142,13 +155,11 @@ circuit = cirq.Circuit(cirq.measure(*qubits, key='result'))-# Validate and run+# Validate and run via samplerdevice.validate_circuit(circuit)-job = processor.run(circuit, repetitions=1000)--# Get results-results = job.results()[0]-print(results.histogram(key='result'))+sampler = engine.get_sampler(processor_id=processor_id)+result = sampler.run(circuit, repetitions=1000)+print(result.histogram(key='result'))```### IonQ@@ -156,23 +167,22 @@ print(results.histogram(key='result'))#### Setup```python-import cirq_ionq+import cirq_ionq as ionq-# Set API key-# Option 1: Environment variable+# Set API key via environment variable (recommended):# export IONQ_API_KEY=your_api_key+# Obtain keys at: https://cloud.ionq.com/settings/keys-# Option 2: In code-service = cirq_ionq.Service(api_key='your_api_key')+service = ionq.Service() # reads IONQ_API_KEY from environment```#### Running on IonQ```python-import cirq_ionq+import cirq+import cirq_ionq as ionq-# Create service-service = cirq_ionq.Service(api_key='your_api_key')+service = ionq.Service() # uses IONQ_API_KEY from environment# Create circuit (IonQ uses generic qubits)qubits = cirq.LineQubit.range(3)@@ -232,17 +242,15 @@ print(f"Timing: {calibration['timing']}")#### Setup```python-from azure.quantum import Workspacefrom azure.quantum.cirq import AzureQuantumService+import os-# Create workspace connection-workspace = Workspace(- resource_id="/subscriptions/.../resourceGroups/.../providers/Microsoft.Quantum/Workspaces/...",- location="eastus"+# Create service from workspace resource ID and location+# (copy from Azure Portal → your Quantum workspace header)+service = AzureQuantumService(+ resource_id=os.environ['AZURE_QUANTUM_RESOURCE_ID'],+ location=os.environ['AZURE_QUANTUM_LOCATION'],)--# Create Cirq service-service = AzureQuantumService(workspace)```#### Running on Azure Quantum (IonQ Backend)@@ -268,18 +276,17 @@ result = service.run()```-#### Running on Azure Quantum (Honeywell Backend)+#### Running on Azure Quantum (Honeywell/Quantinuum Backend)```python-# Run on Honeywell System Model H1+# Target names are workspace-specific; list available targets firstresult = service.run(circuit=circuit,repetitions=1000,- target='honeywell.hqs-lt-s1'+ target='honeywell.hqs-lt-s1-apival' # example; use service.targets() to list)-# Check Honeywell-specific options-target_info = service.get_target('honeywell.hqs-lt-s1')+target_info = service.get_target('honeywell.hqs-lt-s1-apival')print(f"Target info: {target_info}")```@@ -288,15 +295,15 @@ print(f"Target info: {target_info}")#### Setup```python+import osimport cirq_aqt-# Set API token+# Set API token via environment variable:# export AQT_TOKEN=your_token-# Create serviceservice = cirq_aqt.AQTSampler(remote_host='https://gateway.aqt.eu',- access_token='your_token'+ access_token=os.environ['AQT_TOKEN'])```@@ -340,10 +347,12 @@ device = cirq_pasqal.PasqalDevice(qubits=cirq.LineQubit.range(10))#### Running on Pasqal```python-# Create sampler+# Create sampler (requires PASQAL token in environment)+import os+sampler = cirq_pasqal.PasqalSampler(remote_host='https://api.pasqal.cloud',- access_token='your_token',+ access_token=os.environ['PASQAL_TOKEN'],device=device)@@ -467,26 +476,29 @@ def print_device_info(device):**Google Cloud:**```bash-# Install gcloud CLI-# Visit: https://cloud.google.com/sdk/docs/install+# Install gcloud CLI: https://cloud.google.com/sdk/docs/install-# Authenticate+# Authenticate with Application Default Credentialsgcloud auth application-default login-# Set project+# Enable Quantum Engine API in your project, then set:export GOOGLE_CLOUD_PROJECT=your-project-id```+See [Access and authentication](https://quantumai.google/cirq/google/access) for approval requirements.+**IonQ:**```bash-# Set API key+# Obtain key at https://cloud.ionq.com/settings/keysexport IONQ_API_KEY=your_api_key```**Azure Quantum:**-```python-# Use Azure CLI or workspace connection string-# See: https://docs.microsoft.com/azure/quantum/+```bash+# Set workspace connection details from Azure Portal+export AZURE_QUANTUM_RESOURCE_ID=/subscriptions/.../providers/Microsoft.Quantum/Workspaces/...+export AZURE_QUANTUM_LOCATION=eastus+# See: https://quantumai.google/cirq/hardware/azure-quantum/access```**AQT:**diff --git a/scientific-skills/cirq/references/noise.md b/scientific-skills/cirq/references/noise.mdindex b5aa0fb3..825878d2 100644--- a/scientific-skills/cirq/references/noise.md+++ b/scientific-skills/cirq/references/noise.md@@ -487,16 +487,15 @@ def mitigate_readout_errors(results, confusion_matrix):### From Google Calibration```python-import cirq_google+import os+import cirq_google as cg-# Get calibration data-processor = cirq_google.get_engine().get_processor('weber')+engine = cg.Engine(project_id=os.environ['GOOGLE_CLOUD_PROJECT'])+processor = engine.get_processor('weber')noise_props = processor.get_device_specification()-# Create noise model from calibration-noise_model = cirq_google.NoiseModelFromGoogleNoiseProperties(noise_props)+noise_model = cg.NoiseModelFromGoogleNoiseProperties(noise_props)-# Simulate with realistic noisesimulator = cirq.DensityMatrixSimulator(noise=noise_model)result = simulator.run(circuit, repetitions=1000)```diff --git a/scientific-skills/cirq/references/simulation.md b/scientific-skills/cirq/references/simulation.mdindex 86972c38..5a8d5ef9 100644--- a/scientific-skills/cirq/references/simulation.md+++ b/scientific-skills/cirq/references/simulation.md@@ -248,13 +248,16 @@ device.validate_circuit(circuit)### Noisy Virtual Hardware```python-# Simulate with device noise-processor = cirq_google.get_engine().get_processor('weber')+import os+import cirq_google as cg++# Simulate with device noise from calibration data+engine = cg.Engine(project_id=os.environ['GOOGLE_CLOUD_PROJECT'])+processor = engine.get_processor('weber')noise_props = processor.get_device_specification()-# Create realistic noisy simulatornoisy_sim = cirq.DensityMatrixSimulator(- noise=cirq_google.NoiseModelFromGoogleNoiseProperties(noise_props)+ noise=cg.NoiseModelFromGoogleNoiseProperties(noise_props))result = noisy_sim.run(circuit, repetitions=1000)diff --git a/scientific-skills/cobrapy/SKILL.md b/scientific-skills/cobrapy/SKILL.mdindex 643a91c9..1a2069ef 100644--- a/scientific-skills/cobrapy/SKILL.md+++ b/scientific-skills/cobrapy/SKILL.md@@ -2,6 +2,8 @@name: cobrapydescription: Constraint-based metabolic modeling (COBRA). FBA, FVA, gene knockouts, flux sampling, SBML models, for systems biology and metabolic engineering analysis.license: GPL-2.0 license+allowed-tools: [Read, Write, Edit, Bash]+compatibility: Requires Python 3.9+ (cobra 0.30+ dropped 3.8). Install with uv pip install. GLPK (swiglpk) is the default solver; CPLEX/Gurobi optional. load_model fetches from bundled data, BiGG, or BioModels (network required for remote models).metadata:skill-author: K-Dense Inc.---@@ -12,6 +14,31 @@ metadata:COBRApy is a Python library for constraint-based reconstruction and analysis (COBRA) of metabolic models, essential for systems biology research. Work with genome-scale metabolic models, perform computational simulations of cellular metabolism, conduct metabolic engineering analyses, and predict phenotypic behaviors.+**Version note:** Examples target **cobra 0.31.1** on PyPI (import `cobra`). Docs: [cobrapy.readthedocs.io](https://cobrapy.readthedocs.io/en/latest/). Repo: [opencobra/cobrapy](https://github.com/opencobra/cobrapy).++## When to Use This Skill++Use this skill when:+- Loading, building, or exporting genome-scale metabolic models (SBML, JSON, YAML)+- Running FBA, pFBA, FVA, or flux sampling on COBRA models+- Performing gene or reaction knockout screens and production envelope analysis+- Designing or optimizing growth media and exchange constraints+- Gap-filling infeasible models or validating model consistency++## Installation++```bash+uv pip install "cobra==0.31.1"+```++MATLAB model I/O (optional):++```bash+uv pip install "cobra[array]==0.31.1"+```++COBRApy uses [optlang](https://optlang.readthedocs.io/) for solvers. GLPK installs automatically via `swiglpk`. For large MILPs/QPs, cobra 0.29+ adds a **hybrid** solver (HIGHS/OSQP); `model.solver = "osqp"` now routes through hybrid and may error on plain LPs in a future release—prefer `model.solver = "hybrid"` when available.+## Core CapabilitiesCOBRApy provides comprehensive tools organized into several key areas:@@ -22,10 +49,14 @@ Load existing models from repositories or files:```pythonfrom cobra.io import load_model-# Load bundled test models-model = load_model("textbook") # E. coli core model-model = load_model("ecoli") # Full E. coli model-model = load_model("salmonella")+# Bundled locally (no network): textbook, iJO1366, salmonella+model = load_model("textbook") # alias for e_coli_core (95 reactions)+model = load_model("e_coli_core") # same core E. coli model+model = load_model("iJO1366") # genome-scale E. coli (bundled)+model = load_model("salmonella") # Salmonella iYS1720 (bundled)++# Remote (BiGG / BioModels; requires network, cached after first fetch)+model = load_model("iML1515") # E. coli genome-scale on BiGG# Load from filesfrom cobra.io import read_sbml_model, load_json_model, load_yaml_model@@ -226,8 +257,9 @@ Add reactions to make models feasible:```pythonfrom cobra.flux_analysis import gapfill-# Prepare universal model with candidate reactions-universal = load_model("universal")+# Provide a universal reaction database (SBML/JSON); not bundled in cobra 0.31++from cobra.io import read_sbml_model+universal = read_sbml_model("path/to/universal_reactions.xml")# Perform gapfillingwith model:@@ -291,8 +323,8 @@ model.objective = "ATPASE"```pythonfrom cobra.io import load_model-# Load model-model = load_model("ecoli")+# Load model (textbook = fast tutorial; iJO1366 / iML1515 for genome-scale)+model = load_model("textbook")# Run FBAsolution = model.optimize()@@ -309,7 +341,8 @@ from cobra.io import load_modelfrom cobra.flux_analysis import single_gene_deletion# Load model-model = load_model("ecoli")+model = load_model("textbook")+baseline = model.slim_optimize()# Perform single gene deletionsresults = single_gene_deletion(model)@@ -319,7 +352,7 @@ essential_genes = results[results["growth"] < 0.01]print(f"Found {len(essential_genes)} essential genes")# Find genes with minimal impact-neutral_genes = results[results["growth"] > 0.9 * solution.objective_value]+neutral_genes = results[results["growth"] > 0.9 * baseline]```### Workflow 3: Media Optimization@@ -329,7 +362,7 @@ from cobra.io import load_modelfrom cobra.medium import minimal_medium# Load model-model = load_model("ecoli")+model = load_model("textbook")# Calculate minimal medium for 50% of max growthtarget_growth = model.slim_optimize() * 0.5@@ -351,7 +384,7 @@ from cobra.flux_analysis import flux_variability_analysisfrom cobra.sampling import sample# Load model-model = load_model("ecoli")+model = load_model("textbook")# First check flux ranges at optimalityfva = flux_variability_analysis(model, fraction_of_optimum=1.0)@@ -439,10 +472,11 @@ Special reactions representing metabolite import/export:3. **Check solution status** after optimization - `optimal` indicates successful solve4. **Use loopless FVA** when thermodynamic feasibility matters5. **Set fraction_of_optimum** appropriately in FVA to explore suboptimal space-6. **Parallelize** computationally expensive operations (sampling, double deletions)+6. **Parallelize** computationally expensive operations (sampling, double deletions) — start with small `n` and `processes=1` on genome-scale models7. **Prefer SBML format** for model exchange and long-term storage8. **Use slim_optimize()** when only objective value needed for performance9. **Validate flux samples** to ensure numerical stability+10. **Confirm output paths** before writing CSV/PNG files from workflow examples## Troubleshootingdiff --git a/scientific-skills/cobrapy/references/api_quick_reference.md b/scientific-skills/cobrapy/references/api_quick_reference.mdindex c7b49229..9a49c2fd 100644--- a/scientific-skills/cobrapy/references/api_quick_reference.md+++ b/scientific-skills/cobrapy/references/api_quick_reference.md@@ -1,6 +1,6 @@# COBRApy API Quick Reference-This document provides quick reference for common COBRApy functions, signatures, and usage patterns.+Quick reference for **cobra 0.31.1**. Full API: https://cobrapy.readthedocs.io/## Model I/O@@ -9,10 +9,14 @@ This document provides quick reference for common COBRApy functions, signatures,```pythonfrom cobra.io import load_model, read_sbml_model, load_json_model, load_yaml_model, load_matlab_model-# Bundled test models-model = load_model("textbook") # E. coli core metabolism-model = load_model("ecoli") # Full E. coli iJO1366-model = load_model("salmonella") # Salmonella LT2+# Bundled locally (cobra.data): textbook, iJO1366, salmonella+model = load_model("textbook") # e_coli_core (95 reactions)+model = load_model("e_coli_core") # same as textbook+model = load_model("iJO1366") # genome-scale E. coli+model = load_model("salmonella") # iYS1720++# BiGG / BioModels (network + disk cache)+model = load_model("iML1515")# From filesmodel = read_sbml_model(filename, f_replace={}, **kwargs)@@ -137,10 +141,14 @@ model.objective_direction = "max" # or "min"```python# Check available solversfrom cobra.util.solver import solvers-print(solvers)+print(solvers) # typically includes glpk; CPLEX/Gurobi if installed# Change solver-model.solver = "glpk" # or "cplex", "gurobi", etc.+model.solver = "glpk" # default via swiglpk+# model.solver = "hybrid" # HIGHS/OSQP for large MILPs/QPs (0.29+)+# model.solver = "cplex" # or "gurobi" with licenses installed++# OSQP: deprecated as standalone LP solver; routes through hybrid in 0.29+# Solver-specific configurationmodel.solver.configuration.timeout = 60 # seconds@@ -652,4 +660,6 @@ for value in parameter_values:df = pd.DataFrame(results)```-This quick reference covers the most commonly used COBRApy functions and patterns. For complete API documentation, see https://cobrapy.readthedocs.io/+This quick reference covers the most commonly used COBRApy functions and patterns. For complete API documentation, see https://cobrapy.readthedocs.io/en/latest/++**File outputs:** Workflow examples that call `to_csv` or `savefig` should use a user-approved `OUTDIR` — see `references/workflows.md`.diff --git a/scientific-skills/cobrapy/references/workflows.md b/scientific-skills/cobrapy/references/workflows.mdindex 08d5e5a5..738c608c 100644--- a/scientific-skills/cobrapy/references/workflows.md+++ b/scientific-skills/cobrapy/references/workflows.md@@ -2,6 +2,15 @@This document provides detailed step-by-step workflows for common COBRApy tasks in metabolic modeling.+**Operational notes (cobra 0.31.1):**+- Confirm with the user before writing CSV/PNG files; set `OUTDIR` to a user-approved path.+- `load_model("ecoli")` and `load_model("universal")` no longer work — use `textbook` / `e_coli_core`, `iJO1366`, or BiGG IDs such as `iML1515`.+- Double deletions, loopless FVA, and large sampling runs can take hours on genome-scale models — use `textbook` for exploration, lower `n`/`processes`, or subset `gene_list1`.++```python+OUTDIR = "cobrapy_output" # set with user approval before running workflows+```+## Workflow 1: Complete Knockout Study with VisualizationThis workflow demonstrates how to perform a comprehensive gene knockout study and visualize the results.@@ -12,8 +21,8 @@ import matplotlib.pyplot as pltfrom cobra.io import load_modelfrom cobra.flux_analysis import single_gene_deletion, double_gene_deletion-# Step 1: Load model-model = load_model("ecoli")+# Step 1: Load model (textbook = core tutorial; use iJO1366 for genome-scale)+model = load_model("textbook")print(f"Loaded model: {model.id}")print(f"Model contains {len(model.reactions)} reactions, {len(model.metabolites)} metabolites, {len(model.genes)} genes")@@ -48,7 +57,7 @@ ax.set_ylabel("Number of genes")ax.set_title("Distribution of Growth Rates After Single Gene Deletions")ax.legend()plt.tight_layout()-plt.savefig("single_deletion_distribution.png", dpi=300)+plt.savefig(f"{OUTDIR}/single_deletion_distribution.png", dpi=300)# Step 6: Identify gene pairs for double deletions# Focus on non-essential genes to find synthetic lethals@@ -56,10 +65,11 @@ target_genes = single_results[single_results["growth"] >= 0.5 * baseline].index.target_genes = [list(gene)[0] for gene in target_genes[:50]] # Limit for performanceprint(f"\nPerforming double deletions on {len(target_genes)} genes...")+# Double deletions scale poorly — use processes=1 on large models unless user approvesdouble_results = double_gene_deletion(model,gene_list1=target_genes,- processes=4+ processes=1)# Step 7: Find synthetic lethal pairs@@ -73,10 +83,10 @@ print(f"Found {len(synthetic_lethals)} synthetic lethal gene pairs")print("\nTop 10 synthetic lethal pairs:")print(synthetic_lethals.head(10))-# Step 8: Export results-single_results.to_csv("single_gene_deletions.csv")-double_results.to_csv("double_gene_deletions.csv")-synthetic_lethals.to_csv("synthetic_lethals.csv")+# Step 8: Export results (confirm OUTDIR with user first)+single_results.to_csv(f"{OUTDIR}/single_gene_deletions.csv")+double_results.to_csv(f"{OUTDIR}/double_gene_deletions.csv")+synthetic_lethals.to_csv(f"{OUTDIR}/synthetic_lethals.csv")```## Workflow 2: Media Design and Optimization@@ -89,7 +99,7 @@ from cobra.medium import minimal_mediumimport pandas as pd# Step 1: Load model and check current medium-model = load_model("ecoli")+model = load_model("textbook")current_medium = model.mediumprint("Current medium composition:")for exchange, bound in current_medium.items():@@ -121,7 +131,7 @@ for fraction in growth_targets:# Step 4: Compare media compositionsmedia_df = pd.DataFrame(minimal_media).fillna(0)-media_df.to_csv("minimal_media_comparison.csv")+media_df.to_csv(f"{OUTDIR}/minimal_media_comparison.csv")# Step 5: Test aerobic vs anaerobic conditionsprint("\n--- Aerobic vs Anaerobic Comparison ---")@@ -192,11 +202,11 @@ import matplotlib.pyplot as pltimport seaborn as sns# Step 1: Load model-model = load_model("ecoli")+model = load_model("textbook")baseline = model.slim_optimize()print(f"Baseline growth: {baseline:.3f} /h")-# Step 2: Perform FVA at optimal growth+# Step 2: Perform FVA at optimal growth (loopless=True is much slower)print("\nPerforming FVA at optimal growth...")fva_optimal = flux_variability_analysis(model, fraction_of_optimum=1.0)@@ -224,9 +234,9 @@ comparison["range_increase"] = comparison["range_90"] - comparison["range_100"]print("\nReactions with largest increase in flexibility at suboptimality:")print(comparison.sort_values("range_increase", ascending=False).head(10))-# Step 6: Perform flux sampling+# Step 6: Perform flux sampling (reduce n/processes on genome-scale models)print("\nPerforming flux sampling (1000 samples)...")-samples = sample(model, n=1000, method="optgp", processes=4)+samples = sample(model, n=500, method="optgp", processes=1)# Step 7: Analyze sampling results for key reactionskey_reactions = ["PFK", "FBA", "TPI", "GAPD", "PGK", "PGM", "ENO", "PYK"]@@ -253,7 +263,7 @@ if available_key_reactions:ax.legend()plt.tight_layout()- plt.savefig("flux_distributions.png", dpi=300)+ plt.savefig(f"{OUTDIR}/flux_distributions.png", dpi=300)# Step 8: Calculate correlation between reactionsprint("\nCalculating flux correlations...")@@ -264,7 +274,7 @@ sns.heatmap(correlation_matrix, annot=True, fmt=".2f", cmap="coolwarm",center=0, ax=ax, square=True)ax.set_title("Flux Correlations Between Key Glycolysis Reactions")plt.tight_layout()-plt.savefig("flux_correlations.png", dpi=300)+plt.savefig(f"{OUTDIR}/flux_correlations.png", dpi=300)# Step 9: Identify reaction modules (highly correlated groups)print("\nHighly correlated reaction pairs (|r| > 0.9):")@@ -275,10 +285,10 @@ for i in range(len(correlation_matrix)):print(f" {correlation_matrix.index[i]} <-> {correlation_matrix.columns[j]}: {corr:.3f}")# Step 10: Export all results-fva_optimal.to_csv("fva_optimal.csv")-fva_suboptimal.to_csv("fva_suboptimal.csv")-samples.to_csv("flux_samples.csv")-correlation_matrix.to_csv("flux_correlations.csv")+fva_optimal.to_csv(f"{OUTDIR}/fva_optimal.csv")+fva_suboptimal.to_csv(f"{OUTDIR}/fva_suboptimal.csv")+samples.to_csv(f"{OUTDIR}/flux_samples.csv")+correlation_matrix.to_csv(f"{OUTDIR}/flux_correlations.csv")```## Workflow 4: Production Strain Design@@ -299,8 +309,9 @@ import matplotlib.pyplot as pltTARGET_METABOLITE = "EX_ac_e" # Acetate productionCARBON_SOURCE = "EX_glc__D_e" # Glucose uptake-# Step 2: Load model-model = load_model("ecoli")+# Step 2: Load model (textbook has acetate exchange; use iJO1366 for genome-scale)+model = load_model("textbook")+biomass_id = list(model.objective.variables)[0].name # e.g. Biomass_Ecoli_coreprint(f"Designing strain for {TARGET_METABOLITE} production")# Step 3: Calculate baseline production envelope@@ -321,51 +332,41 @@ ax.set_title("Wild-type Production Envelope")ax.legend()ax.grid(True, alpha=0.3)plt.tight_layout()-plt.savefig("production_envelope_wildtype.png", dpi=300)+plt.savefig(f"{OUTDIR}/production_envelope_wildtype.png", dpi=300)# Step 4: Maximize production while maintaining growthprint("\nOptimizing for production...")-# Set minimum growth constraint-MIN_GROWTH = 0.1 # Maintain at least 10% of max growth--with model:- # Change objective to product formation- model.objective = TARGET_METABOLITE- model.objective_direction = "max"-- # Add growth constraint- growth_reaction = model.reactions.get_by_id(model.objective.name) if hasattr(model.objective, 'name') else list(model.objective.variables.keys())[0].name- max_growth = model.slim_optimize()--model.reactions.BIOMASS_Ecoli_core_w_GAM.lower_bound = MIN_GROWTH+max_growth = model.slim_optimize()+MIN_GROWTH = 0.1 * max_growth # Maintain at least 10% of max growthwith model:+ model.reactions.get_by_id(biomass_id).lower_bound = MIN_GROWTHmodel.objective = TARGET_METABOLITEmodel.objective_direction = "max"production_solution = model.optimize()max_production = production_solution.objective_valueprint(f"Maximum production: {max_production:.3f} mmol/gDW/h")- print(f"Growth rate: {production_solution.fluxes['BIOMASS_Ecoli_core_w_GAM']:.3f} /h")+ print(f"Growth rate: {production_solution.fluxes[biomass_id]:.3f} /h")# Step 5: Identify beneficial gene knockoutsprint("\nScreening for beneficial knockouts...")--# Reset model-model.reactions.BIOMASS_Ecoli_core_w_GAM.lower_bound = MIN_GROWTHmodel.objective = TARGET_METABOLITEmodel.objective_direction = "max"knockout_results = []for gene in model.genes:with model:+ model.reactions.get_by_id(biomass_id).lower_bound = MIN_GROWTH+ model.objective = TARGET_METABOLITE+ model.objective_direction = "max"gene.knock_out()try:solution = model.optimize()if solution.status == "optimal":production = solution.objective_value- growth = solution.fluxes["BIOMASS_Ecoli_core_w_GAM"]+ growth = solution.fluxes[biomass_id]if production > max_production * 1.05: # >5% improvementknockout_results.append({@@ -382,7 +383,7 @@ if len(knockout_df) > 0:knockout_df = knockout_df.sort_values("improvement", ascending=False)print(f"\nFound {len(knockout_df)} beneficial knockouts:")print(knockout_df.head(10))- knockout_df.to_csv("beneficial_knockouts.csv", index=False)+ knockout_df.to_csv(f"{OUTDIR}/beneficial_knockouts.csv", index=False)else:print("No beneficial single knockouts found")@@ -392,13 +393,16 @@ if len(knockout_df) > 0:top_genes = knockout_df.head(3)["gene"].tolist()with model:+ model.reactions.get_by_id(biomass_id).lower_bound = MIN_GROWTH+ model.objective = TARGET_METABOLITE+ model.objective_direction = "max"for gene_id in top_genes:model.genes.get_by_id(gene_id).knock_out()solution = model.optimize()if solution.status == "optimal":combined_production = solution.objective_value- combined_growth = solution.fluxes["BIOMASS_Ecoli_core_w_GAM"]+ combined_growth = solution.fluxes[biomass_id]combined_improvement = (combined_production / max_production - 1) * 100print(f"\nCombined knockout results:")@@ -412,12 +416,15 @@ if len(knockout_df) > 0:best_gene = knockout_df.iloc[0]["gene"]with model:+ model.reactions.get_by_id(biomass_id).lower_bound = MIN_GROWTH+ model.objective = TARGET_METABOLITE+ model.objective_direction = "max"model.genes.get_by_id(best_gene).knock_out()solution = model.optimize()# Get active pathwaysactive_fluxes = solution.fluxes[solution.fluxes.abs() > 0.1]- active_fluxes.to_csv(f"production_strain_fluxes_{best_gene}_knockout.csv")+ active_fluxes.to_csv(f"{OUTDIR}/production_strain_fluxes_{best_gene}_knockout.csv")print(f"\nActive reactions in production strain: {len(active_fluxes)}")```@@ -432,7 +439,7 @@ from cobra.flux_analysis import flux_variability_analysisimport pandas as pd# Step 1: Load model-model = load_model("ecoli") # Or read_sbml_model("your_model.xml")+model = load_model("textbook") # Or read_sbml_model("your_model.xml")print(f"Model: {model.id}")print(f"Reactions: {len(model.reactions)}")print(f"Metabolites: {len(model.metabolites)}")@@ -546,10 +553,10 @@ if orphan_genes:else:print("No orphan genes found")-# Step 7: Check for thermodynamically infeasible loops+# Step 7: Check for thermodynamically infeasible loops (loopless FVA is slow on large models)print("\n--- Thermodynamic Loop Check ---")-fva_loopless = flux_variability_analysis(model, loopless=True)fva_standard = flux_variability_analysis(model)+fva_loopless = flux_variability_analysis(model, loopless=True)loop_reactions = []for reaction_id in fva_standard.index:@@ -586,8 +593,8 @@ validation_report = {}validation_df = pd.DataFrame([validation_report])-validation_df.to_csv("model_validation_report.csv", index=False)-print("Validation report saved to model_validation_report.csv")+validation_df.to_csv(f"{OUTDIR}/model_validation_report.csv", index=False)+print(f"Validation report saved to {OUTDIR}/model_validation_report.csv")```These workflows provide comprehensive templates for common COBRApy tasks. Adapt them as needed for specific research questions and models.diff --git a/scientific-skills/deepchem/SKILL.md b/scientific-skills/deepchem/SKILL.mdindex 7ca597b0..438d224a 100644--- a/scientific-skills/deepchem/SKILL.md+++ b/scientific-skills/deepchem/SKILL.md@@ -2,6 +2,8 @@name: deepchemdescription: Molecular ML with diverse featurizers and pre-built datasets. Use for property prediction (ADMET, toxicity) with traditional ML or GNNs when you want extensive featurization options and MoleculeNet benchmarks. Best for quick experiments with pre-trained models, diverse molecular representations. For graph-first PyTorch workflows use torchdrug; for benchmark datasets use pytdc.license: MIT license+allowed-tools: [Read, Write, Edit, Bash]+compatibility: Requires Python 3.7–3.11 (PyPI 2.8.0 caps at <3.12). Install PyTorch, TensorFlow, or JAX before the matching deepchem extra. RDKit is a core dependency.metadata:skill-author: K-Dense Inc.---@@ -12,6 +14,8 @@ metadata:DeepChem is a comprehensive Python library for applying machine learning to chemistry, materials science, and biology. Enable molecular property prediction, drug discovery, materials design, and biomolecule analysis through specialized neural networks, molecular featurization methods, and pretrained models.+**Version note:** Examples target **deepchem 2.8.0** (PyPI stable, Apr 2024). Requires **Python 3.7–3.11** (`<3.12` on PyPI). Core utilities (loaders, featurizers, MoleculeNet) work without a DL backend; GNN and transformer models need the matching extra (`torch`, `tensorflow`, or `jax`). Install the backend framework first when using GPU builds.+## When to Use This SkillThis skill should be used when:@@ -438,7 +442,7 @@ python scripts/graph_neural_network.py \```### 3. `transfer_learning.py`-Fine-tune pretrained models (ChemBERTa, GROVER) on molecular property prediction tasks.+Fine-tune pretrained models (ChemBERTa, GROVER, MolFormer) on molecular property prediction tasks.```bash# Fine-tune ChemBERTa on BBBP@@ -528,15 +532,17 @@ model = dc.models.GCNModel(batch_size=32) # Instead of 128- Collect more data### Issue 4: Import Errors-**Problem**: Module not found errors.-**Solution**: Ensure DeepChem is installed with required dependencies:+**Problem**: `No module named 'torch'` / `No module named 'tensorflow'` warnings, or model classes fail to import.+**Solution**: DeepChem loads lazily — install the backend that matches your model, then add the matching extra:```bash-uv pip install deepchem-# For PyTorch models-uv pip install deepchem[torch]-# For all features-uv pip install deepchem[all]+uv pip install deepchem # loaders, featurizers, MoleculeNet only+uv pip install 'deepchem[torch]' # GCN, GAT, AttentiveFP, HuggingFaceModel, GroverModel+uv pip install 'deepchem[tensorflow]' # legacy Keras models+uv pip install 'deepchem[jax]' # Haiku/JAX models```+Install PyTorch or TensorFlow with the correct CUDA build **before** the extra when using GPUs. Quote extras in zsh: `'deepchem[torch]'`.++**Conda + PyTorch users:** If `import deepchem` fails with `undefined symbol: iJIT_NotifyEvent`, pin MKL below 2025 (`conda install "mkl<2025"`) — PyTorch wheels may be incompatible with MKL 2025.0.0.## Reference Documentation@@ -567,24 +573,26 @@ Eight detailed end-to-end workflows:**When to reference**: Use these workflows as templates for implementing complete solutions.-## Installation Notes+## Installation++Core package (data loaders, featurizers, MoleculeNet, scikit-learn wrappers):-Basic installation:```bashuv pip install deepchem```-For PyTorch models (GCN, GAT, etc.):-```bash-uv pip install deepchem[torch]-```+Add the extra that matches your model backend (install PyTorch/TensorFlow/JAX first for GPU builds):-For all features:```bash-uv pip install deepchem[all]+uv pip install 'deepchem[torch]' # GNNs, TorchModel, HuggingFaceModel, GroverModel+uv pip install 'deepchem[tensorflow]' # Keras/TensorFlow models+uv pip install 'deepchem[jax]' # JAX/Haiku models+uv pip install 'deepchem[dqc]' # Differentiable quantum chemistry (torch + xitorch)```-If import errors occur, the user may need specific dependencies. Check the DeepChem documentation for detailed installation instructions.+Nightly builds: `uv pip install --pre deepchem` (same extras apply with `--pre`).++See [installation guide](https://deepchem.readthedocs.io/en/latest/get_started/installation.html) and [soft requirements](https://deepchem.readthedocs.io/en/latest/requirements.html) for optional dependencies per model class.## Additional Resourcesdiff --git a/scientific-skills/deepchem/references/api_reference.md b/scientific-skills/deepchem/references/api_reference.mdindex 86ae0cfe..fd3635d3 100644--- a/scientific-skills/deepchem/references/api_reference.md+++ b/scientific-skills/deepchem/references/api_reference.md@@ -111,6 +111,8 @@ For recurrent networks and transformers:## Models+**Install note (2.8.0):** PyPI extras are `torch`, `tensorflow`, `jax`, and `dqc` — there is no `[all]` extra. Install PyTorch/TensorFlow/JAX before the matching `uv pip install 'deepchem[torch]'` (quote brackets in zsh).+### Scikit-Learn Integration- **SklearnModel**: Wrapper for any scikit-learn algorithm- Usage: `SklearnModel(model=RandomForestRegressor())`diff --git a/scientific-skills/deepchem/scripts/transfer_learning.py b/scientific-skills/deepchem/scripts/transfer_learning.pyindex 1665334a..40daa6d6 100644--- a/scientific-skills/deepchem/scripts/transfer_learning.py+++ b/scientific-skills/deepchem/scripts/transfer_learning.py@@ -156,6 +156,67 @@ def train_grover(train_dataset, test_dataset, task_type='classification', n_taskreturn model, results+def train_molformer(train_dataset, valid_dataset, test_dataset, task_type='classification', n_tasks=1, n_epochs=10):+ """+ Fine-tune MolFormer on a dataset.++ Args:+ train_dataset: Training dataset+ valid_dataset: Validation dataset+ test_dataset: Test dataset+ task_type: 'classification' or 'regression'+ n_tasks: Number of prediction tasks+ n_epochs: Number of fine-tuning epochs++ Returns:+ Trained model and evaluation results+ """+ print("=" * 70)+ print("Fine-tuning MolFormer")+ print("=" * 70)+ print("\nMolFormer is a transformer pretrained on molecular structures.")+ print("It uses SMILES strings as input via HuggingFaceModel.")++ print(f"\nLoading pretrained MolFormer model...")+ model = dc.models.HuggingFaceModel(+ model=PRETRAINED_MODELS['molformer']['model_id'],+ task=task_type,+ n_tasks=n_tasks,+ batch_size=32,+ learning_rate=2e-5+ )++ print(f"\nFine-tuning for {n_epochs} epochs...")+ print("(This may take a while on the first run as the model is downloaded)")+ model.fit(train_dataset, nb_epoch=n_epochs)+ print("Fine-tuning complete!")++ print("\n" + "=" * 70)+ print("Model Evaluation")+ print("=" * 70)++ if task_type == 'classification':+ metrics = [+ dc.metrics.Metric(dc.metrics.roc_auc_score, name='ROC-AUC'),+ dc.metrics.Metric(dc.metrics.accuracy_score, name='Accuracy'),+ ]+ else:+ metrics = [+ dc.metrics.Metric(dc.metrics.r2_score, name='R²'),+ dc.metrics.Metric(dc.metrics.mean_absolute_error, name='MAE'),+ ]++ results = {}+ for name, dataset in [('Train', train_dataset), ('Valid', valid_dataset), ('Test', test_dataset)]:+ print(f"\n{name} Set:")+ scores = model.evaluate(dataset, metrics)+ results[name] = scores+ for metric_name, score in scores.items():+ print(f" {metric_name}: {score:.4f}")++ return model, results++def load_molnet_dataset(dataset_name, model_type):"""Load a MoleculeNet dataset with appropriate featurization.@@ -349,6 +410,13 @@ def main():n_tasks=n_tasks,n_epochs=args.epochs)+ elif args.model == 'molformer':+ model, results = train_molformer(+ train, valid, test,+ task_type=task_type,+ n_tasks=n_tasks,+ n_epochs=args.epochs+ )else:print(f"Error: Model {args.model} not yet implemented", file=sys.stderr)return 1diff --git a/scientific-skills/pyzotero/SKILL.md b/scientific-skills/pyzotero/SKILL.mdindex 6da1655c..45412d8d 100644--- a/scientific-skills/pyzotero/SKILL.md+++ b/scientific-skills/pyzotero/SKILL.md@@ -3,6 +3,7 @@ name: pyzoterodescription: Interact with Zotero reference management libraries using the pyzotero Python client. Retrieve, create, update, and delete items, collections, tags, and attachments via the Zotero Web API v3. Use this skill when working with Zotero libraries programmatically, managing bibliographic references, exporting citations, searching library contents, uploading PDF attachments, or building research automation workflows that integrate with Zotero.allowed-tools: Read Write Edit Bashlicense: MIT License+compatibility: Requires Python 3.10+ and pyzotero 1.13+. Web API access needs a Zotero API key. Optional CLI and MCP extras require Zotero 7 with local API access enabled.metadata:skill-author: K-Dense Inc.---@@ -11,6 +12,8 @@ metadata:Pyzotero is a Python wrapper for the [Zotero API v3](https://www.zotero.org/support/dev/web_api/v3/start). Use it to programmatically manage Zotero libraries: read items and collections, create and update references, upload attachments, manage tags, and export citations.+**Current upstream:** pyzotero 1.13.0 (PyPI, May 2026). Docs: [pyzotero.readthedocs.io](https://pyzotero.readthedocs.io/en/latest/).+## Authentication Setup**Required credentials** — get from https://www.zotero.org/settings/keys:@@ -30,17 +33,22 @@ See [references/authentication.md](references/authentication.md) for full setup## Installation```bash-uv add pyzotero-# or with CLI support:-uv add "pyzotero[cli]"+uv add pyzotero # Web API client+uv add "pyzotero[cli]" # + local CLI (Zotero 7)+uv add "pyzotero[mcp]" # + MCP server for LLM clients (Zotero 7)```## Quick Start```python+import osfrom pyzotero import Zotero-zot = Zotero(library_id='123456', library_type='user', api_key='ABC1234XYZ')+zot = Zotero(+ library_id=os.environ['ZOTERO_LIBRARY_ID'],+ library_type=os.environ.get('ZOTERO_LIBRARY_TYPE', 'user'),+ api_key=os.environ['ZOTERO_API_KEY'],+)# Retrieve top-level items (returns 100 by default)items = zot.top(limit=10)@@ -70,13 +78,14 @@ all_items = zot.everything(zot.items())| [references/search-params.md](references/search-params.md) | Filtering, sorting, search parameters || [references/write-api.md](references/write-api.md) | Creating, updating, deleting items || [references/collections.md](references/collections.md) | Collection CRUD operations |-| [references/tags.md](references/tags.md) | Tag retrieval and management |-| [references/files-attachments.md](references/files-attachments.md) | File retrieval and attachment uploads |+| [references/tags.md](references/tags.md) | Tag access and management |+| [references/files-attachments.md](references/files-attachments.md) | File download and attachment uploads || [references/exports.md](references/exports.md) | BibTeX, CSL-JSON, bibliography export || [references/pagination.md](references/pagination.md) | follow(), everything(), generators |-| [references/full-text.md](references/full-text.md) | Full-text content indexing and retrieval |+| [references/full-text.md](references/full-text.md) | Full-text content indexing and access || [references/saved-searches.md](references/saved-searches.md) | Saved search management |-| [references/cli.md](references/cli.md) | Command-line interface usage |+| [references/cli.md](references/cli.md) | Command-line interface (local Zotero 7) |+| [references/mcp.md](references/mcp.md) | MCP server for LLM clients (local Zotero 7) || [references/error-handling.md](references/error-handling.md) | Errors and exception handling |## Common Patterns@@ -109,3 +118,7 @@ print(bibtex.entries)zot = Zotero(library_id='123456', library_type='user', local=True)items = zot.items()```++### Local Zotero 7 (CLI or MCP, no API key)++For searching a locally running Zotero desktop app (including full-text PDF search), use the CLI or MCP server instead of the Web API. Both require Zotero 7 with local API access enabled. See [references/cli.md](references/cli.md) and [references/mcp.md](references/mcp.md).diff --git a/scientific-skills/pyzotero/references/authentication.md b/scientific-skills/pyzotero/references/authentication.mdindex cd19f974..33b3e579 100644--- a/scientific-skills/pyzotero/references/authentication.md+++ b/scientific-skills/pyzotero/references/authentication.md@@ -1,25 +1,29 @@# Authentication & Setup+> **Security:** Never hardcode API keys in source code or commit them to version control. Use environment variables or a `.env` file scoped to `ZOTERO_*` keys only. Placeholder values like `ABC1234XYZ` below are illustrative — substitute your real credentials from env vars.+## Credentials-Obtain from https://www.zotero.org/settings/keys:+Obtain from https://www.zotero.org/settings/keys (or create a key at https://www.zotero.org/settings/keys/new):| Credential | Where to Find ||-----------|---------------|| **User ID** | "Your userID for use in API calls" section |-| **API Key** | Create new key at /settings/keys/new |+| **API Key** | Create new key at /settings/keys/new, or via Settings → Security → Applications → "Create new key" at https://www.zotero.org/settings/security || **Group Library ID** | Integer after `/groups/` in group URL (e.g. `https://www.zotero.org/groups/169947`) |-## Environment Variables+## Environment Variables (recommended)Store in `.env` or export in shell:+```ZOTERO_LIBRARY_ID=436-ZOTERO_API_KEY=ABC1234XYZ+ZOTERO_API_KEY=your_api_key_hereZOTERO_LIBRARY_TYPE=user```Load in Python:+```pythonimport osfrom dotenv import load_dotenv@@ -29,19 +33,25 @@ load_dotenv()zot = Zotero(library_id=os.environ['ZOTERO_LIBRARY_ID'],- library_type=os.environ['ZOTERO_LIBRARY_TYPE'],- api_key=os.environ['ZOTERO_API_KEY']+ library_type=os.environ.get('ZOTERO_LIBRARY_TYPE', 'user'),+ api_key=os.environ['ZOTERO_API_KEY'],)```## Library Types```python+import os+# Personal library-zot = Zotero('436', 'user', 'ABC1234XYZ')+zot = Zotero(+ os.environ['ZOTERO_LIBRARY_ID'],+ 'user',+ os.environ['ZOTERO_API_KEY'],+)-# Group library-zot = Zotero('169947', 'group', 'ABC1234XYZ')+# Group library — use the group ID as library_id+zot = Zotero('169947', 'group', os.environ['ZOTERO_API_KEY'])```**Important**: A `Zotero` instance is bound to a single library. To access multiple libraries, create multiple instances.@@ -55,13 +65,15 @@ zot = Zotero(library_id='436', library_type='user', local=True)items = zot.items(limit=10) # reads from local Zotero```+For Zotero 7, enable local API access: Settings → Advanced → "Allow other applications on this computer to communicate with Zotero". See [cli.md](cli.md) and [mcp.md](mcp.md) for richer local access.+## Optional Parameters```pythonzot = Zotero(- library_id='436',+ library_id=os.environ['ZOTERO_LIBRARY_ID'],library_type='user',- api_key='ABC1234XYZ',+ api_key=os.environ['ZOTERO_API_KEY'],preserve_json_order=True, # use OrderedDict for JSON responseslocale='en-US', # localise field names (e.g. 'fr-FR' for French))@@ -70,12 +82,14 @@ zot = Zotero(## Key PermissionsCheck what the current API key can access:+```pythoninfo = zot.key_info()# Returns dict with user info and group access permissions```Check accessible groups:+```pythongroups = zot.groups()# Returns list of group libraries accessible to the current key@@ -84,6 +98,7 @@ groups = zot.groups()## API Key ScopesWhen creating an API key at https://www.zotero.org/settings/keys/new, choose appropriate permissions:+- **Read Only**: For retrieving items and collections- **Write Access**: For creating, updating, and deleting items- **Notes Access**: To include notes in read/write operationsdiff --git a/scientific-skills/pyzotero/references/cli.md b/scientific-skills/pyzotero/references/cli.mdindex ba4a7d62..b4de2c73 100644--- a/scientific-skills/pyzotero/references/cli.md+++ b/scientific-skills/pyzotero/references/cli.md@@ -1,6 +1,8 @@# Command-Line Interface-The pyzotero CLI connects to your **local Zotero installation** (not the remote API). It requires a running local Zotero desktop app.+The pyzotero CLI connects to your **local Zotero 7 installation** (not the remote Web API). It requires a running Zotero desktop app with local API access enabled:++**Zotero → Settings → Advanced → Allow other applications on this computer to communicate with Zotero**## Installationdiff --git a/scientific-skills/pyzotero/references/error-handling.md b/scientific-skills/pyzotero/references/error-handling.mdindex 159896b6..e81cd96d 100644--- a/scientific-skills/pyzotero/references/error-handling.md+++ b/scientific-skills/pyzotero/references/error-handling.md@@ -28,8 +28,13 @@ Common exceptions:```pythonfrom pyzotero import Zoterofrom pyzotero import zotero_errors+import os-zot = Zotero('123456', 'user', 'APIKEY')+zot = Zotero(+ os.environ['ZOTERO_LIBRARY_ID'],+ os.environ.get('ZOTERO_LIBRARY_TYPE', 'user'),+ os.environ['ZOTERO_API_KEY'],+)try:item = zot.item('BADKEY')diff --git a/scientific-skills/pyzotero/references/exports.md b/scientific-skills/pyzotero/references/exports.mdindex b7e246d0..056f4db7 100644--- a/scientific-skills/pyzotero/references/exports.md+++ b/scientific-skills/pyzotero/references/exports.md@@ -74,7 +74,7 @@ Set `content` to any Zotero export format:| BibLaTeX | `'biblatex'` | list of unicode strings || Wikipedia Citation Templates | `'wikipedia'` | list of unicode strings |-**Note**: When using an export format as `content`, you must provide a `limit` parameter. Multiple simultaneous format retrieval is not supported.+**Note**: When using an export format as `content`, you must provide a `limit` parameter. Multiple simultaneous export formats are not supported.```python# Export as RISdiff --git a/scientific-skills/pyzotero/references/mcp.md b/scientific-skills/pyzotero/references/mcp.mdnew file mode 100644index 00000000..659bdfe8--- /dev/null+++ b/scientific-skills/pyzotero/references/mcp.md@@ -0,0 +1,90 @@+# MCP Server++Pyzotero 1.12+ ships an optional [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server that exposes your **local Zotero library** and Semantic Scholar integration as tools for LLM clients (e.g., Claude Desktop).++## Requirements++- **Zotero 7** with local API access enabled:+ - Zotero → Settings → Advanced → **Allow other applications on this computer to communicate with Zotero**+- Python 3.10+ (required by `pyzotero[mcp]`)++The MCP server reads from your local Zotero installation — it does not use the remote Web API or an API key.++## Installation++```bash+# In a project+uv add "pyzotero[mcp]"++# As a standalone tool+uv tool install "pyzotero[mcp]"+```++Run without installing:++```bash+uvx --from "pyzotero[mcp]" pyzotero-mcp+```++## Claude Desktop Configuration++Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):++**If `pyzotero-mcp` is installed:**++```json+{+ "mcpServers": {+ "zotero": {+ "command": "pyzotero-mcp"+ }+ }+}+```++**Without installing (via uvx):**++```json+{+ "mcpServers": {+ "zotero": {+ "command": "uvx",+ "args": ["--from", "pyzotero[mcp]", "pyzotero-mcp"]+ }+ }+}+```++## Available Tools++### Zotero Library Tools++| Tool | Description |+|------|-------------|+| `search` | Search the local library by query, item type, collection, tag, or full-text content |+| `get_item` | Get a single item by key |+| `get_children` | Get child items (attachments, notes) of an item |+| `list_collections` | List all collections |+| `list_tags` | List all tags, optionally filtered by collection |+| `get_fulltext` | Get full-text content of a PDF or other attachment |++### Semantic Scholar Tools++| Tool | Description |+|------|-------------|+| `find_related` | Find semantically similar papers (SPECTER2 embeddings) |+| `get_citations` | Find papers that cite a given paper |+| `get_references` | Find papers referenced by a given paper |+| `search_semantic_scholar` | Search Semantic Scholar's paper index |++Semantic Scholar tools can optionally check whether results already exist in your local Zotero library (`check_library` parameter, enabled by default).++## MCP vs Web API vs CLI++| Mode | Access | API key | Best for |+|------|--------|---------|----------|+| Web API (`Zotero(...)`) | Remote library sync | Required | Automation, bulk CRUD, group libraries |+| CLI (`pyzotero[cli]`) | Local Zotero 7 | Not required | Shell scripts, quick local search |+| MCP (`pyzotero[mcp]`) | Local Zotero 7 | Not required | LLM agents in sandboxed apps |++For remote library management from Python, use the Web API client documented in the other reference files. Use MCP or CLI when you need fast access to locally indexed PDFs and full-text search without network calls.diff --git a/uv.lock b/uv.lockindex 082c2c46..7712320b 100644--- a/uv.lock+++ b/uv.lock@@ -1668,7 +1668,7 @@ wheels = [[[package]]name = "scientific-agent-skills"-version = "2.40.0"+version = "2.42.0"source = { virtual = "." }dependencies = [{ name = "cisco-ai-skill-scanner" },