MayaChemTools

Previous  TOC  NextFileIO::SDFileIO.pmCode | PDF | PDFGreen | PDFA4 | PDFA4Green

NAME

SDFileIO

SYNOPSIS

use SDFileIO;

use SDFileIO qw(:all);

DESCRIPTION

SDFIleIO class provides the following methods:

new, GenerateMoleculeString, IsSDFile, ParseMoleculeString, ReadMolecule , ReadMoleculeString, WriteMolecule

The following methods can also be used as functions:

GenerateMoleculeString, IsSDlFile, ParseMoleculeString

Data specific to SDFileIO class not directly used by Molecule, Atom and Bond objects - data label/value pairs, atom SteroParity and so on - is associated to and retrieved from approptiate objects using following methods:

SetMDL<PropertyName>
GetMDL<PropertyName>.

SD data label and values are attached to Molecule object as a refernece to a hash using SetMDLDataFieldLabelAndValues and can be retrieved using GetMDLDataFieldLabelAndValues method.

SDFileIO class is derive from FileIO class and uses its methods to support generic file related functionality.

METHODS

new
$NewSDFileIO = new SDFileIO(%NamesAndValues);

Using specified SDFileIO property names and values hash, new method creates a new object and returns a reference to newly created SDFileIO object.

GenerateMoleculeString
$MoleculeString = $SDFileIO->GenerateMoleculeString($Molecule);
$MoleculeString = SDFileIO::GenerateMoleculeString($Molecule);

Returns a MoleculeString in SD format corresponding to Molecule

IsSDFile
$Status = $SDFileIO->IsSDFile($FileName);
$Status = SDFileIO::IsSDFile($FileName);

Returns 1 or 0 based on whether FileName is a SD file

ParseMoleculeString
$Molecule = $SDFileIO->ParseMoleculeString($MoleculeString);
$Molecule = $SDFileIO::ParseMoleculeString($MoleculeString);

Parses MoleculeString and returns a Molecule object. SD data field label and value pairs are associated to Molecule object as a reference to a hash using:

$Molecule->SetMDLDataFieldLabelAndValues(\%DataLabelsAndValues)

The reference to hash can be retrieved by:

$DataLabelsAndValues = $Molecule->GetMDLDataFieldLabelAndValues();
for $DataLabel (sort keys %{$DataLabelsAndValues}) {
     $DataValue = $DataLabelsAndValues->{$DataLabel};
}
ReadMolecule
$Molecule = $SDFileIO->ReadMolecule($FileHandle);

Reads data for the next compound in a file using already opened FileHandle, creates, and returns a Molecule object

ReadMoleculeString
$MoleculeString = $SDFileIO->ReadMoleculeString($FileHandle);

Reads data for the next compound in a file using already opened FileHandle and returns a MoleculeString corresponding to compound structure and other associated data

WriteMolecule
$SDFileIO->WriteMolecule($Molecule);

Writes Molecule data to a file in MDLMol format and returns SDFileIO

AUTHOR

Manish Sud

SEE ALSO

MoleculeFileIO.pmMDLMolFileIO.pm

COPYRIGHT

Copyright (C) 2004-2008 Manish Sud. All rights reserved.

This file is part of MayaChemTools.

MayaChemTools is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

 

 

Previous  TOC  NextApril 29, 2008FileIO::SDFileIO.pm