Hot answers tagged

8 votes

RDkit and PySmiles results differ on some SMILES strings

Speculating a comparison of the outputs by both programs may help, I let RDKit process to SMILES to yield a representation including the atom indices. Derived from ...
  • 1,459
7 votes

How to canonicalize SMILES written with aromatic bond symbols (:)?

tldr; That SMILES is invalid This was answered on GitHub by Noel O'Boyle, but I wanted to provide more context. First off, versions: I had to go back and check, but Open Babel 2.3.2 was released in ...
7 votes

How to canonicalize SMILES written with aromatic bond symbols (:)?

I think it might be good to have a look at SELFIES by Alan Aspuru-Guzik and co-workers: https://github.com/aspuru-guzik-group/selfies From what I remember from his talk in Girona last December, this ...
  • 751
7 votes
Accepted

How to convert SMILES to Amino Acids sequence using RDKit

openbabel could also be used to tackle this problem. Convert initial structure to PDB format. I suspect this can be done directly from whatever format you are using for the skeletal structure, but I ...
  • 14.3k
7 votes

How to convert SMILES to Amino Acids sequence using RDKit

Based on your recent comment to want to assemble a protein from scratch, and assuming you want to stick to the naturally occurring $\alpha$-amino acids, I suggest to type the amino acids by their ...
  • 1,459
6 votes

How to input 3D coordinates from xyz file and connectivity from SMILES in rdkit?

Your best bet is to keep the molecule (e.g., as a .mol or .sdf file) around and then simply update the coordinates from the <...
5 votes

Node features matrix with Networkx

You can get a list of lists of the node features like this: g = mol_to_nx(Chem.MolFromSmiles('CCC')) [list(g.nodes[n].values()) for n in range(g.number_of_nodes())] ...
  • 778
5 votes
Accepted

Excluding certain sp3-hybridized carbons with SMARTS

Your SMARTS works. To see what a SMARTS finds, it is always a good idea to depict the result. ...
  • 411
5 votes
Accepted

RDkit and PySmiles results differ on some SMILES strings

It is a bug in pysmiles. pysmiles has problems with aromatic nitrogen if the SMILES is in aromatic form (lower case) but not if it is kekulized (upper case and double bonds) If we add the hydrogens to ...
  • 411
4 votes

How to input 3D coordinates from xyz file and connectivity from SMILES in rdkit?

The representation of a molecular structure as SMILES string is a (very) reduced one, often with only implicit hydrogen atoms. Recreating a 3D molecular structure with either OpenBabel or RDKit not ...
  • 1,459

Only top scored, non community-wiki answers of a minimum length are eligible