I've wrote short script to replicate that problem.

#!/usr/bin/perl

use Chemistry::OpenBabel;

my $mol1 = new Chemistry::OpenBabel::OBMol;
my $mol2 = new Chemistry::OpenBabel::OBMol;
#my $mol3 = new Chemistry::OpenBabel::OBMol; # should not be necesary

my $obConversion = new Chemistry::OpenBabel::OBConversion;
$obConversion->SetInFormat("smi");
$obConversion->ReadString($mol1, "C1=CC=CS1");
$obConversion->ReadString($mol2, "CCO");

print  "Mol1: ".$mol1->NumAtoms()."\n";

print "Mol2: ".$mol2->NumAtoms()."\n";

$mol3 = $mol2;

print "Mol3 step one: ".$mol3->NumAtoms()."\n";

### there you go

#$mol3 += $mol1; # doesn't work, throws error
$mol3 -> add($mol1); # this does what above should.

###

print "Mol3 step two: ".$mol3->NumAtoms()."\n";



----
Pozdrawiam,  |  Best regards,
Maciek Wójcikowski
mac...@wojcikowski.pl


W dniu 28 marca 2012 16:48 użytkownik Noel O'Boyle
<baoille...@gmail.com>napisał:

> Can you provide a short script that reproduces the problem? For
> example, with SMILES strings.
>
> - Noel
>
> On 26 March 2012 11:28, mwojcikowski <mac...@wojcikowski.pl> wrote:
> > I've done some extra testing, when I wanted to write the simplest script
> to
> > recreate that problem. It seams it was my fault, and Setup does work
> > (although the weird error). I found out by the way that += operator on
> OBmol
> > class doesn't work resulting empty value. How would you recommend to
> append
> > ligand to pocket structure in perl instead of:
> > $mol = $mol_pocket;
> > $mol += $mol_ligand;
> > where every variable is initialized OBmol object and both prefixed ones
> are
> > read from files.
> >
> > --
> > View this message in context:
> http://forums.openbabel.org/OBForceField-in-Perl-tp4503052p4505342.html
> > Sent from the General discussion mailing list archive at Nabble.com.
> >
> >
> ------------------------------------------------------------------------------
> > This SF email is sponsosred by:
> > Try Windows Azure free for 90 days Click Here
> > http://p.sf.net/sfu/sfd2d-msazure
> > _______________________________________________
> > OpenBabel-discuss mailing list
> > OpenBabel-discuss@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to