inputs
Input types for chemical structure representations.
This module provides Maker classes for creating RDKit molecules from various chemical identifiers and representations.
Examples:
>>> from jfchemistry.inputs import Smiles, PubChemCID
>>>
>>> smiles_maker = Smiles(add_hydrogens=True, remove_salts=True)
>>> smiles_job = smiles_maker.make("CCO")
>>> mol = smiles_job.output["structure"]
>>>
>>> # Retrieve molecule from PubChem
>>> pubchem_maker = PubChemCID()
>>> pubchem_job = pubchem_maker.make(702) # Ethanol
>>> mol = pubchem_job.output["structure"]
PolymerInput
dataclass
Bases: CoreMaker
flowchart TD
jfchemistry.inputs.PolymerInput[PolymerInput]
jfchemistry.core.makers.core_maker.CoreMaker[CoreMaker]
jfchemistry.core.makers.core_maker.CoreMaker --> jfchemistry.inputs.PolymerInput
click jfchemistry.inputs.PolymerInput href "" "jfchemistry.inputs.PolymerInput"
click jfchemistry.core.makers.core_maker.CoreMaker href "" "jfchemistry.core.makers.core_maker.CoreMaker"
Polymer Input.
Source code in jfchemistry/inputs/polymer.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |
make
make(monomer: str, head: str | None = None, tail: str | None = None) -> Response[_output_model]
Make a polymer.
Source code in jfchemistry/inputs/polymer.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |
PubChemCID
dataclass
Bases: MoleculeInput
flowchart TD
jfchemistry.inputs.PubChemCID[PubChemCID]
jfchemistry.inputs.core.MoleculeInput[MoleculeInput]
jfchemistry.core.makers.core_maker.CoreMaker[CoreMaker]
jfchemistry.inputs.core.MoleculeInput --> jfchemistry.inputs.PubChemCID
jfchemistry.core.makers.core_maker.CoreMaker --> jfchemistry.inputs.core.MoleculeInput
click jfchemistry.inputs.PubChemCID href "" "jfchemistry.inputs.PubChemCID"
click jfchemistry.inputs.core.MoleculeInput href "" "jfchemistry.inputs.core.MoleculeInput"
click jfchemistry.core.makers.core_maker.CoreMaker href "" "jfchemistry.core.makers.core_maker.CoreMaker"
Retrieve molecules from PubChem database by compound ID.
Downloads molecular structures from the PubChem database using the compound identifier (CID). The structure is retrieved in SDF format from PubChem's REST API.
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
Name of the input method (default: "PubChem CID Input").
TYPE:
|
remove_salts |
Inherited from MoleculeInput.
TYPE:
|
add_hydrogens |
Inherited from MoleculeInput.
TYPE:
|
Examples:
>>> from jfchemistry.inputs import PubChemCID
>>>
>>> # Retrieve ethanol (CID: 702)
>>> pubchem = PubChemCID()
>>> job = pubchem.make(702)
>>> mol = job.output["structure"]
>>>
>>> # Retrieve without adding hydrogens
>>> pubchem_no_h = PubChemCID(add_hydrogens=False)
>>> job = pubchem_no_h.make(2244) # Aspirin
Source code in jfchemistry/inputs/pubchem.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | |
make
make(input: int) -> Response[Output]
Create a workflow job to retrieve a molecule from PubChem.
| PARAMETER | DESCRIPTION |
|---|---|
input
|
PubChem compound ID (CID).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Response[Output]
|
Response containing: - structure: RDMolMolecule from PubChem - files: MOL file representation |
Source code in jfchemistry/inputs/pubchem.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 | |
Smiles
dataclass
Bases: MoleculeInput
flowchart TD
jfchemistry.inputs.Smiles[Smiles]
jfchemistry.inputs.core.MoleculeInput[MoleculeInput]
jfchemistry.core.makers.core_maker.CoreMaker[CoreMaker]
jfchemistry.inputs.core.MoleculeInput --> jfchemistry.inputs.Smiles
jfchemistry.core.makers.core_maker.CoreMaker --> jfchemistry.inputs.core.MoleculeInput
click jfchemistry.inputs.Smiles href "" "jfchemistry.inputs.Smiles"
click jfchemistry.inputs.core.MoleculeInput href "" "jfchemistry.inputs.core.MoleculeInput"
click jfchemistry.core.makers.core_maker.CoreMaker href "" "jfchemistry.core.makers.core_maker.CoreMaker"
Create molecules from SMILES strings.
Parses SMILES (Simplified Molecular Input Line Entry System) strings and converts them to RDKit Mol objects. Supports standard SMILES notation including stereochemistry and aromaticity.
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
Name of the input method (default: "SMILES Input").
TYPE:
|
remove_salts |
Inherited from MoleculeInput.
TYPE:
|
add_hydrogens |
Inherited from MoleculeInput.
TYPE:
|
Source code in jfchemistry/inputs/smiles.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | |
make
make(input: str) -> Response[Output]
Create a workflow job to generate a molecule from SMILES.
| PARAMETER | DESCRIPTION |
|---|---|
input
|
SMILES string.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Response[Output]
|
Response containing: - structure: RDMolMolecule from SMILES - files: MOL file representation |
Source code in jfchemistry/inputs/smiles.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 | |