Skip to content
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

smallmol containing Hs #63

Closed
z-linlinlin opened this issue Dec 14, 2020 · 6 comments
Closed

smallmol containing Hs #63

z-linlinlin opened this issue Dec 14, 2020 · 6 comments
Assignees

Comments

@z-linlinlin
Copy link

Use SmallMol to transform a molecule with 30 heavy atoms, in version 0.1.12, it retrurns: SmallMol with 30 atoms and 1 conformers
But when I updated the moleculekit version to 0.4.7 , it becomes : SmallMol with 52 atoms and 1 conformers

@z-linlinlin
Copy link
Author

And I tried SmallMol(mol, fixHs=False, removeHs=True), it didn't work

@stefdoerr
Copy link
Contributor

Hi, did you use force_reading by any chance?
Can you provide me with the molecule to test?

If it's a mol2 file you can also try directly with rdkit to see if it does the same:

from rdkit import Chem
mol = Chem.MolFromMol2File("mylig.mol2", removeHs=False)
mol.GetNumAtoms()

@stefdoerr stefdoerr self-assigned this Dec 14, 2020
@z-linlinlin
Copy link
Author

z-linlinlin commented Dec 14, 2020

Here is a simple example:

import moleculekit.smallmol.smallmol as mk
import moleculekit.tools.voxeldescriptors as mk_voxel
from rdkit import Chem
from rdkit.Chem import AllChem
smiles = "CN"
mol = Chem.MolFromSmiles(smiles)
mol_H = Chem.AddHs(mol)
AllChem.EmbedMolecule(mol_H)
mol_conformer = Chem.RemoveHs(mol_H)
smallmol = mk.SmallMol(mol_conformer, fixHs=False)
coords_mol = smallmol.get("coords")[:, :, 0]
channel_mol = mk_voxel.getChannels(smallmol)[0]
print(coords_mol.shape, channel_mol.shape)

I hope the channel_mol to be of shape (2, 8) as before, but I got (7, 8).

@stefdoerr
Copy link
Contributor

Oh nice! You found a bug in copying of molecule. I'm fixing it now and will report once it's release in a new moleculekit version (in an hour or so hopefully).
Thanks a lot!

@stefdoerr
Copy link
Contributor

Ok version 0.5.5 of moleculekit is out which should fix this. Give it a try and tell me if it worked for you

@z-linlinlin
Copy link
Author

Ok version 0.5.5 of moleculekit is out which should fix this. Give it a try and tell me if it worked for you

It works well !
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants