AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Sar Analyzer

skill-qinsizheng-sar-analyzer-skill-sar-analyzer-skill · by qinsizheng

>

No reviews yet
0 installs
25 views
0.0% view→install

Install

$ agentstack add skill-qinsizheng-sar-analyzer-skill-sar-analyzer-skill

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-qinsizheng-sar-analyzer-skill-sar-analyzer-skill)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
7mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Sar Analyzer? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

SAR Analyzer Skill

Overview

The SAR Analyzer skill provides a complete computational workflow for Structure-Activity Relationship (SAR) analysis of small molecule libraries. It is designed for medicinal chemists and computational chemists working on drug discovery projects who need to:

  • Identify and cluster molecular scaffolds using Murcko framework extraction
  • Perform R-group decomposition to understand substituent contributions to activity
  • Calculate molecular properties and efficiency metrics (LE, LLE)
  • Generate publication-quality SAR tables with chemical structures
  • Visualize potency-lipophilicity relationships and scaffold comparisons
  • Identify optimal compounds and prioritize scaffolds for further optimization

This skill integrates RDKit-based cheminformatics with statistical analysis and visualization to provide actionable insights for medicinal chemistry campaigns.


When to Use This Skill

Use the SAR Analyzer skill when the user requests:

  • SAR analysis of a compound library
  • Scaffold identification or clustering
  • R-group decomposition or substituent analysis
  • Molecular property calculations (MW, cLogP, TPSA, etc.)
  • Ligand efficiency (LE) or lipophilic ligand efficiency (LLE) calculations
  • Generation of SAR tables with structures
  • Identification of optimal compounds or scaffolds
  • Analysis of structure-activity trends
  • Comparison of chemical series or scaffolds

Typical user queries:

  • "Analyze the SAR of this compound library"
  • "Identify scaffolds and perform R-group decomposition"
  • "Which compounds have the best LLE?"
  • "Generate SAR tables for each scaffold"
  • "What are the key SAR trends in this dataset?"

Required Input Data

The skill expects a CSV file with the following columns:

Mandatory Columns:

  • Example_Number or Compound_ID: Unique identifier for each compound
  • SMILES: Molecular structure in SMILES notation
  • Activity data (at least one):
  • Ki_uM or IC50_uM

Optional Columns:

  • Chemical_Name: Compound name or identifier
  • cLogP: Pre-calculated lipophilicity (will be calculated if missing)
  • Any other experimental data

Data Format Notes:

  • Ki/IC50 values may contain special characters: `, ≥` (will be parsed correctly)
  • Missing activity values are handled gracefully
  • SMILES must be valid and parseable by RDKit

Example Files:

The skill includes example files in the examples/ directory:

  • example_input.csv: Example input file demonstrating the expected CSV format with compound structures (SMILES), activity data (Ki values), and identifiers. Use this as a template for preparing your own compound libraries.
  • Example_SAR_Table.png: Example output showing a publication-quality SAR table for scaffold S1 with R-group decomposition, activity data, and color-coded highlighting. This demonstrates the expected output format when using the SAR table generation workflow.

Note: The workflow using this skill should generate SAR table figures similar to Example_SAR_Table.png, with:

  • Core scaffold structure with labeled R-group positions
  • R-group substituents displayed as chemical structures
  • Activity data columns (Ki values, LLE, cLogP)
  • Color-coded highlighting for top compounds and excellent values
  • Summary statistics

Complete SAR Analysis Workflow

Step 1: Initial Data Loading and Property Calculation

Script: sar_analysis.py

Purpose: Load the CSV data, parse SMILES structures, calculate molecular properties, and compute efficiency metrics.

Usage:

python3 /home/ubuntu/skills/sar-analyzer/scripts/sar_analysis.py 

What it does:

  1. Loads CSV and validates SMILES structures
  2. Parses Ki/IC50 values (handles , ≥ symbols)
  3. Calculates molecular properties:
  • Molecular weight (MW)
  • Lipophilicity (cLogP using Wildman-Crippen)
  • Hydrogen bond acceptors/donors (HBA/HBD)
  • Topological polar surface area (TPSA)
  • Rotatable bonds
  • Heavy atom count
  1. Computes efficiency metrics:
  • pKi = -log₁₀(Ki in M)
  • Ligand Efficiency (LE) = pKi / Heavy Atoms
  • Lipophilic Ligand Efficiency (LLE) = pKi - cLogP
  1. Generates summary statistics

Output: data_with_analysis.csv (full dataset with calculated properties)

Example:

python3 /home/ubuntu/skills/sar-analyzer/scripts/sar_analysis.py Table1_Complete_with_SMILES.csv

Step 2: Scaffold Identification and Clustering

Script: scaffold_analysis.py

Purpose: Generate Murcko scaffolds, cluster compounds by scaffold, and calculate scaffold-level statistics.

Usage:

python3 /home/ubuntu/skills/sar-analyzer/scripts/scaffold_analysis.py

Prerequisites: Must run after sar_analysis.py (requires data_with_analysis.csv)

What it does:

  1. Generates Murcko scaffolds (removes side chains, keeps ring systems)
  2. Clusters compounds by identical scaffold
  3. Identifies major scaffolds (≥5 compounds by default)
  4. Calculates scaffold statistics:
  • Number of compounds per scaffold
  • Mean/median/min/max activity
  • Mean LLE and other properties
  1. Assigns scaffold IDs (S1, S2, S3, etc.)

Outputs:

  • scaffold_statistics.csv: Summary statistics per scaffold
  • scaffold_mapping.csv: Compound-to-scaffold mapping
  • data_with_scaffolds.csv: Full data with scaffold assignments

Customization: Edit the script to change the minimum compound threshold (default: 5)


Step 3: R-Group Decomposition

Script: rgroup_analysis.py

Purpose: Decompose compounds into core scaffold + R-groups to understand substituent contributions.

Usage:

python3 /home/ubuntu/skills/sar-analyzer/scripts/rgroup_analysis.py

Prerequisites: Must run after scaffold_analysis.py

What it does:

  1. For each major scaffold, defines core structure with attachment points
  2. Performs R-group decomposition using RDKit
  3. Extracts R-group SMILES for each position
  4. Maps R-groups to activity data
  5. Identifies SAR trends per R-group position

Output: rgroup_decomposition.csv

Columns:

  • Core: Core scaffold SMILES with attachment points ([:1], [:2], etc.)
  • R1, R2, R3, ...: R-group SMILES for each position
  • Example_Number: Compound identifier
  • Ki_BD1, Ki_BD2, Sum_Ki: Activity data
  • cLogP, Avg_LLE: Physicochemical properties
  • Scaffold_ID: Scaffold identifier (S1, S2, etc.)

Note: The number of R-groups varies by scaffold (typically 4-9 positions)


Step 4: Statistical Analysis and SAR Trends

Script: sar_trends_analysis.py

Purpose: Perform correlation analysis, identify top compounds, and analyze SAR trends.

Usage:

python3 /home/ubuntu/skills/sar-analyzer/scripts/sar_trends_analysis.py

Prerequisites: Requires data_with_analysis.csv and scaffold_statistics.csv

What it does:

  1. Correlation analysis:
  • Pearson and Spearman correlations
  • cLogP vs potency, MW vs potency, etc.
  1. Scaffold comparison:
  • One-way ANOVA or Kruskal-Wallis test
  • Identify significantly different scaffolds
  1. Top compound identification:
  • Best potency (lowest Ki)
  • Best LLE (highest efficiency)
  • Best LE (highest ligand efficiency)
  1. Generates summary statistics

Output: Console output with statistical results (can be redirected to file)


Step 5: Visualization

Script: create_visualizations.py

Purpose: Generate publication-quality figures for SAR analysis.

Usage:

python3 /home/ubuntu/skills/sar-analyzer/scripts/create_visualizations.py

Prerequisites: Requires data_with_analysis.csv and scaffold_statistics.csv

What it does:

  1. Potency vs lipophilicity scatter plot (color-coded by LLE)
  2. Scaffold comparison bar charts (mean Ki, LLE)
  3. Top compounds visualization
  4. Property distribution histograms

Outputs (in /figures/ directory):

  • potency_vs_lipophilicity.png
  • scaffold_comparison.png
  • top_potency_compounds.png
  • Additional figures as needed

Customization: Edit the script to adjust figure size, colors, or add additional plots


Step 6: SAR Table Generation

