Skip to content

Commit

Permalink
build based on f36ec2e
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Oct 25, 2024
1 parent 310e5ca commit 6e1153c
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 27 deletions.
2 changes: 1 addition & 1 deletion dev/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documenter":{"julia_version":"1.11.1","generation_timestamp":"2024-10-25T15:33:35","documenter_version":"1.7.0"}}
{"documenter":{"julia_version":"1.11.1","generation_timestamp":"2024-10-25T15:34:24","documenter_version":"1.7.0"}}
20 changes: 10 additions & 10 deletions dev/alignments/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
1 3 10 11 16 11 4 15 7 17 5 5 5 3 10 10 18 3 1
14 3 5 15 14 12 4 2 7 14 5 2 17 3 7 21 8 3 10
1 3 21 19 7 16 13 5 7 21 15 5 17 3 5 2 16 3 1
9 3 12 11 14 10 4 18 7 18 15 5 2 3 5 2 19 3 2</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; size(A) # length and number of sequences</code><code class="nohighlight hljs ansi" style="display:block;">(53, 100)</code></pre><p>When reading from FASTA, the choice of the alphabet is made by reading the first five sequences, and comparing the observed characters with the list of default alphabets (see <a href="../alphabets/#The-Alphabet-type">The <code>Alphabet</code> type</a>). If they fit one of the defaults, it will be used. Otherwise, an alphabet will be created <em>ad hoc</em>: </p><pre><code class="nohighlight hljs ansi" style="display:block;"></code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; A = read_fasta(&quot;../../example/strange_characters.fasta&quot;); # warning produced because no default alphabet was found</code><code class="nohighlight hljs ansi" style="display:block;"><span class="sgr33"><span class="sgr1">┌ Warning: </span></span>Could not find a default alphabet for characters [&#39;!&#39;, &#39;-&#39;, &#39;/&#39;, &#39;0&#39;, &#39;9&#39;, &#39;@&#39;, &#39;A&#39;, &#39;C&#39;, &#39;G&#39;, &#39;T&#39;]
<span class="sgr33"><span class="sgr1"></span></span> Using Alphabet{Char,Int64}: [&#39;!&#39;, &#39;-&#39;, &#39;/&#39;, &#39;0&#39;, &#39;9&#39;, &#39;@&#39;, &#39;A&#39;, &#39;C&#39;, &#39;G&#39;, &#39;T&#39;]
<span class="sgr33"><span class="sgr1"></span></span><span class="sgr90">@ BioSequenceMappings ~/work/BioSequenceMappings.jl/BioSequenceMappings.jl/src/IO.jl:62</span></code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; A.alphabet |&gt; symbols |&gt; prod</code><code class="nohighlight hljs ansi" style="display:block;">&quot;!-/09@ACGT&quot;</code></pre><p>Writing to a FASTA file is just as easy: </p><pre><code class="language-julia-repl hljs" style="display:block;">julia&gt; write(&quot;new_fasta_file.fasta&quot;, A) # or...</code><code class="nohighlight hljs ansi" style="display:block;"></code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; open(&quot;new_fasta_file.fasta&quot;, &quot;w&quot;) do io
9 3 12 11 14 10 4 18 7 18 15 5 2 3 5 2 19 3 2</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; size(A) # length and number of sequences</code><code class="nohighlight hljs ansi" style="display:block;">(53, 100)</code></pre><p>When reading from FASTA, the choice of the alphabet is made by reading the first five sequences, and comparing the observed characters with the list of default alphabets (see <a href="../alphabets/#The-Alphabet-type">The <code>Alphabet</code> type</a>). If they fit one of the defaults, it will be used. Otherwise, an alphabet will be created <em>ad hoc</em>: </p><pre><code class="nohighlight hljs ansi" style="display:block;"></code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; A = read_fasta(&quot;../../example/strange_characters.fasta&quot;); # warning produced because no default alphabet was found</code><code class="nohighlight hljs ansi" style="display:block;">┌ Warning: Could not find a default alphabet for characters [&#39;!&#39;, &#39;-&#39;, &#39;/&#39;, &#39;0&#39;, &#39;9&#39;, &#39;@&#39;, &#39;A&#39;, &#39;C&#39;, &#39;G&#39;, &#39;T&#39;]
Using Alphabet{Char,Int64}: [&#39;!&#39;, &#39;-&#39;, &#39;/&#39;, &#39;0&#39;, &#39;9&#39;, &#39;@&#39;, &#39;A&#39;, &#39;C&#39;, &#39;G&#39;, &#39;T&#39;]
@ BioSequenceMappings ~/work/BioSequenceMappings.jl/BioSequenceMappings.jl/src/IO.jl:62</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; A.alphabet |&gt; symbols |&gt; prod</code><code class="nohighlight hljs ansi" style="display:block;">&quot;!-/09@ACGT&quot;</code></pre><p>Writing to a FASTA file is just as easy: </p><pre><code class="language-julia-repl hljs" style="display:block;">julia&gt; write(&quot;new_fasta_file.fasta&quot;, A) # or...</code><code class="nohighlight hljs ansi" style="display:block;"></code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; open(&quot;new_fasta_file.fasta&quot;, &quot;w&quot;) do io
write(io, A)
end</code><code class="nohighlight hljs ansi" style="display:block;"></code></pre><h2 id="Accessing-and-iterating"><a class="docs-heading-anchor" href="#Accessing-and-iterating">Accessing &amp; iterating</a><a id="Accessing-and-iterating-1"></a><a class="docs-heading-anchor-permalink" href="#Accessing-and-iterating" title="Permalink"></a></h2><p>Sequences can be accessed by indexing. Indexing using a range will return a view in the underlying <code>data</code> matrix. </p><pre><code class="language-julia-repl hljs" style="display:block;">julia&gt; A[1] # the first sequence of the alignment</code><code class="nohighlight hljs ansi" style="display:block;">53-element view(::Matrix{Int64}, :, 1) with eltype Int64:
1
Expand Down Expand Up @@ -84,16 +84,16 @@
4 3 5 3 3 5 5 3 5 1
2 3 2 5 3 2 4 3 2 4</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; B[1][1] = 5</code><code class="nohighlight hljs ansi" style="display:block;">5</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; A[1][1] # A remains unchanged</code><code class="nohighlight hljs ansi" style="display:block;">5</code></pre><p>With <a href="../reference/#BioSequenceMappings.subsample_random-Tuple{AbstractAlignment, Int64}"><code>subsample_random</code></a>, it is also possible to create a random subalignment by picking sequences from the original one. For now, this is only possible without replacement, <em>i.e.</em> the same sequence cannot be picked twice. To just pick one sequence at random without creating a new alignment object, just call <code>rand</code>. </p><pre><code class="language-julia-repl hljs" style="display:block;">julia&gt; subsample_random(A, 3) # new alignment using three random sequences from A</code><code class="nohighlight hljs ansi" style="display:block;">Alignment of M=3 sequences of length L=10 - Shown as `MxL` matrix
3×10 adjoint(::Matrix{Int64}) with eltype Int64:
4 3 5 3 3 5 5 3 5 1
2 3 2 5 3 2 4 3 2 4
2 4 4 1 4 2 3 2 2 3
2 3 2 5 3 2 4 3 2 4</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; subsample_random(A, 12) # sampling without replacement: this will error since size(A, 1) &lt; 12</code><code class="nohighlight hljs ansi" style="display:block;">ERROR: AssertionError: Cannot take 12 different sequences from alignment of size 5</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; rand(A) # one random sequence from A (returns a view)</code><code class="nohighlight hljs ansi" style="display:block;">10-element view(::Matrix{Int64}, :, 4) with eltype Int64:
3
3
3 3 5 2 2 1 5 3 1 2</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; subsample_random(A, 12) # sampling without replacement: this will error since size(A, 1) &lt; 12</code><code class="nohighlight hljs ansi" style="display:block;">ERROR: AssertionError: Cannot take 12 different sequences from alignment of size 5</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; rand(A) # one random sequence from A (returns a view)</code><code class="nohighlight hljs ansi" style="display:block;">10-element view(::Matrix{Int64}, :, 1) with eltype Int64:
5
3
4
2
2
4
1
5
3
1
2</code></pre><h2 id="OneHotAlignment"><a class="docs-heading-anchor" href="#OneHotAlignment">OneHotAlignment</a><a id="OneHotAlignment-1"></a><a class="docs-heading-anchor-permalink" href="#OneHotAlignment" title="Permalink"></a></h2><p>TBA</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../alphabets/">« Alphabets</a><a class="docs-footer-nextpage" href="../utilities/">Utilities »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Friday 25 October 2024 15:33">Friday 25 October 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
5
5</code></pre><h2 id="OneHotAlignment"><a class="docs-heading-anchor" href="#OneHotAlignment">OneHotAlignment</a><a id="OneHotAlignment-1"></a><a class="docs-heading-anchor-permalink" href="#OneHotAlignment" title="Permalink"></a></h2><p>TBA</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../alphabets/">« Alphabets</a><a class="docs-footer-nextpage" href="../utilities/">Utilities »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Friday 25 October 2024 15:34">Friday 25 October 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion dev/alphabets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@
1

julia&gt; nt_alphabet(Y) # now this works
&quot;CC-A-&quot;</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Quickstart</a><a class="docs-footer-nextpage" href="../alignments/">Alignments »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Friday 25 October 2024 15:33">Friday 25 October 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
&quot;CC-A-&quot;</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Quickstart</a><a class="docs-footer-nextpage" href="../alignments/">Alignments »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Friday 25 October 2024 15:34">Friday 25 October 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit 6e1153c

Please sign in to comment.