ankane/rdkit
最新稳定版本:v0.2.0
Composer 安装命令:
composer require ankane/rdkit
包简介
Cheminformatics for PHP, powered by RDKit
README 文档
README
Cheminformatics for PHP, powered by RDKit
Installation
Run:
composer require ankane/rdkit
Add scripts to composer.json to download the shared library:
"scripts": { "post-install-cmd": "RDKit\\Vendor::check", "post-update-cmd": "RDKit\\Vendor::check" }
And run:
composer install
Getting Started
Create a molecule
use RDKit\Molecule; $mol = Molecule::fromSmiles('c1ccccc1O');
Get the number of atoms
$mol->numAtoms();
Get substructure matches
$mol->match(Molecule::fromSmarts('ccO'));
Get fragments
$mol->fragments();
Generate an SVG
$mol->toSvg();
Fingerprints
A number of fingerprints are supported.
RDKit
$mol->rdkitFingerprint();
Morgan
$mol->morganFingerprint();
Pattern
$mol->patternFingerprint();
Atom pair
$mol->atomPairFingerprint();
Topological torsion
$mol->topologicalTorsionFingerprint();
MACCS
$mol->maccsFingerprint();
You can use a library like pgvector-php to find similar molecules. See an example.
Updates
Add or remove hydrogen atoms
$mol->addHs(); $mol->removeHs();
Standardize
$mol->cleanup(); $mol->normalize(); $mol->neutralize(); $mol->reionize(); $mol->canonicalTautomer(); $mol->chargeParent(); $mol->fragmentParent();
Conversion
SMILES
$mol->toSmiles();
SMARTS
$mol->toSmarts();
CXSMILES
$mol->toCXSmiles();
CXSMARTS
$mol->toCXSmarts();
JSON
$mol->toJson();
Reactions
Create a reaction
use RDKit\Reaction; $rxn = Reaction::fromSmarts('[CH3:1][OH:2]>>[CH2:1]=[OH0:2]');
Generate an SVG
$rxn->toSvg();
History
View the changelog
Contributing
Everyone is encouraged to help improve this project. Here are a few ways you can help:
- Report bugs
- Fix bugs and submit pull requests
- Write, clarify, or fix documentation
- Suggest or add new features
To get started with development:
git clone https://github.com/ankane/rdkit-php.git cd rdkit-php composer install composer test
统计信息
- 总下载量: 23
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2024-08-09