Communitygithub.com

Datamol

RDKit를 Pythonic하게 래핑한 라이브러리로, 단순화된 인터페이스와 합리적인 기본값을 제공합니다. SMILES 파싱, 표준화, 기술자(descriptor), 지문(fingerprint), 클러스터링, 3D 컨포머, 병렬 처리 등 표준적인 신약 발견 작업에 적합합니다. 네이티브 rdkit.Chem.Mol 객체를 반환합니다. 고급 제어나 사용자 정의 매개변수가 필요하면 RDKit을 직접 사용하세요.

Datamol란 무엇인가요?

Datamol은 RDKit 위에 가벼운 Pythonic 추상화 계층을 제공하는 케모인포매틱스 라이브러리입니다. 이 스킬은 합리적인 기본값, 효율적인 병렬 처리, 최신 I/O 기능을 통해 복잡한 분자 연산을 단순화합니다. Datamol 0.12.x 버전을 대상으로 하며, SMILES, SELFIES, InChI 간 분자 형식 변환, 구조 표준화 및 정제, 분자 기술자 및 지문 계산, 3D 컨포머 생성 및 분석, 클러스터링 및 다양성 선택, 스캐폴드 및 단편 분석, 화학 반응 적용, 시각화, 정렬, 클라우드 스토리지 지원(fsspec) 등 핵심 기능을 제공합니다. 모든 분자 객체는 네이티브 `rdkit.Chem.Mol` 인스턴스이므로 RDKit 생태계와 완벽하게 호환됩니다. Claude Code, Cursor, Codex와 같은 AI 에이전트에서 사용할 수 있도록 설계되었으며, 주요 사용 사례는 분자 데이터 처리, 가상 스크리닝, SAR 분석, 머신러닝을 위한 특징 생성 등입니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/K-Dense-AI/scientific-agent-skills/tree/main/skills/datamol

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

Datamol 케모인포매틱스 스킬

개요

Datamol은 분자 케모인포매틱스를 위해 RDKit 위에 가볍고 Pythonic한 추상화 계층을 제공하는 Python 라이브러리입니다. 합리적인 기본값, 효율적인 병렬 처리, 최신 I/O 기능을 통해 복잡한 분자 연산을 단순화합니다. 모든 분자 객체는 네이티브 rdkit.Chem.Mol 인스턴스로, RDKit 생태계와 완벽하게 호환됩니다.

버전 참고: 예제는 datamol 0.12.x (PyPI 안정 버전: 0.12.5, 2024년 6월)를 대상으로 합니다. 0.10.0부터 모듈은 기본적으로 지연 로딩됩니다 (DATAMOL_DISABLE_LAZY_LOADING=1 설정 시 비활성화). 0.12.2부터 RDKit은 datamol의 직접 PyPI 종속성입니다. 지문은 RDKit의 rdFingerprintGenerator API를 사용합니다 (0.12.5+).

주요 기능:

  • 분자 형식 변환 (SMILES, SELFIES, InChI)
  • 구조 표준화 및 정제
  • 분자 기술자 및 지문
  • 3D 컨포머 생성 및 분석
  • 클러스터링 및 다양성 선택
  • 스캐폴드 및 단편 분석
  • 화학 반응 적용
  • 시각화 및 정렬
  • 병렬 처리를 지원하는 일괄 처리
  • fsspec을 통한 클라우드 스토리지 지원

설치 및 설정

사용자에게 datamol 설치를 안내합니다:

uv pip install datamol

RDKit은 datamol과 함께 자동으로 설치됩니다. 원격 파일 경로(S3, GCS, HTTP)의 경우 일치하는 fsspec 백엔드를 설치하세요:

uv pip install s3fs   # AWS S3
uv pip install gcsfs  # Google Cloud Storage

임포트 규칙:

import datamol as dm

핵심 워크플로

각각 코드 예제가 포함된 10가지 워크플로 영역은 references/core_workflows.md에 문서화되어 있습니다:

