Add functionnal version of bron and carbosh algorith for clique finding

This commit is contained in:
2008-03-06 15:27:17 +00:00
parent a92f16f253
commit 08a709592f
12 changed files with 183 additions and 1431 deletions

View File

@ -1,342 +0,0 @@
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>obitools.oligo</title>
<link rel="stylesheet" href="epydoc.css" type="text/css" />
<script type="text/javascript" src="epydoc.js"></script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="obitools-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Tree link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Index link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Help link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="http://www.grenoble.prabi.fr/trac/OBITools">OBITools</a></th>
</tr></table></th>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="100%">
<span class="breadcrumbs">
<a href="obitools-module.html">Package&nbsp;obitools</a> ::
Package&nbsp;oligo
</span>
</td>
<td>
<table cellpadding="0" cellspacing="0">
<!-- hide/show private -->
<tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
<tr><td align="right"><span class="options"
>[<a href="frames.html" target="_top">frames</a
>]&nbsp;|&nbsp;<a href="obitools.oligo-module.html"
target="_top">no&nbsp;frames</a>]</span></td></tr>
</table>
</td>
</tr>
</table>
<!-- ==================== PACKAGE DESCRIPTION ==================== -->
<h1 class="epydoc">Package oligo</h1><span class="codelink"><a href="obitools.oligo-pysrc.html">source&nbsp;code</a></span><br /><br />
<!-- ==================== SUBMODULES ==================== -->
<a name="section-Submodules"></a>
<table class="summary" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td colspan="2" class="table-header">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr valign="top">
<td align="left"><span class="table-header">Submodules</span></td>
<td align="right" valign="top"
><span class="options">[<a href="#section-Submodules"
class="privatelink" onclick="toggle_private();"
>hide private</a>]</span></td>
</tr>
</table>
</td>
</tr>
<tr><td class="summary">
<ul class="nomargin">
<li> <strong class="uidlink"><a href="obitools.oligo.options-module.html">obitools.oligo.options</a></strong> </li>
<li> <strong class="uidlink"><a href="obitools.oligo.predicat-module.html">obitools.oligo.predicat</a></strong> </li>
</ul></td></tr>
</table>
<br />
<!-- ==================== FUNCTIONS ==================== -->
<a name="section-Functions"></a>
<table class="summary" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td colspan="2" class="table-header">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr valign="top">
<td align="left"><span class="table-header">Functions</span></td>
<td align="right" valign="top"
><span class="options">[<a href="#section-Functions"
class="privatelink" onclick="toggle_private();"
>hide private</a>]</span></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">iterator</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="obitools.oligo-module.html#wordIterator" class="summary-sig-name">wordIterator</a>(<span class="summary-sig-arg">size</span>,
<span class="summary-sig-arg">_prefix</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string"></code><code class="variable-quote">'</code></span>)</span><br />
Iterate thought the list of all DNA word of size `size`.</td>
<td align="right" valign="top">
<span class="codelink"><a href="obitools.oligo-pysrc.html#wordIterator">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">iterator</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="obitools.oligo-module.html#wordSelector" class="summary-sig-name">wordSelector</a>(<span class="summary-sig-arg">words</span>,
<span class="summary-sig-arg">accept</span>=<span class="summary-sig-default">None</span>,
<span class="summary-sig-arg">reject</span>=<span class="summary-sig-default">None</span>)</span><br />
Filter over a DNA word iterator.</td>
<td align="right" valign="top">
<span class="codelink"><a href="obitools.oligo-pysrc.html#wordSelector">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">int</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="obitools.oligo-module.html#wordDist" class="summary-sig-name">wordDist</a>(<span class="summary-sig-arg">w1</span>,
<span class="summary-sig-arg">w2</span>)</span><br />
estimate Hamming distance between two words of the same size.</td>
<td align="right" valign="top">
<span class="codelink"><a href="obitools.oligo-pysrc.html#wordDist">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- ==================== VARIABLES ==================== -->
<a name="section-Variables"></a>
<table class="summary" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td colspan="2" class="table-header">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr valign="top">
<td align="left"><span class="table-header">Variables</span></td>
<td align="right" valign="top"
><span class="options">[<a href="#section-Variables"
class="privatelink" onclick="toggle_private();"
>hide private</a>]</span></td>
</tr>
</table>
</td>
</tr>
<tr class="private">
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<a name="_dna"></a><span class="summary-name">_dna</span> = <code title="'acgt'"><code class="variable-quote">'</code><code class="variable-string">acgt</code><code class="variable-quote">'</code></code>
</td>
</tr>
</table>
<!-- ==================== FUNCTION DETAILS ==================== -->
<a name="section-FunctionDetails"></a>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td colspan="2" class="table-header">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr valign="top">
<td align="left"><span class="table-header">Function Details</span></td>
<td align="right" valign="top"
><span class="options">[<a href="#section-FunctionDetails"
class="privatelink" onclick="toggle_private();"
>hide private</a>]</span></td>
</tr>
</table>
</td>
</tr>
</table>
<a name="wordIterator"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">wordIterator</span>(<span class="sig-arg">size</span>,
<span class="sig-arg">_prefix</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string"></code><code class="variable-quote">'</code></span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="obitools.oligo-pysrc.html#wordIterator">source&nbsp;code</a></span>&nbsp;
</td>
</table>
Iterate thought the list of all DNA word of size `size`.
<dl class="fields">
<dt>Parameters:</dt>
<dd><ul class="nomargin-top">
<li><strong class="pname"><code>size</code></strong> (int) - size of the DNA word</li>
<li><strong class="pname"><code>_prefix</code></strong> (<p>string</p>
@return an iterator on DNA word (str)) - internal parameter used for recursion purpose</li>
</ul></dd>
<dt>Returns: iterator</dt>
</dl>
</td></tr></table>
</div>
<a name="wordSelector"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">wordSelector</span>(<span class="sig-arg">words</span>,
<span class="sig-arg">accept</span>=<span class="sig-default">None</span>,
<span class="sig-arg">reject</span>=<span class="sig-default">None</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="obitools.oligo-pysrc.html#wordSelector">source&nbsp;code</a></span>&nbsp;
</td>
</table>
Filter over a DNA word iterator.
<dl class="fields">
<dt>Parameters:</dt>
<dd><ul class="nomargin-top">
<li><strong class="pname"><code>words</code></strong> (an iterator) - an iterable object other a list of DNA words</li>
<li><strong class="pname"><code>accept</code></strong> (list) - a list of predicat. Eeach predicat is a function accepting one
str parametter and returning a boolean value.</li>
<li><strong class="pname"><code>reject</code></strong> (<p>list</p>
@return an iterator on DNA word (str)) - a list of predicat. Eeach predicat is a function accepting one
str parametter and returning a boolean value.</li>
</ul></dd>
<dt>Returns: iterator</dt>
</dl>
</td></tr></table>
</div>
<a name="wordDist"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">wordDist</span>(<span class="sig-arg">w1</span>,
<span class="sig-arg">w2</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="obitools.oligo-pysrc.html#wordDist">source&nbsp;code</a></span>&nbsp;
</td>
</table>
estimate Hamming distance between two words of the same size.
<dl class="fields">
<dt>Parameters:</dt>
<dd><ul class="nomargin-top">
<li><strong class="pname"><code>w1</code></strong> (str) - the first word</li>
<li><strong class="pname"><code>w2</code></strong> (str) - the second word</li>
</ul></dd>
<dt>Returns: int</dt>
<dd>the count of difference between the two words</dd>
</dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="obitools-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Tree link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Index link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Help link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="http://www.grenoble.prabi.fr/trac/OBITools">OBITools</a></th>
</tr></table></th>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
<a href="epydoc-log.html">Generated by Epydoc
3.0beta1 on Thu Jan 10 09:55:20 2008</a>
</td>
<td align="right" class="footer">
<a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
</td>
</tr>
</table>
<script type="text/javascript">
<!--
// Private objects are initially displayed (because if
// javascript is turned off then we want them to be
// visible); but by default, we want to hide them. So hide
// them unless we have a cookie that says to show them.
checkCookie()
// -->
</script>
</body>
</html>

View File

@ -1,195 +0,0 @@
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>obitools.oligo</title>
<link rel="stylesheet" href="epydoc.css" type="text/css" />
<script type="text/javascript" src="epydoc.js"></script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="obitools-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Tree link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Index link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Help link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="http://www.grenoble.prabi.fr/trac/OBITools">OBITools</a></th>
</tr></table></th>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="100%">
<span class="breadcrumbs">
<a href="obitools-module.html">Package&nbsp;obitools</a> ::
Package&nbsp;oligo
</span>
</td>
<td>
<table cellpadding="0" cellspacing="0">
<!-- hide/show private -->
<tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
<tr><td align="right"><span class="options"
>[<a href="frames.html" target="_top">frames</a
>]&nbsp;|&nbsp;<a href="obitools.oligo-pysrc.html"
target="_top">no&nbsp;frames</a>]</span></td></tr>
</table>
</td>
</tr>
</table>
<h1 class="epydoc">Source Code for <a href="obitools.oligo-module.html">Package obitools.oligo</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno"> 1</tt> <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">itertools</tt> <tt class="py-keyword">import</tt> <tt class="py-name">imap</tt> </tt>
<a name="L2"></a><tt class="py-lineno"> 2</tt> <tt class="py-line"> </tt>
<a name="L3"></a><tt class="py-lineno"> 3</tt> <tt class="py-line"> </tt>
<a name="L4"></a><tt class="py-lineno"> 4</tt> <tt class="py-line"><tt id="link-0" class="py-name" targets="Variable obitools.oligo._dna=obitools.oligo-module.html#_dna"><a title="obitools.oligo._dna" class="py-name" href="#" onclick="return doclink('link-0', '_dna', 'link-0');">_dna</a></tt><tt class="py-op">=</tt><tt class="py-string">'acgt'</tt> </tt>
<a name="L5"></a><tt class="py-lineno"> 5</tt> <tt class="py-line"> </tt>
<a name="wordIterator"></a><div id="wordIterator-def"><a name="L6"></a><tt class="py-lineno"> 6</tt> <a class="py-toggle" href="#" id="wordIterator-toggle" onclick="return toggle('wordIterator');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="obitools.oligo-module.html#wordIterator">wordIterator</a><tt class="py-op">(</tt><tt class="py-param">size</tt><tt class="py-op">,</tt><tt class="py-param">_prefix</tt><tt class="py-op">=</tt><tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="wordIterator-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="wordIterator-expanded"><a name="L7"></a><tt class="py-lineno"> 7</tt> <tt class="py-line"> <tt class="py-docstring">'''</tt> </tt>
<a name="L8"></a><tt class="py-lineno"> 8</tt> <tt class="py-line"><tt class="py-docstring"> Iterate thought the list of all DNA word of</tt> </tt>
<a name="L9"></a><tt class="py-lineno"> 9</tt> <tt class="py-line"><tt class="py-docstring"> size `size`.</tt> </tt>
<a name="L10"></a><tt class="py-lineno">10</tt> <tt class="py-line"><tt class="py-docstring"> </tt> </tt>
<a name="L11"></a><tt class="py-lineno">11</tt> <tt class="py-line"><tt class="py-docstring"> @param size: size of the DNA word</tt> </tt>
<a name="L12"></a><tt class="py-lineno">12</tt> <tt class="py-line"><tt class="py-docstring"> @type size: int</tt> </tt>
<a name="L13"></a><tt class="py-lineno">13</tt> <tt class="py-line"><tt class="py-docstring"> @param _prefix: internal parameter used for recursion purpose</tt> </tt>
<a name="L14"></a><tt class="py-lineno">14</tt> <tt class="py-line"><tt class="py-docstring"> @type _prefix: string</tt> </tt>
<a name="L15"></a><tt class="py-lineno">15</tt> <tt class="py-line"><tt class="py-docstring"> </tt> </tt>
<a name="L16"></a><tt class="py-lineno">16</tt> <tt class="py-line"><tt class="py-docstring"> @return an iterator on DNA word (str)</tt> </tt>
<a name="L17"></a><tt class="py-lineno">17</tt> <tt class="py-line"><tt class="py-docstring"> @rtype: iterator</tt> </tt>
<a name="L18"></a><tt class="py-lineno">18</tt> <tt class="py-line"><tt class="py-docstring"> '''</tt> </tt>
<a name="L19"></a><tt class="py-lineno">19</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">size</tt><tt class="py-op">:</tt> </tt>
<a name="L20"></a><tt class="py-lineno">20</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">l</tt> <tt class="py-keyword">in</tt> <tt id="link-1" class="py-name"><a title="obitools.oligo._dna" class="py-name" href="#" onclick="return doclink('link-1', '_dna', 'link-0');">_dna</a></tt><tt class="py-op">:</tt> </tt>
<a name="L21"></a><tt class="py-lineno">21</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">w</tt> <tt class="py-keyword">in</tt> <tt id="link-2" class="py-name" targets="Function obitools.oligo.wordIterator()=obitools.oligo-module.html#wordIterator"><a title="obitools.oligo.wordIterator" class="py-name" href="#" onclick="return doclink('link-2', 'wordIterator', 'link-2');">wordIterator</a></tt><tt class="py-op">(</tt><tt class="py-name">size</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">,</tt><tt class="py-name">_prefix</tt><tt class="py-op">+</tt><tt class="py-name">l</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L22"></a><tt class="py-lineno">22</tt> <tt class="py-line"> <tt class="py-keyword">yield</tt> <tt class="py-name">w</tt> </tt>
<a name="L23"></a><tt class="py-lineno">23</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L24"></a><tt class="py-lineno">24</tt> <tt class="py-line"> <tt class="py-keyword">yield</tt> <tt class="py-name">_prefix</tt> </tt>
</div><a name="L25"></a><tt class="py-lineno">25</tt> <tt class="py-line"> </tt>
<a name="wordSelector"></a><div id="wordSelector-def"><a name="L26"></a><tt class="py-lineno">26</tt> <a class="py-toggle" href="#" id="wordSelector-toggle" onclick="return toggle('wordSelector');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="obitools.oligo-module.html#wordSelector">wordSelector</a><tt class="py-op">(</tt><tt class="py-param">words</tt><tt class="py-op">,</tt><tt class="py-param">accept</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-param">reject</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="wordSelector-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="wordSelector-expanded"><a name="L27"></a><tt class="py-lineno">27</tt> <tt class="py-line"> <tt class="py-docstring">'''</tt> </tt>
<a name="L28"></a><tt class="py-lineno">28</tt> <tt class="py-line"><tt class="py-docstring"> Filter over a DNA word iterator.</tt> </tt>
<a name="L29"></a><tt class="py-lineno">29</tt> <tt class="py-line"><tt class="py-docstring"> </tt> </tt>
<a name="L30"></a><tt class="py-lineno">30</tt> <tt class="py-line"><tt class="py-docstring"> @param words: an iterable object other a list of DNA words</tt> </tt>
<a name="L31"></a><tt class="py-lineno">31</tt> <tt class="py-line"><tt class="py-docstring"> @type words: an iterator</tt> </tt>
<a name="L32"></a><tt class="py-lineno">32</tt> <tt class="py-line"><tt class="py-docstring"> @param accept: a list of predicat. Eeach predicat is a function</tt> </tt>
<a name="L33"></a><tt class="py-lineno">33</tt> <tt class="py-line"><tt class="py-docstring"> accepting one str parametter and returning a boolean</tt> </tt>
<a name="L34"></a><tt class="py-lineno">34</tt> <tt class="py-line"><tt class="py-docstring"> value.</tt> </tt>
<a name="L35"></a><tt class="py-lineno">35</tt> <tt class="py-line"><tt class="py-docstring"> @type accept: list</tt> </tt>
<a name="L36"></a><tt class="py-lineno">36</tt> <tt class="py-line"><tt class="py-docstring"> @param reject: a list of predicat. Eeach predicat is a function</tt> </tt>
<a name="L37"></a><tt class="py-lineno">37</tt> <tt class="py-line"><tt class="py-docstring"> accepting one str parametter and returning a boolean</tt> </tt>
<a name="L38"></a><tt class="py-lineno">38</tt> <tt class="py-line"><tt class="py-docstring"> value.</tt> </tt>
<a name="L39"></a><tt class="py-lineno">39</tt> <tt class="py-line"><tt class="py-docstring"> @type reject: list</tt> </tt>
<a name="L40"></a><tt class="py-lineno">40</tt> <tt class="py-line"><tt class="py-docstring"> </tt> </tt>
<a name="L41"></a><tt class="py-lineno">41</tt> <tt class="py-line"><tt class="py-docstring"> @return an iterator on DNA word (str)</tt> </tt>
<a name="L42"></a><tt class="py-lineno">42</tt> <tt class="py-line"><tt class="py-docstring"> @rtype: iterator</tt> </tt>
<a name="L43"></a><tt class="py-lineno">43</tt> <tt class="py-line"><tt class="py-docstring"> '''</tt> </tt>
<a name="L44"></a><tt class="py-lineno">44</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">accept</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L45"></a><tt class="py-lineno">45</tt> <tt class="py-line"> <tt class="py-name">accept</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L46"></a><tt class="py-lineno">46</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">reject</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L47"></a><tt class="py-lineno">47</tt> <tt class="py-line"> <tt class="py-name">reject</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L48"></a><tt class="py-lineno">48</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">w</tt> <tt class="py-keyword">in</tt> <tt class="py-name">words</tt><tt class="py-op">:</tt> </tt>
<a name="L49"></a><tt class="py-lineno">49</tt> <tt class="py-line"> <tt class="py-name">accepted</tt> <tt class="py-op">=</tt> <tt class="py-name">reduce</tt><tt class="py-op">(</tt><tt class="py-keyword">lambda</tt> <tt class="py-name">x</tt><tt class="py-op">,</tt><tt class="py-name">y</tt><tt class="py-op">:</tt> <tt class="py-name">bool</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">)</tt> <tt class="py-keyword">and</tt> <tt class="py-name">bool</tt><tt class="py-op">(</tt><tt class="py-name">y</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L50"></a><tt class="py-lineno">50</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-name">p</tt><tt class="py-op">(</tt><tt class="py-name">w</tt><tt class="py-op">)</tt> <tt class="py-keyword">for</tt> <tt class="py-name">p</tt> <tt class="py-keyword">in</tt> <tt class="py-name">accept</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L51"></a><tt class="py-lineno">51</tt> <tt class="py-line"> <tt class="py-name">True</tt><tt class="py-op">)</tt> </tt>
<a name="L52"></a><tt class="py-lineno">52</tt> <tt class="py-line"> <tt class="py-name">rejected</tt> <tt class="py-op">=</tt> <tt class="py-name">reduce</tt><tt class="py-op">(</tt><tt class="py-keyword">lambda</tt> <tt class="py-name">x</tt><tt class="py-op">,</tt><tt class="py-name">y</tt><tt class="py-op">:</tt><tt class="py-name">bool</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">)</tt> <tt class="py-keyword">or</tt> <tt class="py-name">bool</tt><tt class="py-op">(</tt><tt class="py-name">y</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L53"></a><tt class="py-lineno">53</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-name">p</tt><tt class="py-op">(</tt><tt class="py-name">w</tt><tt class="py-op">)</tt> <tt class="py-keyword">for</tt> <tt class="py-name">p</tt> <tt class="py-keyword">in</tt> <tt class="py-name">reject</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L54"></a><tt class="py-lineno">54</tt> <tt class="py-line"> <tt class="py-name">False</tt><tt class="py-op">)</tt> </tt>
<a name="L55"></a><tt class="py-lineno">55</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">accepted</tt> <tt class="py-keyword">and</tt> <tt class="py-keyword">not</tt> <tt class="py-name">rejected</tt><tt class="py-op">:</tt> </tt>
<a name="L56"></a><tt class="py-lineno">56</tt> <tt class="py-line"> <tt class="py-keyword">yield</tt> <tt class="py-name">w</tt> </tt>
</div><a name="L57"></a><tt class="py-lineno">57</tt> <tt class="py-line"> </tt>
<a name="wordDist"></a><div id="wordDist-def"><a name="L58"></a><tt class="py-lineno">58</tt> <a class="py-toggle" href="#" id="wordDist-toggle" onclick="return toggle('wordDist');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="obitools.oligo-module.html#wordDist">wordDist</a><tt class="py-op">(</tt><tt class="py-param">w1</tt><tt class="py-op">,</tt><tt class="py-param">w2</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="wordDist-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="wordDist-expanded"><a name="L59"></a><tt class="py-lineno">59</tt> <tt class="py-line"> <tt class="py-docstring">'''</tt> </tt>
<a name="L60"></a><tt class="py-lineno">60</tt> <tt class="py-line"><tt class="py-docstring"> estimate Hamming distance between two words of the same size.</tt> </tt>
<a name="L61"></a><tt class="py-lineno">61</tt> <tt class="py-line"><tt class="py-docstring"> </tt> </tt>
<a name="L62"></a><tt class="py-lineno">62</tt> <tt class="py-line"><tt class="py-docstring"> @param w1: the first word</tt> </tt>
<a name="L63"></a><tt class="py-lineno">63</tt> <tt class="py-line"><tt class="py-docstring"> @type w1: str</tt> </tt>
<a name="L64"></a><tt class="py-lineno">64</tt> <tt class="py-line"><tt class="py-docstring"> @param w2: the second word</tt> </tt>
<a name="L65"></a><tt class="py-lineno">65</tt> <tt class="py-line"><tt class="py-docstring"> @type w2: str</tt> </tt>
<a name="L66"></a><tt class="py-lineno">66</tt> <tt class="py-line"><tt class="py-docstring"> </tt> </tt>
<a name="L67"></a><tt class="py-lineno">67</tt> <tt class="py-line"><tt class="py-docstring"> @return: the count of difference between the two words</tt> </tt>
<a name="L68"></a><tt class="py-lineno">68</tt> <tt class="py-line"><tt class="py-docstring"> @rtype: int</tt> </tt>
<a name="L69"></a><tt class="py-lineno">69</tt> <tt class="py-line"><tt class="py-docstring"> '''</tt> </tt>
<a name="L70"></a><tt class="py-lineno">70</tt> <tt class="py-line"> <tt class="py-name">dist</tt> <tt class="py-op">=</tt> <tt class="py-name">reduce</tt><tt class="py-op">(</tt><tt class="py-keyword">lambda</tt> <tt class="py-name">x</tt><tt class="py-op">,</tt><tt class="py-name">y</tt><tt class="py-op">:</tt><tt class="py-name">x</tt><tt class="py-op">+</tt><tt class="py-name">y</tt><tt class="py-op">,</tt> </tt>
<a name="L71"></a><tt class="py-lineno">71</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-name">int</tt><tt class="py-op">(</tt><tt class="py-name">i</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">!=</tt><tt class="py-name">i</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L72"></a><tt class="py-lineno">72</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">i</tt> <tt class="py-keyword">in</tt> <tt class="py-name">imap</tt><tt class="py-op">(</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-name">w1</tt><tt class="py-op">,</tt><tt class="py-name">w2</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L73"></a><tt class="py-lineno">73</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">dist</tt> </tt>
</div><a name="L74"></a><tt class="py-lineno">74</tt> <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="obitools-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Tree link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Index link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Help link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="http://www.grenoble.prabi.fr/trac/OBITools">OBITools</a></th>
</tr></table></th>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
<a href="epydoc-log.html">Generated by Epydoc
3.0beta1 on Thu Jan 10 09:55:33 2008</a>
</td>
<td align="right" class="footer">
<a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
</td>
</tr>
</table>
<script type="text/javascript">
<!--
// Private objects are initially displayed (because if
// javascript is turned off then we want them to be
// visible); but by default, we want to hide them. So hide
// them unless we have a cookie that says to show them.
checkCookie()
// -->
</script>
</body>
</html>

View File

@ -1,204 +0,0 @@
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>obitools.oligo.options</title>
<link rel="stylesheet" href="epydoc.css" type="text/css" />
<script type="text/javascript" src="epydoc.js"></script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="obitools-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Tree link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Index link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Help link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="http://www.grenoble.prabi.fr/trac/OBITools">OBITools</a></th>
</tr></table></th>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="100%">
<span class="breadcrumbs">
<a href="obitools-module.html">Package&nbsp;obitools</a> ::
<a href="obitools.oligo-module.html">Package&nbsp;oligo</a> ::
Module&nbsp;options
</span>
</td>
<td>
<table cellpadding="0" cellspacing="0">
<!-- hide/show private -->
<tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
<tr><td align="right"><span class="options"
>[<a href="frames.html" target="_top">frames</a
>]&nbsp;|&nbsp;<a href="obitools.oligo.options-module.html"
target="_top">no&nbsp;frames</a>]</span></td></tr>
</table>
</td>
</tr>
</table>
<!-- ==================== MODULE DESCRIPTION ==================== -->
<h1 class="epydoc">Module options</h1><span class="codelink"><a href="obitools.oligo.options-pysrc.html">source&nbsp;code</a></span><br /><br />
<!-- ==================== FUNCTIONS ==================== -->
<a name="section-Functions"></a>
<table class="summary" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td colspan="2" class="table-header">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr valign="top">
<td align="left"><span class="table-header">Functions</span></td>
<td align="right" valign="top"
><span class="options">[<a href="#section-Functions"
class="privatelink" onclick="toggle_private();"
>hide private</a>]</span></td>
</tr>
</table>
</td>
</tr>
<tr class="private">
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="_acceptedOptionCallback"></a><span class="summary-sig-name">_acceptedOptionCallback</span>(<span class="summary-sig-arg">options</span>,
<span class="summary-sig-arg">opt</span>,
<span class="summary-sig-arg">value</span>,
<span class="summary-sig-arg">parser</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="obitools.oligo.options-pysrc.html#_acceptedOptionCallback">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr class="private">
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="_rejectedOptionCallback"></a><span class="summary-sig-name">_rejectedOptionCallback</span>(<span class="summary-sig-arg">options</span>,
<span class="summary-sig-arg">opt</span>,
<span class="summary-sig-arg">value</span>,
<span class="summary-sig-arg">parser</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="obitools.oligo.options-pysrc.html#_rejectedOptionCallback">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="addOligoOptions"></a><span class="summary-sig-name">addOligoOptions</span>(<span class="summary-sig-arg">optionManager</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="obitools.oligo.options-pysrc.html#addOligoOptions">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="dnaWordIterator"></a><span class="summary-sig-name">dnaWordIterator</span>(<span class="summary-sig-arg">options</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="obitools.oligo.options-pysrc.html#dnaWordIterator">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="obitools-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Tree link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Index link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Help link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="http://www.grenoble.prabi.fr/trac/OBITools">OBITools</a></th>
</tr></table></th>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
<a href="epydoc-log.html">Generated by Epydoc
3.0beta1 on Thu Jan 10 09:55:20 2008</a>
</td>
<td align="right" class="footer">
<a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
</td>
</tr>
</table>
<script type="text/javascript">
<!--
// Private objects are initially displayed (because if
// javascript is turned off then we want them to be
// visible); but by default, we want to hide them. So hide
// them unless we have a cookie that says to show them.
checkCookie()
// -->
</script>
</body>
</html>

View File

@ -1,270 +0,0 @@
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>obitools.oligo.options</title>
<link rel="stylesheet" href="epydoc.css" type="text/css" />
<script type="text/javascript" src="epydoc.js"></script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="obitools-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Tree link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Index link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Help link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="http://www.grenoble.prabi.fr/trac/OBITools">OBITools</a></th>
</tr></table></th>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="100%">
<span class="breadcrumbs">
<a href="obitools-module.html">Package&nbsp;obitools</a> ::
<a href="obitools.oligo-module.html">Package&nbsp;oligo</a> ::
Module&nbsp;options
</span>
</td>
<td>
<table cellpadding="0" cellspacing="0">
<!-- hide/show private -->
<tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
<tr><td align="right"><span class="options"
>[<a href="frames.html" target="_top">frames</a
>]&nbsp;|&nbsp;<a href="obitools.oligo.options-pysrc.html"
target="_top">no&nbsp;frames</a>]</span></td></tr>
</table>
</td>
</tr>
</table>
<h1 class="epydoc">Source Code for <a href="obitools.oligo.options-module.html">Module obitools.oligo.options</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno"> 1</tt> <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">logging</tt> <tt class="py-keyword">import</tt> <tt class="py-name">debug</tt><tt class="py-op">,</tt><tt class="py-name">root</tt><tt class="py-op">,</tt><tt class="py-name">DEBUG</tt> </tt>
<a name="L2"></a><tt class="py-lineno"> 2</tt> <tt class="py-line"> </tt>
<a name="L3"></a><tt class="py-lineno"> 3</tt> <tt class="py-line"> </tt>
<a name="L4"></a><tt class="py-lineno"> 4</tt> <tt class="py-line"> </tt>
<a name="L5"></a><tt class="py-lineno"> 5</tt> <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-0" class="py-name" targets="Package obitools=obitools-module.html"><a title="obitools" class="py-name" href="#" onclick="return doclink('link-0', 'obitools', 'link-0');">obitools</a></tt><tt class="py-op">.</tt><tt id="link-1" class="py-name" targets="Package obitools.oligo=obitools.oligo-module.html"><a title="obitools.oligo" class="py-name" href="#" onclick="return doclink('link-1', 'oligo', 'link-1');">oligo</a></tt> <tt class="py-keyword">import</tt> <tt id="link-2" class="py-name" targets="Function obitools.oligo.wordSelector()=obitools.oligo-module.html#wordSelector"><a title="obitools.oligo.wordSelector" class="py-name" href="#" onclick="return doclink('link-2', 'wordSelector', 'link-2');">wordSelector</a></tt><tt class="py-op">,</tt><tt id="link-3" class="py-name" targets="Function obitools.oligo.wordIterator()=obitools.oligo-module.html#wordIterator"><a title="obitools.oligo.wordIterator" class="py-name" href="#" onclick="return doclink('link-3', 'wordIterator', 'link-3');">wordIterator</a></tt> </tt>
<a name="L6"></a><tt class="py-lineno"> 6</tt> <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-4" class="py-name"><a title="obitools" class="py-name" href="#" onclick="return doclink('link-4', 'obitools', 'link-0');">obitools</a></tt><tt class="py-op">.</tt><tt id="link-5" class="py-name"><a title="obitools.oligo" class="py-name" href="#" onclick="return doclink('link-5', 'oligo', 'link-1');">oligo</a></tt> <tt class="py-keyword">import</tt> <tt id="link-6" class="py-name" targets="Module obitools.oligo.predicat=obitools.oligo.predicat-module.html"><a title="obitools.oligo.predicat" class="py-name" href="#" onclick="return doclink('link-6', 'predicat', 'link-6');">predicat</a></tt> </tt>
<a name="L7"></a><tt class="py-lineno"> 7</tt> <tt class="py-line"> </tt>
<a name="L8"></a><tt class="py-lineno"> 8</tt> <tt class="py-line"> </tt>
<a name="L9"></a><tt class="py-lineno"> 9</tt> <tt class="py-line"> </tt>
<a name="_acceptedOptionCallback"></a><div id="_acceptedOptionCallback-def"><a name="L10"></a><tt class="py-lineno"> 10</tt> <a class="py-toggle" href="#" id="_acceptedOptionCallback-toggle" onclick="return toggle('_acceptedOptionCallback');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="obitools.oligo.options-module.html#_acceptedOptionCallback">_acceptedOptionCallback</a><tt class="py-op">(</tt><tt class="py-param">options</tt><tt class="py-op">,</tt><tt class="py-param">opt</tt><tt class="py-op">,</tt><tt class="py-param">value</tt><tt class="py-op">,</tt><tt class="py-param">parser</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="_acceptedOptionCallback-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="_acceptedOptionCallback-expanded"><a name="L11"></a><tt class="py-lineno"> 11</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">hasattr</tt><tt class="py-op">(</tt><tt class="py-name">parser</tt><tt class="py-op">.</tt><tt class="py-name">values</tt><tt class="py-op">,</tt> <tt class="py-string">'acceptedOligo'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L12"></a><tt class="py-lineno"> 12</tt> <tt class="py-line"> <tt class="py-name">parser</tt><tt class="py-op">.</tt><tt class="py-name">values</tt><tt class="py-op">.</tt><tt class="py-name">acceptedOligo</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L13"></a><tt class="py-lineno"> 13</tt> <tt class="py-line"> <tt class="py-name">parser</tt><tt class="py-op">.</tt><tt class="py-name">values</tt><tt class="py-op">.</tt><tt class="py-name">acceptedOligo</tt><tt class="py-op">.</tt><tt id="link-7" class="py-name" targets="Method obitools.align.Alignement.append()=obitools.align.Alignement-class.html#append"><a title="obitools.align.Alignement.append" class="py-name" href="#" onclick="return doclink('link-7', 'append', 'link-7');">append</a></tt><tt class="py-op">(</tt><tt id="link-8" class="py-name"><a title="obitools.oligo.predicat" class="py-name" href="#" onclick="return doclink('link-8', 'predicat', 'link-6');">predicat</a></tt><tt class="py-op">.</tt><tt id="link-9" class="py-name" targets="Function obitools.oligo.predicat.rePredicatGenerator()=obitools.oligo.predicat-module.html#rePredicatGenerator"><a title="obitools.oligo.predicat.rePredicatGenerator" class="py-name" href="#" onclick="return doclink('link-9', 'rePredicatGenerator', 'link-9');">rePredicatGenerator</a></tt><tt class="py-op">(</tt><tt class="py-name">value</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L14"></a><tt class="py-lineno"> 14</tt> <tt class="py-line"> </tt>
<a name="_rejectedOptionCallback"></a><div id="_rejectedOptionCallback-def"><a name="L15"></a><tt class="py-lineno"> 15</tt> <a class="py-toggle" href="#" id="_rejectedOptionCallback-toggle" onclick="return toggle('_rejectedOptionCallback');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="obitools.oligo.options-module.html#_rejectedOptionCallback">_rejectedOptionCallback</a><tt class="py-op">(</tt><tt class="py-param">options</tt><tt class="py-op">,</tt><tt class="py-param">opt</tt><tt class="py-op">,</tt><tt class="py-param">value</tt><tt class="py-op">,</tt><tt class="py-param">parser</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="_rejectedOptionCallback-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="_rejectedOptionCallback-expanded"><a name="L16"></a><tt class="py-lineno"> 16</tt> <tt class="py-line"> <tt class="py-name">debug</tt><tt class="py-op">(</tt><tt class="py-name">value</tt><tt class="py-op">)</tt> </tt>
<a name="L17"></a><tt class="py-lineno"> 17</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">hasattr</tt><tt class="py-op">(</tt><tt class="py-name">parser</tt><tt class="py-op">.</tt><tt class="py-name">values</tt><tt class="py-op">,</tt> <tt class="py-string">'rejectedOligo'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L18"></a><tt class="py-lineno"> 18</tt> <tt class="py-line"> <tt class="py-name">parser</tt><tt class="py-op">.</tt><tt class="py-name">values</tt><tt class="py-op">.</tt><tt class="py-name">rejectedOligo</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L19"></a><tt class="py-lineno"> 19</tt> <tt class="py-line"> <tt class="py-name">parser</tt><tt class="py-op">.</tt><tt class="py-name">values</tt><tt class="py-op">.</tt><tt class="py-name">rejectedOligo</tt><tt class="py-op">.</tt><tt id="link-10" class="py-name"><a title="obitools.align.Alignement.append" class="py-name" href="#" onclick="return doclink('link-10', 'append', 'link-7');">append</a></tt><tt class="py-op">(</tt><tt id="link-11" class="py-name"><a title="obitools.oligo.predicat" class="py-name" href="#" onclick="return doclink('link-11', 'predicat', 'link-6');">predicat</a></tt><tt class="py-op">.</tt><tt id="link-12" class="py-name"><a title="obitools.oligo.predicat.rePredicatGenerator" class="py-name" href="#" onclick="return doclink('link-12', 'rePredicatGenerator', 'link-9');">rePredicatGenerator</a></tt><tt class="py-op">(</tt><tt class="py-name">value</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L20"></a><tt class="py-lineno"> 20</tt> <tt class="py-line"> </tt>
<a name="L21"></a><tt class="py-lineno"> 21</tt> <tt class="py-line"> </tt>
<a name="L22"></a><tt class="py-lineno"> 22</tt> <tt class="py-line"> </tt>
<a name="addOligoOptions"></a><div id="addOligoOptions-def"><a name="L23"></a><tt class="py-lineno"> 23</tt> <a class="py-toggle" href="#" id="addOligoOptions-toggle" onclick="return toggle('addOligoOptions');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="obitools.oligo.options-module.html#addOligoOptions">addOligoOptions</a><tt class="py-op">(</tt><tt class="py-param">optionManager</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="addOligoOptions-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="addOligoOptions-expanded"><a name="L24"></a><tt class="py-lineno"> 24</tt> <tt class="py-line"> </tt>
<a name="L25"></a><tt class="py-lineno"> 25</tt> <tt class="py-line"> <tt class="py-name">optionManager</tt><tt class="py-op">.</tt><tt class="py-name">add_option</tt><tt class="py-op">(</tt><tt class="py-string">'-s'</tt><tt class="py-op">,</tt><tt class="py-string">'--oligo-size'</tt><tt class="py-op">,</tt> </tt>
<a name="L26"></a><tt class="py-lineno"> 26</tt> <tt class="py-line"> <tt class="py-name">action</tt><tt class="py-op">=</tt><tt class="py-string">"store"</tt><tt class="py-op">,</tt> <tt class="py-name">dest</tt><tt class="py-op">=</tt><tt class="py-string">"oligoSize"</tt><tt class="py-op">,</tt> </tt>
<a name="L27"></a><tt class="py-lineno"> 27</tt> <tt class="py-line"> <tt class="py-name">metavar</tt><tt class="py-op">=</tt><tt class="py-string">"&lt;###&gt;"</tt><tt class="py-op">,</tt> </tt>
<a name="L28"></a><tt class="py-lineno"> 28</tt> <tt class="py-line"> <tt class="py-name">type</tt><tt class="py-op">=</tt><tt class="py-string">"int"</tt><tt class="py-op">,</tt> </tt>
<a name="L29"></a><tt class="py-lineno"> 29</tt> <tt class="py-line"> <tt class="py-name">help</tt><tt class="py-op">=</tt><tt class="py-string">"Size of oligonucleotide to generate"</tt><tt class="py-op">)</tt> </tt>
<a name="L30"></a><tt class="py-lineno"> 30</tt> <tt class="py-line"> </tt>
<a name="L31"></a><tt class="py-lineno"> 31</tt> <tt class="py-line"> <tt class="py-name">optionManager</tt><tt class="py-op">.</tt><tt class="py-name">add_option</tt><tt class="py-op">(</tt><tt class="py-string">'-f'</tt><tt class="py-op">,</tt><tt class="py-string">'--family-size'</tt><tt class="py-op">,</tt> </tt>
<a name="L32"></a><tt class="py-lineno"> 32</tt> <tt class="py-line"> <tt class="py-name">action</tt><tt class="py-op">=</tt><tt class="py-string">"store"</tt><tt class="py-op">,</tt> <tt class="py-name">dest</tt><tt class="py-op">=</tt><tt class="py-string">"familySize"</tt><tt class="py-op">,</tt> </tt>
<a name="L33"></a><tt class="py-lineno"> 33</tt> <tt class="py-line"> <tt class="py-name">metavar</tt><tt class="py-op">=</tt><tt class="py-string">"&lt;###&gt;"</tt><tt class="py-op">,</tt> </tt>
<a name="L34"></a><tt class="py-lineno"> 34</tt> <tt class="py-line"> <tt class="py-name">type</tt><tt class="py-op">=</tt><tt class="py-string">"int"</tt><tt class="py-op">,</tt> </tt>
<a name="L35"></a><tt class="py-lineno"> 35</tt> <tt class="py-line"> <tt class="py-name">help</tt><tt class="py-op">=</tt><tt class="py-string">"Size of oligonucleotide family to generate"</tt><tt class="py-op">)</tt> </tt>
<a name="L36"></a><tt class="py-lineno"> 36</tt> <tt class="py-line"> </tt>
<a name="L37"></a><tt class="py-lineno"> 37</tt> <tt class="py-line"> <tt class="py-name">optionManager</tt><tt class="py-op">.</tt><tt class="py-name">add_option</tt><tt class="py-op">(</tt><tt class="py-string">'-d'</tt><tt class="py-op">,</tt><tt class="py-string">'--distance'</tt><tt class="py-op">,</tt> </tt>
<a name="L38"></a><tt class="py-lineno"> 38</tt> <tt class="py-line"> <tt class="py-name">action</tt><tt class="py-op">=</tt><tt class="py-string">"store"</tt><tt class="py-op">,</tt> <tt class="py-name">dest</tt><tt class="py-op">=</tt><tt class="py-string">"oligoDist"</tt><tt class="py-op">,</tt> </tt>
<a name="L39"></a><tt class="py-lineno"> 39</tt> <tt class="py-line"> <tt class="py-name">metavar</tt><tt class="py-op">=</tt><tt class="py-string">"&lt;###&gt;"</tt><tt class="py-op">,</tt> </tt>
<a name="L40"></a><tt class="py-lineno"> 40</tt> <tt class="py-line"> <tt class="py-name">type</tt><tt class="py-op">=</tt><tt class="py-string">"int"</tt><tt class="py-op">,</tt> </tt>
<a name="L41"></a><tt class="py-lineno"> 41</tt> <tt class="py-line"> <tt class="py-name">default</tt><tt class="py-op">=</tt><tt class="py-number">1</tt><tt class="py-op">,</tt> </tt>
<a name="L42"></a><tt class="py-lineno"> 42</tt> <tt class="py-line"> <tt class="py-name">help</tt><tt class="py-op">=</tt><tt class="py-string">"minimal distance between two oligonucleotides"</tt><tt class="py-op">)</tt> </tt>
<a name="L43"></a><tt class="py-lineno"> 43</tt> <tt class="py-line"> </tt>
<a name="L44"></a><tt class="py-lineno"> 44</tt> <tt class="py-line"> <tt class="py-name">optionManager</tt><tt class="py-op">.</tt><tt class="py-name">add_option</tt><tt class="py-op">(</tt><tt class="py-string">'-g'</tt><tt class="py-op">,</tt><tt class="py-string">'--gc-max'</tt><tt class="py-op">,</tt> </tt>
<a name="L45"></a><tt class="py-lineno"> 45</tt> <tt class="py-line"> <tt class="py-name">action</tt><tt class="py-op">=</tt><tt class="py-string">"store"</tt><tt class="py-op">,</tt> <tt class="py-name">dest</tt><tt class="py-op">=</tt><tt class="py-string">"gcMax"</tt><tt class="py-op">,</tt> </tt>
<a name="L46"></a><tt class="py-lineno"> 46</tt> <tt class="py-line"> <tt class="py-name">metavar</tt><tt class="py-op">=</tt><tt class="py-string">"&lt;###&gt;"</tt><tt class="py-op">,</tt> </tt>
<a name="L47"></a><tt class="py-lineno"> 47</tt> <tt class="py-line"> <tt class="py-name">type</tt><tt class="py-op">=</tt><tt class="py-string">"int"</tt><tt class="py-op">,</tt> </tt>
<a name="L48"></a><tt class="py-lineno"> 48</tt> <tt class="py-line"> <tt class="py-name">default</tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> </tt>
<a name="L49"></a><tt class="py-lineno"> 49</tt> <tt class="py-line"> <tt class="py-name">help</tt><tt class="py-op">=</tt><tt class="py-string">"maximum count of G or C nucleotide acceptable in a word"</tt><tt class="py-op">)</tt> </tt>
<a name="L50"></a><tt class="py-lineno"> 50</tt> <tt class="py-line"> </tt>
<a name="L51"></a><tt class="py-lineno"> 51</tt> <tt class="py-line"> <tt class="py-name">optionManager</tt><tt class="py-op">.</tt><tt class="py-name">add_option</tt><tt class="py-op">(</tt><tt class="py-string">'-a'</tt><tt class="py-op">,</tt><tt class="py-string">'--accepted'</tt><tt class="py-op">,</tt> </tt>
<a name="L52"></a><tt class="py-lineno"> 52</tt> <tt class="py-line"> <tt class="py-name">action</tt><tt class="py-op">=</tt><tt class="py-string">"callback"</tt><tt class="py-op">,</tt> <tt class="py-name">callback</tt><tt class="py-op">=</tt><tt id="link-13" class="py-name" targets="Function obitools.oligo.options._acceptedOptionCallback()=obitools.oligo.options-module.html#_acceptedOptionCallback"><a title="obitools.oligo.options._acceptedOptionCallback" class="py-name" href="#" onclick="return doclink('link-13', '_acceptedOptionCallback', 'link-13');">_acceptedOptionCallback</a></tt><tt class="py-op">,</tt> </tt>
<a name="L53"></a><tt class="py-lineno"> 53</tt> <tt class="py-line"> <tt class="py-name">metavar</tt><tt class="py-op">=</tt><tt class="py-string">"&lt;regular pattern&gt;"</tt><tt class="py-op">,</tt> </tt>
<a name="L54"></a><tt class="py-lineno"> 54</tt> <tt class="py-line"> <tt class="py-name">type</tt><tt class="py-op">=</tt><tt class="py-string">"str"</tt><tt class="py-op">,</tt> </tt>
<a name="L55"></a><tt class="py-lineno"> 55</tt> <tt class="py-line"> <tt class="py-name">help</tt><tt class="py-op">=</tt><tt class="py-string">"pattern of accepted oligonucleotide"</tt><tt class="py-op">)</tt> </tt>
<a name="L56"></a><tt class="py-lineno"> 56</tt> <tt class="py-line"> </tt>
<a name="L57"></a><tt class="py-lineno"> 57</tt> <tt class="py-line"> <tt class="py-name">optionManager</tt><tt class="py-op">.</tt><tt class="py-name">add_option</tt><tt class="py-op">(</tt><tt class="py-string">'-r'</tt><tt class="py-op">,</tt><tt class="py-string">'--rejected'</tt><tt class="py-op">,</tt> </tt>
<a name="L58"></a><tt class="py-lineno"> 58</tt> <tt class="py-line"> <tt class="py-name">action</tt><tt class="py-op">=</tt><tt class="py-string">"callback"</tt><tt class="py-op">,</tt> <tt class="py-name">callback</tt><tt class="py-op">=</tt><tt id="link-14" class="py-name" targets="Function obitools.oligo.options._rejectedOptionCallback()=obitools.oligo.options-module.html#_rejectedOptionCallback"><a title="obitools.oligo.options._rejectedOptionCallback" class="py-name" href="#" onclick="return doclink('link-14', '_rejectedOptionCallback', 'link-14');">_rejectedOptionCallback</a></tt><tt class="py-op">,</tt> </tt>
<a name="L59"></a><tt class="py-lineno"> 59</tt> <tt class="py-line"> <tt class="py-name">metavar</tt><tt class="py-op">=</tt><tt class="py-string">"&lt;regular pattern&gt;"</tt><tt class="py-op">,</tt> </tt>
<a name="L60"></a><tt class="py-lineno"> 60</tt> <tt class="py-line"> <tt class="py-name">type</tt><tt class="py-op">=</tt><tt class="py-string">"str"</tt><tt class="py-op">,</tt> </tt>
<a name="L61"></a><tt class="py-lineno"> 61</tt> <tt class="py-line"> <tt class="py-name">help</tt><tt class="py-op">=</tt><tt class="py-string">"pattern of rejected oligonucleotide"</tt><tt class="py-op">)</tt> </tt>
<a name="L62"></a><tt class="py-lineno"> 62</tt> <tt class="py-line"> </tt>
<a name="L63"></a><tt class="py-lineno"> 63</tt> <tt class="py-line"> <tt class="py-name">optionManager</tt><tt class="py-op">.</tt><tt class="py-name">add_option</tt><tt class="py-op">(</tt><tt class="py-string">'-p'</tt><tt class="py-op">,</tt><tt class="py-string">'--homopolymere'</tt><tt class="py-op">,</tt> </tt>
<a name="L64"></a><tt class="py-lineno"> 64</tt> <tt class="py-line"> <tt class="py-name">action</tt><tt class="py-op">=</tt><tt class="py-string">"store"</tt><tt class="py-op">,</tt> <tt class="py-name">dest</tt><tt class="py-op">=</tt><tt class="py-string">"homopolymere"</tt><tt class="py-op">,</tt> </tt>
<a name="L65"></a><tt class="py-lineno"> 65</tt> <tt class="py-line"> <tt class="py-name">metavar</tt><tt class="py-op">=</tt><tt class="py-string">"&lt;###&gt;"</tt><tt class="py-op">,</tt> </tt>
<a name="L66"></a><tt class="py-lineno"> 66</tt> <tt class="py-line"> <tt class="py-name">type</tt><tt class="py-op">=</tt><tt class="py-string">"int"</tt><tt class="py-op">,</tt> </tt>
<a name="L67"></a><tt class="py-lineno"> 67</tt> <tt class="py-line"> <tt class="py-name">default</tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> </tt>
<a name="L68"></a><tt class="py-lineno"> 68</tt> <tt class="py-line"> <tt class="py-name">help</tt><tt class="py-op">=</tt><tt class="py-string">"reject oligo with homopolymere longer than."</tt><tt class="py-op">)</tt> </tt>
<a name="L69"></a><tt class="py-lineno"> 69</tt> <tt class="py-line"> </tt>
<a name="L70"></a><tt class="py-lineno"> 70</tt> <tt class="py-line"> <tt class="py-name">optionManager</tt><tt class="py-op">.</tt><tt class="py-name">add_option</tt><tt class="py-op">(</tt><tt class="py-string">'-P'</tt><tt class="py-op">,</tt><tt class="py-string">'--homopolymere-min'</tt><tt class="py-op">,</tt> </tt>
<a name="L71"></a><tt class="py-lineno"> 71</tt> <tt class="py-line"> <tt class="py-name">action</tt><tt class="py-op">=</tt><tt class="py-string">"store"</tt><tt class="py-op">,</tt> <tt class="py-name">dest</tt><tt class="py-op">=</tt><tt class="py-string">"homopolymere_min"</tt><tt class="py-op">,</tt> </tt>
<a name="L72"></a><tt class="py-lineno"> 72</tt> <tt class="py-line"> <tt class="py-name">metavar</tt><tt class="py-op">=</tt><tt class="py-string">"&lt;###&gt;"</tt><tt class="py-op">,</tt> </tt>
<a name="L73"></a><tt class="py-lineno"> 73</tt> <tt class="py-line"> <tt class="py-name">type</tt><tt class="py-op">=</tt><tt class="py-string">"int"</tt><tt class="py-op">,</tt> </tt>
<a name="L74"></a><tt class="py-lineno"> 74</tt> <tt class="py-line"> <tt class="py-name">default</tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> </tt>
<a name="L75"></a><tt class="py-lineno"> 75</tt> <tt class="py-line"> <tt class="py-name">help</tt><tt class="py-op">=</tt><tt class="py-string">"accept only oligo with homopolymere longer than."</tt><tt class="py-op">)</tt> </tt>
</div><a name="L76"></a><tt class="py-lineno"> 76</tt> <tt class="py-line"> </tt>
<a name="dnaWordIterator"></a><div id="dnaWordIterator-def"><a name="L77"></a><tt class="py-lineno"> 77</tt> <a class="py-toggle" href="#" id="dnaWordIterator-toggle" onclick="return toggle('dnaWordIterator');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="obitools.oligo.options-module.html#dnaWordIterator">dnaWordIterator</a><tt class="py-op">(</tt><tt class="py-param">options</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="dnaWordIterator-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="dnaWordIterator-expanded"><a name="L78"></a><tt class="py-lineno"> 78</tt> <tt class="py-line"> </tt>
<a name="L79"></a><tt class="py-lineno"> 79</tt> <tt class="py-line"> <tt class="py-keyword">assert</tt> <tt id="link-15" class="py-name" targets="Module obitools.obischemas.options=obitools.obischemas.options-module.html,Module obitools.oligo.options=obitools.oligo.options-module.html,Package obitools.options=obitools.options-module.html"><a title="obitools.obischemas.options
obitools.oligo.options
obitools.options" class="py-name" href="#" onclick="return doclink('link-15', 'options', 'link-15');">options</a></tt><tt class="py-op">.</tt><tt class="py-name">oligoSize</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-string">"option -s or --oligo-size must be specified"</tt> </tt>
<a name="L80"></a><tt class="py-lineno"> 80</tt> <tt class="py-line"> <tt class="py-keyword">assert</tt> <tt id="link-16" class="py-name"><a title="obitools.obischemas.options
obitools.oligo.options
obitools.options" class="py-name" href="#" onclick="return doclink('link-16', 'options', 'link-15');">options</a></tt><tt class="py-op">.</tt><tt class="py-name">familySize</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-string">"option -f or --family-size must be specified"</tt> </tt>
<a name="L81"></a><tt class="py-lineno"> 81</tt> <tt class="py-line"> <tt class="py-keyword">assert</tt> <tt id="link-17" class="py-name"><a title="obitools.obischemas.options
obitools.oligo.options
obitools.options" class="py-name" href="#" onclick="return doclink('link-17', 'options', 'link-15');">options</a></tt><tt class="py-op">.</tt><tt class="py-name">oligoDist</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-string">"option -d or --distance must be specified"</tt> </tt>
<a name="L82"></a><tt class="py-lineno"> 82</tt> <tt class="py-line"> </tt>
<a name="L83"></a><tt class="py-lineno"> 83</tt> <tt class="py-line"> <tt class="py-name">words</tt> <tt class="py-op">=</tt> <tt id="link-18" class="py-name"><a title="obitools.oligo.wordIterator" class="py-name" href="#" onclick="return doclink('link-18', 'wordIterator', 'link-3');">wordIterator</a></tt><tt class="py-op">(</tt><tt id="link-19" class="py-name"><a title="obitools.obischemas.options
obitools.oligo.options
obitools.options" class="py-name" href="#" onclick="return doclink('link-19', 'options', 'link-15');">options</a></tt><tt class="py-op">.</tt><tt class="py-name">oligoSize</tt><tt class="py-op">)</tt> </tt>
<a name="L84"></a><tt class="py-lineno"> 84</tt> <tt class="py-line"> <tt class="py-name">seed</tt> <tt class="py-op">=</tt> <tt class="py-string">'a'</tt> <tt class="py-op">*</tt> <tt id="link-20" class="py-name"><a title="obitools.obischemas.options
obitools.oligo.options
obitools.options" class="py-name" href="#" onclick="return doclink('link-20', 'options', 'link-15');">options</a></tt><tt class="py-op">.</tt><tt class="py-name">oligoSize</tt> </tt>
<a name="L85"></a><tt class="py-lineno"> 85</tt> <tt class="py-line"> </tt>
<a name="L86"></a><tt class="py-lineno"> 86</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">hasattr</tt><tt class="py-op">(</tt><tt id="link-21" class="py-name"><a title="obitools.obischemas.options
obitools.oligo.options
obitools.options" class="py-name" href="#" onclick="return doclink('link-21', 'options', 'link-15');">options</a></tt><tt class="py-op">,</tt> <tt class="py-string">"acceptedOligo"</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L87"></a><tt class="py-lineno"> 87</tt> <tt class="py-line"> <tt id="link-22" class="py-name"><a title="obitools.obischemas.options
obitools.oligo.options
obitools.options" class="py-name" href="#" onclick="return doclink('link-22', 'options', 'link-15');">options</a></tt><tt class="py-op">.</tt><tt class="py-name">acceptedOligo</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L88"></a><tt class="py-lineno"> 88</tt> <tt class="py-line"> </tt>
<a name="L89"></a><tt class="py-lineno"> 89</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">hasattr</tt><tt class="py-op">(</tt><tt id="link-23" class="py-name"><a title="obitools.obischemas.options
obitools.oligo.options
obitools.options" class="py-name" href="#" onclick="return doclink('link-23', 'options', 'link-15');">options</a></tt><tt class="py-op">,</tt> <tt class="py-string">"rejectedOligo"</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L90"></a><tt class="py-lineno"> 90</tt> <tt class="py-line"> <tt id="link-24" class="py-name"><a title="obitools.obischemas.options
obitools.oligo.options
obitools.options" class="py-name" href="#" onclick="return doclink('link-24', 'options', 'link-15');">options</a></tt><tt class="py-op">.</tt><tt class="py-name">rejectedOligo</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L91"></a><tt class="py-lineno"> 91</tt> <tt class="py-line"> </tt>
<a name="L92"></a><tt class="py-lineno"> 92</tt> <tt class="py-line"> <tt id="link-25" class="py-name"><a title="obitools.obischemas.options
obitools.oligo.options
obitools.options" class="py-name" href="#" onclick="return doclink('link-25', 'options', 'link-15');">options</a></tt><tt class="py-op">.</tt><tt class="py-name">acceptedOligo</tt><tt class="py-op">.</tt><tt id="link-26" class="py-name"><a title="obitools.align.Alignement.append" class="py-name" href="#" onclick="return doclink('link-26', 'append', 'link-7');">append</a></tt><tt class="py-op">(</tt><tt id="link-27" class="py-name"><a title="obitools.oligo.predicat" class="py-name" href="#" onclick="return doclink('link-27', 'predicat', 'link-6');">predicat</a></tt><tt class="py-op">.</tt><tt id="link-28" class="py-name" targets="Function obitools.oligo.predicat.distMinGenerator()=obitools.oligo.predicat-module.html#distMinGenerator"><a title="obitools.oligo.predicat.distMinGenerator" class="py-name" href="#" onclick="return doclink('link-28', 'distMinGenerator', 'link-28');">distMinGenerator</a></tt><tt class="py-op">(</tt><tt class="py-name">seed</tt><tt class="py-op">,</tt> <tt id="link-29" class="py-name"><a title="obitools.obischemas.options
obitools.oligo.options
obitools.options" class="py-name" href="#" onclick="return doclink('link-29', 'options', 'link-15');">options</a></tt><tt class="py-op">.</tt><tt class="py-name">oligoDist</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L93"></a><tt class="py-lineno"> 93</tt> <tt class="py-line"> </tt>
<a name="L94"></a><tt class="py-lineno"> 94</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt id="link-30" class="py-name"><a title="obitools.obischemas.options
obitools.oligo.options
obitools.options" class="py-name" href="#" onclick="return doclink('link-30', 'options', 'link-15');">options</a></tt><tt class="py-op">.</tt><tt class="py-name">homopolymere</tt><tt class="py-op">:</tt> </tt>
<a name="L95"></a><tt class="py-lineno"> 95</tt> <tt class="py-line"> <tt id="link-31" class="py-name"><a title="obitools.obischemas.options
obitools.oligo.options
obitools.options" class="py-name" href="#" onclick="return doclink('link-31', 'options', 'link-15');">options</a></tt><tt class="py-op">.</tt><tt class="py-name">rejectedOligo</tt><tt class="py-op">.</tt><tt id="link-32" class="py-name"><a title="obitools.align.Alignement.append" class="py-name" href="#" onclick="return doclink('link-32', 'append', 'link-7');">append</a></tt><tt class="py-op">(</tt><tt id="link-33" class="py-name"><a title="obitools.oligo.predicat" class="py-name" href="#" onclick="return doclink('link-33', 'predicat', 'link-6');">predicat</a></tt><tt class="py-op">.</tt><tt id="link-34" class="py-name" targets="Function obitools.oligo.predicat.homoPolymerGenerator()=obitools.oligo.predicat-module.html#homoPolymerGenerator"><a title="obitools.oligo.predicat.homoPolymerGenerator" class="py-name" href="#" onclick="return doclink('link-34', 'homoPolymerGenerator', 'link-34');">homoPolymerGenerator</a></tt><tt class="py-op">(</tt><tt id="link-35" class="py-name"><a title="obitools.obischemas.options
obitools.oligo.options
obitools.options" class="py-name" href="#" onclick="return doclink('link-35', 'options', 'link-15');">options</a></tt><tt class="py-op">.</tt><tt class="py-name">homopolymere</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L96"></a><tt class="py-lineno"> 96</tt> <tt class="py-line"> </tt>
<a name="L97"></a><tt class="py-lineno"> 97</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt id="link-36" class="py-name"><a title="obitools.obischemas.options
obitools.oligo.options
obitools.options" class="py-name" href="#" onclick="return doclink('link-36', 'options', 'link-15');">options</a></tt><tt class="py-op">.</tt><tt class="py-name">homopolymere_min</tt><tt class="py-op">:</tt> </tt>
<a name="L98"></a><tt class="py-lineno"> 98</tt> <tt class="py-line"> <tt id="link-37" class="py-name"><a title="obitools.obischemas.options
obitools.oligo.options
obitools.options" class="py-name" href="#" onclick="return doclink('link-37', 'options', 'link-15');">options</a></tt><tt class="py-op">.</tt><tt class="py-name">acceptedOligo</tt><tt class="py-op">.</tt><tt id="link-38" class="py-name"><a title="obitools.align.Alignement.append" class="py-name" href="#" onclick="return doclink('link-38', 'append', 'link-7');">append</a></tt><tt class="py-op">(</tt><tt id="link-39" class="py-name"><a title="obitools.oligo.predicat" class="py-name" href="#" onclick="return doclink('link-39', 'predicat', 'link-6');">predicat</a></tt><tt class="py-op">.</tt><tt id="link-40" class="py-name"><a title="obitools.oligo.predicat.homoPolymerGenerator" class="py-name" href="#" onclick="return doclink('link-40', 'homoPolymerGenerator', 'link-34');">homoPolymerGenerator</a></tt><tt class="py-op">(</tt><tt id="link-41" class="py-name"><a title="obitools.obischemas.options
obitools.oligo.options
obitools.options" class="py-name" href="#" onclick="return doclink('link-41', 'options', 'link-15');">options</a></tt><tt class="py-op">.</tt><tt class="py-name">homopolymere_min</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L99"></a><tt class="py-lineno"> 99</tt> <tt class="py-line"> </tt>
<a name="L100"></a><tt class="py-lineno">100</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt id="link-42" class="py-name"><a title="obitools.obischemas.options
obitools.oligo.options
obitools.options" class="py-name" href="#" onclick="return doclink('link-42', 'options', 'link-15');">options</a></tt><tt class="py-op">.</tt><tt class="py-name">gcMax</tt><tt class="py-op">:</tt> </tt>
<a name="L101"></a><tt class="py-lineno">101</tt> <tt class="py-line"> <tt id="link-43" class="py-name"><a title="obitools.obischemas.options
obitools.oligo.options
obitools.options" class="py-name" href="#" onclick="return doclink('link-43', 'options', 'link-15');">options</a></tt><tt class="py-op">.</tt><tt class="py-name">rejectedOligo</tt><tt class="py-op">.</tt><tt id="link-44" class="py-name"><a title="obitools.align.Alignement.append" class="py-name" href="#" onclick="return doclink('link-44', 'append', 'link-7');">append</a></tt><tt class="py-op">(</tt><tt id="link-45" class="py-name"><a title="obitools.oligo.predicat" class="py-name" href="#" onclick="return doclink('link-45', 'predicat', 'link-6');">predicat</a></tt><tt class="py-op">.</tt><tt id="link-46" class="py-name" targets="Function obitools.oligo.predicat.gcUpperBondGenerator()=obitools.oligo.predicat-module.html#gcUpperBondGenerator"><a title="obitools.oligo.predicat.gcUpperBondGenerator" class="py-name" href="#" onclick="return doclink('link-46', 'gcUpperBondGenerator', 'link-46');">gcUpperBondGenerator</a></tt><tt class="py-op">(</tt><tt id="link-47" class="py-name"><a title="obitools.obischemas.options
obitools.oligo.options
obitools.options" class="py-name" href="#" onclick="return doclink('link-47', 'options', 'link-15');">options</a></tt><tt class="py-op">.</tt><tt class="py-name">gcMax</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L102"></a><tt class="py-lineno">102</tt> <tt class="py-line"> </tt>
<a name="L103"></a><tt class="py-lineno">103</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt id="link-48" class="py-name"><a title="obitools.oligo.wordSelector" class="py-name" href="#" onclick="return doclink('link-48', 'wordSelector', 'link-2');">wordSelector</a></tt><tt class="py-op">(</tt><tt class="py-name">words</tt><tt class="py-op">,</tt> <tt id="link-49" class="py-name"><a title="obitools.obischemas.options
obitools.oligo.options
obitools.options" class="py-name" href="#" onclick="return doclink('link-49', 'options', 'link-15');">options</a></tt><tt class="py-op">.</tt><tt class="py-name">acceptedOligo</tt><tt class="py-op">,</tt> <tt id="link-50" class="py-name"><a title="obitools.obischemas.options
obitools.oligo.options
obitools.options" class="py-name" href="#" onclick="return doclink('link-50', 'options', 'link-15');">options</a></tt><tt class="py-op">.</tt><tt class="py-name">rejectedOligo</tt><tt class="py-op">)</tt> </tt>
</div><a name="L104"></a><tt class="py-lineno">104</tt> <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="obitools-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Tree link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Index link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Help link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="http://www.grenoble.prabi.fr/trac/OBITools">OBITools</a></th>
</tr></table></th>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
<a href="epydoc-log.html">Generated by Epydoc
3.0beta1 on Thu Jan 10 09:55:33 2008</a>
</td>
<td align="right" class="footer">
<a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
</td>
</tr>
</table>
<script type="text/javascript">
<!--
// Private objects are initially displayed (because if
// javascript is turned off then we want them to be
// visible); but by default, we want to hide them. So hide
// them unless we have a cookie that says to show them.
checkCookie()
// -->
</script>
</body>
</html>

View File

@ -1,199 +0,0 @@
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>obitools.oligo.predicat</title>
<link rel="stylesheet" href="epydoc.css" type="text/css" />
<script type="text/javascript" src="epydoc.js"></script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="obitools-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Tree link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Index link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Help link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="http://www.grenoble.prabi.fr/trac/OBITools">OBITools</a></th>
</tr></table></th>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="100%">
<span class="breadcrumbs">
<a href="obitools-module.html">Package&nbsp;obitools</a> ::
<a href="obitools.oligo-module.html">Package&nbsp;oligo</a> ::
Module&nbsp;predicat
</span>
</td>
<td>
<table cellpadding="0" cellspacing="0">
<!-- hide/show private -->
<tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
<tr><td align="right"><span class="options"
>[<a href="frames.html" target="_top">frames</a
>]&nbsp;|&nbsp;<a href="obitools.oligo.predicat-module.html"
target="_top">no&nbsp;frames</a>]</span></td></tr>
</table>
</td>
</tr>
</table>
<!-- ==================== MODULE DESCRIPTION ==================== -->
<h1 class="epydoc">Module predicat</h1><span class="codelink"><a href="obitools.oligo.predicat-pysrc.html">source&nbsp;code</a></span><br /><br />
<!-- ==================== FUNCTIONS ==================== -->
<a name="section-Functions"></a>
<table class="summary" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td colspan="2" class="table-header">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr valign="top">
<td align="left"><span class="table-header">Functions</span></td>
<td align="right" valign="top"
><span class="options">[<a href="#section-Functions"
class="privatelink" onclick="toggle_private();"
>hide private</a>]</span></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="rePredicatGenerator"></a><span class="summary-sig-name">rePredicatGenerator</span>(<span class="summary-sig-arg">regex</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="obitools.oligo.predicat-pysrc.html#rePredicatGenerator">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="gcUpperBondGenerator"></a><span class="summary-sig-name">gcUpperBondGenerator</span>(<span class="summary-sig-arg">count</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="obitools.oligo.predicat-pysrc.html#gcUpperBondGenerator">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="homoPolymerGenerator"></a><span class="summary-sig-name">homoPolymerGenerator</span>(<span class="summary-sig-arg">count</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="obitools.oligo.predicat-pysrc.html#homoPolymerGenerator">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="distMinGenerator"></a><span class="summary-sig-name">distMinGenerator</span>(<span class="summary-sig-arg">word</span>,
<span class="summary-sig-arg">dmin</span>)</span></td>
<td align="right" valign="top">
<span class="codelink"><a href="obitools.oligo.predicat-pysrc.html#distMinGenerator">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="obitools-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Tree link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Index link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Help link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="http://www.grenoble.prabi.fr/trac/OBITools">OBITools</a></th>
</tr></table></th>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
<a href="epydoc-log.html">Generated by Epydoc
3.0beta1 on Thu Jan 10 09:55:20 2008</a>
</td>
<td align="right" class="footer">
<a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
</td>
</tr>
</table>
<script type="text/javascript">
<!--
// Private objects are initially displayed (because if
// javascript is turned off then we want them to be
// visible); but by default, we want to hide them. So hide
// them unless we have a cookie that says to show them.
checkCookie()
// -->
</script>
</body>
</html>

View File

@ -1,146 +0,0 @@
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>obitools.oligo.predicat</title>
<link rel="stylesheet" href="epydoc.css" type="text/css" />
<script type="text/javascript" src="epydoc.js"></script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="obitools-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Tree link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Index link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Help link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="http://www.grenoble.prabi.fr/trac/OBITools">OBITools</a></th>
</tr></table></th>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="100%">
<span class="breadcrumbs">
<a href="obitools-module.html">Package&nbsp;obitools</a> ::
<a href="obitools.oligo-module.html">Package&nbsp;oligo</a> ::
Module&nbsp;predicat
</span>
</td>
<td>
<table cellpadding="0" cellspacing="0">
<!-- hide/show private -->
<tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
<tr><td align="right"><span class="options"
>[<a href="frames.html" target="_top">frames</a
>]&nbsp;|&nbsp;<a href="obitools.oligo.predicat-pysrc.html"
target="_top">no&nbsp;frames</a>]</span></td></tr>
</table>
</td>
</tr>
</table>
<h1 class="epydoc">Source Code for <a href="obitools.oligo.predicat-module.html">Module obitools.oligo.predicat</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno"> 1</tt> <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">re</tt> </tt>
<a name="L2"></a><tt class="py-lineno"> 2</tt> <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-0" class="py-name" targets="Package obitools=obitools-module.html"><a title="obitools" class="py-name" href="#" onclick="return doclink('link-0', 'obitools', 'link-0');">obitools</a></tt><tt class="py-op">.</tt><tt id="link-1" class="py-name" targets="Package obitools.oligo=obitools.oligo-module.html"><a title="obitools.oligo" class="py-name" href="#" onclick="return doclink('link-1', 'oligo', 'link-1');">oligo</a></tt> <tt class="py-keyword">import</tt> <tt id="link-2" class="py-name" targets="Function obitools.oligo.wordDist()=obitools.oligo-module.html#wordDist"><a title="obitools.oligo.wordDist" class="py-name" href="#" onclick="return doclink('link-2', 'wordDist', 'link-2');">wordDist</a></tt> </tt>
<a name="L3"></a><tt class="py-lineno"> 3</tt> <tt class="py-line"> </tt>
<a name="rePredicatGenerator"></a><div id="rePredicatGenerator-def"><a name="L4"></a><tt class="py-lineno"> 4</tt> <a class="py-toggle" href="#" id="rePredicatGenerator-toggle" onclick="return toggle('rePredicatGenerator');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="obitools.oligo.predicat-module.html#rePredicatGenerator">rePredicatGenerator</a><tt class="py-op">(</tt><tt class="py-param">regex</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="rePredicatGenerator-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="rePredicatGenerator-expanded"><a name="L5"></a><tt class="py-lineno"> 5</tt> <tt class="py-line"> <tt class="py-name">regex</tt> <tt class="py-op">=</tt> <tt class="py-name">re</tt><tt class="py-op">.</tt><tt class="py-name">compile</tt><tt class="py-op">(</tt><tt class="py-name">regex</tt><tt class="py-op">,</tt><tt class="py-name">re</tt><tt class="py-op">.</tt><tt class="py-name">I</tt><tt class="py-op">)</tt> </tt>
<a name="L6"></a><tt class="py-lineno"> 6</tt> <tt class="py-line"> <tt class="py-keyword">def</tt> <tt class="py-def-name">predicat</tt><tt class="py-op">(</tt><tt class="py-param">w</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L7"></a><tt class="py-lineno"> 7</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">bool</tt><tt class="py-op">(</tt><tt class="py-name">regex</tt><tt class="py-op">.</tt><tt class="py-name">search</tt><tt class="py-op">(</tt><tt class="py-name">w</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L8"></a><tt class="py-lineno"> 8</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt id="link-3" class="py-name" targets="Module obitools.oligo.predicat=obitools.oligo.predicat-module.html"><a title="obitools.oligo.predicat" class="py-name" href="#" onclick="return doclink('link-3', 'predicat', 'link-3');">predicat</a></tt> </tt>
</div><a name="L9"></a><tt class="py-lineno"> 9</tt> <tt class="py-line"> </tt>
<a name="gcUpperBondGenerator"></a><div id="gcUpperBondGenerator-def"><a name="L10"></a><tt class="py-lineno">10</tt> <a class="py-toggle" href="#" id="gcUpperBondGenerator-toggle" onclick="return toggle('gcUpperBondGenerator');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="obitools.oligo.predicat-module.html#gcUpperBondGenerator">gcUpperBondGenerator</a><tt class="py-op">(</tt><tt class="py-param">count</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="gcUpperBondGenerator-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="gcUpperBondGenerator-expanded"><a name="L11"></a><tt class="py-lineno">11</tt> <tt class="py-line"> <tt class="py-keyword">def</tt> <tt class="py-def-name">predicat</tt><tt class="py-op">(</tt><tt class="py-param">w</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L12"></a><tt class="py-lineno">12</tt> <tt class="py-line"> <tt class="py-name">c</tt> <tt class="py-op">=</tt> <tt class="py-name">w</tt><tt class="py-op">.</tt><tt class="py-name">count</tt><tt class="py-op">(</tt><tt class="py-string">'g'</tt><tt class="py-op">)</tt><tt class="py-op">+</tt><tt class="py-name">w</tt><tt class="py-op">.</tt><tt class="py-name">count</tt><tt class="py-op">(</tt><tt class="py-string">'c'</tt><tt class="py-op">)</tt> </tt>
<a name="L13"></a><tt class="py-lineno">13</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">c</tt> <tt class="py-op">&lt;=</tt> <tt class="py-name">count</tt> </tt>
</div><a name="L14"></a><tt class="py-lineno">14</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt id="link-4" class="py-name"><a title="obitools.oligo.predicat" class="py-name" href="#" onclick="return doclink('link-4', 'predicat', 'link-3');">predicat</a></tt> </tt>
</div><a name="L15"></a><tt class="py-lineno">15</tt> <tt class="py-line"> </tt>
<a name="homoPolymerGenerator"></a><div id="homoPolymerGenerator-def"><a name="L16"></a><tt class="py-lineno">16</tt> <a class="py-toggle" href="#" id="homoPolymerGenerator-toggle" onclick="return toggle('homoPolymerGenerator');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="obitools.oligo.predicat-module.html#homoPolymerGenerator">homoPolymerGenerator</a><tt class="py-op">(</tt><tt class="py-param">count</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="homoPolymerGenerator-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="homoPolymerGenerator-expanded"><a name="L17"></a><tt class="py-lineno">17</tt> <tt class="py-line"> <tt class="py-name">pattern</tt> <tt class="py-op">=</tt> <tt class="py-string">'(.)'</tt> <tt class="py-op">+</tt> <tt class="py-string">'\\1'</tt> <tt class="py-op">*</tt> <tt class="py-op">(</tt><tt class="py-name">count</tt> <tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
<a name="L18"></a><tt class="py-lineno">18</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt id="link-5" class="py-name" targets="Function obitools.oligo.predicat.rePredicatGenerator()=obitools.oligo.predicat-module.html#rePredicatGenerator"><a title="obitools.oligo.predicat.rePredicatGenerator" class="py-name" href="#" onclick="return doclink('link-5', 'rePredicatGenerator', 'link-5');">rePredicatGenerator</a></tt><tt class="py-op">(</tt><tt class="py-name">pattern</tt><tt class="py-op">)</tt> </tt>
</div><a name="L19"></a><tt class="py-lineno">19</tt> <tt class="py-line"> </tt>
<a name="distMinGenerator"></a><div id="distMinGenerator-def"><a name="L20"></a><tt class="py-lineno">20</tt> <a class="py-toggle" href="#" id="distMinGenerator-toggle" onclick="return toggle('distMinGenerator');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="obitools.oligo.predicat-module.html#distMinGenerator">distMinGenerator</a><tt class="py-op">(</tt><tt class="py-param">word</tt><tt class="py-op">,</tt><tt class="py-param">dmin</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="distMinGenerator-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="distMinGenerator-expanded"><a name="L21"></a><tt class="py-lineno">21</tt> <tt class="py-line"> <tt class="py-keyword">def</tt> <tt class="py-def-name">predicat</tt><tt class="py-op">(</tt><tt class="py-param">w</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L22"></a><tt class="py-lineno">22</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">w</tt><tt class="py-op">==</tt><tt class="py-name">word</tt> <tt class="py-keyword">or</tt> <tt id="link-6" class="py-name"><a title="obitools.oligo.wordDist" class="py-name" href="#" onclick="return doclink('link-6', 'wordDist', 'link-2');">wordDist</a></tt><tt class="py-op">(</tt><tt class="py-name">w</tt><tt class="py-op">,</tt> <tt class="py-name">word</tt><tt class="py-op">)</tt> <tt class="py-op">&gt;=</tt> <tt class="py-name">dmin</tt> </tt>
</div><a name="L23"></a><tt class="py-lineno">23</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt id="link-7" class="py-name"><a title="obitools.oligo.predicat" class="py-name" href="#" onclick="return doclink('link-7', 'predicat', 'link-3');">predicat</a></tt> </tt>
</div><a name="L24"></a><tt class="py-lineno">24</tt> <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="obitools-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Tree link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Index link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Help link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="http://www.grenoble.prabi.fr/trac/OBITools">OBITools</a></th>
</tr></table></th>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
<a href="epydoc-log.html">Generated by Epydoc
3.0beta1 on Thu Jan 10 09:55:33 2008</a>
</td>
<td align="right" class="footer">
<a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
</td>
</tr>
</table>
<script type="text/javascript">
<!--
// Private objects are initially displayed (because if
// javascript is turned off then we want them to be
// visible); but by default, we want to hide them. So hide
// them unless we have a cookie that says to show them.
checkCookie()
// -->
</script>
</body>
</html>

View File

@ -59,7 +59,7 @@ class BioSequence(object):
self._seq=str(seq).lower()
self._info = dict(info)
self.definition=definition
self._id=id
self.id=id
def getDefinition(self):
'''

View File

@ -14,21 +14,21 @@ _H= _A + _C + _T
_V= _A + _C + _G
_N= _A + _C + _G + _T
_dnahash={'A':_A,
'C':_C,
'G':_G,
'T':_T,
'R':_R,
'Y':_Y,
'M':_M,
'K':_K,
'W':_W,
'S':_S,
'B':_B,
'D':_D,
'H':_H,
'V':_V,
'N':_N,
_dnahash={'a':_A,
'c':_C,
'g':_G,
't':_T,
'r':_R,
'y':_Y,
'm':_M,
'k':_K,
'w':_W,
's':_S,
'b':_B,
'd':_D,
'h':_H,
'v':_V,
'n':_N,
}
def hashCodeIterator(sequence,wsize,degeneratemax=0,offset=0):
@ -44,7 +44,7 @@ def hashCodeIterator(sequence,wsize,degeneratemax=0,offset=0):
hashmask +=3
for l in sequence:
l = l.upper()
l = l.lower()
hl = _dnahash[l]
if emask[epointer]:

View File

@ -219,6 +219,12 @@ class Graph(object):
index=self.getNode(node).index
return self._node[index]
def edgeCount(self):
n = reduce(lambda x,y:x+y, (len(z) for z in self._node.itervalues()),0)
if not self._directed:
n=n/2
return n
def subgraph(self,nodes,name='G'):
sub = Graph(name,self._directed,self._index)
if not isinstance(nodes, set):

View File

@ -3,20 +3,25 @@ import time
import sys
_maxsize=0
_solution=0
_notbound=0
_sizebound=0
def cliqueIterator(graph,minsize=1,node=None):
global _maxsize,_solution
global _maxsize,_solution,_notbound,_sizebound
_maxsize=0
_solution=0
_notbound=0
_sizebound=0
starttime = time.time()
if node:
node = graph.getNode(node)
index = node.index
clique= set([index])
candidates= graph.neighbourIndexSet(index=index)
candidates= set(graph.neighbourIndexSet(index=index))
else:
clique=set()
candidates = set(x.index for x in graph)
@ -33,12 +38,24 @@ def cliqueIterator(graph,minsize=1,node=None):
def _cliqueIterator(graph,clique,candidates,notset,minsize=0,start=None):
global _maxsize,_solution
def _cliqueIterator(graph,clique,candidates,notlist,minsize=0,start=None):
global _maxsize,_solution,_notbound,_sizebound
if len(clique)>_maxsize or not _solution % 1000 :
# Speed indicator
lclique = len(clique)
lcandidates = len(candidates)
notmin = lcandidates
notfix = None
for n in notlist:
nnc = candidates - graph.neighbourIndexSet(index=n)
nc = len(nnc)
if nc < notmin:
notmin=nc
notfix=n
notfixneib = nnc
if lclique > _maxsize or not _solution % 1000 :
if start is not None:
top = time.time()
delta = top - start
@ -46,43 +63,35 @@ def _cliqueIterator(graph,clique,candidates,notset,minsize=0,start=None):
start = top
else:
speed = 0
print >>sys.stderr,"\rCandidates : %-5d Maximum clique size : %-5d Solutions explored : %10d speed = %5.2f solutions/sec " % (lcandidates,_maxsize,_solution,speed),
print >>sys.stderr,"\rCandidates : %-5d Maximum clique size : %-5d Solutions explored : %10d speed = %5.2f solutions/sec sizebound=%10d notbound=%10d " % (lcandidates,_maxsize,_solution,speed,_sizebound,_notbound),
sys.stderr.flush()
if len(clique)>_maxsize:
_maxsize=len(clique)
if lclique > _maxsize:
_maxsize=lclique
# print >>sys.stderr,'koukou'
if (len(clique)+len(candidates)) >= minsize:
if not candidates and not notset:
if not candidates and not notlist:
yield set(clique)
else:
while candidates:
while notmin and candidates and (lclique + len(candidates)) >= minsize:
# count explored solution
_solution+=1
if notfix is None:
nextcandidate = candidates.pop()
else:
nextcandidate = notfixneib.pop()
candidates.remove(nextcandidate)
clique.add(nextcandidate)
# Speed indicator
neighbours = graph.neighbourIndexSet(index=nextcandidate)
nextcandidates = candidates & neighbours
nextnot = notlist & neighbours
nextcandidates= candidates & graph.neighbourIndexSet(index=nextcandidate)
nextnot = notset & graph.neighbourIndexSet(index=nextcandidate)
# potentialClique = nextcandidates | clique
# nextcandidates = set(x for x in nextcandidates
# if len(graph.neighbourIndexSet(index=x) & potentialClique) >= (minsize - 1))
#
#
#
# if (len(nextcandidates) + len(clique)) >= minsize:
#
# if nextcandidates:
nnc = candidates - neighbours
lnnc=len(nnc)
for c in _cliqueIterator(graph,
set(clique),
@ -94,5 +103,19 @@ def _cliqueIterator(graph,clique,candidates,notset,minsize=0,start=None):
clique.remove(nextcandidate)
notset.add(nextcandidate)
notmin-=1
if lnnc < notmin:
notmin = lnnc
notfix = nextcandidate
notfixneib = nnc
if notmin==0:
_notbound+=1
notlist.add(nextcandidate)
else:
if (lclique + len(candidates)) < minsize:
_sizebound+=1

View File

@ -2,8 +2,9 @@ from logging import debug,root,DEBUG
from obitools.word import wordSelector,wordIterator
from obitools.word import wordSelector,allWordIterator
from obitools.word import predicat
import sys
@ -80,16 +81,16 @@ def dnaWordIterator(options):
assert options.familySize is not None,"option -f or --family-size must be specified"
assert options.oligoDist is not None,"option -d or --distance must be specified"
words = wordIterator(options.oligoSize)
seed = 'a' * options.oligoSize
words = allWordIterator(options.oligoSize)
#seed = 'a' * options.oligoSize
if not hasattr(options, "acceptedOligo"):
if not hasattr(options, "acceptedOligo") or options.acceptedOligo is None:
options.acceptedOligo=[]
if not hasattr(options, "rejectedOligo"):
if not hasattr(options, "rejectedOligo") or options.rejectedOligo is None:
options.rejectedOligo=[]
options.acceptedOligo.append(predicat.distMinGenerator(seed, options.oligoDist))
#options.acceptedOligo.append(predicat.distMinGenerator(seed, options.oligoDist))
if options.homopolymere:
options.rejectedOligo.append(predicat.homoPolymerGenerator(options.homopolymere))

78
src/oligoTag.py Executable file
View File

@ -0,0 +1,78 @@
#!/usr/local/bin/python
import sys
import re
from logging import root,DEBUG
from obitools.options import getOptionManager
from obitools import oligo
from obitools.word.options import addOligoOptions
from obitools.word.options import dnaWordIterator,wordSelector
from obitools.word import wordDist
from obitools.word.predicat import distMinGenerator
from obitools.graph.algorithms.clique import cliqueIterator
from obitools.graph import Graph
def edgeIterator(words,distmin=1):
words=[x for x in words]
for i in xrange(len(words)):
for j in xrange(i+1,len(words)):
if wordDist(words[i], words[j])>=distmin:
yield words[i], words[j]
def readData(edges):
graph = Graph()
for x,y in edges:
graph.addEdge(x, y)
return graph
if __name__=='__main__':
try:
import psyco
psyco.full()
except ImportError:
pass
optionParser = getOptionManager([addOligoOptions],
)
(options, entries) = optionParser()
goodOligo = dnaWordIterator(options)
print >>sys.stderr,"Build good words graph..."
graph= readData(edgeIterator(goodOligo,options.oligoDist))
print >>sys.stderr,"Initial graph size : %d edge count : %d" % (len(graph),graph.edgeCount())
# print >>sys.stderr,"Component connexe count : %d" % len(connected_components(graph))
print >>sys.stderr
# startNode = graph.getNode(index=0).label
ci = cliqueIterator(graph, options.familySize)
try:
result = ci.next()
print >>sys.stderr
for word in result:
print graph.getNode(index=word).getLabel()
except StopIteration:
print >>sys.stderr
print >>sys.stderr,"-------------------------------------------"
print >>sys.stderr
print >>sys.stderr,"No solutions for this parametter set"
print >>sys.stderr
print >>sys.stderr,"-------------------------------------------"
print >>sys.stderr