schrodinger.application.transforms.autosar.util module¶
- class schrodinger.application.transforms.autosar.util.Cutoff(min: float, max: float)¶
Bases:
object
Represent an inclusive min and inclusive max cutoff for a property
- min: float¶
- max: float¶
- __init__(min: float, max: float) None ¶
- class schrodinger.application.transforms.autosar.util.RGroup(smiles: str, properties: dict[str, float] = <factory>)¶
Bases:
object
An RGroup and it associated properties
When accessing a property using the index operator (e.g., rgroup[key]), it will return the value of the property from the underlying properties dictionary.
- NOTE: This dataclass is intended to be used with SMILES that encode the attachment
point and R-group index within SMILES itself. For example, a SMILES of “CC[*:3]” defines both the attachment point and that it is RGroup 3.
- NOTE: We assume RGroups with the exact same SMILES are equivalent and that their
properties are also equivalent. This allows us to hash RGroup instances using just the SMILES string.
- Parameters:
smiles – the SMILES string of the RGroup
properties – a dictionary mapping property names to their values
- smiles: str¶
- properties: dict[str, float]¶
- __init__(smiles: str, properties: dict[str, float] = <factory>) None ¶
- schrodinger.application.transforms.autosar.util.to_csv_str(row: dict[str, Any], fieldnames: list[str]) str ¶
Convert a dictionary to a string representing a single row in a CSV file.
- Parameters:
row – the dictionary to convert to a CSV string
fieldnames – the list of fieldnames to use for the CSV output
- schrodinger.application.transforms.autosar.util.read_csv(file: str, id_fieldname: str, value_fieldnames: Optional[list[str]] = None) list[dict[str, str | float]] ¶
Read a CSV file to a list of PropertyDictWithID.
- NOTE: Cells in the value_fieldnames columns are converted to floats. If a cell is
empty, it is converted to NaN.
- Parameters:
file – the path to the CSV file
id_fieldname – the column to use as the identifier for each row
value_fieldnames – the columns to use as the properties for each row.
- schrodinger.application.transforms.autosar.util.read_all_rgroups(input_paths: list[str], smiles_fieldname: str, value_fieldnames: list[str]) list[list[RGroup]] ¶
Read all RGroups from the given input CSV paths.
- Parameters:
input_paths – a list of paths to the CSV files
smiles_fieldname – the column to use as the SMILES for each RGroup
value_fieldnames – the columns to use as the properties for each RGroup
- schrodinger.application.transforms.autosar.util.read_rgroups(input_path: str, smiles_fieldname: str, value_fieldnames: list[str]) list[RGroup] ¶
Read RGroups from a single CSV file.
- Parameters:
input_path – the path to the CSV file
smiles_fieldname – the column to use as the SMILES for each RGroup
value_fieldnames – the columns to use as the properties for each RGroup
- schrodinger.application.transforms.autosar.util.get_properties_with_negative_values(all_rgroups: list[list[RGroup]], properties_to_check: list[str]) list[str] ¶
Over all RGroups determine which properties have at least one negative value.
- Parameters:
all_rgroups – a list of lists of RGroups
properties_to_check – the properties to check for negative values
- schrodinger.application.transforms.autosar.util.normalize_cutoffs(cutoffs: dict[str, Cutoff], ref_smiles: str, ref_properties: dict[str, float]) dict[str, Cutoff] ¶
Adjust the cutoffs to be relative to the reference properties.
- Parameters:
cutoffs – the cutoffs to adjust
ref_smiles – the SMILES of the reference molecule
ref_properties – the reference properties