You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, I am trying to use Mordred to get all the features (1875) of my molecules. The Mordred package fails on 3D features given just SMILEs. For the columns of the 3D features, Mordred gives (missing 3D coordinate (GeomDiameter/mordred._graph_matrix.Diameter3D(True, False)/mordred._graph_matrix.DistanceMatrix3D(True, False)). There are some other features missing as well. Those other missing items often give error (min() arg is an empty sequence (MINtsC)) as their column value as an example.
I realize that I should give 3D features instead of just SMILES to Mordred. How can I get those 3D features from SMILES using RDKIT and can someone post an example of those 3D features being fed to Mordred? How do I solve the second problem of (min() arg is an empty sequence (MINdsCH)) for instance for other variables too?
I have also tried the solution in #93 and that solution does not work.
The text was updated successfully, but these errors were encountered:
molecules = [smiles_to_molecule(smiles) for smiles in smiles_list]
Initialize Mordred descriptor calculator
calc = Calculator(descriptors, ignore_3D=True)
Calculate descriptors for each molecule
descriptors_list = []
for mol in molecules:
if mol is not None:
# Calculate descriptors and fill missing values with 0
desc = calc(mol).fill_missing(0)
descriptors_list.append([d if d is not None else 0 for d in desc])
Convert list of descriptors to a numpy array
descriptors_array = np.array(descriptors_list)
Output the array of descriptors
print(descriptors_array)
Save the descriptors array to a CSV file
df = pd.DataFrame(descriptors_array, columns=[str(d) for d in calc.descriptors])
df.to_csv('molecular_descriptors.csv', index=False)
`
@ky66mordred only allows calculating 3D features from mol or SDF files. You can use RDKit to generate a 3D conformer and then calculate the 3D features from that, though.
So, I am trying to use Mordred to get all the features (1875) of my molecules. The Mordred package fails on 3D features given just SMILEs. For the columns of the 3D features, Mordred gives (missing 3D coordinate (GeomDiameter/mordred._graph_matrix.Diameter3D(True, False)/mordred._graph_matrix.DistanceMatrix3D(True, False)). There are some other features missing as well. Those other missing items often give error (min() arg is an empty sequence (MINtsC)) as their column value as an example.
I realize that I should give 3D features instead of just SMILES to Mordred. How can I get those 3D features from SMILES using RDKIT and can someone post an example of those 3D features being fed to Mordred? How do I solve the second problem of (min() arg is an empty sequence (MINdsCH)) for instance for other variables too?
I have also tried the solution in #93 and that solution does not work.
The text was updated successfully, but these errors were encountered: