On Sat, Sep 17, 2011 at 1:58 PM, Noel O'Boyle <baoille...@gmail.com> wrote:
> > I went with the -xs and am currently working on the to-smarts conversion.
> >
> > First question:
> >
> > I got those lines:
> > 0 16 5 6 5 7 5 6 1 6 2 7 1 8 <7>
> > 0 16 5 6 5 7 5 6 5 6 <668>
> > 1 7 1 6 1 6 1 6 <544>
> > 1 16 1 6 1 7 1 6 1 6 1 6 <633>
> > 2 6 1 7 1 6 1 16 1 6 1 6 <514>
> > 2 6 2 6 1 16 1 6 1 7 1 6 <651>
> > 2 7 1 6 1 16 1 6 1 6 2 6 <428>
> > 5 7 5 7 5 6 5 7 5 6 5 6 <294>
> > 5 16 5 6 5 7 5 6 5 6 <272>
> > According to here
> > http://openbabel.org/docs/dev/FileFormats/Fingerprint_format.html, "the
> > first digit indicates whether the fragment is linear (0) or cyclic (1)".
> > What does a 5 or a 2 at the beinning mean?
>
> I realise now I made a mistake there. The first number is the bond
> order of a ring bond (if it's cyclic). Bond orders are 1, 2, 3 and 5
> for aromatic.
>
> obabel -:"C1CCCCC1" -ofpt -xs -xf FP2
> gives (among others)
> 1 6 1 6 1 6 1 6 1 6 1 6
>
> obabel -:"c1ccccc1" -ofpt -xs -xf FP2
> gives
> 5 6 5 6 5 6 5 6 5 6 5 6
>
> - Noel
>
Thanks, in case someone is interested, here is how I did the
to-smarts-conversion in Java,
Best regards,
Martin
private static String BONDS[] = { null, "", "=", "#", null, ":" };
public static String parseFP2Fragment(String line)
{
String smarts = "";
String ringBond = null;
String s[] = line.split(" ");
for (int i = 0; i < s.length; i++)
{
if (i == 0) // ringbond
{
ringBond = BONDS[Integer.parseInt(s[0])];
}
else if (i == s.length - 1) // hash
{
// ignore
}
else if (i % 2 == 1) // atom
{
smarts += "[#" + s[i] + "]";
if (ringBond != null && i == 1)
smarts += "1"; // first ring atom
}
else if (i % 2 == 0) // bond
{
smarts += BONDS[Integer.parseInt(s[i])];
}
}
if (ringBond != null)
{
smarts += ringBond;
smarts += "1"; // last ring atom
}
return smarts;
}
--
Dipl-Inf. Martin Gütlein
Phone:
+49 (0)761 203 7633 (office)
+49 (0)177 623 9499 (mobile)
Email:
guetl...@informatik.uni-freiburg.de
------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
http://p.sf.net/sfu/rim-devcon-copy2
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss