-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
quick Shepherd question #3
Comments
This is performed in example scripts in the shepherd-score repository, see https://github.com/coleygroup/shepherd-score/tree/main/scripts. Also tagging @kentoabeywardane in case there is a more explicit demonstration. For a simpler (but less robust) process, you can follow the last parts of |
@Nick-Mul to be explicitly clear, here's code you can follow. I didn't explicitly test this just now, so let me know if there's a problem
|
To extract an RDKit mol object you can use Here's an example of how to get an RDKit Mol of the generated molecule at samples = pickle.load('samples.pickle')
mol, charge, xyz_block = get_mol_from_atom_pos(
samples[-1][sample_idx]['x1']['atoms'],
samples[-1][sample_idx]['x1']['positions']
) To be explicit, [
ref_molec_molblock, # str
ref_partial_charges, # np.array
ref_surface_points, # np.array
ref_electrostatics, # np.array
ref_pharmacophore_types, # np.array
ref_pharmacophore_positions, # np.array
ref_pharmacophore_vectors, # np.array
[ # list of dictionaries of generated samples.
{'x1': {
'atoms': np.array (N,),
'positions': np.array (N,3)
}
'x2': {
'positions': np.array (S,3)
}
'x3': {
'positions': np.array (S,3),
'charges': np.array (S,)
}
'x4': {
'types': np.array (P,),
'positions': np.array (P,3),
'directions': np.array (P,3)
}
}
...
]
] In the unconditional setting, there are no reference molecules so it is just the inner list containing the generated samples. Note that depending on the conditioning at generation, some of the representations may be nonsense. For example, when sampling from P(x1 | x3, x4), the `positions' in the 'x2' key should be ignored since it will just be noise. |
Hello,
This looks really useful and everything seems to be working :)
Really quick question, could you give me a pointer on how to extract a molecule from the pickle files?
Thanks,
Nick
e.g.
The text was updated successfully, but these errors were encountered: