Browse Source
Update README with dc2
Signed-off-by: shiyu22 <shiyu.chen@zilliz.com>
main
1 changed files with
8 additions and
15 deletions
-
README.md
|
|
@ -20,25 +20,18 @@ This operator uses [RDKit](https://www.rdkit.org/docs/index.html) to generate th |
|
|
|
|
|
|
|
An example that use the Morgan algorithm to generate a fingerprint of the molecular formula 'Cc1ccc(cc1)S(=O)(=O)N'. |
|
|
|
|
|
|
|
*Write the pipeline in simplified style:* |
|
|
|
|
|
|
|
```python |
|
|
|
import towhee |
|
|
|
|
|
|
|
towhee.dc(['Cc1ccc(cc1)S(=O)(=O)N']) \ |
|
|
|
.molecular_fingerprinting() \ |
|
|
|
.show() |
|
|
|
``` |
|
|
|
<img src="./result1.png" height="35px"/> |
|
|
|
|
|
|
|
*Write a same pipeline with explicit inputs/outputs name specifications:* |
|
|
|
|
|
|
|
```python |
|
|
|
import towhee |
|
|
|
from towhee.dc2 import pipe, ops, DataCollection |
|
|
|
|
|
|
|
p = ( |
|
|
|
pipe.input('smiles') |
|
|
|
.map('smiles', 'fingerprint', ops.molecular_fingerprinting.rdkit()) |
|
|
|
.output('smiles', 'fingerprint') |
|
|
|
) |
|
|
|
|
|
|
|
towhee.dc['smiles'](['Cc1ccc(cc1)S(=O)(=O)N']) \ |
|
|
|
.molecular_fingerprinting['smiles', 'fingerprint']() \ |
|
|
|
.show() |
|
|
|
DataCollection(p('Cc1ccc(cc1)S(=O)(=O)N')).show() |
|
|
|
``` |
|
|
|
<img src="./result2.png" height="75px"/> |
|
|
|
|
|
|
|