drugforge.data.schema.ligand.write_ligands_to_multi_sdf
- drugforge.data.schema.ligand.write_ligands_to_multi_sdf(sdf_name: str | Path, ligands: list[Ligand], overwrite=False)[source]
Dumb way to do this, but just write out each ligand to the same. Alternate way would be to flush each to OEMol and then write out using OE but seems convoluted.
Note that this will overwrite the file if it exists unless overwrite is set to False
- Parameters:
sdf_name (Union[str, Path]) – Path to the SDF file
ligands (list[Ligand]) – List of ligands to write out
overwrite (bool, optional) – Overwrite the file if it exists, by default False
- Raises:
FileExistsError – If the file exists and overwrite is False
ValueError – If the sdf_name does not end in .sdf