Skip to content

Commit

Permalink
deploy: e7912ca
Browse files Browse the repository at this point in the history
  • Loading branch information
jordibc committed Jan 9, 2025
1 parent f42df92 commit 015abd8
Show file tree
Hide file tree
Showing 37 changed files with 557 additions and 557 deletions.
32 changes: 16 additions & 16 deletions _modules/ete4/core/seqgroup.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ete4.core.seqgroup &#8212; ETE Toolkit 4.0.0-beta3 documentation</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=d1102ebc" />
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=5ecbeea2" />
<link rel="stylesheet" type="text/css" href="../../../_static/basic.css?v=686e5160" />
<link rel="stylesheet" type="text/css" href="../../../_static/alabaster.css?v=27fed22d" />
<script src="../../../_static/documentation_options.js?v=9c56ea15"></script>
Expand Down Expand Up @@ -41,22 +41,22 @@ <h1>Source code for ete4.core.seqgroup</h1><div class="highlight"><pre>
<span class="sd">supported.</span>
<span class="sd">&quot;&quot;&quot;</span>

<span class="kn">from</span> <span class="nn">..parser.fasta</span> <span class="kn">import</span> <span class="n">read_fasta</span><span class="p">,</span> <span class="n">write_fasta</span>
<span class="kn">from</span> <span class="nn">..parser.paml</span> <span class="kn">import</span> <span class="n">read_paml</span><span class="p">,</span> <span class="n">write_paml</span>
<span class="kn">from</span> <span class="nn">..parser.phylip</span> <span class="kn">import</span> <span class="n">read_phylip</span><span class="p">,</span> <span class="n">write_phylip</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">..parser.fasta</span><span class="w"> </span><span class="kn">import</span> <span class="n">read_fasta</span><span class="p">,</span> <span class="n">write_fasta</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">..parser.paml</span><span class="w"> </span><span class="kn">import</span> <span class="n">read_paml</span><span class="p">,</span> <span class="n">write_paml</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">..parser.phylip</span><span class="w"> </span><span class="kn">import</span> <span class="n">read_phylip</span><span class="p">,</span> <span class="n">write_phylip</span>


<span class="n">__all__</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;SeqGroup&#39;</span><span class="p">]</span>


<div class="viewcode-block" id="SeqGroup">
<a class="viewcode-back" href="../../../reference/reference_seqgroup.html#ete4.core.seqgroup.SeqGroup">[docs]</a>
<span class="k">class</span> <span class="nc">SeqGroup</span><span class="p">:</span>
<span class="k">class</span><span class="w"> </span><span class="nc">SeqGroup</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Class to store a set of sequences (aligned or not).&quot;&quot;&quot;</span>

<div class="viewcode-block" id="SeqGroup.__init__">
<a class="viewcode-back" href="../../../reference/reference_seqgroup.html#ete4.core.seqgroup.SeqGroup.__init__">[docs]</a>
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">sequences</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="nb">format</span><span class="o">=</span><span class="s1">&#39;fasta&#39;</span><span class="p">,</span>
<span class="k">def</span><span class="w"> </span><span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">sequences</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="nb">format</span><span class="o">=</span><span class="s1">&#39;fasta&#39;</span><span class="p">,</span>
<span class="n">fix_duplicates</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="w"> </span><span class="sa">r</span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> :param sequences: Path to the file containing the sequences or,</span>
Expand Down Expand Up @@ -101,24 +101,24 @@ <h1>Source code for ete4.core.seqgroup</h1><div class="highlight"><pre>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s1">&#39;Unsupported format: </span><span class="si">{</span><span class="nb">format</span><span class="si">}</span><span class="s1">&#39;</span><span class="p">)</span></div>


<span class="k">def</span> <span class="fm">__len__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">def</span><span class="w"> </span><span class="fm">__len__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">id2seq</span><span class="p">)</span>

<span class="k">def</span> <span class="fm">__contains__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">item</span><span class="p">):</span>
<span class="k">def</span><span class="w"> </span><span class="fm">__contains__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">item</span><span class="p">):</span>
<span class="k">return</span> <span class="n">item</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">name2id</span>

<span class="k">def</span> <span class="fm">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">def</span><span class="w"> </span><span class="fm">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="n">write_fasta</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>

<span class="k">def</span> <span class="fm">__iter__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">def</span><span class="w"> </span><span class="fm">__iter__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">iter_entries</span><span class="p">()</span>

<span class="k">def</span> <span class="fm">__repr__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">def</span><span class="w"> </span><span class="fm">__repr__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="s1">&#39;SeqGroup (</span><span class="si">%s</span><span class="s1">)&#39;</span> <span class="o">%</span> <span class="nb">hex</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="fm">__hash__</span><span class="p">())</span>

<div class="viewcode-block" id="SeqGroup.write">
<a class="viewcode-back" href="../../../reference/reference_seqgroup.html#ete4.core.seqgroup.SeqGroup.write">[docs]</a>
<span class="k">def</span> <span class="nf">write</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">format</span><span class="o">=</span><span class="s1">&#39;fasta&#39;</span><span class="p">,</span> <span class="n">outfile</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="k">def</span><span class="w"> </span><span class="nf">write</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">format</span><span class="o">=</span><span class="s1">&#39;fasta&#39;</span><span class="p">,</span> <span class="n">outfile</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Return the text representation of the sequences.</span>

<span class="sd"> :param format: Format for the output representation.</span>
Expand All @@ -135,7 +135,7 @@ <h1>Source code for ete4.core.seqgroup</h1><div class="highlight"><pre>

<div class="viewcode-block" id="SeqGroup.iter_entries">
<a class="viewcode-back" href="../../../reference/reference_seqgroup.html#ete4.core.seqgroup.SeqGroup.iter_entries">[docs]</a>
<span class="k">def</span> <span class="nf">iter_entries</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">def</span><span class="w"> </span><span class="nf">iter_entries</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Return an iterator over all sequences in the collection.</span>

<span class="sd"> Each item is a tuple with the sequence name, sequence, and</span>
Expand All @@ -147,14 +147,14 @@ <h1>Source code for ete4.core.seqgroup</h1><div class="highlight"><pre>

<div class="viewcode-block" id="SeqGroup.get_seq">
<a class="viewcode-back" href="../../../reference/reference_seqgroup.html#ete4.core.seqgroup.SeqGroup.get_seq">[docs]</a>
<span class="k">def</span> <span class="nf">get_seq</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">):</span>
<span class="k">def</span><span class="w"> </span><span class="nf">get_seq</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Return the sequence associated to a given entry name.&quot;&quot;&quot;</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">id2seq</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">name2id</span><span class="p">[</span><span class="n">name</span><span class="p">]]</span></div>


<div class="viewcode-block" id="SeqGroup.get_entries">
<a class="viewcode-back" href="../../../reference/reference_seqgroup.html#ete4.core.seqgroup.SeqGroup.get_entries">[docs]</a>
<span class="k">def</span> <span class="nf">get_entries</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">def</span><span class="w"> </span><span class="nf">get_entries</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Return the list of entries currently stored.&quot;&quot;&quot;</span>
<span class="n">keys</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">id2seq</span><span class="o">.</span><span class="n">keys</span><span class="p">())</span>
<span class="n">seqs</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">id2seq</span><span class="o">.</span><span class="n">values</span><span class="p">())</span>
Expand All @@ -165,7 +165,7 @@ <h1>Source code for ete4.core.seqgroup</h1><div class="highlight"><pre>

<div class="viewcode-block" id="SeqGroup.set_seq">
<a class="viewcode-back" href="../../../reference/reference_seqgroup.html#ete4.core.seqgroup.SeqGroup.set_seq">[docs]</a>
<span class="k">def</span> <span class="nf">set_seq</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">seq</span><span class="p">,</span> <span class="n">comments</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="k">def</span><span class="w"> </span><span class="nf">set_seq</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">seq</span><span class="p">,</span> <span class="n">comments</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Add or update a sequence.&quot;&quot;&quot;</span>
<span class="n">name</span> <span class="o">=</span> <span class="n">name</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>

Expand Down
Loading

0 comments on commit 015abd8

Please sign in to comment.