Hi all,

I'm using a perl script to make SMI2anything conversions (commented on
another thread).

The first thing; I would like to know if there exist some way to pass a
molfile as string (for apply to OBconversion -> ReadString)

Reasons about this.... 

=======

I want to found an easy way to have OpenBabel on php ... I have been trying
with PECL:: PERL, hoping I could embed Perl code directly in php, but I have
not gotten any satisfactory result when I try to embed OpenBabel callings.
Methods return nothing.

After many hours looking for and testing, I've found the following solution
that seems to work, cause the main problem was how to return to PHP a
response from PERL::


<?php 

//an example

$smiles=$_GET["smiles"];
$service=$_GET["service"];  

$file="/absolute-path-to/smiles2anything.pl '$smiles' '$service'";
$myVar = "";

ob_start();
passthru("$file");
$myVar = ob_get_contents();
ob_end_clean ();

print "
".$myVar."
";

//myVar contains the output messages from perl script

?>


I want to apply this to interact with JME editor (and with ajax / direct
script injection in background). To get smiles (from jme) and obtain
canonicals, inchi, vmol, sdf, all through web-interface and on-the-fly (from
ob)... and to get molfile (from jme) and obtain smiles, canonicals, inchi
(from ob)....

But ... some problems I have 

1 - From a SMILES obtained from JME ->
[H]C([H])=C([H])O[B-]([H])([H])OC([H])[H] -> I obtained the Molfile (from
the same JME):


[H]C([H])=C([H])O[B-]([H])([H])OC([H])[H]
JME 2010.01.2 Sun Jan 23 18:30:27 CET 2011
 
 13 12  0  0  0  0  0  0  0  0999 V2000
    0.9096    1.0095    0.0000 H   0  0  0  0  0  0  0  0  0  0  0  0
    0.0100    0.0000    0.0000 H   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    3.4884    0.0000 H   0  0  0  0  0  0  0  0  0  0  0  0
    4.5979    0.4898    0.0000 H   0  0  0  0  0  0  0  0  0  0  0  0
    4.1781    0.3698    0.0000 H   0  0  0  0  0  0  0  0  0  0  0  0
    2.9886    3.8482    0.0000 H   0  0  0  0  0  0  0  0  0  0  0  0
    4.1881    6.4071    0.0000 H   0  0  0  0  0  0  0  0  0  0  0  0
    1.4993    4.8578    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
    4.7578    3.2185    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
    0.7097    1.2494    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.6497    3.2085    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    4.3380    1.2994    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    3.3485    4.7678    0.0000 B   0  5  0  0  0  0  0  0  0  0  0  0
  1 10  1  0  0  0  0
  2 10  1  0  0  0  0
  3 11  1  0  0  0  0
  4 12  1  0  0  0  0
  5 12  1  0  0  0  0
  6 13  1  0  0  0  0
  7 13  1  0  0  0  0
  8 11  1  0  0  0  0
  8 13  1  0  0  0  0
  9 12  1  0  0  0  0
  9 13  1  0  0  0  0
 10 11  2  0  0  0  0
M  CHG  1  13  -1
M  END


But when I tried to SMI->SDF with OpenBabel I obtained  a different mol:


 OpenBabel01241100252D

 13 12  0  0  0  0  0  0  0  0999 V2000
    0.0000    0.0000    0.0000 H   0  0  0  0  0
    0.0000    0.0000    0.0000 C   0  0  0  0  0
    0.0000    0.0000    0.0000 H   0  0  0  0  0
    0.0000    0.0000    0.0000 C   0  0  0  0  0
    0.0000    0.0000    0.0000 H   0  0  0  0  0
    0.0000    0.0000    0.0000 O   0  0  0  0  0
    0.0000    0.0000    0.0000 B   0  0  0  0  0
    0.0000    0.0000    0.0000 H   0  0  0  0  0
    0.0000    0.0000    0.0000 H   0  0  0  0  0
    0.0000    0.0000    0.0000 O   0  0  0  0  0
    0.0000    0.0000    0.0000 C   0  0  0  0  0
    0.0000    0.0000    0.0000 H   0  0  0  0  0
    0.0000    0.0000    0.0000 H   0  0  0  0  0
  1  2  1  0  0  0
  2  3  1  0  0  0
  2  4  2  0  0  0
  4  5  1  0  0  0
  4  6  1  0  0  0
  6  7  1  0  0  0
  7  8  1  0  0  0
  7  9  1  0  0  0
  7 10  1  0  0  0
 10 11  1  0  0  0
 11 12  1  0  0  0
 11 13  1  0  0  0
M  CHG  1   7  -1
M  END
$$$$


If I try to passing this latest mol to JME, doesn't accept it!! I'm not
chemist, and don't understand why there exist these differences... anyone
could help me?? MOLfile (V2000) recognised by JME is not SDF compatible (or
MDL, MOL, etc)?? why these differences??

2 - 2nd attempt, to try MOL2anything the same way, i.e., to get molFile from
JME and obtain smiles, inchis, etc from OpenBabel...  this is related to my
first question in this email, about how to pass MolFile as String to
Obconv->ReadString. I tried to enclose between ' ' but doesn't work

Someone could help to me?

Best Regards,




-- 
View this message in context: 
http://forums.openbabel.org/MOL-file-as-string-by-parameter-and-JME-tp3233189p3233189.html
Sent from the openbabel-scripting mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
OpenBabel-scripting mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbabel-scripting

Reply via email to