Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > by-pkgid > 763d6289e1351f2d34257ce697a3ccb7 > files > 1411

biopython-doc-1.47-2mdv2008.1.x86_64.rpm

<?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>Bio.SeqIO.Interfaces</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">

  <!-- 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>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="Bio-module.html">Package&nbsp;Bio</a> ::
        <a href="Bio.SeqIO-module.html">Package&nbsp;SeqIO</a> ::
        Module&nbsp;Interfaces
      </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="Bio.SeqIO.Interfaces-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="Bio.SeqIO.Interfaces-module.html">Module Bio.SeqIO.Interfaces</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno">  1</tt>  <tt class="py-line"><tt class="py-comment"># Copyright 2006, 2007 by Peter Cock.  All rights reserved.</tt> </tt>
<a name="L2"></a><tt class="py-lineno">  2</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># This code is part of the Biopython distribution and governed by its</tt> </tt>
<a name="L3"></a><tt class="py-lineno">  3</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># license.  Please see the LICENSE file that should have been included</tt> </tt>
<a name="L4"></a><tt class="py-lineno">  4</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># as part of this package.</tt> </tt>
<a name="L5"></a><tt class="py-lineno">  5</tt>  <tt class="py-line"><tt class="py-comment"></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-0" class="py-name" targets="Package Bio=Bio-module.html"><a title="Bio" class="py-name" href="#" onclick="return doclink('link-0', 'Bio', 'link-0');">Bio</a></tt><tt class="py-op">.</tt><tt id="link-1" class="py-name" targets="Package Bio.Alphabet=Bio.Alphabet-module.html,Class Bio.Alphabet.Alphabet=Bio.Alphabet.Alphabet-class.html"><a title="Bio.Alphabet
Bio.Alphabet.Alphabet" class="py-name" href="#" onclick="return doclink('link-1', 'Alphabet', 'link-1');">Alphabet</a></tt> <tt class="py-keyword">import</tt> <tt id="link-2" class="py-name" targets="Variable Bio.Alphabet.generic_alphabet=Bio.Alphabet-module.html#generic_alphabet"><a title="Bio.Alphabet.generic_alphabet" class="py-name" href="#" onclick="return doclink('link-2', 'generic_alphabet', 'link-2');">generic_alphabet</a></tt> </tt>
<a name="L7"></a><tt class="py-lineno">  7</tt>  <tt class="py-line"> </tt>
<a name="SequenceIterator"></a><div id="SequenceIterator-def"><a name="L8"></a><tt class="py-lineno">  8</tt> <a class="py-toggle" href="#" id="SequenceIterator-toggle" onclick="return toggle('SequenceIterator');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="Bio.SeqIO.Interfaces.SequenceIterator-class.html">SequenceIterator</a> <tt class="py-op">:</tt> </tt>
</div><div id="SequenceIterator-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="SequenceIterator-expanded"><a name="L9"></a><tt class="py-lineno">  9</tt>  <tt class="py-line">    <tt class="py-docstring">"""Base class for building SeqRecord iterators.</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">    You should write a next() method to return SeqRecord</tt> </tt>
<a name="L12"></a><tt class="py-lineno"> 12</tt>  <tt class="py-line"><tt class="py-docstring">    objects.  You may wish to redefine the __init__</tt> </tt>
<a name="L13"></a><tt class="py-lineno"> 13</tt>  <tt class="py-line"><tt class="py-docstring">    method as well.</tt> </tt>
<a name="L14"></a><tt class="py-lineno"> 14</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="SequenceIterator.__init__"></a><div id="SequenceIterator.__init__-def"><a name="L15"></a><tt class="py-lineno"> 15</tt> <a class="py-toggle" href="#" id="SequenceIterator.__init__-toggle" onclick="return toggle('SequenceIterator.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="Bio.SeqIO.Interfaces.SequenceIterator-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">handle</tt><tt class="py-op">,</tt> <tt class="py-param">alphabet</tt><tt class="py-op">=</tt><tt id="link-3" class="py-name"><a title="Bio.Alphabet.generic_alphabet" class="py-name" href="#" onclick="return doclink('link-3', 'generic_alphabet', 'link-2');">generic_alphabet</a></tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> </tt>
</div><div id="SequenceIterator.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SequenceIterator.__init__-expanded"><a name="L16"></a><tt class="py-lineno"> 16</tt>  <tt class="py-line">        <tt class="py-docstring">"""Create a SequenceIterator object.</tt> </tt>
<a name="L17"></a><tt class="py-lineno"> 17</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L18"></a><tt class="py-lineno"> 18</tt>  <tt class="py-line"><tt class="py-docstring">        handle - input file</tt> </tt>
<a name="L19"></a><tt class="py-lineno"> 19</tt>  <tt class="py-line"><tt class="py-docstring">        alphabet - optional, e.g. Bio.Alphabet.generic_protein</tt> </tt>
<a name="L20"></a><tt class="py-lineno"> 20</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L21"></a><tt class="py-lineno"> 21</tt>  <tt class="py-line"><tt class="py-docstring">        Note when subclassing:</tt> </tt>
<a name="L22"></a><tt class="py-lineno"> 22</tt>  <tt class="py-line"><tt class="py-docstring">        - there should be a single non-optional argument,</tt> </tt>
<a name="L23"></a><tt class="py-lineno"> 23</tt>  <tt class="py-line"><tt class="py-docstring">          the handle.</tt> </tt>
<a name="L24"></a><tt class="py-lineno"> 24</tt>  <tt class="py-line"><tt class="py-docstring">        - you do not have to require an alphabet.</tt> </tt>
<a name="L25"></a><tt class="py-lineno"> 25</tt>  <tt class="py-line"><tt class="py-docstring">        - you can add additional optional arguments."""</tt> </tt>
<a name="L26"></a><tt class="py-lineno"> 26</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-4" class="py-name" targets="Variable Bio.LocusLink.web_parse.handle=Bio.LocusLink.web_parse-module.html#handle,Variable Bio.Ndb.handle=Bio.Ndb-module.html#handle"><a title="Bio.LocusLink.web_parse.handle
Bio.Ndb.handle" class="py-name" href="#" onclick="return doclink('link-4', 'handle', 'link-4');">handle</a></tt> <tt class="py-op">=</tt> <tt id="link-5" class="py-name"><a title="Bio.LocusLink.web_parse.handle
Bio.Ndb.handle" class="py-name" href="#" onclick="return doclink('link-5', 'handle', 'link-4');">handle</a></tt> </tt>
<a name="L27"></a><tt class="py-lineno"> 27</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-6" class="py-name" targets="Variable Bio.Prosite.Pattern.Prosite.alphabet=Bio.Prosite.Pattern.Prosite-class.html#alphabet,Function Bio.Std.alphabet()=Bio.Std-module.html#alphabet"><a title="Bio.Prosite.Pattern.Prosite.alphabet
Bio.Std.alphabet" class="py-name" href="#" onclick="return doclink('link-6', 'alphabet', 'link-6');">alphabet</a></tt> <tt class="py-op">=</tt> <tt id="link-7" class="py-name"><a title="Bio.Prosite.Pattern.Prosite.alphabet
Bio.Std.alphabet" class="py-name" href="#" onclick="return doclink('link-7', 'alphabet', 'link-6');">alphabet</a></tt> </tt>
</div><a name="L28"></a><tt class="py-lineno"> 28</tt>  <tt class="py-line">        <tt class="py-comment">#####################################################</tt> </tt>
<a name="L29"></a><tt class="py-lineno"> 29</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment"># You may want to subclass this, for example        #</tt> </tt>
<a name="L30"></a><tt class="py-lineno"> 30</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment"># to read through the file to find the first record,#</tt> </tt>
<a name="L31"></a><tt class="py-lineno"> 31</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment"># or if additional arguments are required.          #</tt> </tt>
<a name="L32"></a><tt class="py-lineno"> 32</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#####################################################</tt> </tt>
<a name="L33"></a><tt class="py-lineno"> 33</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="SequenceIterator.next"></a><div id="SequenceIterator.next-def"><a name="L34"></a><tt class="py-lineno"> 34</tt> <a class="py-toggle" href="#" id="SequenceIterator.next-toggle" onclick="return toggle('SequenceIterator.next');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="Bio.SeqIO.Interfaces.SequenceIterator-class.html#next">next</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> </tt>
</div><div id="SequenceIterator.next-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SequenceIterator.next-expanded"><a name="L35"></a><tt class="py-lineno"> 35</tt>  <tt class="py-line">        <tt class="py-docstring">"""Return the next record in the file.</tt> </tt>
<a name="L36"></a><tt class="py-lineno"> 36</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L37"></a><tt class="py-lineno"> 37</tt>  <tt class="py-line"><tt class="py-docstring">        This method should be replaced by any derived class to do something useful."""</tt> </tt>
<a name="L38"></a><tt class="py-lineno"> 38</tt>  <tt class="py-line">        <tt class="py-keyword">raise</tt> <tt class="py-name">NotImplementedError</tt><tt class="py-op">,</tt> <tt class="py-string">"This object should be subclassed"</tt> </tt>
</div><a name="L39"></a><tt class="py-lineno"> 39</tt>  <tt class="py-line">        <tt class="py-comment">#####################################################</tt> </tt>
<a name="L40"></a><tt class="py-lineno"> 40</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment"># You SHOULD subclass this, to split the file up    #</tt> </tt>
<a name="L41"></a><tt class="py-lineno"> 41</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment"># into your individual records, and convert these   #</tt> </tt>
<a name="L42"></a><tt class="py-lineno"> 42</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment"># into useful objects, e.g. return SeqRecord object #</tt> </tt>
<a name="L43"></a><tt class="py-lineno"> 43</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#####################################################</tt> </tt>
<a name="L44"></a><tt class="py-lineno"> 44</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="SequenceIterator.__iter__"></a><div id="SequenceIterator.__iter__-def"><a name="L45"></a><tt class="py-lineno"> 45</tt> <a class="py-toggle" href="#" id="SequenceIterator.__iter__-toggle" onclick="return toggle('SequenceIterator.__iter__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="Bio.SeqIO.Interfaces.SequenceIterator-class.html#__iter__">__iter__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="SequenceIterator.__iter__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SequenceIterator.__iter__-expanded"><a name="L46"></a><tt class="py-lineno"> 46</tt>  <tt class="py-line">        <tt class="py-docstring">"""Iterate over the entries as a SeqRecord objects.</tt> </tt>
<a name="L47"></a><tt class="py-lineno"> 47</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L48"></a><tt class="py-lineno"> 48</tt>  <tt class="py-line"><tt class="py-docstring">        Example usage for Fasta files:</tt> </tt>
<a name="L49"></a><tt class="py-lineno"> 49</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L50"></a><tt class="py-lineno"> 50</tt>  <tt class="py-line"><tt class="py-docstring">        myFile = open("example.fasta","r")</tt> </tt>
<a name="L51"></a><tt class="py-lineno"> 51</tt>  <tt class="py-line"><tt class="py-docstring">        myFastaReader = FastaIterator(myFile)</tt> </tt>
<a name="L52"></a><tt class="py-lineno"> 52</tt>  <tt class="py-line"><tt class="py-docstring">        for record in myFastaReader :</tt> </tt>
<a name="L53"></a><tt class="py-lineno"> 53</tt>  <tt class="py-line"><tt class="py-docstring">            print record.id</tt> </tt>
<a name="L54"></a><tt class="py-lineno"> 54</tt>  <tt class="py-line"><tt class="py-docstring">            print record.seq</tt> </tt>
<a name="L55"></a><tt class="py-lineno"> 55</tt>  <tt class="py-line"><tt class="py-docstring">        myFile.close()"""</tt> </tt>
<a name="L56"></a><tt class="py-lineno"> 56</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">iter</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-8" class="py-name" targets="Method Bio.AlignIO.ClustalIO.ClustalIterator.next()=Bio.AlignIO.ClustalIO.ClustalIterator-class.html#next,Method Bio.AlignIO.EmbossIO.EmbossIterator.next()=Bio.AlignIO.EmbossIO.EmbossIterator-class.html#next,Method Bio.AlignIO.FastaIO.FastaM10Iterator.next()=Bio.AlignIO.FastaIO.FastaM10Iterator-class.html#next,Method Bio.AlignIO.Interfaces.AlignmentIterator.next()=Bio.AlignIO.Interfaces.AlignmentIterator-class.html#next,Method Bio.AlignIO.PhylipIO.PhylipIterator.next()=Bio.AlignIO.PhylipIO.PhylipIterator-class.html#next,Method Bio.AlignIO.StockholmIO.StockholmIterator.next()=Bio.AlignIO.StockholmIO.StockholmIterator-class.html#next,Method Bio.Blast.NCBIStandalone.Iterator.next()=Bio.Blast.NCBIStandalone.Iterator-class.html#next,Method Bio.Blast.ParseBlastTable.BlastTableReader.next()=Bio.Blast.ParseBlastTable.BlastTableReader-class.html#next,Method Bio.CDD.Iterator.next()=Bio.CDD.Iterator-class.html#next,Method Bio.Compass.Iterator.next()=Bio.Compass.Iterator-class.html#next,Method Bio.DocSQL.IterationCursor.next()=Bio.DocSQL.IterationCursor-class.html#next,Method Bio.ECell.Iterator.next()=Bio.ECell.Iterator-class.html#next,Method Bio.Enzyme.Iterator.next()=Bio.Enzyme.Iterator-class.html#next,Method Bio.Fasta.Iterator.next()=Bio.Fasta.Iterator-class.html#next,Method Bio.GenBank.Iterator.next()=Bio.GenBank.Iterator-class.html#next,Method Bio.Gobase.Iterator.next()=Bio.Gobase.Iterator-class.html#next,Method Bio.IntelliGenetics.IntelliGeneticsReader.next()=Bio.IntelliGenetics.IntelliGeneticsReader-class.html#next,Method Bio.IntelliGenetics.Iterator.next()=Bio.IntelliGenetics.Iterator-class.html#next,Method Bio.LocusLink.Iterator.next()=Bio.LocusLink.Iterator-class.html#next,Method Bio.Medline.Iterator.next()=Bio.Medline.Iterator-class.html#next,Method Bio.MetaTool.Iterator.next()=Bio.MetaTool.Iterator-class.html#next,Method Bio.NBRF.Iterator.next()=Bio.NBRF.Iterator-class.html#next,Method Bio.Nexus.Nexus.CharBuffer.next()=Bio.Nexus.Nexus.CharBuffer-class.html#next,Method Bio.Prosite.Iterator.next()=Bio.Prosite.Iterator-class.html#next,Method Bio.Prosite.Prodoc.Iterator.next()=Bio.Prosite.Prodoc.Iterator-class.html#next,Method Bio.Rebase.Iterator.next()=Bio.Rebase.Iterator-class.html#next,Method Bio.SCOP.Cla.Iterator.next()=Bio.SCOP.Cla.Iterator-class.html#next,Method Bio.SCOP.Des.Iterator.next()=Bio.SCOP.Des.Iterator-class.html#next,Method Bio.SCOP.Dom.Iterator.next()=Bio.SCOP.Dom.Iterator-class.html#next,Method Bio.SCOP.Hie.Iterator.next()=Bio.SCOP.Hie.Iterator-class.html#next,Method Bio.SCOP.Raf.Iterator.next()=Bio.SCOP.Raf.Iterator-class.html#next,Method Bio.Saf.Iterator.next()=Bio.Saf.Iterator-class.html#next,Method Bio.SeqIO.Interfaces.InterlacedSequenceIterator.next()=Bio.SeqIO.Interfaces.InterlacedSequenceIterator-class.html#next,Method Bio.SeqIO.Interfaces.SequenceIterator.next()=Bio.SeqIO.Interfaces.SequenceIterator-class.html#next,Method Bio.Sequencing.Ace.Iterator.next()=Bio.Sequencing.Ace.Iterator-class.html#next,Method Bio.Sequencing.Phd.Iterator.next()=Bio.Sequencing.Phd.Iterator-class.html#next,Method Bio.SwissProt.SProt.Iterator.next()=Bio.SwissProt.SProt.Iterator-class.html#next,Method Bio.UniGene.Iterator.next()=Bio.UniGene.Iterator-class.html#next,Method Martel.Iterator.EventStream.next()=Martel.Iterator.EventStream-class.html#next,Method Martel.Iterator.HeaderFooterEventStream.next()=Martel.Iterator.HeaderFooterEventStream-class.html#next,Method Martel.Iterator.Iterate.next()=Martel.Iterator.Iterate-class.html#next,Method Martel.Iterator.RecordEventStream.next()=Martel.Iterator.RecordEventStream-class.html#next,Method Martel.RecordReader.CountLines.next()=Martel.RecordReader.CountLines-class.html#next,Method Martel.RecordReader.EndsWith.next()=Martel.RecordReader.EndsWith-class.html#next,Method Martel.RecordReader.Everything.next()=Martel.RecordReader.Everything-class.html#next,Method Martel.RecordReader.Nothing.next()=Martel.RecordReader.Nothing-class.html#next,Method Martel.RecordReader.RecordReader.next()=Martel.RecordReader.RecordReader-class.html#next,Method Martel.RecordReader.StartsWith.next()=Martel.RecordReader.StartsWith-class.html#next,Method Martel.RecordReader.Until.next()=Martel.RecordReader.Until-class.html#next"><a title="Bio.AlignIO.ClustalIO.ClustalIterator.next
Bio.AlignIO.EmbossIO.EmbossIterator.next
Bio.AlignIO.FastaIO.FastaM10Iterator.next
Bio.AlignIO.Interfaces.AlignmentIterator.next
Bio.AlignIO.PhylipIO.PhylipIterator.next
Bio.AlignIO.StockholmIO.StockholmIterator.next
Bio.Blast.NCBIStandalone.Iterator.next
Bio.Blast.ParseBlastTable.BlastTableReader.next
Bio.CDD.Iterator.next
Bio.Compass.Iterator.next
Bio.DocSQL.IterationCursor.next
Bio.ECell.Iterator.next
Bio.Enzyme.Iterator.next
Bio.Fasta.Iterator.next
Bio.GenBank.Iterator.next
Bio.Gobase.Iterator.next
Bio.IntelliGenetics.IntelliGeneticsReader.next
Bio.IntelliGenetics.Iterator.next
Bio.LocusLink.Iterator.next
Bio.Medline.Iterator.next
Bio.MetaTool.Iterator.next
Bio.NBRF.Iterator.next
Bio.Nexus.Nexus.CharBuffer.next
Bio.Prosite.Iterator.next
Bio.Prosite.Prodoc.Iterator.next
Bio.Rebase.Iterator.next
Bio.SCOP.Cla.Iterator.next
Bio.SCOP.Des.Iterator.next
Bio.SCOP.Dom.Iterator.next
Bio.SCOP.Hie.Iterator.next
Bio.SCOP.Raf.Iterator.next
Bio.Saf.Iterator.next
Bio.SeqIO.Interfaces.InterlacedSequenceIterator.next
Bio.SeqIO.Interfaces.SequenceIterator.next
Bio.Sequencing.Ace.Iterator.next
Bio.Sequencing.Phd.Iterator.next
Bio.SwissProt.SProt.Iterator.next
Bio.UniGene.Iterator.next
Martel.Iterator.EventStream.next
Martel.Iterator.HeaderFooterEventStream.next
Martel.Iterator.Iterate.next
Martel.Iterator.RecordEventStream.next
Martel.RecordReader.CountLines.next
Martel.RecordReader.EndsWith.next
Martel.RecordReader.Everything.next
Martel.RecordReader.Nothing.next
Martel.RecordReader.RecordReader.next
Martel.RecordReader.StartsWith.next
Martel.RecordReader.Until.next" class="py-name" href="#" onclick="return doclink('link-8', 'next', 'link-8');">next</a></tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L57"></a><tt class="py-lineno"> 57</tt>  <tt class="py-line"> </tt>
<a name="InterlacedSequenceIterator"></a><div id="InterlacedSequenceIterator-def"><a name="L58"></a><tt class="py-lineno"> 58</tt> <a class="py-toggle" href="#" id="InterlacedSequenceIterator-toggle" onclick="return toggle('InterlacedSequenceIterator');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="Bio.SeqIO.Interfaces.InterlacedSequenceIterator-class.html">InterlacedSequenceIterator</a><tt class="py-op">(</tt><tt class="py-base-class">SequenceIterator</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> </tt>
</div><div id="InterlacedSequenceIterator-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="InterlacedSequenceIterator-expanded"><a name="L59"></a><tt class="py-lineno"> 59</tt>  <tt class="py-line">    <tt class="py-docstring">"""Base class for any iterator of a non-sequential file type.</tt> </tt>
<a name="L60"></a><tt class="py-lineno"> 60</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L61"></a><tt class="py-lineno"> 61</tt>  <tt class="py-line"><tt class="py-docstring">    This object is not intended for use directly.</tt> </tt>
<a name="L62"></a><tt class="py-lineno"> 62</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L63"></a><tt class="py-lineno"> 63</tt>  <tt class="py-line"><tt class="py-docstring">    When writing a parser for any interlaced sequence file where the whole</tt> </tt>
<a name="L64"></a><tt class="py-lineno"> 64</tt>  <tt class="py-line"><tt class="py-docstring">    file must be read in order to extract any single record, then you should</tt> </tt>
<a name="L65"></a><tt class="py-lineno"> 65</tt>  <tt class="py-line"><tt class="py-docstring">    subclass this object.</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">    All you need to do is to define your own:</tt> </tt>
<a name="L68"></a><tt class="py-lineno"> 68</tt>  <tt class="py-line"><tt class="py-docstring">    (1) __init__ method to parse the file and call self.move_start()</tt> </tt>
<a name="L69"></a><tt class="py-lineno"> 69</tt>  <tt class="py-line"><tt class="py-docstring">    (2) __len__ method to return the number of records</tt> </tt>
<a name="L70"></a><tt class="py-lineno"> 70</tt>  <tt class="py-line"><tt class="py-docstring">    (3) __getitem__ to return any requested record.</tt> </tt>
<a name="L71"></a><tt class="py-lineno"> 71</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L72"></a><tt class="py-lineno"> 72</tt>  <tt class="py-line"><tt class="py-docstring">    This class will then provide the iterator methods including next(), but relies</tt> </tt>
<a name="L73"></a><tt class="py-lineno"> 73</tt>  <tt class="py-line"><tt class="py-docstring">    on knowing the total number of records and tracking the pending record index in</tt> </tt>
<a name="L74"></a><tt class="py-lineno"> 74</tt>  <tt class="py-line"><tt class="py-docstring">    as self._n</tt> </tt>
<a name="L75"></a><tt class="py-lineno"> 75</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L76"></a><tt class="py-lineno"> 76</tt>  <tt class="py-line"><tt class="py-docstring">    It is up to the subclassed object to decide if it wants to generate a cache of</tt> </tt>
<a name="L77"></a><tt class="py-lineno"> 77</tt>  <tt class="py-line"><tt class="py-docstring">    SeqRecords when initialised, or simply use its own lists and dicts and create</tt> </tt>
<a name="L78"></a><tt class="py-lineno"> 78</tt>  <tt class="py-line"><tt class="py-docstring">    SeqRecords on request.</tt> </tt>
<a name="L79"></a><tt class="py-lineno"> 79</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L80"></a><tt class="py-lineno"> 80</tt>  <tt class="py-line"> </tt>
<a name="InterlacedSequenceIterator.__init__"></a><div id="InterlacedSequenceIterator.__init__-def"><a name="L81"></a><tt class="py-lineno"> 81</tt> <a class="py-toggle" href="#" id="InterlacedSequenceIterator.__init__-toggle" onclick="return toggle('InterlacedSequenceIterator.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="Bio.SeqIO.Interfaces.InterlacedSequenceIterator-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> </tt>
</div><div id="InterlacedSequenceIterator.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="InterlacedSequenceIterator.__init__-expanded"><a name="L82"></a><tt class="py-lineno"> 82</tt>  <tt class="py-line">        <tt class="py-docstring">"""Create the object.</tt> </tt>
<a name="L83"></a><tt class="py-lineno"> 83</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L84"></a><tt class="py-lineno"> 84</tt>  <tt class="py-line"><tt class="py-docstring">        This method should be replaced by any derived class to do something useful."""</tt> </tt>
<a name="L85"></a><tt class="py-lineno"> 85</tt>  <tt class="py-line">        <tt class="py-comment">#We assume that your implementation of __init__ will ensure self._n=0</tt> </tt>
<a name="L86"></a><tt class="py-lineno"> 86</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-9" class="py-name" targets="Method Bio.SeqIO.Interfaces.InterlacedSequenceIterator.move_start()=Bio.SeqIO.Interfaces.InterlacedSequenceIterator-class.html#move_start"><a title="Bio.SeqIO.Interfaces.InterlacedSequenceIterator.move_start" class="py-name" href="#" onclick="return doclink('link-9', 'move_start', 'link-9');">move_start</a></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 class="py-keyword">raise</tt> <tt class="py-name">NotImplementedError</tt><tt class="py-op">,</tt> <tt class="py-string">"This object method should be subclassed"</tt> </tt>
</div><a name="L88"></a><tt class="py-lineno"> 88</tt>  <tt class="py-line">        <tt class="py-comment">#####################################################</tt> </tt>
<a name="L89"></a><tt class="py-lineno"> 89</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment"># You SHOULD subclass this                          #</tt> </tt>
<a name="L90"></a><tt class="py-lineno"> 90</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#####################################################</tt> </tt>
<a name="L91"></a><tt class="py-lineno"> 91</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="InterlacedSequenceIterator.__len__"></a><div id="InterlacedSequenceIterator.__len__-def"><a name="L92"></a><tt class="py-lineno"> 92</tt> <a class="py-toggle" href="#" id="InterlacedSequenceIterator.__len__-toggle" onclick="return toggle('InterlacedSequenceIterator.__len__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="Bio.SeqIO.Interfaces.InterlacedSequenceIterator-class.html#__len__">__len__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> </tt>
</div><div id="InterlacedSequenceIterator.__len__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="InterlacedSequenceIterator.__len__-expanded"><a name="L93"></a><tt class="py-lineno"> 93</tt>  <tt class="py-line">        <tt class="py-docstring">"""Return the number of records.</tt> </tt>
<a name="L94"></a><tt class="py-lineno"> 94</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L95"></a><tt class="py-lineno"> 95</tt>  <tt class="py-line"><tt class="py-docstring">        This method should be replaced by any derived class to do something useful."""</tt> </tt>
<a name="L96"></a><tt class="py-lineno"> 96</tt>  <tt class="py-line">        <tt class="py-keyword">raise</tt> <tt class="py-name">NotImplementedError</tt><tt class="py-op">,</tt> <tt class="py-string">"This object method should be subclassed"</tt> </tt>
</div><a name="L97"></a><tt class="py-lineno"> 97</tt>  <tt class="py-line">        <tt class="py-comment">#####################################################</tt> </tt>
<a name="L98"></a><tt class="py-lineno"> 98</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment"># You SHOULD subclass this                          #</tt> </tt>
<a name="L99"></a><tt class="py-lineno"> 99</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#####################################################</tt> </tt>
<a name="L100"></a><tt class="py-lineno">100</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="InterlacedSequenceIterator.__getitem__"></a><div id="InterlacedSequenceIterator.__getitem__-def"><a name="L101"></a><tt class="py-lineno">101</tt> <a class="py-toggle" href="#" id="InterlacedSequenceIterator.__getitem__-toggle" onclick="return toggle('InterlacedSequenceIterator.__getitem__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="Bio.SeqIO.Interfaces.InterlacedSequenceIterator-class.html#__getitem__">__getitem__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">i</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> </tt>
</div><div id="InterlacedSequenceIterator.__getitem__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="InterlacedSequenceIterator.__getitem__-expanded"><a name="L102"></a><tt class="py-lineno">102</tt>  <tt class="py-line">        <tt class="py-docstring">"""Return the requested record.</tt> </tt>
<a name="L103"></a><tt class="py-lineno">103</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L104"></a><tt class="py-lineno">104</tt>  <tt class="py-line"><tt class="py-docstring">        This method should be replaced by any derived class to do something</tt> </tt>
<a name="L105"></a><tt class="py-lineno">105</tt>  <tt class="py-line"><tt class="py-docstring">        useful.</tt> </tt>
<a name="L106"></a><tt class="py-lineno">106</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L107"></a><tt class="py-lineno">107</tt>  <tt class="py-line"><tt class="py-docstring">        It should NOT touch the value of self._n"""</tt> </tt>
<a name="L108"></a><tt class="py-lineno">108</tt>  <tt class="py-line">        <tt class="py-keyword">raise</tt> <tt class="py-name">NotImplementedError</tt><tt class="py-op">,</tt> <tt class="py-string">"This object method should be subclassed"</tt> </tt>
</div><a name="L109"></a><tt class="py-lineno">109</tt>  <tt class="py-line">        <tt class="py-comment">#####################################################</tt> </tt>
<a name="L110"></a><tt class="py-lineno">110</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment"># You SHOULD subclass this                          #</tt> </tt>
<a name="L111"></a><tt class="py-lineno">111</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#####################################################</tt> </tt>
<a name="L112"></a><tt class="py-lineno">112</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="InterlacedSequenceIterator.move_start"></a><div id="InterlacedSequenceIterator.move_start-def"><a name="L113"></a><tt class="py-lineno">113</tt> <a class="py-toggle" href="#" id="InterlacedSequenceIterator.move_start-toggle" onclick="return toggle('InterlacedSequenceIterator.move_start');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="Bio.SeqIO.Interfaces.InterlacedSequenceIterator-class.html#move_start">move_start</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> </tt>
</div><div id="InterlacedSequenceIterator.move_start-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="InterlacedSequenceIterator.move_start-expanded"><a name="L114"></a><tt class="py-lineno">114</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_n</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
</div><a name="L115"></a><tt class="py-lineno">115</tt>  <tt class="py-line"> </tt>
<a name="InterlacedSequenceIterator.next"></a><div id="InterlacedSequenceIterator.next-def"><a name="L116"></a><tt class="py-lineno">116</tt> <a class="py-toggle" href="#" id="InterlacedSequenceIterator.next-toggle" onclick="return toggle('InterlacedSequenceIterator.next');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="Bio.SeqIO.Interfaces.InterlacedSequenceIterator-class.html#next">next</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> </tt>
</div><div id="InterlacedSequenceIterator.next-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="InterlacedSequenceIterator.next-expanded"><a name="L117"></a><tt class="py-lineno">117</tt>  <tt class="py-line">        <tt class="py-name">next_record</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_n</tt> </tt>
<a name="L118"></a><tt class="py-lineno">118</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">next_record</tt> <tt class="py-op">&lt;</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> </tt>
<a name="L119"></a><tt class="py-lineno">119</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_n</tt> <tt class="py-op">=</tt> <tt class="py-name">next_record</tt><tt class="py-op">+</tt><tt class="py-number">1</tt> </tt>
<a name="L120"></a><tt class="py-lineno">120</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">[</tt><tt class="py-name">next_record</tt><tt class="py-op">]</tt> </tt>
<a name="L121"></a><tt class="py-lineno">121</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt> <tt class="py-op">:</tt> </tt>
<a name="L122"></a><tt class="py-lineno">122</tt>  <tt class="py-line">            <tt class="py-comment">#StopIteration</tt> </tt>
<a name="L123"></a><tt class="py-lineno">123</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-keyword">return</tt> <tt class="py-name">None</tt> </tt>
</div><a name="L124"></a><tt class="py-lineno">124</tt>  <tt class="py-line">     </tt>
<a name="InterlacedSequenceIterator.__iter__"></a><div id="InterlacedSequenceIterator.__iter__-def"><a name="L125"></a><tt class="py-lineno">125</tt> <a class="py-toggle" href="#" id="InterlacedSequenceIterator.__iter__-toggle" onclick="return toggle('InterlacedSequenceIterator.__iter__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="Bio.SeqIO.Interfaces.InterlacedSequenceIterator-class.html#__iter__">__iter__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="InterlacedSequenceIterator.__iter__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="InterlacedSequenceIterator.__iter__-expanded"><a name="L126"></a><tt class="py-lineno">126</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">iter</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-10" class="py-name"><a title="Bio.AlignIO.ClustalIO.ClustalIterator.next
Bio.AlignIO.EmbossIO.EmbossIterator.next
Bio.AlignIO.FastaIO.FastaM10Iterator.next
Bio.AlignIO.Interfaces.AlignmentIterator.next
Bio.AlignIO.PhylipIO.PhylipIterator.next
Bio.AlignIO.StockholmIO.StockholmIterator.next
Bio.Blast.NCBIStandalone.Iterator.next
Bio.Blast.ParseBlastTable.BlastTableReader.next
Bio.CDD.Iterator.next
Bio.Compass.Iterator.next
Bio.DocSQL.IterationCursor.next
Bio.ECell.Iterator.next
Bio.Enzyme.Iterator.next
Bio.Fasta.Iterator.next
Bio.GenBank.Iterator.next
Bio.Gobase.Iterator.next
Bio.IntelliGenetics.IntelliGeneticsReader.next
Bio.IntelliGenetics.Iterator.next
Bio.LocusLink.Iterator.next
Bio.Medline.Iterator.next
Bio.MetaTool.Iterator.next
Bio.NBRF.Iterator.next
Bio.Nexus.Nexus.CharBuffer.next
Bio.Prosite.Iterator.next
Bio.Prosite.Prodoc.Iterator.next
Bio.Rebase.Iterator.next
Bio.SCOP.Cla.Iterator.next
Bio.SCOP.Des.Iterator.next
Bio.SCOP.Dom.Iterator.next
Bio.SCOP.Hie.Iterator.next
Bio.SCOP.Raf.Iterator.next
Bio.Saf.Iterator.next
Bio.SeqIO.Interfaces.InterlacedSequenceIterator.next
Bio.SeqIO.Interfaces.SequenceIterator.next
Bio.Sequencing.Ace.Iterator.next
Bio.Sequencing.Phd.Iterator.next
Bio.SwissProt.SProt.Iterator.next
Bio.UniGene.Iterator.next
Martel.Iterator.EventStream.next
Martel.Iterator.HeaderFooterEventStream.next
Martel.Iterator.Iterate.next
Martel.Iterator.RecordEventStream.next
Martel.RecordReader.CountLines.next
Martel.RecordReader.EndsWith.next
Martel.RecordReader.Everything.next
Martel.RecordReader.Nothing.next
Martel.RecordReader.RecordReader.next
Martel.RecordReader.StartsWith.next
Martel.RecordReader.Until.next" class="py-name" href="#" onclick="return doclink('link-10', 'next', 'link-8');">next</a></tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L127"></a><tt class="py-lineno">127</tt>  <tt class="py-line"> </tt>
<a name="SequenceWriter"></a><div id="SequenceWriter-def"><a name="L128"></a><tt class="py-lineno">128</tt> <a class="py-toggle" href="#" id="SequenceWriter-toggle" onclick="return toggle('SequenceWriter');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="Bio.SeqIO.Interfaces.SequenceWriter-class.html">SequenceWriter</a><tt class="py-op">:</tt> </tt>
</div><div id="SequenceWriter-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="SequenceWriter-expanded"><a name="L129"></a><tt class="py-lineno">129</tt>  <tt class="py-line">    <tt class="py-docstring">"""This class should be subclassed.</tt> </tt>
<a name="L130"></a><tt class="py-lineno">130</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L131"></a><tt class="py-lineno">131</tt>  <tt class="py-line"><tt class="py-docstring">    Interlaced file formats (e.g. Clustal) should subclass directly.</tt> </tt>
<a name="L132"></a><tt class="py-lineno">132</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L133"></a><tt class="py-lineno">133</tt>  <tt class="py-line"><tt class="py-docstring">    Sequential file formats (e.g. Fasta, GenBank) should subclass</tt> </tt>
<a name="L134"></a><tt class="py-lineno">134</tt>  <tt class="py-line"><tt class="py-docstring">    the SequentialSequenceWriter class instead.</tt> </tt>
<a name="L135"></a><tt class="py-lineno">135</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="SequenceWriter.__init__"></a><div id="SequenceWriter.__init__-def"><a name="L136"></a><tt class="py-lineno">136</tt> <a class="py-toggle" href="#" id="SequenceWriter.__init__-toggle" onclick="return toggle('SequenceWriter.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="Bio.SeqIO.Interfaces.SequenceWriter-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">handle</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="SequenceWriter.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SequenceWriter.__init__-expanded"><a name="L137"></a><tt class="py-lineno">137</tt>  <tt class="py-line">        <tt class="py-docstring">"""Creates the writer object.</tt> </tt>
<a name="L138"></a><tt class="py-lineno">138</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L139"></a><tt class="py-lineno">139</tt>  <tt class="py-line"><tt class="py-docstring">        Use the method write_file() to actually record your sequence records."""</tt> </tt>
<a name="L140"></a><tt class="py-lineno">140</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-11" class="py-name"><a title="Bio.LocusLink.web_parse.handle
Bio.Ndb.handle" class="py-name" href="#" onclick="return doclink('link-11', 'handle', 'link-4');">handle</a></tt> <tt class="py-op">=</tt> <tt id="link-12" class="py-name"><a title="Bio.LocusLink.web_parse.handle
Bio.Ndb.handle" class="py-name" href="#" onclick="return doclink('link-12', 'handle', 'link-4');">handle</a></tt> </tt>
</div><a name="L141"></a><tt class="py-lineno">141</tt>  <tt class="py-line"> </tt>
<a name="SequenceWriter.clean"></a><div id="SequenceWriter.clean-def"><a name="L142"></a><tt class="py-lineno">142</tt> <a class="py-toggle" href="#" id="SequenceWriter.clean-toggle" onclick="return toggle('SequenceWriter.clean');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="Bio.SeqIO.Interfaces.SequenceWriter-class.html#clean">clean</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">text</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> </tt>
</div><div id="SequenceWriter.clean-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SequenceWriter.clean-expanded"><a name="L143"></a><tt class="py-lineno">143</tt>  <tt class="py-line">        <tt class="py-docstring">"""Use this to avoid getting newlines in the output."""</tt> </tt>
<a name="L144"></a><tt class="py-lineno">144</tt>  <tt class="py-line">        <tt class="py-name">answer</tt> <tt class="py-op">=</tt> <tt id="link-13" class="py-name" targets="Method Bio.EUtils.POM.ElementNode.text()=Bio.EUtils.POM.ElementNode-class.html#text,Method Bio.Prosite.Prodoc._RecordConsumer.text()=Bio.Prosite.Prodoc._RecordConsumer-class.html#text,Variable Martel.test.test_Iterator.text=Martel.test.test_Iterator-module.html#text,Variable Martel.test.test_ParseRecords.text=Martel.test.test_ParseRecords-module.html#text"><a title="Bio.EUtils.POM.ElementNode.text
Bio.Prosite.Prodoc._RecordConsumer.text
Martel.test.test_Iterator.text
Martel.test.test_ParseRecords.text" class="py-name" href="#" onclick="return doclink('link-13', 'text', 'link-13');">text</a></tt> </tt>
<a name="L145"></a><tt class="py-lineno">145</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt id="link-14" class="py-name" targets="Variable Bio.MarkovModel.x=Bio.MarkovModel-module.html#x,Variable Bio.Statistics.lowess.x=Bio.Statistics.lowess-module.html#x"><a title="Bio.MarkovModel.x
Bio.Statistics.lowess.x" class="py-name" href="#" onclick="return doclink('link-14', 'x', 'link-14');">x</a></tt> <tt class="py-keyword">in</tt> <tt class="py-op">[</tt><tt class="py-string">"\n"</tt><tt class="py-op">,</tt> <tt class="py-string">"\r"</tt><tt class="py-op">]</tt> <tt class="py-op">:</tt> </tt>
<a name="L146"></a><tt class="py-lineno">146</tt>  <tt class="py-line">            <tt class="py-name">answer</tt> <tt class="py-op">=</tt> <tt class="py-name">answer</tt><tt class="py-op">.</tt><tt class="py-name">replace</tt><tt class="py-op">(</tt><tt id="link-15" class="py-name"><a title="Bio.MarkovModel.x
Bio.Statistics.lowess.x" class="py-name" href="#" onclick="return doclink('link-15', 'x', 'link-14');">x</a></tt><tt class="py-op">,</tt> <tt class="py-string">" "</tt><tt class="py-op">)</tt> </tt>
<a name="L147"></a><tt class="py-lineno">147</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">answer</tt><tt class="py-op">.</tt><tt class="py-name">replace</tt><tt class="py-op">(</tt><tt class="py-string">"  "</tt><tt class="py-op">,</tt> <tt class="py-string">" "</tt><tt class="py-op">)</tt> </tt>
</div><a name="L148"></a><tt class="py-lineno">148</tt>  <tt class="py-line">     </tt>
<a name="SequenceWriter.write_file"></a><div id="SequenceWriter.write_file-def"><a name="L149"></a><tt class="py-lineno">149</tt> <a class="py-toggle" href="#" id="SequenceWriter.write_file-toggle" onclick="return toggle('SequenceWriter.write_file');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="Bio.SeqIO.Interfaces.SequenceWriter-class.html#write_file">write_file</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">records</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> </tt>
</div><div id="SequenceWriter.write_file-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SequenceWriter.write_file-expanded"><a name="L150"></a><tt class="py-lineno">150</tt>  <tt class="py-line">        <tt class="py-docstring">"""Use this to write an entire file containing the given records.</tt> </tt>
<a name="L151"></a><tt class="py-lineno">151</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L152"></a><tt class="py-lineno">152</tt>  <tt class="py-line"><tt class="py-docstring">        records - A list or iterator returning SeqRecord objects</tt> </tt>
<a name="L153"></a><tt class="py-lineno">153</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L154"></a><tt class="py-lineno">154</tt>  <tt class="py-line"><tt class="py-docstring">        This method can only be called once."""</tt> </tt>
<a name="L155"></a><tt class="py-lineno">155</tt>  <tt class="py-line">        <tt class="py-comment">#Note when implementing this, you should close the file at the end.</tt> </tt>
<a name="L156"></a><tt class="py-lineno">156</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">raise</tt> <tt class="py-name">NotImplementedError</tt><tt class="py-op">,</tt> <tt class="py-string">"This object should be subclassed"</tt> </tt>
</div></div><a name="L157"></a><tt class="py-lineno">157</tt>  <tt class="py-line">        <tt class="py-comment">#####################################################</tt> </tt>
<a name="L158"></a><tt class="py-lineno">158</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment"># You SHOULD subclass this                          #</tt> </tt>
<a name="L159"></a><tt class="py-lineno">159</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#####################################################</tt> </tt>
<a name="L160"></a><tt class="py-lineno">160</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="SequentialSequenceWriter"></a><div id="SequentialSequenceWriter-def"><a name="L161"></a><tt class="py-lineno">161</tt> <a class="py-toggle" href="#" id="SequentialSequenceWriter-toggle" onclick="return toggle('SequentialSequenceWriter');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="Bio.SeqIO.Interfaces.SequentialSequenceWriter-class.html">SequentialSequenceWriter</a><tt class="py-op">(</tt><tt class="py-base-class">SequenceWriter</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="SequentialSequenceWriter-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="SequentialSequenceWriter-expanded"><a name="L162"></a><tt class="py-lineno">162</tt>  <tt class="py-line">    <tt class="py-docstring">"""This class should be subclassed.</tt> </tt>
<a name="L163"></a><tt class="py-lineno">163</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L164"></a><tt class="py-lineno">164</tt>  <tt class="py-line"><tt class="py-docstring">    It is intended for sequential file formats with an (optional)</tt> </tt>
<a name="L165"></a><tt class="py-lineno">165</tt>  <tt class="py-line"><tt class="py-docstring">    header, repeated records, and an (optional) footer.</tt> </tt>
<a name="L166"></a><tt class="py-lineno">166</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L167"></a><tt class="py-lineno">167</tt>  <tt class="py-line"><tt class="py-docstring">    In this case (as with interlaced file formats), the user may</tt> </tt>
<a name="L168"></a><tt class="py-lineno">168</tt>  <tt class="py-line"><tt class="py-docstring">    simply call the write_file() method and be done.</tt> </tt>
<a name="L169"></a><tt class="py-lineno">169</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L170"></a><tt class="py-lineno">170</tt>  <tt class="py-line"><tt class="py-docstring">    However, they may also call the write_header(), followed</tt> </tt>
<a name="L171"></a><tt class="py-lineno">171</tt>  <tt class="py-line"><tt class="py-docstring">    by multiple calls to write_record() and/or write_records()</tt> </tt>
<a name="L172"></a><tt class="py-lineno">172</tt>  <tt class="py-line"><tt class="py-docstring">    followed finally by write_footer().</tt> </tt>
<a name="L173"></a><tt class="py-lineno">173</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L174"></a><tt class="py-lineno">174</tt>  <tt class="py-line"><tt class="py-docstring">    Users must call write_header() and write_footer() even when</tt> </tt>
<a name="L175"></a><tt class="py-lineno">175</tt>  <tt class="py-line"><tt class="py-docstring">    the file format concerned doesn't have a header or footer.</tt> </tt>
<a name="L176"></a><tt class="py-lineno">176</tt>  <tt class="py-line"><tt class="py-docstring">    This is to try and make life as easy as possible when</tt> </tt>
<a name="L177"></a><tt class="py-lineno">177</tt>  <tt class="py-line"><tt class="py-docstring">    switching the output format.</tt> </tt>
<a name="L178"></a><tt class="py-lineno">178</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L179"></a><tt class="py-lineno">179</tt>  <tt class="py-line"><tt class="py-docstring">    Note that write_header() cannot require any assumptions about</tt> </tt>
<a name="L180"></a><tt class="py-lineno">180</tt>  <tt class="py-line"><tt class="py-docstring">    the number of records.</tt> </tt>
<a name="L181"></a><tt class="py-lineno">181</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="SequentialSequenceWriter.__init__"></a><div id="SequentialSequenceWriter.__init__-def"><a name="L182"></a><tt class="py-lineno">182</tt> <a class="py-toggle" href="#" id="SequentialSequenceWriter.__init__-toggle" onclick="return toggle('SequentialSequenceWriter.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="Bio.SeqIO.Interfaces.SequentialSequenceWriter-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">handle</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="SequentialSequenceWriter.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SequentialSequenceWriter.__init__-expanded"><a name="L183"></a><tt class="py-lineno">183</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-16" class="py-name"><a title="Bio.LocusLink.web_parse.handle
Bio.Ndb.handle" class="py-name" href="#" onclick="return doclink('link-16', 'handle', 'link-4');">handle</a></tt> <tt class="py-op">=</tt> <tt id="link-17" class="py-name"><a title="Bio.LocusLink.web_parse.handle
Bio.Ndb.handle" class="py-name" href="#" onclick="return doclink('link-17', 'handle', 'link-4');">handle</a></tt> </tt>
<a name="L184"></a><tt class="py-lineno">184</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_header_written</tt> <tt class="py-op">=</tt> <tt id="link-18" class="py-name" targets="Variable Bio.EUtils.POM.False=Bio.EUtils.POM-module.html#False"><a title="Bio.EUtils.POM.False" class="py-name" href="#" onclick="return doclink('link-18', 'False', 'link-18');">False</a></tt> </tt>
<a name="L185"></a><tt class="py-lineno">185</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_record_written</tt> <tt class="py-op">=</tt> <tt id="link-19" class="py-name"><a title="Bio.EUtils.POM.False" class="py-name" href="#" onclick="return doclink('link-19', 'False', 'link-18');">False</a></tt> </tt>
<a name="L186"></a><tt class="py-lineno">186</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_footer_written</tt> <tt class="py-op">=</tt> <tt id="link-20" class="py-name"><a title="Bio.EUtils.POM.False" class="py-name" href="#" onclick="return doclink('link-20', 'False', 'link-18');">False</a></tt> </tt>
</div><a name="L187"></a><tt class="py-lineno">187</tt>  <tt class="py-line"> </tt>
<a name="SequentialSequenceWriter.write_header"></a><div id="SequentialSequenceWriter.write_header-def"><a name="L188"></a><tt class="py-lineno">188</tt> <a class="py-toggle" href="#" id="SequentialSequenceWriter.write_header-toggle" onclick="return toggle('SequentialSequenceWriter.write_header');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="Bio.SeqIO.Interfaces.SequentialSequenceWriter-class.html#write_header">write_header</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> </tt>
</div><div id="SequentialSequenceWriter.write_header-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SequentialSequenceWriter.write_header-expanded"><a name="L189"></a><tt class="py-lineno">189</tt>  <tt class="py-line">        <tt class="py-keyword">assert</tt> <tt class="py-keyword">not</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_header_written</tt><tt class="py-op">,</tt> <tt class="py-string">"You have aleady called write_header()"</tt> </tt>
<a name="L190"></a><tt class="py-lineno">190</tt>  <tt class="py-line">        <tt class="py-keyword">assert</tt> <tt class="py-keyword">not</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_record_written</tt><tt class="py-op">,</tt> <tt class="py-string">"You have aleady called write_record() or write_records()"</tt> </tt>
<a name="L191"></a><tt class="py-lineno">191</tt>  <tt class="py-line">        <tt class="py-keyword">assert</tt> <tt class="py-keyword">not</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_footer_written</tt><tt class="py-op">,</tt> <tt class="py-string">"You have aleady called write_footer()"</tt> </tt>
<a name="L192"></a><tt class="py-lineno">192</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_header_written</tt> <tt class="py-op">=</tt> <tt id="link-21" class="py-name" targets="Variable Bio.EUtils.POM.True=Bio.EUtils.POM-module.html#True"><a title="Bio.EUtils.POM.True" class="py-name" href="#" onclick="return doclink('link-21', 'True', 'link-21');">True</a></tt> </tt>
</div><a name="L193"></a><tt class="py-lineno">193</tt>  <tt class="py-line">         </tt>
<a name="SequentialSequenceWriter.write_footer"></a><div id="SequentialSequenceWriter.write_footer-def"><a name="L194"></a><tt class="py-lineno">194</tt> <a class="py-toggle" href="#" id="SequentialSequenceWriter.write_footer-toggle" onclick="return toggle('SequentialSequenceWriter.write_footer');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="Bio.SeqIO.Interfaces.SequentialSequenceWriter-class.html#write_footer">write_footer</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> </tt>
</div><div id="SequentialSequenceWriter.write_footer-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SequentialSequenceWriter.write_footer-expanded"><a name="L195"></a><tt class="py-lineno">195</tt>  <tt class="py-line">        <tt class="py-keyword">assert</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_header_written</tt><tt class="py-op">,</tt> <tt class="py-string">"You must call write_header() first"</tt> </tt>
<a name="L196"></a><tt class="py-lineno">196</tt>  <tt class="py-line">        <tt class="py-keyword">assert</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_record_written</tt><tt class="py-op">,</tt> <tt class="py-string">"You have not called write_record() or write_records() yet"</tt> </tt>
<a name="L197"></a><tt class="py-lineno">197</tt>  <tt class="py-line">        <tt class="py-keyword">assert</tt> <tt class="py-keyword">not</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_footer_written</tt><tt class="py-op">,</tt> <tt class="py-string">"You have aleady called write_footer()"</tt> </tt>
<a name="L198"></a><tt class="py-lineno">198</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_footer_written</tt> <tt class="py-op">=</tt> <tt id="link-22" class="py-name"><a title="Bio.EUtils.POM.True" class="py-name" href="#" onclick="return doclink('link-22', 'True', 'link-21');">True</a></tt> </tt>
</div><a name="L199"></a><tt class="py-lineno">199</tt>  <tt class="py-line"> </tt>
<a name="SequentialSequenceWriter.write_record"></a><div id="SequentialSequenceWriter.write_record-def"><a name="L200"></a><tt class="py-lineno">200</tt> <a class="py-toggle" href="#" id="SequentialSequenceWriter.write_record-toggle" onclick="return toggle('SequentialSequenceWriter.write_record');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="Bio.SeqIO.Interfaces.SequentialSequenceWriter-class.html#write_record">write_record</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">record</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="SequentialSequenceWriter.write_record-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SequentialSequenceWriter.write_record-expanded"><a name="L201"></a><tt class="py-lineno">201</tt>  <tt class="py-line">        <tt class="py-docstring">"""Write a single record to the output file.</tt> </tt>
<a name="L202"></a><tt class="py-lineno">202</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L203"></a><tt class="py-lineno">203</tt>  <tt class="py-line"><tt class="py-docstring">        record - a SeqRecord object</tt> </tt>
<a name="L204"></a><tt class="py-lineno">204</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L205"></a><tt class="py-lineno">205</tt>  <tt class="py-line"><tt class="py-docstring">        Once you have called write_header() you can call write_record()</tt> </tt>
<a name="L206"></a><tt class="py-lineno">206</tt>  <tt class="py-line"><tt class="py-docstring">        and/or write_records() as many times as needed.  Then call</tt> </tt>
<a name="L207"></a><tt class="py-lineno">207</tt>  <tt class="py-line"><tt class="py-docstring">        write_footer() and close()."""</tt> </tt>
<a name="L208"></a><tt class="py-lineno">208</tt>  <tt class="py-line">        <tt class="py-keyword">assert</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_header_written</tt><tt class="py-op">,</tt> <tt class="py-string">"You must call write_header() first"</tt> </tt>
<a name="L209"></a><tt class="py-lineno">209</tt>  <tt class="py-line">        <tt class="py-keyword">assert</tt> <tt class="py-keyword">not</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_footer_written</tt><tt class="py-op">,</tt> <tt class="py-string">"You have already called write_footer()"</tt> </tt>
<a name="L210"></a><tt class="py-lineno">210</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_record_written</tt> <tt class="py-op">=</tt> <tt id="link-23" class="py-name"><a title="Bio.EUtils.POM.True" class="py-name" href="#" onclick="return doclink('link-23', 'True', 'link-21');">True</a></tt> </tt>
<a name="L211"></a><tt class="py-lineno">211</tt>  <tt class="py-line">        <tt class="py-keyword">raise</tt> <tt class="py-name">NotImplementedError</tt><tt class="py-op">,</tt> <tt class="py-string">"This object should be subclassed"</tt> </tt>
</div><a name="L212"></a><tt class="py-lineno">212</tt>  <tt class="py-line">        <tt class="py-comment">#####################################################</tt> </tt>
<a name="L213"></a><tt class="py-lineno">213</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment"># You SHOULD subclass this                          #</tt> </tt>
<a name="L214"></a><tt class="py-lineno">214</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#####################################################</tt> </tt>
<a name="L215"></a><tt class="py-lineno">215</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="SequentialSequenceWriter.write_records"></a><div id="SequentialSequenceWriter.write_records-def"><a name="L216"></a><tt class="py-lineno">216</tt> <a class="py-toggle" href="#" id="SequentialSequenceWriter.write_records-toggle" onclick="return toggle('SequentialSequenceWriter.write_records');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="Bio.SeqIO.Interfaces.SequentialSequenceWriter-class.html#write_records">write_records</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">records</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="SequentialSequenceWriter.write_records-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SequentialSequenceWriter.write_records-expanded"><a name="L217"></a><tt class="py-lineno">217</tt>  <tt class="py-line">        <tt class="py-docstring">"""Write multiple record to the output file.</tt> </tt>
<a name="L218"></a><tt class="py-lineno">218</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L219"></a><tt class="py-lineno">219</tt>  <tt class="py-line"><tt class="py-docstring">        records - A list or iterator returning SeqRecord objects</tt> </tt>
<a name="L220"></a><tt class="py-lineno">220</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L221"></a><tt class="py-lineno">221</tt>  <tt class="py-line"><tt class="py-docstring">        Once you have called write_header() you can call write_record()</tt> </tt>
<a name="L222"></a><tt class="py-lineno">222</tt>  <tt class="py-line"><tt class="py-docstring">        and/or write_records() as many times as needed.  Then call</tt> </tt>
<a name="L223"></a><tt class="py-lineno">223</tt>  <tt class="py-line"><tt class="py-docstring">        write_footer() and close()."""</tt> </tt>
<a name="L224"></a><tt class="py-lineno">224</tt>  <tt class="py-line">        <tt class="py-comment">#Default implementation:</tt> </tt>
<a name="L225"></a><tt class="py-lineno">225</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">assert</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_header_written</tt><tt class="py-op">,</tt> <tt class="py-string">"You must call write_header() first"</tt> </tt>
<a name="L226"></a><tt class="py-lineno">226</tt>  <tt class="py-line">        <tt class="py-keyword">assert</tt> <tt class="py-keyword">not</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_footer_written</tt><tt class="py-op">,</tt> <tt class="py-string">"You have already called write_footer()"</tt> </tt>
<a name="L227"></a><tt class="py-lineno">227</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt id="link-24" class="py-name" targets="Variable Bio.Emboss.primer3_format.record=Bio.Emboss.primer3_format-module.html#record,Variable Bio.Emboss.primersearch_format.record=Bio.Emboss.primersearch_format-module.html#record,Method Bio.GFF.Feature.record()=Bio.GFF.Feature-class.html#record,Variable Bio.LocusLink.web_parse.record=Bio.LocusLink.web_parse-module.html#record,Variable Bio.Ndb.record=Bio.Ndb-module.html#record,Function Bio.Std.record()=Bio.Std-module.html#record,Variable Bio.expressions.blocks.record=Bio.expressions.blocks-module.html#record,Variable Bio.expressions.embl.embl65.record=Bio.expressions.embl.embl65-module.html#record,Variable Bio.expressions.fasta.record=Bio.expressions.fasta-module.html#record,Variable Bio.expressions.genbank.record=Bio.expressions.genbank-module.html#record,Variable Bio.expressions.hmmpfam.record=Bio.expressions.hmmpfam-module.html#record,Variable Bio.expressions.swissprot.ipi.record=Bio.expressions.swissprot.ipi-module.html#record,Variable Bio.expressions.swissprot.speclist.record=Bio.expressions.swissprot.speclist-module.html#record,Variable Bio.expressions.swissprot.sprot38.record=Bio.expressions.swissprot.sprot38-module.html#record,Variable Bio.expressions.swissprot.sprot40.record=Bio.expressions.swissprot.sprot40-module.html#record,Variable Martel.test.test_swissprot38.record=Martel.test.test_swissprot38-module.html#record,Variable Martel.test.testformats.swissprot38.record=Martel.test.testformats.swissprot38-module.html#record"><a title="Bio.Emboss.primer3_format.record
Bio.Emboss.primersearch_format.record
Bio.GFF.Feature.record
Bio.LocusLink.web_parse.record
Bio.Ndb.record
Bio.Std.record
Bio.expressions.blocks.record
Bio.expressions.embl.embl65.record
Bio.expressions.fasta.record
Bio.expressions.genbank.record
Bio.expressions.hmmpfam.record
Bio.expressions.swissprot.ipi.record
Bio.expressions.swissprot.speclist.record
Bio.expressions.swissprot.sprot38.record
Bio.expressions.swissprot.sprot40.record
Martel.test.test_swissprot38.record
Martel.test.testformats.swissprot38.record" class="py-name" href="#" onclick="return doclink('link-24', 'record', 'link-24');">record</a></tt> <tt class="py-keyword">in</tt> <tt class="py-name">records</tt> <tt class="py-op">:</tt> </tt>
<a name="L228"></a><tt class="py-lineno">228</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-25" class="py-name" targets="Method Bio.SeqIO.FastaIO.FastaWriter.write_record()=Bio.SeqIO.FastaIO.FastaWriter-class.html#write_record,Method Bio.SeqIO.Interfaces.SequentialSequenceWriter.write_record()=Bio.SeqIO.Interfaces.SequentialSequenceWriter-class.html#write_record,Method Bio.SeqIO.StockholmIO.StockholmWriter.write_record()=Bio.SeqIO.StockholmIO.StockholmWriter-class.html#write_record,Method Bio.StdHandler.ConvertDispatchHandler.write_record()=Bio.StdHandler.ConvertDispatchHandler-class.html#write_record"><a title="Bio.SeqIO.FastaIO.FastaWriter.write_record
Bio.SeqIO.Interfaces.SequentialSequenceWriter.write_record
Bio.SeqIO.StockholmIO.StockholmWriter.write_record
Bio.StdHandler.ConvertDispatchHandler.write_record" class="py-name" href="#" onclick="return doclink('link-25', 'write_record', 'link-25');">write_record</a></tt><tt class="py-op">(</tt><tt id="link-26" class="py-name"><a title="Bio.Emboss.primer3_format.record
Bio.Emboss.primersearch_format.record
Bio.GFF.Feature.record
Bio.LocusLink.web_parse.record
Bio.Ndb.record
Bio.Std.record
Bio.expressions.blocks.record
Bio.expressions.embl.embl65.record
Bio.expressions.fasta.record
Bio.expressions.genbank.record
Bio.expressions.hmmpfam.record
Bio.expressions.swissprot.ipi.record
Bio.expressions.swissprot.speclist.record
Bio.expressions.swissprot.sprot38.record
Bio.expressions.swissprot.sprot40.record
Martel.test.test_swissprot38.record
Martel.test.testformats.swissprot38.record" class="py-name" href="#" onclick="return doclink('link-26', 'record', 'link-24');">record</a></tt><tt class="py-op">)</tt> </tt>
<a name="L229"></a><tt class="py-lineno">229</tt>  <tt class="py-line">        <tt class="py-comment">#Mark as true, even if there where no records</tt> </tt>
<a name="L230"></a><tt class="py-lineno">230</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_record_written</tt> <tt class="py-op">=</tt> <tt id="link-27" class="py-name"><a title="Bio.EUtils.POM.True" class="py-name" href="#" onclick="return doclink('link-27', 'True', 'link-21');">True</a></tt> </tt>
</div><a name="L231"></a><tt class="py-lineno">231</tt>  <tt class="py-line"> </tt>
<a name="SequentialSequenceWriter.write_file"></a><div id="SequentialSequenceWriter.write_file-def"><a name="L232"></a><tt class="py-lineno">232</tt> <a class="py-toggle" href="#" id="SequentialSequenceWriter.write_file-toggle" onclick="return toggle('SequentialSequenceWriter.write_file');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="Bio.SeqIO.Interfaces.SequentialSequenceWriter-class.html#write_file">write_file</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">records</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> </tt>
</div><div id="SequentialSequenceWriter.write_file-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SequentialSequenceWriter.write_file-expanded"><a name="L233"></a><tt class="py-lineno">233</tt>  <tt class="py-line">        <tt class="py-docstring">"""Use this to write an entire file containing the given records.</tt> </tt>
<a name="L234"></a><tt class="py-lineno">234</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L235"></a><tt class="py-lineno">235</tt>  <tt class="py-line"><tt class="py-docstring">        records - A list or iterator returning SeqRecord objects</tt> </tt>
<a name="L236"></a><tt class="py-lineno">236</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L237"></a><tt class="py-lineno">237</tt>  <tt class="py-line"><tt class="py-docstring">        This method can only be called once."""</tt> </tt>
<a name="L238"></a><tt class="py-lineno">238</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-28" class="py-name" targets="Method Bio.AlignIO.EmbossIO.EmbossWriter.write_header()=Bio.AlignIO.EmbossIO.EmbossWriter-class.html#write_header,Method Bio.AlignIO.Interfaces.SequentialAlignmentWriter.write_header()=Bio.AlignIO.Interfaces.SequentialAlignmentWriter-class.html#write_header,Method Bio.NMR.xpktools.Peaklist.write_header()=Bio.NMR.xpktools.Peaklist-class.html#write_header,Method Bio.SeqIO.Interfaces.SequentialSequenceWriter.write_header()=Bio.SeqIO.Interfaces.SequentialSequenceWriter-class.html#write_header,Method Bio.SeqIO.StockholmIO.StockholmWriter.write_header()=Bio.SeqIO.StockholmIO.StockholmWriter-class.html#write_header"><a title="Bio.AlignIO.EmbossIO.EmbossWriter.write_header
Bio.AlignIO.Interfaces.SequentialAlignmentWriter.write_header
Bio.NMR.xpktools.Peaklist.write_header
Bio.SeqIO.Interfaces.SequentialSequenceWriter.write_header
Bio.SeqIO.StockholmIO.StockholmWriter.write_header" class="py-name" href="#" onclick="return doclink('link-28', 'write_header', 'link-28');">write_header</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L239"></a><tt class="py-lineno">239</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-29" class="py-name" targets="Method Bio.SeqIO.Interfaces.SequentialSequenceWriter.write_records()=Bio.SeqIO.Interfaces.SequentialSequenceWriter-class.html#write_records"><a title="Bio.SeqIO.Interfaces.SequentialSequenceWriter.write_records" class="py-name" href="#" onclick="return doclink('link-29', 'write_records', 'link-29');">write_records</a></tt><tt class="py-op">(</tt><tt class="py-name">records</tt><tt class="py-op">)</tt> </tt>
<a name="L240"></a><tt class="py-lineno">240</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-30" class="py-name" targets="Method Bio.AlignIO.EmbossIO.EmbossWriter.write_footer()=Bio.AlignIO.EmbossIO.EmbossWriter-class.html#write_footer,Method Bio.AlignIO.Interfaces.SequentialAlignmentWriter.write_footer()=Bio.AlignIO.Interfaces.SequentialAlignmentWriter-class.html#write_footer,Method Bio.SeqIO.Interfaces.SequentialSequenceWriter.write_footer()=Bio.SeqIO.Interfaces.SequentialSequenceWriter-class.html#write_footer,Method Bio.SeqIO.StockholmIO.StockholmWriter.write_footer()=Bio.SeqIO.StockholmIO.StockholmWriter-class.html#write_footer"><a title="Bio.AlignIO.EmbossIO.EmbossWriter.write_footer
Bio.AlignIO.Interfaces.SequentialAlignmentWriter.write_footer
Bio.SeqIO.Interfaces.SequentialSequenceWriter.write_footer
Bio.SeqIO.StockholmIO.StockholmWriter.write_footer" class="py-name" href="#" onclick="return doclink('link-30', 'write_footer', 'link-30');">write_footer</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L241"></a><tt class="py-lineno">241</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">

  <!-- 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>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Mon Sep 15 09:27:06 2008
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" 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>