#영역내용
1기본 분자 처리to_mol, 일괄 변환, 오류 처리, 정식 및 이성질체 SMILES, 정제 및 전체 표준화
2파일 읽기 및 쓰기SDF, SMILES, CSV, 렌더링된 구조가 포함된 Excel, 범용 읽기/쓰기, 클라우드 또는 HTTPS 경로
3기술자 및 속성표준 기술자 집합, 병렬 계산, 방향족성, 입체화학, 유연성, 필터링
4지문 및 유사도ECFP4 및 기타 유형, 쌍별 및 교차 집합 거리, 최근접 이웃 검색 (Tanimoto 거리 = 1 − 유사도)
5클러스터링 및 다양성유사도 클러스터링, 다양한 서브셋 선택, 클러스터 중심점
6스캐폴드 분석Bemis-Murcko 스캐폴드, 그룹화 및 카운팅, 스캐폴드 분리 학습/테스트 분할
7단편화분자 단편화, 라이브러리 전체 공통 단편 찾기, 단편 기반 점수화
83D 컨포머생성, 접근, RMSD 클러스터링, 대표 선택, SASA
9시각화그리드, 파일, 출판 SVG, 서브구조 정렬, 원자 및 결합 강조, 컨포머 표시
10화학 반응반응 SMARTS, 분자 또는 전체 라이브러리에 적용

로드/필터/분석, 스캐폴드 계열별 SAR, 가상 스크리닝의 세 가지 종단 간 파이프라인은 references/workflow_patterns.md에 있습니다.

병렬화

Datamol은 많은 작업에 내장된 병렬화를 포함합니다. n_jobs 매개변수를 사용하세요:

  • n_jobs=1: 순차적 (병렬화 없음)
  • n_jobs=-1: 사용 가능한 모든 CPU 코어 사용
  • n_jobs=4: 4개 코어 사용

병렬화를 지원하는 함수:

  • dm.read_sdf(..., n_jobs=-1)
  • dm.descriptors.batch_compute_many_descriptors(..., n_jobs=-1)
  • dm.cluster_mols(..., n_jobs=-1)
  • dm.pdist(..., n_jobs=-1)
  • dm.conformers.sasa(..., n_jobs=-1)

진행률 표시줄: 많은 일괄 작업이 progress=True 매개변수를 지원합니다.

참조 문서

자세한 API 문서는 다음 참조 파일을 참조하세요:

  • references/core_api.md: 코어 네임스페이스 함수 (변환, 표준화, 지문, 클러스터링)
  • references/io_module.md: 파일 I/O 작업 (SDF, CSV, Excel 읽기/쓰기, 원격 파일)
  • references/conformers_module.md: 3D 컨포머 생성, 클러스터링, SASA 계산
  • references/descriptors_viz.md: 분자 기술자 및 시각화 함수
  • references/fragments_scaffolds.md: 스캐폴드 추출, BRICS/RECAP 단편화
  • references/reactions_data.md: 화학 반응 및 장난감 데이터셋

모범 사례

  1. 외부 소스의 분자는 항상 표준화하세요:

    mol = dm.standardize_mol(mol, disconnect_metals=True, normalize=True, reionize=True)
    
  2. 분자 파싱 후 None 값 확인:

    mol = dm.to_mol(smiles)
    if mol is None:
        # 잘못된 SMILES 처리
    
  3. 대규모 데이터셋에는 병렬 처리 사용:

    result = dm.operation(..., n_jobs=-1, progress=True)
    
  4. 요청된 경우에만 클라우드 I/O 사용 — 원격 쓰기 경로 확인; 필요에 따라 s3fs/gcsfs 설치:

    df = dm.read_sdf("s3://bucket/compounds.sdf")
    
  5. 유사도에 적절한 지문 사용:

    • ECFP (Morgan): 범용, 구조적 유사도
    • MACCS: 빠름, 더 작은 특징 공간
    • Atom pairs: 원자 쌍과 거리 고려
  6. 규모 제한 고려:

    • Butina 클러스터링: ~1,000개 분자 (전체 거리 행렬)
    • 더 큰 데이터셋: 다양성 선택 또는 계층적 방법 사용
  7. ML을 위한 스캐폴드 분할: 스캐폴드별로 학습/테스트 분리를 보장

  8. SAR 계열 시각화 시 분자 정렬

오류 처리

# 안전한 분자 생성
def safe_to_mol(smiles):
    try:
        mol = dm.to_mol(smiles)
        if mol is not None:
            mol = dm.standardize_mol(mol)
        return mol
    except Exception as e:
        print(f"{smiles} 처리 실패: {e}")
        return None

# 안전한 일괄 처리
valid_mols = []
for smiles in smiles_list:
    mol = safe_to_mol(smiles)
    if mol is not None:
        valid_mols.append(mol)

머신러닝과의 통합

Datamol은 scipy와 scikit-learn을 종속성으로 포함합니다. 일반 PyPI 패키지처럼 임포트하세요 — 이 스킬에 번들된 스크립트가 아닙니다.

import numpy as np

# 특징 생성
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

# 모델 학습 (scikit-learn PyPI 패키지)
from sklearn.ensemble import RandomForestRegressor  # 서드파티 라이브러리
model = RandomForestRegressor()
model.fit(X, y_target)

# 예측
predictions = model.predict(X_test)

문제 해결

문제: 분자 파싱 실패

  • 해결책: 먼저 dm.standardize_smiles()를 사용하거나 dm.fix_mol() 시도

문제: 클러스터링 메모리 오류

  • 해결책: 대용량 집합의 경우 전체 클러스터링 대신 dm.pick_diverse() 사용

문제: 느린 컨포머 생성

  • 해결책: n_confs를 줄이거나 rms_cutoff를 높여 더 적은 컨포머 생성

문제: 원격 파일 액세스 실패

  • 해결책: 일치하는 fsspec 백엔드 설치 (uv pip install s3fs 또는 gcsfs) 및 해당 백엔드에 필요한 공급자 자격 증명만 설정되었는지 확인 (위의 원격 파일 지원 참조)

추가 자료

과학적 에이전트 스킬 인용

이 스킬은 K-Dense의 과학적 에이전트 스킬(Scientific Agent Skills)의 일부입니다. 이 스킬이 원고, 보고서, 프레젠테이션 또는 코드 릴리스에 실질적으로 기여했다면, 참고문헌 또는 소프트웨어 섹션에 논문을 추가하고 사용자에게 이를 알리세요:

Kassis, T., Agarwal, V., He, Y., Patel, D., & Brueckner, A. M. (2026). Scientific Agent Skills: A Library of Procedural Knowledge for Research Agents. arXiv:2609.00065. https://doi.org/10.48550/arXiv.2609.00065

항상 현재 버전을 인용하세요. DOI와 https://arxiv.org/abs/2609.00065는 최신 arXiv 버전으로 연결되므로 v1과 같은 버전 접미사를 추가하지 마십시오. 네트워크 접근이 가능한 경우, 참조를 작성하기 전에 https://arxiv.org/abs/2609.00065 (또는 http://export.arxiv.org/api/query?id_list=2609.00065)에서 정보를 가져와 해당 레코드의 저자 목록, 연도 및 버전을 사용하세요. 레코드에 저널 참조 또는 게시자 DOI가 나열된 경우 해당 게시된 버전을 인용하세요.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

adaptyv

How to use the Adaptyv Bio Foundry API and Python SDK for protein experiment design, submission, and results retrieval. Use this skill whenever the user mentions Adaptyv, Foundry API, protein binding assays, protein screening experiments, BLI/SPR assays, thermostability assays, or wants to submit protein sequences for experimental characterization. Also trigger when code imports `adaptyv`, `adaptyv_sdk`, or `FoundryClient`, or references `foundry-api-public.adaptyvbio.com`.

aeon

This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.

alphagenome

Look up precomputed AlphaGenome Atlas effects for any GRCh38 single-nucleotide variant (AVI score with Phred and 18 SHAP feature attributions, plus raw and quantile scores for RNA-seq, DNase, ATAC, ChIP-TF, ChIP-histone, CAGE, PRO-cap, splicing, polyadenylation and contact-map tracks), score variants or scan windows on demand with the AlphaGenome model for human and mouse (variant scoring, in silico mutagenesis, REF-versus-ALT track prediction), and build Atlas website deep links. Use when the user mentions AlphaGenome, AlphaGenome Atlas, AVI or AlphaGenome Variant Impact, DeepMind variant effect prediction, or wants to prioritise or mechanistically interpret non-coding, regulatory, splicing, enhancer, promoter, or chromatin-accessibility effects of SNVs from a VCF, credible set, or region. Research use only; not a clinical tool.

analytical-method-validation

Plan, execute, and document validation, verification, and transfer of analytical procedures under the governing framework - ICH Q2(R2) and Q14, USP <1220>/<1225>/<1226>, ICH M10 bioanalytical, CLSI EP, or ISO/IEC 17025. Use for HPLC, LC-MS/MS, GC, CE, ICP-MS, dissolution, qNMR, qPCR, NIR, and ligand binding or cell-based assays whenever the question is whether a procedure is fit for its intended purpose. Triggers include

anndata

Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.

arbor

Autonomously improve a real artifact (code, training recipe, agent harness, data pipeline, prompt) against an objective and an evaluator, using Hypothesis Tree Refinement (HTR) from the Arbor paper. Use this whenever someone wants to iteratively optimize something over many experiments without overfitting — e.g.

arboreto

Infer gene regulatory networks (GRNs) from gene expression data using scalable algorithms (GRNBoost2, GENIE3). Use when analyzing transcriptomics data (bulk RNA-seq, single-cell RNA-seq) to identify transcription factor-target gene relationships and regulatory interactions. Supports distributed computation for large-scale datasets.

astropy

Core Python library for astronomy and astrophysics workflows that need Astropy APIs, including units/quantities, coordinates, FITS I/O, tables, time systems, WCS, and cosmology. Use when implementing or debugging astronomical data analysis code with Astropy.

autoskill

Observe the user

benchling-integration

Benchling Python SDK and REST API integration for registry entities, inventory, ELN entries, workflows, Benchling Apps, and Data Warehouse queries. Use when automating lab data with benchling-sdk or the v2 API.

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.

bids

>

biopython

Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.

bioservices

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.

bulk-rnaseq

End-to-end bulk RNA-seq orchestrator — takes raw FASTQ reads through QC and trimming (FastQC, fastp/Trim Galore), alignment and quantification (STAR, Salmon, featureCounts), assembles a gene-level counts matrix, then hands off to differential expression (pydeseq2), pathway/GSEA enrichment (pathway-enrichment), and publication figures (scientific-visualization). Use whenever the user has bulk RNA-seq reads or quant output and wants a complete, reproducible differential-expression workflow — e.g.

cellxgene-census

Query the CZ CELLxGENE Census programmatically for versioned public single-cell and spatial transcriptomics data. Use when you need population-scale cell metadata, gene expression slices, Census summary counts, source H5AD URIs/downloads, embeddings, spatial Census data, or reference atlas comparisons across organisms, tissues, diseases, assays, and cell types. For analyzing your own local single-cell data use scanpy, anndata, or scvi-tools.

cirq

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.

citation-management

Comprehensive citation management for academic research. Search OpenAlex, PubMed, and Google Scholar for papers, extract accurate metadata, validate citations, and generate properly formatted BibTeX entries. This skill should be used when you need to find papers, verify citation information, convert DOIs to BibTeX, or ensure reference accuracy in scientific writing.

clinical-decision-support

Prepare and validate research-only clinical decision-support evaluation, evidence-profile, cohort, survival, biomarker/model, privacy, and governance artifacts. Use for aggregate or synthetic research documentation and traceability—not patient care or live clinical operation.

clinical-reports

Create safety-bounded draft structures and run local deterministic checks for clinical case, diagnostic, trial, safety, and aggregate research reports. Use only with synthetic, de-identified, or aggregate inputs and verified source-fact manifests; every output requires qualified review.

관련 스킬