본문으로 건너뛰기
Skillpedia
머신러닝51k · #3501

molfeat

하는 일

이 도구는 분자의 구조 같은 화학 정보를 컴퓨터가 이해할 수 있는 수치 표현으로 바꿉니다. 이 표현은 분자 특성 예측이나 비슷한 분자 찾기 같은 작업에 쓰입니다.

사용하는 경우

  • ✓새로운 분자의 특성을 예측하고 싶을 때.
  • ✓알려진 분자와 비슷한 특성을 가진 분자를 검색할 때.
  • ✓분자 데이터로 머신러닝 모델을 학습시킬 때.

스킬 링크

https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/molfeat/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/molfeat/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“SMILES 분자 ‘CCO’를 반지름 2의 ECFP 핑거프린트로 변환해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

도구는 특정 알고리즘을 사용해 분자 구조를 일련의 숫자(핑거프린트 또는 디스크립터)로 바꿉니다. 다양한 표현 방식을 처리할 수 있으며, 변환이 일관되도록 보장합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Molfeat — Small-molecule featurization

When to use

Use this skill to turn SMILES or RDKit molecules into fingerprints, descriptors, pharmacophores, or pretrained embeddings for molecular machine learning and similarity search. Compare representations on the same molecular split and assay endpoint.

This skill targets Molfeat 1.0.0. The previous 0.11 runtime guidance is obsolete: 1.x supports modern Python and removes DGL/DGLLife, legacy Graphormer, and protein adapters. Historical model-store cards can still name removed adapters. The tagged 1.0 migration guide and source take precedence over older pages still served at the documentation's stable URL.

Installation

Create an isolated environment. Core examples were executed on Python 3.13.3/macOS Apple Silicon with Molfeat 1.0.0, datamol 0.13.0, RDKit 2026.03.6, and PyTorch 2.14.1.

uv venv --python 3.13 .venv-molfeat
uv pip install --python .venv-molfeat/bin/python "molfeat==1.0.0"

On Windows use .venv-molfeat\Scripts\python.exe as the interpreter path. Upstream supports Python 3.11–3.14; macOS Intel uses Python 3.11–3.12, PyTorch 2.2.x, NumPy<2, and Transformers<5. Other platforms require PyTorch>=2.5. Let Molfeat's platform markers resolve these constraints; do not copy Apple Silicon pins to Intel.

Install only needed extras with the same interpreter: molfeat[transformer]==1.0.0 for Hugging Face models, [mordred] for mordredcommunity, [pyg] for graph tensors, [fcd] for ChemNet embeddings, [selfies] for SELFIES conversion, [cache] for HDF5/Parquet, [viz] for visualization, and [cloud] for S3/GCS stores. DGL and Graphormer extras no longer exist. Pretrained inference may download substantial weights; check model licensing, disk space, and device requirements first.

Workflow

  1. Preserve source record IDs, labels, original structures, and a declared policy for salts, stereochemistry, tautomers, charge, and duplicate compounds. Standardization changes chemical identity; apply the same policy to training and prediction.
  2. Start with an explicit ECFP baseline. A calculator processes one molecule; MoleculeTransformer batches it. datamol.Mol is RDKit's molecule type.
  3. Record rejected positions and align every associated array. Inspect descriptor NaN/Inf separately: successful parsing does not guarantee finite features.
  4. Fit any feature selection, imputation, scaling, and model inside the training fold. Prefer scaffold/group or temporal splits appropriate to the scientific question; random splits can leak close analogues or repeated measurements.
  5. Save the featurizer state, ordered feature names, package versions, molecular preprocessing policy, and input IDs. Revalidate old state after migrating to 1.x.

Fingerprint baseline and invalid records

import numpy as np
from molfeat.calc import FPCalculator
from molfeat.trans import MoleculeTransformer

smiles = ["CCO", "invalid", "CC(=O)O", "c1ccccc1"]
record_ids = np.array(["ethanol", "rejected", "acetate", "benzene"])
y = np.array([0.1, 9.9, 0.2, 0.3])  # toy labels only
calc = FPCalculator("ecfp", radius=2, fpSize=2048, includeChirality=True)
transformer = MoleculeTransformer(calc, n_jobs=1, dtype=np.float32)
X, valid_ids = transformer(smiles, ignore_errors=True)
assert X.shape == (3, 2048)
X_ids, y_valid = record_ids[valid_ids], y[valid_ids]
assert valid_ids == [0, 2, 3]
assert np.isfinite(X).all()

ignore_errors belongs on the call, not the constructor. With True, __call__ returns filtered features and original input positions; with False, it raises on failed molecules. transform(..., ignore_errors=True) preserves positions using None for failures. Never filter each feature block independently and then concatenate.

ECFP radius is a bond radius: radius=2 means ECFP4; radius 3 means ECFP6. In 1.0.0 FPCalculator("ecfp") defaults to radius 2 and 2048 bits. FPVecTransformer has a different default length of 2000, so specify length=2048 when using it.

Configuration round trip

transformer.to_state_yaml_file("featurizer.yml")
loaded = MoleculeTransformer.from_state_yaml_file("featurizer.yml")
np.testing.assert_array_equal(loaded(["CCO"]), transformer(["CCO"]))

Load only trusted configuration/artifacts. State can identify Python classes and

…

자주 묻는 질문

‘핑거프린트’와 ‘디스크립터’는 무엇인가요?

핑거프린트는 분자의 디지털 바코드와 같아서 특정 특징이 있는지 없는지를 나타냅니다. 디스크립터는 특정 분자 특성을 수량화한 숫자 값입니다.

이 도구를 모든 종류의 분자에 쓸 수 있나요?

네, 분자가 SMILES나 RDKit 구조처럼 도구가 이해하는 형식으로 표현될 수 있다면 가능합니다. 잘못된 분자를 식별하고 선택적으로 무시할 수도 있습니다.

모델 학습에 쓸 결과를 신뢰할 수 있게 하려면 어떻게 하나요?

학습과 시험에 쓰는 모든 분자에 같은 표준화 규칙을 사용하고, 표현을 만들 때 사용한 정확한 설정을 저장하는 것이 중요합니다. 이렇게 해야 결과의 일관성이 보장됩니다.

상세 정보

작성자의 원본 설명

Featurizes small molecules with Molfeat for QSAR/QSPR, chemical similarity, virtual screening, and molecular ML. Covers ECFP/MACCS fingerprints, RDKit descriptors, pharmacophores, pretrained embeddings, configuration persistence, and molecule-to-label alignment.

repo: K-Dense-AI/scientific-agent-skills

인기도

GitHub 스타
51k
순위
#3501
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