SYNOPSYS
#!/usr/bin/perl
use Chemistry::File::SLN;
# parse a SLN string for benzene
my $s = 'C[1]H:CH:CH:CH:CH:CH@1';
my $mol = Chemistry::Mol->parse($s, format => 'sln');
# print a SLN string
print $mol->print(format => 'sln');
# print a unique (canonical) SLN string
print $mol->print(format => 'sln', unique => 1);
# parse a multiline SLN file
my @mols = Chemistry::Mol->read("file.sln", format => 'sln');
# write a multiline SLN file
Chemistry::Mol->write("file.sln", mols => [@mols]);
This module parses a SLN (Sybyl Line Notation) string. This is a File I/O driver for the PerlMol project. http://www.perlmol.org/. It registers the 'sln' format with Chemistry::Mol, and recognizes filenames ending in '.sln'.
Optional attributes for atoms, bonds, and molecules are stored as $atom->attr("sln/attr"), $bond->attr("sln/attr"), and $mol->attr("sln/attr"), respectively. Boolean attributes are stored with a value of 'TRUE'. That's the way boolean attributes are recognized when writing, so that they can be written in the shortened form.
$sln_attr->{backbone} = 1;
# would be ouput as "C[backbone=1]"
$sln_attr->{backbone} = 'TRUE';
# would be ouput as "C[backbone]"
Also note that attribute names are normalized to lowercase on reading.
Product's homepage
Requirements:
· Perl