|
NAMEChemistry::File::SLN - SLN linear notation parser/writerSYNOPSYS#!/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]); DESCRIPTIONThis 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. OPTIONSThe following options are available when reading:
The following options are available when writing:
CAVEATSThis version does not implement the full SLN specification. It supports simple structures and some attributes, but it does not support any of the following:
The SLN specification is vague on several points, and I don't have a reference implementation available, so I had to make several arbitrary decisions. Also, this version of this module has not been tested exhaustively, so please report any bugs that you find. If the parser doesn't understand a string, it only says "syntax error", which may not be very helpful. VERSION0.11SEE ALSOChemistry::Mol, Chemistry::File, Chemistry::File::SMILESThe PerlMol website <http://www.perlmol.org/> Ash, S.; Cline, M. A.; Homer, R. W.; Hurst, T.; Smith, G. B., SYBYL Line Notation (SLN): A Versatile Language for Chemical Structure Representation. J. Chem. Inf. Comput. Sci; 1997; 37(1); 71-79. DOI: 10.1021/ci960109j (<http://dx.doi.org/10.1021/ci960109j>) AUTHORIvan Tubert-Brohman <itub@cpan.org>COPYRIGHTCopyright (c) 2004 Ivan Tubert-Brohman. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Visit the GSP FreeBSD Man Page Interface. |