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

only return atoms within sphere=1 layer during generating HOSE code #954

Open
biotech7 opened this issue Jan 26, 2023 · 4 comments
Open

Comments

@biotech7
Copy link

biotech7 commented Jan 26, 2023

🐛 Bug

by getSpheres(paras ) to get all atoms according with specified sphere,but only return sphere=1 atoms without more ones.

To Reproduce

Steps to reproduce the behavior:

  ` String smiles = "CCC1=CC=CC(=C1NC(=O)CN(CC(=O)O)CC(=O)O)CC";//-----Universal SMILES
    int sphere = 6;//----sphere
    HOSECodeGenerator hcg = new HOSECodeGenerator();
    IChemObjectBuilder bldr = SilentChemObjectBuilder.getInstance();
    SmilesParser smipar = new SmilesParser(bldr);
    IAtomContainer mol = smipar.parseSmiles(smiles);

    List<IAtom>[] nodeAtoms = hcg.getSpheres(mol, mol.getAtom(9), sphere, false);
    for (int i = 0; i < sphere; i++) {
        for (IAtom iAtom : nodeAtoms[i]) {
            System.out.println(iAtom.getSymbol());
        }
        System.out.println("-------");
    }`

Environment

  • OS: win10
  • IDE: IDEA 2021
  • JDK:1.8
  • CDK version:2.8

test

@johnmay
Copy link
Member

johnmay commented Jan 26, 2023

Thanks please note hose codes are an outdated method and something like Signatures/CircularFingerprint is much better.

@biotech7
Copy link
Author

John, thanks for your valuable advice.
It is mostly like that CircularFingerprinter could not be "reversed" to corresponding molecule structure as I wanted.
Signatures could satisfy my requests. But how to convert atom index into vertexIndex in the job of calling this method signatureStringForVertex(vertexIndex, height) , I could not figure out a way for this conversion from CDK JavaDoc.
Signatures usually gets rid of aromaticity/chirality infomation when "cutting" a fragment from a full molecule. Is there a
straightforward strategy to recover all the lost info from signatures? All info play key role in AI modelling.

@johnmay
Copy link
Member

johnmay commented Jan 27, 2023

You should be able to get the atom info from the circular fingerprint… but I need to check.

Anyways the main point was you probably don’t want hose codes :)

@biotech7
Copy link
Author

key properties such as aromaticity, charge,stereotypical type etc. as well as height/sphere stored in a substructure based on CircularFP are highly preferred.

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