source: orange-bioinformatics/docs/modules/obiChem.htm @ 1623:186d828e3699

Revision 1623:186d828e3699, 5.1 KB checked in by mitar, 2 years ago (diff)

Renamed documentation directory.

Line 
1<html>
2<head>
3<link rel=stylesheet href="../style.css" type="text/css">
4</head>
5<body>
6
7<h1>obiChem: A library for searching frequent molecular fragments</h1>
8<index name="modules/molecular fragments">
9<p>obi implements the following classes
10<ul>
11    <li>FragmentMiner   : The main class that does the search</li>
12    <li>Fragment        : Representation of the fragment</li>
13    <li>Fragmenter      : A class that is used to fragment an ExampleTable</li>
14    <li>FragmentBasedLearner    : A learner wrapper class that first runs the molecular fragmentation on the data</li>
15</ul>
16</p>
17
18<h2>FragmentMiner</h2>
19<p>A class for finding frequent molecular fragments</p>
20<p class=section>Attributes</p>
21<dl class=attributes>
22    <dt>active</dt>
23    <dd>list of smiles codes of active molecules</dd>
24    <dt>inactive</dt>
25    <dd>list of smiles codes of inactive molecules</dd>
26    <dt>minSupport</dt>
27    <dd>minimum frequency in the active set of the fragments to search for</dd>
28    <dt>maxSupport</dt>
29    <dd>maximum frequency in the inactive set of the fragments to search for</dd>
30    <dt>addWholeRings</dt>
31    <dd>if True rings will be added as a whole rather then atom by atom</dd>
32    <dt>canonicalPruning</dt>
33    <dd>if True a cache of all cannonical codes of all fragments will be kept to avoid redundant search</dd>
34    <dt>findClosed</dt>
35    <dd>finds only fragments that are not sub-structures of any other fragment with the same support (default: True)</dd>
36</dl>
37<p class=section>Methods</p>
38<dl class=methods>
39    <dt>Search()</dt>
40    <dd>Runs the fragment search algorithm and returns a list of found fragments</dd>
41</dl>
42<h3>Example</h3>
43<XMP class=code>miner = FragmentMiner(active = ["NC(C)C(=O)O", "NC(CS)C(=O)O", "NC(CO)C(=O)O"], inactive = [], minSupport = 0.6)
44for fragment in miner.Search():
45    print fragment.ToSmiles() , "Support: %.3f" %fragment.Support()</XMP>
46
47<h2>Fragment</h2>
48<p>A class representing a molecular fragment</p>
49<p class=section>Methods</p>
50<dl class=methods>
51    <dt>ToOBMol()</dt>
52    <dd>Returns an openbabel.OBMol object representation</dd>
53    <dt>ToSmiles()</dt>
54    <dd>Returns a SMILES code representation</dd>
55    <dt>ToCanonicalSmiles()</dt>
56    <dd>Returns a canonical SMILES code representation</dd>
57    <dt>Support()</dt>
58    <dd>Returns the support of the fragment in the active set</dd>
59    <dt>OcurrencesIn(smiles)</dt>
60    <dd>Returns the number of times a fragment is containd in the molecule represented by the <code>smiles</code> code argument</dd>
61    <dt>ContainedIn(smiles)</dt>
62    <dd>Returns True if the fragment is present in the molecule represented by the <code>smiles</code> code argument</dd>
63</dl>
64
65<h2>Fragmenter</h2>
66<p>An object that is used to fragment an ExampleTable</p>
67<p class=section>Attributes</p>
68<dl class=attributes>
69    <dt>minSupport</dt>
70    <dd>minimum frequency in the active set of the fragments to search for (default: 0.2)</dd>
71    <dt>maxSupport</dt>
72    <dd>maximum frequency in the inactive set of the fragments to search for (default: 0.2)</dd>
73    <dt>findClosed</dt>
74    <dd>finds only fragments that are not sub-structures of any other fragment with the same support (default: True)</dd>
75</dl>
76<p class=section>Methods</p>
77<dl class=methods>
78    <dt>__call__(data, smilesAttr, activeFunc)</dt>
79    <dd>Takes a data-set, and runs the FragmentMiner on it. Returns a new data-set and the fragments.
80        The new data-set contains new attributes that represent the presence of a fragment that was found.
81        <p class>Arguments</p>
82        <dl class=arguments>
83            <dt>data</dt>
84            <dd>the dataset</dd>
85            <dt>smilesAttr</dt>
86            <dd>the attribute in the data that contains the SMILES codes (if none is provided it will try to make a smart guess)</dd>
87            <dt>activeFunc</dt>
88            <dd>a function that takes an example from the data-set and returns True if the example should be
89                    considered as active (if none is provided all examples are considered active)</dd>
90       </dl>
91    </dd>
92</dl>
93<h3>Example</h3>
94<XMP class=code>fragmenter=Fragmenter(minSupport=0.1, maxSupport=0.05)
95data, fragments=fragmenter(data, "SMILES")
96</XMP>
97
98<h2>FragmentBasedLearner</h2>
99<p>A learner wrapper class that first runs the molecular fragmentation on the data.</p>
100<p class=section>Attributes</p>
101<dl class=attributes>
102    <dt>smilesAttr</dt>
103    <dd>Attribute in the data that contains the smiles codes (if none is provided it will try to make a smart guess)</dd>
104    <dt>learner</dt>
105    <dd>learner that will be used to actualy learn on the fragmented data (default: orngSVM.SVMLearner)</dd>
106    <dt>minSupport</dt>
107    <dd>minimum frequency in the active set of the fragments to search for</dd>
108    <dt>maxSupport</dt>
109    <dd>maximum frequency in the inactive set of the fragments to search for</dd>
110    <dt>activeFunc</dt>
111    <dd>a function that takes an example from the learning data-set and returns True if the example should be
112                    considered as active (if none is provided all examples are considered active)</dd>
113    <dt>findClosed</dt>
114    <dd>finds only fragments that are not sub-structures of any other fragment with the same support (default: True)</dd>
115   
116</dl>
Note: See TracBrowser for help on using the repository browser.