Scripts:

  • create_s1_s7_tables.py: Generate detailed SAR tables for all major scaffolds (automatically detects all scaffolds)
  • draw_all_scaffolds.py: Generate scaffold structure images
  • draw_all_unique_scaffolds.py: Comprehensive scaffold visualization

Purpose: Create publication-ready SAR tables with structures and activity data.

Usage:

# Generate SAR tables for all major scaffolds (automatically processes all scaffolds in the dataset)
python3 /home/ubuntu/skills/sar-analyzer/scripts/create_s1_s7_tables.py

# Generate scaffold structure images
python3 /home/ubuntu/skills/sar-analyzer/scripts/draw_all_scaffolds.py

# Generate comprehensive scaffold overview
python3 /home/ubuntu/skills/sar-analyzer/scripts/draw_all_unique_scaffolds.py

Prerequisites: Requires rgroup_decomposition.csv

What it does:

  1. Creates SAR tables with:
  • Core scaffold structure with R-group labels
  • R-group substituents for each compound
  • Activity data (Ki, LLE, cLogP)
  • Color-coded highlighting (best compounds in gold, excellent values in green)
  • Summary statistics
  1. Generates high-resolution structure images
  2. Creates scaffold comparison figures

Outputs:

  • SAR_Table_{scaffold_id}_Complete.png for each major scaffold (e.g., SAR_Table_S1_Complete.png, SAR_Table_S2_Complete.png, etc.)
  • {scaffold_id}_Core_Structure.png for each scaffold (e.g., S1_Core_Structure.png, S2_Core_Structure.png, etc.)
  • all_scaffolds_batch*.png (from drawallscaffolds.py)
  • top20_scaffolds_summary.png (from drawallunique_scaffolds.py)

Efficiency Metrics Explained

Ligand Efficiency (LE)

Formula: LE = pKi / Heavy Atom Count

Interpretation:

  • LE > 0.3: Excellent
  • LE 0.25-0.3: Good
  • LE 7.0: Excellent (optimal drug-like properties)
  • LLE 5.0-7.0: Good
  • LLE 3.0-5.0: Moderate
  • LLE 7.0) over raw potency
  • Scaffold comparison: Use statistical tests to confirm differences between scaffolds
  • SAR trends: Look for consistent patterns across multiple R-group positions
  • Outliers: Investigate compounds with unusual properties or activity

5. Visualization

  • Color coding: Use consistent color schemes (e.g., green for good, red for poor)
  • Log scale: Use log scale for activity data (Ki, IC50) in plots
  • Structure images: Ensure structures are large enough to be readable
  • Publication quality: Generate figures at 300 dpi for publication

Common Workflows

Workflow 1: Complete SAR Analysis (Recommended)

Run all scripts in sequence for comprehensive analysis:

# Step 1: Load data and calculate properties
python3 /home/ubuntu/skills/sar-analyzer/scripts/sar_analysis.py input_data.csv

# Step 2: Identify scaffolds
python3 /home/ubuntu/skills/sar-analyzer/scripts/scaffold_analysis.py

# Step 3: R-group decomposition
python3 /home/ubuntu/skills/sar-analyzer/scripts/rgroup_analysis.py

# Step 4: Statistical analysis
python3 /home/ubuntu/skills/sar-analyzer/scripts/sar_trends_analysis.py

# Step 5: Generate visualizations
python3 /home/ubuntu/skills/sar-analyzer/scripts/create_visualizations.py

# Step 6: Create SAR tables
python3 /home/ubuntu/skills/sar-analyzer/scripts/create_s1_s7_tables.py
python3 /home/ubuntu/skills/sar-analyzer/scripts/draw_all_unique_scaffolds.py

Workflow 2: Quick Property Calculation

For rapid property calculation without full SAR analysis:

python3 /home/ubuntu/skills/sar-analyzer/scripts/sar_analysis.py input_data.csv

Output: data_with_analysis.csv with all calculated properties

Workflow 3: Scaffold-Focused Analysis

For projects focused on scaffold hopping or series comparison:

python3 /home/ubuntu/skills/sar-analyzer/scripts/sar_analysis.py input_data.csv
python3 /home/ubuntu/skills/sar-analyzer/scripts/scaffold_analysis.py
python3 /home/ubuntu/skills/sar-analyzer/scripts/draw_all_unique_scaffolds.py

