|
NAMEChemistry::OpenSMILES::Parser - OpenSMILES format reader SYNOPSIS use Chemistry::OpenSMILES::Parser;
my $parser = Chemistry::OpenSMILES::Parser->new;
my @moieties = $parser->parse( 'C#C.c1ccccc1' );
$\ = "\n";
for my $moiety (@moieties) {
# $moiety is a Graph::Undirected object
print scalar $moiety->vertices;
print scalar $moiety->edges;
}
DESCRIPTION"Chemistry::OpenSMILES::Parser" is OpenSMILES format reader. METHODS"parse( $smiles, \%options )"Parses a SMILES string and returns an array of disconnected molecular entities as separate instances of Graph::Undirected. Their interpretation is described in detail in Chemistry::OpenSMILES. Options parse() accepts the following options for key-value pairs in an anonymous hash for its second parameter:
CAVEATSDeprecated charge notations ("--" and "++") are supported. OpenSMILES specification mandates a strict order of ring bonds and branches: branched_atom ::= atom ringbond* branch* Chemistry::OpenSMILES::Parser supports both the mandated, and inverted structure, where ring bonds follow branch descriptions. Whitespace is not supported yet. SMILES descriptors must be cleaned of it before attempting reading with Chemistry::OpenSMILES::Parser. The derivation of implicit hydrogen counts for aromatic atoms is not unambiguously defined in the OpenSMILES specification. Thus only aromatic carbon is accounted for as if having valence of 3. Chiral atoms with three neighbours are interpreted as having a lone pair of electrons one of its chiral neighbours. The lone pair is always understood as being the second in the order of neighbour enumeration, except when the atom with the lone pair starts a chain. In that case lone pair is the first. AUTHORSAndrius Merkys, <merkys@cpan.org>
|