view mayachemtools/docs/modules/html/SDFileIO.html @ 9:ab29fa5c8c1f draft default tip

Uploaded
author deepakjadmin
date Thu, 15 Dec 2016 14:18:03 -0500
parents 73ae111cf86f
children
line wrap: on
line source

<html>
<head>
<title>MayaChemTools:Documentation:FileIO::SDFileIO.pm</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../css/MayaChemTools.css">
</head>
<body leftmargin="20" rightmargin="20" topmargin="10" bottommargin="10">
<br/>
<center>
<a href="http://www.mayachemtools.org" title="MayaChemTools Home"><img src="../../images/MayaChemToolsLogo.gif" border="0" alt="MayaChemTools"></a>
</center>
<br/>
<div class="DocNav">
<table width="100%" border=0 cellpadding=0 cellspacing=2>
<tr align="left" valign="top"><td width="33%" align="left"><a href="./MDLMolFileIO.html" title="MDLMolFileIO.html">Previous</a>&nbsp;&nbsp;<a href="./index.html" title="Table of Contents">TOC</a>&nbsp;&nbsp;<a href="./FileUtil.html" title="FileUtil.html">Next</a></td><td width="34%" align="middle"><strong>FileIO::SDFileIO.pm</strong></td><td width="33%" align="right"><a href="././code/SDFileIO.html" title="View source code">Code</a>&nbsp;|&nbsp;<a href="./../pdf/SDFileIO.pdf" title="PDF US Letter Size">PDF</a>&nbsp;|&nbsp;<a href="./../pdfgreen/SDFileIO.pdf" title="PDF US Letter Size with narrow margins: www.changethemargins.com">PDFGreen</a>&nbsp;|&nbsp;<a href="./../pdfa4/SDFileIO.pdf" title="PDF A4 Size">PDFA4</a>&nbsp;|&nbsp;<a href="./../pdfa4green/SDFileIO.pdf" title="PDF A4 Size with narrow margins: www.changethemargins.com">PDFA4Green</a></td></tr>
</table>
</div>
<p>
</p>
<h2>NAME</h2>
<p>SDFileIO</p>
<p>
</p>
<h2>SYNOPSIS</h2>
<p>use FileIO::SDFileIO;</p>
<p>use FileIO::SDFileIO qw(:all);</p>
<p>
</p>
<h2>DESCRIPTION</h2>
<p><strong>SDFIleIO</strong> class provides the following methods:</p>
<p> <a href="#new">new</a>, <a href="#generatemoleculestring">GenerateMoleculeString</a>, <a href="#issdfile">IsSDFile</a>, <a href="#parsemoleculestring">ParseMoleculeString</a>, <a href="#readmolecule">ReadMolecule</a>
, <a href="#readmoleculestring">ReadMoleculeString</a>, <a href="#writemolecule">WriteMolecule</a>
</p><p>The following methods can also be used as functions:</p>
<p>GenerateMoleculeString, IsSDFile, ParseMoleculeString</p>
<p>Data specific to <strong>SDFileIO</strong> class not directly used by <strong>Molecule</strong>, <strong>Atom</strong> and
<strong>Bond</strong> objects - data label/value pairs, atom SteroParity and so on - is associated to
and retrieved from approptiate objects using following methods:</p>
<div class="OptionsBox">
    SetMDL&lt;PropertyName&gt;
<br/>    GetMDL&lt;PropertyName&gt;.</div>
<p>SD data label and values are attached to <strong>Molecule</strong> object as a refernece to a hash
using SetDataFieldLabelAndValues and can be retrieved using GetDataFieldLabelAndValues
method.</p>
<p><strong>SDFileIO</strong> class is derived from <em>FileIO</em> class and uses its methods to support
generic file related functionality.</p>
<p>
</p>
<h2>METHODS</h2>
<dl>
<dt><strong><a name="new" class="item"><strong>new</strong></a></strong></dt>
<dd>
<div class="OptionsBox">
    $NewSDFileIO = new FileIO::SDFileIO(%NamesAndValues);</div>
<p>Using specified <em>SDFileIO</em> property names and values hash, <strong>new</strong> method creates a new object
and returns a reference to newly created <strong>SDFileIO</strong> object.</p>
</dd>
<dt><strong><a name="generatemoleculestring" class="item"><strong>GenerateMoleculeString</strong></a></strong></dt>
<dd>
<div class="OptionsBox">
    $MoleculeString = $SDFileIO-&gt;GenerateMoleculeString($Molecule);
<br/>    $MoleculeString = FileIO::SDFileIO::GenerateMoleculeString($Molecule);</div>
<p>Returns a <strong>MoleculeString</strong> in SD format corresponding to <em>Molecule</em>.</p>
</dd>
<dt><strong><a name="issdfile" class="item"><strong>IsSDFile</strong></a></strong></dt>
<dd>
<div class="OptionsBox">
    $Status = $SDFileIO-&gt;IsSDFile($FileName);
<br/>    $Status = FileIO::SDFileIO::IsSDFile($FileName);</div>
<p>Returns 1 or 0 based on whether <em>FileName</em> is a SD file.</p>
</dd>
<dt><strong><a name="parsemoleculestring" class="item"><strong>ParseMoleculeString</strong></a></strong></dt>
<dd>
<div class="OptionsBox">
    $Molecule = $SDFileIO-&gt;ParseMoleculeString($MoleculeString);
<br/>    $Molecule = FileIO::SDFileIO::ParseMoleculeString($MoleculeString);</div>
<p>Parses <em>MoleculeString</em> and returns a <strong>Molecule</strong> object. SD data field label and value pairs
are associated to <strong>Molecule</strong> object as a reference to a hash using:</p>
<div class="OptionsBox">
    $Molecule-&gt;SetDataFieldLabelAndValues(\%DataLabelsAndValues)</div>
<p>The reference to hash can be retrieved by:</p>
<div class="OptionsBox">
    $DataLabelsAndValues = $Molecule-&gt;GetDataFieldLabelAndValues();
<br/>    for $DataLabel (sort keys %{$DataLabelsAndValues}) {
<br/>&nbsp;&nbsp;&nbsp;&nbsp;        $DataValue = $DataLabelsAndValues-&gt;{$DataLabel};
<br/>    }</div>
</dd>
<dt><strong><a name="readmolecule" class="item"><strong>ReadMolecule</strong></a></strong></dt>
<dd>
<div class="OptionsBox">
    $Molecule = $SDFileIO-&gt;ReadMolecule($FileHandle);</div>
<p>Reads data for the next compound in a file using already opened <em>FileHandle</em>, creates,
and returns a <strong>Molecule</strong> object.</p>
</dd>
<dt><strong><a name="readmoleculestring" class="item"><strong>ReadMoleculeString</strong></a></strong></dt>
<dd>
<div class="OptionsBox">
    $MoleculeString = $SDFileIO-&gt;ReadMoleculeString($FileHandle);</div>
<p>Reads data for the next compound in a file using already opened <em>FileHandle</em> and
returns a <strong>MoleculeString</strong> corresponding to compound structure and other associated
data.</p>
</dd>
<dt><strong><a name="writemolecule" class="item"><strong>WriteMolecule</strong></a></strong></dt>
<dd>
<div class="OptionsBox">
    $SDFileIO-&gt;WriteMolecule($Molecule);</div>
<p>Writes <em>Molecule</em> data to a file in MDLMol format and returns <strong>SDFileIO</strong>.</p>
</dd>
</dl>
<p>
</p>
<h2>AUTHOR</h2>
<p><a href="mailto:msud@san.rr.com">Manish Sud</a></p>
<p>
</p>
<h2>SEE ALSO</h2>
<p><a href="./MoleculeFileIO.html">MoleculeFileIO.pm</a>,&nbsp<a href="./MDLMolFileIO.html">MDLMolFileIO.pm</a>
</p>
<p>
</p>
<h2>COPYRIGHT</h2>
<p>Copyright (C) 2015 Manish Sud. All rights reserved.</p>
<p>This file is part of MayaChemTools.</p>
<p>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.</p>
<p>&nbsp</p><p>&nbsp</p><div class="DocNav">
<table width="100%" border=0 cellpadding=0 cellspacing=2>
<tr align="left" valign="top"><td width="33%" align="left"><a href="./MDLMolFileIO.html" title="MDLMolFileIO.html">Previous</a>&nbsp;&nbsp;<a href="./index.html" title="Table of Contents">TOC</a>&nbsp;&nbsp;<a href="./FileUtil.html" title="FileUtil.html">Next</a></td><td width="34%" align="middle"><strong>March 29, 2015</strong></td><td width="33%" align="right"><strong>FileIO::SDFileIO.pm</strong></td></tr>
</table>
</div>
<br />
<center>
<img src="../../images/h2o2.png">
</center>
</body>
</html>