|
NAMEChemistry::File::SMILES - SMILES linear notation parser/writerSYNOPSYS#!/usr/bin/perl use Chemistry::File::SMILES; # parse a SMILES string my $s = 'C1CC1(=O)[O-]'; my $mol = Chemistry::Mol->parse($s, format => 'smiles'); # print a SMILES string print $mol->print(format => 'smiles'); # print a unique (canonical) SMILES string print $mol->print(format => 'smiles', unique => 1); # parse a SMILES file my @mols = Chemistry::Mol->read("file.smi", format => 'smiles'); # write a multiline SMILES file Chemistry::Mol->write("file.smi", mols => \@mols); DESCRIPTIONThis module parses a SMILES (Simplified Molecular Input Line Entry Specification) string. This is a File I/O driver for the PerlMol project. <http://www.perlmol.org/>. It registers the 'smiles' format with Chemistry::Mol.This parser interprets anything after whitespace as the molecule's name; for example, when the following SMILES string is parsed, $mol->name will be set to "Methyl chloride": CCl Methyl chloride The name is not included by default on output. However, if the "name" option is defined, the name will be included after the SMILES string, separated by a tab. print $mol->print(format => 'smiles', name => 1); Multiline SMILES and SMILES filesA file or string can contain multiple molecules, one per line.CCl Methyl chloride CO Methanol Files with the extension '.smi' are assumed to have this format. Atom Mapping NumbersAs an extension for reaction processing, SMILES strings may have atom mapping numbers, which are introduced after a colon in a bracketed atom. For example, [C:1]. The mapping number need not be unique. This module reads the mapping numbers and stores them as the name of the atom ($atom->name).On output, atom names are not included by default. See the "number" and "auto_number" options below for ways of including them. head1 OPTIONS The following options are supported in addition to the options mentioned for Chemistry::File, such as "mol_class", "format", and "fatal".
CAVEATSStereochemistry is not supported! Stereochemical descriptors such as @, @@, /, and \ will be silently ignored on input, and will certainly not be produced on output.Reading branches that start before an atom, such as (OC)C, which should be equivalent to C(OC) and COC, according to some variants of the SMILES specification. Many other tools don't implement this rule either. The kekulize option works by increasing the bond orders of atoms that don't have their usual valences satisfied. This may cause problems if you have atoms with explicitly low hydrogen counts. VERSION0.47SEE ALSOChemistry::Mol, Chemistry::FileThe SMILES Home Page at http://www.daylight.com/dayhtml/smiles/ The Daylight Theory Manual at http://www.daylight.com/dayhtml/doc/theory/theory.smiles.html The PerlMol website <http://www.perlmol.org/> AUTHORIvan Tubert-Brohman <itub@cpan.org>COPYRIGHTCopyright (c) 2009 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. |