Workflow 4: R-Group SAR Tables Only

If scaffolds are already known and you want detailed R-group tables:

python3 /home/ubuntu/skills/sar-analyzer/scripts/sar_analysis.py input_data.csv
python3 /home/ubuntu/skills/sar-analyzer/scripts/scaffold_analysis.py
python3 /home/ubuntu/skills/sar-analyzer/scripts/rgroup_analysis.py
python3 /home/ubuntu/skills/sar-analyzer/scripts/create_s1_s7_tables.py

Output Files Reference

Data Files

| File | Description | Generated By | |------|-------------|--------------| | data_with_analysis.csv | Full dataset with calculated properties and metrics | sar_analysis.py | | scaffold_statistics.csv | Scaffold-level summary statistics | scaffold_analysis.py | | scaffold_mapping.csv | Compound-to-scaffold mapping | scaffold_analysis.py | | data_with_scaffolds.csv | Full data with scaffold assignments | scaffold_analysis.py | | rgroup_decomposition.csv | R-group analysis results | rgroup_analysis.py |

Figure Files

| File | Description | Generated By | |------|-------------|--------------| | potency_vs_lipophilicity.png | Main SAR plot | create_visualizations.py | | scaffold_comparison.png | Scaffold performance comparison | create_visualizations.py | | top_potency_compounds.png | Best compounds visualization | create_visualizations.py | | SAR_Table_S*_Complete.png | Detailed SAR tables per scaffold | create_s1_s7_tables.py | | S*_Core_Structure.png | High-resolution scaffold images | create_s1_s7_tables.py | | all_scaffolds_batch*.png | Comprehensive scaffold overview | draw_all_unique_scaffolds.py | | top20_scaffolds_summary.png | Top 20 scaffolds summary | draw_all_unique_scaffolds.py |


Troubleshooting

Issue: RDKit cannot parse SMILES

Solution: Check for invalid SMILES strings in the input CSV. Use a SMILES validator or regenerate SMILES from structure files.

Issue: No scaffolds identified

Solution: Reduce the minimum scaffold size threshold in scaffold_analysis.py (default: 5 compounds).

Issue: R-group decomposition fails

Solution: Ensure the core structure is correctly defined with attachment points. Check that compounds actually match the core scaffold.

Issue: Missing activity data

Solution: The scripts handle missing data gracefully. Compounds with missing Ki/IC50 will be excluded from specific analyses but retained in the dataset.

Issue: Memory errors with large datasets

Solution: Process scaffolds separately or reduce image resolution in visualization scripts.

Issue: Figures are too small/large

Solution: Edit the figsize parameter in visualization scripts (e.g., figsize=(12, 8)).


Dependencies

The skill requires the following Python packages:

rdkit>=2023.9.1
pandas>=2.1.0
numpy>=1.24.3
matplotlib>=3.7.2
seaborn>=0.12.2
scipy>=1.11.2

Installation:

sudo pip3 install rdkit pandas numpy matplotlib seaborn scipy

Note: RDKit is pre-installed in the Manus sandbox environment.


Advanced Usage

Customizing Scaffold Definitions

To modify scaffold definitions or add custom cores:

  1. Edit rgroup_analysis.py
  2. Define custom core SMILES with attachment points:

``python core_smiles = "O=c1c2c(ccn1[*:5])C([*:1])=CC1=NN(c3ccc([*:3])cc3[*:4])C3C1=C2NCC3[*:2]" ``

  1. Update the scaffold ID mapping

Adding New Efficiency Metrics

To add custom efficiency metrics:

  1. Edit sar_analysis.py
  2. Add calculation after the LLE section:

``python df['Custom_Metric'] = df['pKi'] - (0.5 * df['cLogP']) + (0.1 * df['TPSA']) ``

  1. Update visualization scripts to include the new metric

Batch Processing Multiple Datasets

To analyze multiple datasets:

for file in *.csv; do
    echo "Processing $file"
    python3 /home/ubuntu/skills/sar-analyzer/scripts/sar_ana

…

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [qinsizheng](https://github.com/qinsizheng)
- **Source:** [qinsizheng/sar-analyzer-skill](https://github.com/qinsizheng/sar-analyzer-skill)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.