Re: [Rdkit-discuss] Saving chains from PDB file

2019-10-07 Thread Maciek Wójcikowski
If you turn off the sanitization the splitting should be super fast too. If that is the only thing you would like to do. pon., 7 paź 2019, 10:31 użytkownik Téletchéa Stéphane < stephane.teletc...@univ-nantes.fr> napisał: > Le 05/10/2019 à 12:46, Chris Swain via Rdkit-discuss a écrit : > > Hi, >

Re: [Rdkit-discuss] Saving chains from PDB file

2019-10-07 Thread Téletchéa Stéphane
Le 05/10/2019 à 12:46, Chris Swain via Rdkit-discuss a écrit : Hi, I have a number of PDB files (foo.pdb.gz) and I want to separate each chain in each file out into a separate file. So if a file contains 4 chains it will generate 4 separate files. Can I do this using RDKit, if so how?

Re: [Rdkit-discuss] Saving chains from PDB file

2019-10-05 Thread Dimitri Maziuk via Rdkit-discuss
On 10/5/2019 10:34 AM, Maciek Wójcikowski wrote: Paolo and Chris, There actually is Rdkit function to do this very task: SplitMolByPDBChainId Why, though? -- It's a punch-card format with chain id in specific column, you just read the lines and sort them into buckets on line[X]. Unless you

Re: [Rdkit-discuss] Saving chains from PDB file

2019-10-05 Thread Chris Swain via Rdkit-discuss
Thanks Chris > On 5 Oct 2019, at 16:34, Maciek Wójcikowski wrote: > > Paolo and Chris, > > There actually is Rdkit function to do this very task: SplitMolByPDBChainId > http://rdkit.org/docs/source/rdkit.Chem.rdmolops.html#rdkit.Chem.rdmolops.SplitMolByPDBChainId > >

Re: [Rdkit-discuss] Saving chains from PDB file

2019-10-05 Thread Maciek Wójcikowski
Paolo and Chris, There actually is Rdkit function to do this very task: SplitMolByPDBChainId http://rdkit.org/docs/source/rdkit.Chem.rdmolops.html#rdkit.Chem.rdmolops.SplitMolByPDBChainId sob., 5 paź 2019, 14:42 użytkownik Paolo Tosco napisał: > Hi Chris, > > The following, though quite

Re: [Rdkit-discuss] Saving chains from PDB file

2019-10-05 Thread Paolo Tosco
Hi Chris, The following, though quite inefficient, will work: from rdkit import Chem mol = Chem.MolFromPDBFile("1CX2.pdb") chains = {a.GetPDBResidueInfo().GetChainId() for a in mol.GetAtoms()} chain_mols = {c: Chem.RWMol(mol) for c in chains} for c, m in chain_mols.items(): bonds_to_remove =