Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REQUEST] swanlab.Melocule 生物化学分子处理类 #476

Open
Zeyi-Lin opened this issue Apr 17, 2024 · 0 comments
Open

[REQUEST] swanlab.Melocule 生物化学分子处理类 #476

Zeyi-Lin opened this issue Apr 17, 2024 · 0 comments
Assignees
Labels
💪 enhancement New feature or request 🌍 prepare for the future Feature prepare for the future
Milestone

Comments

@Zeyi-Lin
Copy link
Member

Zeyi-Lin commented Apr 17, 2024

示例交互代码:

"""
swanlab.Molecules的逻辑是将输入转换成pdb等格式的文件,保存到日志文件夹。再在未来在前端由Three.js等库读取pdb文件,实现3D渲染生物化学分子。
"""

import swanlab
from rdkit import Chem

swanlab.init()

# 使用 SMILES 字符串创建一个 RDKit 分子对象
smiles = "CCO"  # 这是乙醇的 SMILES 表达式
molecule = Chem.MolFromSmiles(smiles)

# 将分子图像记录到 SwanLab
# 1. from_rdkit
swanlab.log({"Ethanol": swanlab.Molecule.from_rdkit(molecule)})

# 2. 直接用smiles
swanlab.log({"Ethanol": swanlab.Molecule.from_smiles(smiles)})

# 3. 使用文件路径
swanlab.log({"Ethanol": swanlab.Molecule("path/to/file")})

image

@Zeyi-Lin Zeyi-Lin added the 💪 enhancement New feature or request label Apr 17, 2024
@Zeyi-Lin Zeyi-Lin self-assigned this Apr 17, 2024
@Zeyi-Lin Zeyi-Lin added the 🌍 prepare for the future Feature prepare for the future label Apr 17, 2024
@Zeyi-Lin Zeyi-Lin added this to the DataType milestone Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪 enhancement New feature or request 🌍 prepare for the future Feature prepare for the future
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant