-
Notifications
You must be signed in to change notification settings - Fork 31
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
Bug in copyMoleculeByAtoms when H are mapped #97
Comments
This is the expected behaviour:
* If only a subset of atoms is copied as a new molecule, this new molecule is automatically considered a fragment (a substructure)
* when calculating neighbours on a fragment, simple hydrogen atoms are automatically removed and converted into a hydrogen query feature
…________________________________
Von: Luc Patiny ***@***.***>
Gesendet: Montag, 31. Juli 2023 13:34
An: Actelion/openchemlib ***@***.***>
Cc: Subscribed ***@***.***>
Betreff: [Actelion/openchemlib] Bug in copyMoleculeByAtoms when H are mapped (Issue #97)
Sorry for the javascript example ...
It seems there is a bug in copyMoleculeByAtoms when we have recognizeDelocalizedBonds:true and one of the mapped atom in an hydrogen.
The atomMap is correct but the hydrogen is not copied.
import OCL from 'openchemlib'
const { Molecule } = OCL
const molecule = Molecule.fromSmiles('C')
molecule.addImplicitHydrogens()
const atomMap = []
const atomMask = [true, true, false, false, false]
let fragment = new Molecule(0, 0)
molecule.copyMoleculeByAtoms(fragment, atomMask, false, atomMap);
console.log(fragment.getAllAtoms(), atomMap) // 2 [ 0, 1, -1, -1, -1 ]
fragment = new Molecule(0, 0)
molecule.copyMoleculeByAtoms(fragment, atomMask, true, atomMap);
// if recognizeDelocalizedBonds is true the atomMap is correct but the fragment do not contain the H as is wrong
console.log(fragment.getAllAtoms(), atomMap) // 1 [ 0, 1, -1, -1, -1 ]
—
Reply to this email directly, view it on GitHub<#97>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACNFEBVOBQC4GOWPLZRBS2LXS6J6BANCNFSM6AAAAAA26D3QSU>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
________________________________
The information of this email and in any file transmitted with it is strictly confidential and may be legally privileged. It is intended solely for the addressee. If you are not the intended recipient, any copying, distribution or any other use of this email is prohibited and may be unlawful. In such case, you should please notify the sender immediately and destroy this email. The content of this email is not legally binding unless confirmed by letter. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of the sender's company.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sorry for the javascript example ...
It seems there is a bug in copyMoleculeByAtoms when we have recognizeDelocalizedBonds:true and one of the mapped atom in an hydrogen.
The atomMap is correct but the hydrogen is not copied.
The text was updated successfully, but these errors were encountered: