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 Biopython and Datamol documentation
Timothy Kassis659ab860c907
diff --git a/scientific-skills/biopython/SKILL.md b/scientific-skills/biopython/SKILL.mdindex ddda8c19..720a1485 100644--- a/scientific-skills/biopython/SKILL.md+++ b/scientific-skills/biopython/SKILL.md@@ -10,7 +10,7 @@ metadata:## Overview-Biopython is a comprehensive set of freely available Python tools for biological computation. It provides functionality for sequence manipulation, file I/O, database access, structural bioinformatics, phylogenetics, and many other bioinformatics tasks. The current version is **Biopython 1.85** (released January 2025), which supports Python 3 and requires NumPy.+Biopython is a comprehensive set of freely available Python tools for biological computation. It provides functionality for sequence manipulation, file I/O, database access, structural bioinformatics, phylogenetics, and many other bioinformatics tasks. The current version is **Biopython 1.87** (released March 2026). It requires **Python 3.10+** and NumPy.## When to Use This Skill@@ -43,20 +43,23 @@ Biopython is organized into modular sub-packages, each addressing specific bioin## Installation and Setup-Install Biopython using pip (requires Python 3 and NumPy):+Install Biopython (requires Python 3.10+ and NumPy):-```python+```bashuv pip install biopython```-For NCBI database access, always set your email address (required by NCBI):+For NCBI database access, always set your email address (required by NCBI). For higher rate limits (10 req/s instead of 3 req/s), read `NCBI_API_KEY` from the environment — do not hardcode keys:```python+import osfrom Bio import Entrez-Entrez.email = "[email protected]"-# Optional: API key for higher rate limits (10 req/s instead of 3 req/s)-Entrez.api_key = "your_api_key_here"+Entrez.email = "[email protected]" # required — use your real email++# Optional: register at https://www.ncbi.nlm.nih.gov/account/settings/+if api_key := os.environ.get("NCBI_API_KEY"):+ Entrez.api_key = api_key```## Using This Skill@@ -262,9 +265,12 @@ Follow these principles when writing Biopython code:from Bio.Seq import Seq```-2. **Set Entrez email** when using NCBI databases+2. **Set Entrez email** when using NCBI databases; load `NCBI_API_KEY` from the environment if present```python+ import osEntrez.email = "[email protected]"+ if api_key := os.environ.get("NCBI_API_KEY"):+ Entrez.api_key = api_key```3. **Use appropriate file formats** - Check which format best suits the task@@ -404,6 +410,12 @@ Phylo.draw_ascii(tree)### Issue: PDB parser warnings**Solution:** Use `PDBParser(QUIET=True)` to suppress warnings, or investigate structure quality.+### Issue: ImportError for Bio.HMM, Bio.MarkovModel, or Bio.Application+**Solution:** These modules were removed in Biopython 1.86. Use [hmmlearn](https://pypi.org/project/hmmlearn/) for HMMs and the standard library `subprocess` module instead of `Bio.Application` CLI wrappers.++### Issue: PairwiseAligner returns fewer alignments after upgrading to 1.86++**Solution:** The default gap score changed from 0 to -1 in 1.86, eliminating trivial tie alignments. Set `aligner.gap_score = 0` to restore the old behavior if needed (see `references/alignment.md`).+## Additional Resources- **Official Documentation**: https://biopython.org/docs/latest/diff --git a/scientific-skills/biopython/references/advanced.md b/scientific-skills/biopython/references/advanced.mdindex 3525cf1e..02fef358 100644--- a/scientific-skills/biopython/references/advanced.md+++ b/scientific-skills/biopython/references/advanced.md@@ -326,9 +326,9 @@ gd_diagram.write("genome_diagram.pdf", "PDF")## Sequence Comparison with Bio.pairwise2-**Note**: Bio.pairwise2 is deprecated. Use Bio.Align.PairwiseAligner instead (see alignment.md).+**Note**: `Bio.pairwise2` is deprecated — use `Bio.Align.PairwiseAligner` instead (see `alignment.md`). For HMM workflows, `Bio.HMM` and `Bio.MarkovModel` were removed in Biopython 1.86; use [hmmlearn](https://pypi.org/project/hmmlearn/) instead.-However, for legacy code:+Legacy `pairwise2` example (avoid in new code):```pythonfrom Bio import pairwise2diff --git a/scientific-skills/biopython/references/alignment.md b/scientific-skills/biopython/references/alignment.mdindex e8fed832..2a45961e 100644--- a/scientific-skills/biopython/references/alignment.md+++ b/scientific-skills/biopython/references/alignment.md@@ -18,10 +18,16 @@ from Bio import Align# Create aligner with default parametersaligner = Align.PairwiseAligner()-# Default scores (as of Biopython 1.85+):+# Default scores (as of Biopython 1.86+):# - Match score: +1.0# - Mismatch score: 0.0-# - All gap scores: -1.0+# - All gap scores: -1.0 (changed from 0 in 1.86 to avoid trivial tie alignments)+```++**Note (1.86+):** The default gap score changed from 0 to -1. Previously, mismatches and gap combinations could score 0, producing many logically equivalent alignments. To restore pre-1.86 behavior:++```python+aligner.gap_score = 0```### Customizing Alignment Parametersdiff --git a/scientific-skills/biopython/references/databases.md b/scientific-skills/biopython/references/databases.mdindex 5d293f78..75c271e9 100644--- a/scientific-skills/biopython/references/databases.md+++ b/scientific-skills/biopython/references/databases.md@@ -19,11 +19,14 @@ Entrez.email = "[email protected]"### API Key (Recommended)-Using an API key increases rate limits from 3 to 10 requests per second:+Using an API key increases rate limits from 3 to 10 requests per second. Register at https://www.ncbi.nlm.nih.gov/account/settings/ and read the key from the environment — do not hardcode it:```python-# Get API key from: https://www.ncbi.nlm.nih.gov/account/settings/-Entrez.api_key = "your_api_key_here"+import os++# Check NCBI_API_KEY from the environment (or export it before running)+if api_key := os.environ.get("NCBI_API_KEY"):+ Entrez.api_key = api_key```### Rate Limiting@@ -393,7 +396,7 @@ handle.close()## Best Practices1. **Always set Entrez.email** - Required by NCBI-2. **Use API key** for higher rate limits (10 req/s vs 3 req/s)+2. **Use `NCBI_API_KEY` from the environment** for higher rate limits (10 req/s vs 3 req/s); never hardcode keys3. **Close handles** after reading to free resources4. **Batch large requests** - Use retstart and retmax for pagination5. **Use WebEnv for large downloads** - Store results on serverdiff --git a/scientific-skills/datamol/SKILL.md b/scientific-skills/datamol/SKILL.mdindex bf48f473..70e94efb 100644--- a/scientific-skills/datamol/SKILL.md+++ b/scientific-skills/datamol/SKILL.md@@ -2,6 +2,8 @@name: datamoldescription: Pythonic wrapper around RDKit with simplified interface and sensible defaults. Preferred for standard drug discovery including SMILES parsing, standardization, descriptors, fingerprints, clustering, 3D conformers, parallel processing. Returns native rdkit.Chem.Mol objects. For advanced control or custom parameters, use rdkit directly.license: Apache-2.0 license+allowed-tools: Read Write Edit Bash+compatibility: Requires Python 3.8+ and datamol (uv pip install). RDKit is installed automatically as a datamol dependency (since 0.12.2). Optional s3fs/gcsfs for cloud I/O via fsspec.metadata:skill-author: K-Dense Inc.---@@ -12,6 +14,8 @@ metadata:Datamol is a Python library that provides a lightweight, Pythonic abstraction layer over RDKit for molecular cheminformatics. Simplify complex molecular operations with sensible defaults, efficient parallelization, and modern I/O capabilities. All molecular objects are native `rdkit.Chem.Mol` instances, ensuring full compatibility with the RDKit ecosystem.+**Version note:** Examples target **datamol 0.12.x** (PyPI stable: **0.12.5**, June 2024). Since 0.10.0, modules are lazy-loaded by default (set `DATAMOL_DISABLE_LAZY_LOADING=1` to disable). Since 0.12.2, RDKit is a direct PyPI dependency of datamol. Fingerprints use RDKit's `rdFingerprintGenerator` API (0.12.5+).+**Key capabilities**:- Molecular format conversion (SMILES, SELFIES, InChI)- Structure standardization and sanitization@@ -32,6 +36,13 @@ Guide users to install datamol:uv pip install datamol```+RDKit is installed automatically with datamol. For remote file paths (S3, GCS, HTTP), install the matching fsspec backend:++```bash+uv pip install s3fs # AWS S3+uv pip install gcsfs # Google Cloud Storage+```+**Import convention**:```pythonimport datamol as dm@@ -107,8 +118,9 @@ df = dm.read_csv("data.csv", smiles_column="SMILES", mol_column="mol")# Excel filesdf = dm.read_excel("compounds.xlsx", sheet_name=0, mol_column="mol")-# Universal reader (auto-detects format)-df = dm.open_df("file.sdf") # Works with .sdf, .csv, .xlsx, .parquet, .json+# Universal reader/writer (auto-detects format; supports compression)+df = dm.open_df("file.sdf") # .sdf, .csv, .xlsx, .parquet, .json, .gz, etc.+dm.save_df(df, "output.parquet")```**Writing files**:@@ -125,16 +137,21 @@ dm.to_smi(mols, "output.smi")dm.to_xlsx(df, "output.xlsx", mol_columns=["mol"])```-**Remote file support** (S3, GCS, HTTP):+**Remote file support** (S3, GCS, HTTP via fsspec):++Only use cloud paths when the user explicitly requests them. Confirm the destination before writing.+```python-# Read from cloud storage+# Read from cloud storage or HTTPS (user-provided URLs only)df = dm.read_sdf("s3://bucket/compounds.sdf")df = dm.read_csv("https://example.com/data.csv")-# Write to cloud storage+# Write to cloud storage — confirm path with user firstdm.to_sdf(mols, "s3://bucket/output.sdf")```+Cloud backends read credentials from the standard provider environment (for example `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_DEFAULT_REGION`, or `GOOGLE_APPLICATION_CREDENTIALS`). Datamol passes these to fsspec locally; it does not collect or transmit environment variables to third-party endpoints. Scope credential access to the named provider variables only.+### 3. Molecular Descriptors and PropertiesRefer to `references/descriptors_viz.md` for detailed descriptor documentation.@@ -189,14 +206,18 @@ druglike_mols = [mol for mol in mols if is_druglike(mol)]### 4. Molecular Fingerprints and Similarity**Generating fingerprints**:++Datamol defaults to ECFP6 (`radius=3`, `n_bits=2048`). Pass `radius=2` explicitly for ECFP4.+```python-# ECFP (Extended Connectivity Fingerprint, default)+# ECFP4 (common in similarity screening)fp = dm.to_fp(mol, fp_type='ecfp', radius=2, n_bits=2048)# Other fingerprint typesfp_maccs = dm.to_fp(mol, fp_type='maccs')fp_topological = dm.to_fp(mol, fp_type='topological')fp_atompair = dm.to_fp(mol, fp_type='atompair')+fp_rdkit = dm.to_fp(mol, fp_type='rdkit')```**Similarity calculations**:@@ -207,8 +228,8 @@ distance_matrix = dm.pdist(mols, n_jobs=-1)# Distances between two setsdistances = dm.cdist(query_mols, library_mols, n_jobs=-1)-# Find most similar molecules-from scipy.spatial.distance import squareform+# Find most similar molecules (scipy is a PyPI package, not a file in this skill)+from scipy.spatial.distance import squareform # third-party librarydist_matrix = squareform(dm.pdist(mols))# Lower distance = higher similarity (Tanimoto distance = 1 - Tanimoto similarity)```@@ -566,14 +587,9 @@ for scaffold, group in sar_df.groupby('scaffold'):### Virtual Screening Pipeline```python-# 1. Generate fingerprints for query and library-query_fps = [dm.to_fp(mol) for mol in query_actives]-library_fps = [dm.to_fp(mol) for mol in library_mols]--# 2. Calculate similarities-from scipy.spatial.distance import cdistimport numpy as np+# 1. Calculate Tanimoto distances between query actives and librarydistances = dm.cdist(query_actives, library_mols, n_jobs=-1)# 3. Find closest matches (min distance to any query)@@ -623,7 +639,7 @@ For detailed API documentation, consult these reference files:result = dm.operation(..., n_jobs=-1, progress=True)```-4. **Leverage fsspec** for cloud storage:+4. **Use cloud I/O only when requested** — confirm remote write paths; install `s3fs`/`gcsfs` as needed:```pythondf = dm.read_sdf("s3://bucket/compounds.sdf")```@@ -665,7 +681,11 @@ for smiles in smiles_list:## Integration with Machine Learning+Datamol ships with `scipy` and `scikit-learn` as dependencies. Import them as normal PyPI packages — they are not scripts bundled in this skill.+```python+import numpy as np+# Feature generationX = np.array([dm.to_fp(mol) for mol in mols])@@ -673,8 +693,8 @@ X = np.array([dm.to_fp(mol) for mol in mols])desc_df = dm.descriptors.batch_compute_many_descriptors(mols, n_jobs=-1)X = desc_df.values-# Train model-from sklearn.ensemble import RandomForestRegressor+# Train model (scikit-learn PyPI package)+from sklearn.ensemble import RandomForestRegressor # third-party librarymodel = RandomForestRegressor()model.fit(X, y_target)@@ -694,7 +714,7 @@ predictions = model.predict(X_test)- **Solution**: Reduce `n_confs` or increase `rms_cutoff` to generate fewer conformers**Issue**: Remote file access fails-- **Solution**: Ensure fsspec and appropriate cloud provider libraries are installed (s3fs, gcsfs, etc.)+- **Solution**: Install the matching fsspec backend (`uv pip install s3fs` or `gcsfs`) and verify only the provider credentials needed for that backend are set (see Remote file support above)## Additional Resourcesdiff --git a/scientific-skills/datamol/references/core_api.md b/scientific-skills/datamol/references/core_api.mdindex 12f4627f..67b19f94 100644--- a/scientific-skills/datamol/references/core_api.md+++ b/scientific-skills/datamol/references/core_api.md@@ -60,8 +60,12 @@ Apply SMILES standardization procedures directly to a SMILES string.### `fix_mol(mol)`Attempt to fix molecular structure issues automatically.-### `fix_valence(mol)`-Correct valence errors in molecular structures.+### `fix_valence(mol)` / `fix_valence_charge(mol, inplace=False)`+Correct valence errors in molecular structures (charge-aware variant available).++### `hash_mol(mol, hash_scheme='all')`+Generate a chemistry-aware hash for deduplication (requires RDKit ≥ 2022.09).+- **`hash_scheme`**: `'all'` (default), `'no_stereo'`, or `'no_tautomers'`## Molecular Properties@@ -80,12 +84,14 @@ Add explicit hydrogen atoms to molecular structure.### `to_fp(mol, fp_type='ecfp', ...)`Generate molecular fingerprints for similarity calculations.- **Fingerprint types**:- - `'ecfp'` - Extended Connectivity Fingerprints (Morgan)- - `'fcfp'` - Functional Connectivity Fingerprints+ - `'ecfp'` / `'fcfp'` - Morgan fingerprints (default radius 3 for ECFP6; pass `radius=2` for ECFP4)- `'maccs'` - MACCS keys- `'topological'` - Topological fingerprints- `'atompair'` - Atom pair fingerprints-- **Common parameters**: `n_bits`, `radius`+ - `'rdkit'` - RDKit topological fingerprint+ - Count variants: `'ecfp-count'`, `'fcfp-count'`, `'atompair-count'`, etc.+- **Implementation**: Uses RDKit `rdFingerprintGenerator` (datamol ≥ 0.12.5)+- **Common parameters**: `n_bits` (default 2048), `radius`- **Returns**: Numpy array or RDKit fingerprint object### `pdist(mols, ...)`diff --git a/scientific-skills/datamol/references/io_module.md b/scientific-skills/datamol/references/io_module.mdindex 71e50270..934c6555 100644--- a/scientific-skills/datamol/references/io_module.md+++ b/scientific-skills/datamol/references/io_module.md@@ -49,8 +49,8 @@ Parse PDB block string.### `dm.open_df(filename, ...)`Universal DataFrame reader - automatically detects format.-- **Supported formats**: CSV, Excel, Parquet, JSON, SDF-- **Example**: `df = dm.open_df("data.csv")` or `df = dm.open_df("molecules.sdf")`+- **Supported formats**: CSV, Excel, Parquet, JSON, SDF (including compressed files such as `.gz`)+- **Example**: `df = dm.open_df("data.csv")` or `df = dm.open_df("molecules.sdf.gz")`## Writing Molecular Files@@ -87,16 +87,19 @@ Convert molecule to MOL block string.Convert molecule to PDB block string.### `dm.save_df(df, filename, ...)`-Save DataFrame in multiple formats (CSV, Excel, Parquet, JSON).+Save DataFrame in multiple formats (CSV, Excel, Parquet, JSON). Auto-detects format from the file extension; supports compression (added in datamol 0.10.0).## Remote File SupportAll I/O functions support remote file paths through fsspec integration:- **Supported protocols**: S3 (AWS), GCS (Google Cloud), Azure, HTTP/HTTPS+- **Optional backends**: `uv pip install s3fs` (S3), `uv pip install gcsfs` (GCS)+- **Credentials**: Standard provider environment variables only (`AWS_*`, `GOOGLE_APPLICATION_CREDENTIALS`, etc.). Datamol uses fsspec locally; confirm remote write paths with the user before saving.- **Example**:```pythondm.read_sdf("s3://bucket/compounds.sdf")dm.read_csv("https://example.com/data.csv")+ dm.save_df(df, "s3://bucket/output.parquet") # confirm destination first```## Key Parameters Across Functionsdiff --git a/scientific-skills/datamol/references/reactions_data.md b/scientific-skills/datamol/references/reactions_data.mdindex e351d2fd..0689e37b 100644--- a/scientific-skills/datamol/references/reactions_data.md+++ b/scientific-skills/datamol/references/reactions_data.md@@ -196,8 +196,8 @@ test = sol_df[sol_df['split'] == 'test']X_train = dm.to_fp(train['mol'])X_test = dm.to_fp(test['mol'])-# Model training (example)-from sklearn.ensemble import RandomForestRegressor+# Model training (example; scikit-learn is a PyPI dependency, not a bundled skill script)+from sklearn.ensemble import RandomForestRegressor # third-party librarymodel = RandomForestRegressor()model.fit(X_train, train['solubility'])predictions = model.predict(X_test)