Hi All,
I have recently installed Openbabel on my computer and trying to
develop some code merging OB and Perl, but unfortunately, I have noticed the
documentation present is not large enough to my comprehension because of my
programming limitations.
I have the same problem in how to access to the data of GetUMapList().
I have also read the post, but it seems was not clearly fixed it. I have
tried the following code to finally confirm the $maplist is a HASH (using
Scalar::Util, because Data::Dumper gave me $VAR1 = bless(
{},'Chemistry::OpenBabel::vvInt' ); but I do not know how to interpret...)
and I have unsuccessfully tried all perlistic ways to access to a given hash
but I do not know how to really access to the content, even trying the
solutions posted here.
Am I missing anything ?, because the foreach loop does not return
anything.
Thanks in advance!!
use Chemistry::OpenBabel;
use Scalar::Util;
my $smiles = "c1cc(CC(=O)CN)ccc1";
my $obMol = new Chemistry::OpenBabel::OBMol;
my $obConversion = new Chemistry::OpenBabel::OBConversion;
$obConversion->SetInFormat("smi");
$obConversion->ReadString($obMol,$smiles);
my $obsmartpattern = new Chemistry::OpenBabel::OBSmartsPattern;
$obsmartpattern->Init('C(=O)');
$obsmartpattern->Match($obMol);
my $maplist = $obsmartpattern->GetMapList();
print UNIVERSAL::isa($maplist,'HASH');
foreach my $index1 (sort {$a cmp $b} keys %{$maplist}) {
printf "index is %s\n",$index;
}
--
View this message in context:
http://open-babel.957263.n4.nabble.com/WriteMapList-using-Perl-tp957583p2543611.html
Sent from the openbabel-scripting mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
OpenBabel-scripting mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbabel-scripting