|
6 | 6 |
|
7 | 7 | <head> |
8 | 8 | <meta charset="utf-8" /> |
| 9 | + <meta name="description" content="Create an identity substitution matrix." /> |
9 | 10 | <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" /> |
10 | 11 |
|
11 | 12 | <title>skbio.sequence.SubstitutionMatrix.identity — scikit-bio 0.7.1-dev documentation</title> |
@@ -695,7 +696,42 @@ <h1>skbio.sequence.SubstitutionMatrix.identity<a class="headerlink" href="#skbio |
695 | 696 | <dl class="py method"> |
696 | 697 | <dt class="sig sig-object py" id="skbio.sequence.SubstitutionMatrix.identity"> |
697 | 698 | <em class="property"><span class="k"><span class="pre">classmethod</span></span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">SubstitutionMatrix.</span></span><span class="sig-name descname"><span class="pre">identity</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">alphabet</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">match</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mismatch</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dtype</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'float32'</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/scikit-bio/scikit-bio/blob/main/skbio/sequence/_substitution.py#L337"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skbio.sequence.SubstitutionMatrix.identity" title="Link to this definition">#</a></dt> |
698 | | -<dd></dd></dl> |
| 699 | +<dd><p>Create an identity substitution matrix.</p> |
| 700 | +<p>All matches and mismatches will have the identical scores, |
| 701 | +respectively, regardless of the character.</p> |
| 702 | +<dl class="field-list simple"> |
| 703 | +<dt class="field-odd">Parameters<span class="colon">:</span></dt> |
| 704 | +<dd class="field-odd"><dl class="simple"> |
| 705 | +<dt><strong>alphabet</strong><span class="classifier">iterable</span></dt><dd><p>Characters that constitute the alphabet.</p> |
| 706 | +</dd> |
| 707 | +<dt><strong>match</strong><span class="classifier">int or float</span></dt><dd><p>Score assigned to all matches.</p> |
| 708 | +</dd> |
| 709 | +<dt><strong>mismatch</strong><span class="classifier">int or float</span></dt><dd><p>Score assigned to all mismatches.</p> |
| 710 | +</dd> |
| 711 | +<dt><strong>dtype</strong><span class="classifier">{“float32”, “float64”}, optional</span></dt><dd><p>Floating-point data type of the matrix. Default is “float32”.</p> |
| 712 | +</dd> |
| 713 | +</dl> |
| 714 | +</dd> |
| 715 | +<dt class="field-even">Returns<span class="colon">:</span></dt> |
| 716 | +<dd class="field-even"><dl class="simple"> |
| 717 | +<dt>SubstitutionMatrix</dt><dd><p>Substitution matrix constructed from the alphabet and scores.</p> |
| 718 | +</dd> |
| 719 | +</dl> |
| 720 | +</dd> |
| 721 | +</dl> |
| 722 | +<p class="rubric">Examples</p> |
| 723 | +<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span><span class="w"> </span><span class="nn">skbio</span><span class="w"> </span><span class="kn">import</span> <span class="n">SubstitutionMatrix</span> |
| 724 | +<span class="gp">>>> </span><span class="n">mat</span> <span class="o">=</span> <span class="n">SubstitutionMatrix</span><span class="o">.</span><span class="n">identity</span><span class="p">(</span><span class="s1">'ACGT'</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">2</span><span class="p">)</span> |
| 725 | +<span class="gp">>>> </span><span class="n">mat</span><span class="o">.</span><span class="n">alphabet</span> |
| 726 | +<span class="go">('A', 'C', 'G', 'T')</span> |
| 727 | +<span class="gp">>>> </span><span class="n">mat</span><span class="o">.</span><span class="n">scores</span> |
| 728 | +<span class="go">array([[ 1., -2., -2., -2.],</span> |
| 729 | +<span class="go"> [-2., 1., -2., -2.],</span> |
| 730 | +<span class="go"> [-2., -2., 1., -2.],</span> |
| 731 | +<span class="go"> [-2., -2., -2., 1.]], dtype=float32)</span> |
| 732 | +</pre></div> |
| 733 | +</div> |
| 734 | +</dd></dl> |
699 | 735 |
|
700 | 736 | </section> |
701 | 737 |
|
|
0 commit comments