On 15/11/2010 21:58, Noel O'Boyle wrote: > Hi Chris, > > I think that right now it's not possible. The ability to access a > molecule's number would also be useful for filtering too. > > On 15 November 2010 20:57, christophersw...@btconnect.com > <christophersw...@btconnect.com> wrote: >> I have sdf that contains only structures, I'd like each to have a unique >> title is this possible? Adding mol1, mol2, mol3 would be sufficient. >> Since 2.3.0 it is possible.
obabel mols.sdf -osdf --title newtitle --addoutindex gives the molecules titles "newtitle 1" etc. --title will replace any existing title. There is also AddInIndex which is added before filtering, but you won't see it in the output if you add a new title. An example to demonstrate a number of features. Read the first 50 molecules in a compressed dataset and print out the SMILES of those containing a pyridine ring, together with the index in the file, the ID (in an sdf property) and the output index. obabel chembl_02.sdf.gz -osmi -l 50 -s c1ccccn1 --append chebi_id --addinindex --addoutindex N1(CCN(CC1)c1c(cc2c3c1OCC(n3cc(c2=O)C(=O)O)C)F)C 3 100146 1 c1(c(=O)c2c(n(c1)OC)c(c(N1CC(CC1)CNCC)c(c2)F)F)C(=O)O 6 100195 2 S(=O)(=O)(Nc1ncc(cc1)C)c1c2c(c(N(C)C)ccc2)ccc1 22 100589 3 c1([nH]c2c(c1)cccc2)C(=O)N1CCN(c2c(N(CC)CC)cccn2)CC1 46 101536 4 If you also add --0xout out.svg you will get a 2D depiction (viewable in Firefox etc.) of these 4 molecules. Chris ------------------------------------------------------------------------------ Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today http://p.sf.net/sfu/msIE9-sfdev2dev _______________________________________________ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss