Skip to content

Create chemical record from SMILES using rdkit#191

Merged
prehner merged 4 commits into
mainfrom
fragmentation_chemical_record
Oct 15, 2023
Merged

Create chemical record from SMILES using rdkit#191
prehner merged 4 commits into
mainfrom
fragmentation_chemical_record

Conversation

@prehner

@prehner prehner commented Oct 10, 2023

Copy link
Copy Markdown
Contributor

Replacement for #188

Adds ChemicalRecord.from_smiles that uses rdkit and a user-provided set of SMARTS to convert a SMILES string into a chemical record (including bonds).

ChemicalRecord.from_smiles("CCCOCC", smarts)
ChemicalRecord(
	identifier=Identifier(smiles=CCCOCC),
	segments=["CH3", "CH2", "OCH2", "CH2", "CH3"],
	bonds=[[0, 1], [1, 2], [2, 3], [3, 4]]
)

You can also pass an Identifier to directly fill out the remaining fields

ChemicalRecord.from_smiles(Identifier(name="1-propanol", smiles="CCCO"), smarts)
ChemicalRecord(
	identifier=Identifier(name=1-propanol, smiles=CCCO),
	segments=["CH3", "CH2", "CH2", "OH"],
	bonds=[[0, 1], [1, 2], [2, 3]]
)

@prehner
prehner marked this pull request as ready for review October 11, 2023 08:53

@g-bauer g-bauer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Found some typos in the docstrings but can be merged as soon those are fixed.

Comment thread feos-core/src/python/parameter/mod.rs Outdated
Comment thread feos-core/src/python/parameter/mod.rs Outdated
Comment thread feos-core/src/python/parameter/fragmentation.rs Outdated
@prehner prehner added this to the v0.5.0 milestone Oct 15, 2023
@prehner prehner added python Python related feature or issue pcsaft Related to the PC-SAFT model gc-pcsaft Related to the gc-PC-SAFT model core related to features in feos-core labels Oct 15, 2023
@prehner
prehner merged commit 0fc8bfa into main Oct 15, 2023
@prehner
prehner deleted the fragmentation_chemical_record branch October 15, 2023 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core related to features in feos-core gc-pcsaft Related to the gc-PC-SAFT model pcsaft Related to the PC-SAFT model python Python related feature or issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants