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

enable sort by number of atoms #76

Closed
matthewberry opened this issue Feb 6, 2024 · 3 comments · Fixed by #99
Closed

enable sort by number of atoms #76

matthewberry opened this issue Feb 6, 2024 · 3 comments · Fixed by #99
Assignees

Comments

@matthewberry
Copy link
Collaborator

No description provided.

@matthewberry matthewberry added this to the ChemScraper 2.0 alpha milestone Feb 6, 2024
@bodom0015
Copy link
Member

I don't believe there is any way to currently get the number of atoms for each Molecule 🤔

Would we need to parse/analyze the chemical formula or the fingerprint or SMILE?

@matthewberry
Copy link
Collaborator Author

Hi @bodom0015, I believe you're correct that we don't have the number of atoms for each molecule yet.

From what I see, RDKit may have a good option for us: https://rdkit.org/docs/source/rdkit.Chem.rdchem.html#rdkit.Chem.rdchem.Mol.GetAtoms

Maybe in https://github.com/moleculemaker/mmli-backend/blob/main/app/services/rdkit_service.py we could add something like this:

    def getAtomCount(self, smileString):
        mol = Chem.MolFromSmiles(smileString)
        if mol is None:
            raise ValueError(f"Could not create molecule from SMILES: {smileString}")
        return len(mol.GetAtoms())

@bodom0015 bodom0015 self-assigned this Feb 19, 2024
@bodom0015
Copy link
Member

bodom0015 commented Feb 19, 2024

Related backend PR: moleculemaker/mmli-backend#30

Working on the frontend portion + sort, and will tag with this issue when I create the PR and deploy it to staging 👍

EDIT - Related Frontend PR: #99

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

Successfully merging a pull request may close this issue.

2 participants