I think you need custom code. For python, you could use pybel. There are
three lines that do what you want (
http://openbabel.org/docs/dev/UseTheLibrary/Python_PybelAPI.html#pybel.Smarts.findall).
You only miss one or two lines to get the atoms by their indices.
Although searching pdb files with it could be a demanding and time
consuming task. It's really made for small molecules, i guess. I'd
personally would loop through atoms check if they are HETATOMs and then
check SMARTS pattern. Alternatively, you can filter them by name, if you
can suspect what's your residues name could be (although it's the most
error prone).
----
Pozdrawiam, | Best regards,
Maciek Wójcikowski
[email protected]
2013/7/8 Brett Hannigan <[email protected]>
> Unfortunately, I don't think that's quite what I need. The obabel filter
> command will look at the given pdb and then output the entire pdb if it
> matches the given SMARTS query, right? What I would like to do is only get
> the atoms that match the SMARTS query.
>
> For example, let's say I have a pdb with a single phospho-serine residue.
> What I would like to do is get only the phosphate atoms from the pdb, and
> not get the rest of the residue atoms.
>
> Really what I am going for here is I'd like specify some groups that I
> find interesting, say a phosphate group, a phenyl group, etc. And then I
> have a database of protein + ligand pdbs. I'd like to loop through those
> pdbs and look for my groups that I am interested in. Rather than just
> identify the pdbs that have the sub-structure I am interested in (i.e.
> identify all pdbs with phosphates), I want to know which atoms in the pdb
> constitute the interesting sub-structure. That way I could then align all
> phosphate groups and look at the residues surrounding the phophates to see
> if I see common modes of binding etc. Phosphate would just be one example,
> you can imagine identifying many other interesting sub-structures.
>
> -Brett
>
> ------------------------------
> *From:* Maciek Wójcikowski <[email protected]>
> *To:* Brett T. Hannigan <[email protected]>
> *Cc:* [email protected]
> *Sent:* Saturday, July 6, 2013 6:21 AM
> *Subject:* Re: [Open Babel] SMILES, SMARTS, and PDB
>
> Hello,
>
> You can "convert" from PDB to PDB using filter option (
> http://openbabel.org/wiki/--filter_option)
> obabel input.pdb -O output.pdb --filter "s='CN'"
>
> If your database is really large, or you want to search multiple times,
> then I'd suggest using FastSearch for performance reasons. For further
> lecture: http://openbabel.org/wiki/FastSearch
>
> ----
> Pozdrawiam, | Best regards,
> Maciek Wójcikowski
> [email protected]
>
>
> 2013/7/5 Brett T. Hannigan <[email protected]>
>
> I have a database of molecules in pdb files. I'd like to go through each
> molecule and see if it has certain substructures, and if they do identify
> which atoms are part of that substructure. So it's easy enough to read the
> pdb file in, convert it to SMILES representation, and then do a SMARTS
> query to look for my substructures. However, if the SMARTS query reports
> that the substructure is present in the molecule, I'm not sure how to
> identify the atoms in the pdb file which make up the match. Any ideas?
>
> --
> ******************************************
> Brett T. Hannigan
> 8011 Ardleigh St.
> Philadelphia, PA 19118
> [email protected]
> ******************************************
>
>
> ------------------------------------------------------------------------------
> This SF.net <http://sf.net/> email is sponsored by Windows:
>
> Build for Windows Store.
>
> http://p.sf.net/sfu/windows-dev2dev
> _______________________________________________
> OpenBabel-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>
>
>
>
>
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
OpenBabel-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss