MDFactoryMDFactory

validators

Pydantic validators for molecular input fields.

attributeCanonicalIsomericSmiles
= Annotated[str, AfterValidator(ensure_canonical_smiles)]
attributeResidueName
= Annotated[str, AfterValidator(validate_residue_name)]
funcensure_canonical_smiles(smi)str

Validate and canonicalize a SMILES string, rejecting unspecified stereochemistry.

paramsmistr

Input SMILES string.

Returns

str

Canonical isomeric SMILES.

funcvalidate_residue_name(resname)str

Validate length and normalize a residue name to uppercase.

paramresnamestr

Residue name (max 3 characters).

Returns

str

Uppercased residue name.