Skip to content

Commit

Permalink
build based on d0eb7ea
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Sep 24, 2023
1 parent e2e02da commit 16f5466
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
6 changes: 3 additions & 3 deletions dev/fai/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

julia> idx = faidx(IOBuffer(str));

julia&gt; rdr = FASTAReader(IOBuffer(str), index=idx);</code></pre><p>You can also add a index to an existing reader using the <code>index!</code> function:</p><article class="docstring"><header><a class="docstring-binding" id="FASTX.FASTA.index!" href="#FASTX.FASTA.index!"><code>FASTX.FASTA.index!</code></a><span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">index!(r::FASTA.Reader, ind::Union{Nothing, Index, IO, AbstractString})</code></pre><p>Set the index of <code>r</code>, and return <code>r</code>. If <code>ind</code> isa <code>Union{Nothing, Index}</code>, directly set the index to <code>ind</code>. If <code>ind</code> isa <code>IO</code>, parse the index from the FAI-formatted IO first. If <code>ind</code> isa <code>AbstractString</code>, treat it as the path to a FAI file to parse.</p><p>See also: <a href="#FASTX.FASTA.Index"><code>Index</code></a>, <a href="../fasta/#FASTX.FASTA.Reader"><code>FASTA.Reader</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/FASTX.jl/blob/36e42cd24459ecfeebe5d0acb6f2cf7a1e5ddef6/src/fasta/reader.jl#L63-L72">source</a></section></article><h3 id="Seeking-using-an-Index"><a class="docs-heading-anchor" href="#Seeking-using-an-Index">Seeking using an <code>Index</code></a><a id="Seeking-using-an-Index-1"></a><a class="docs-heading-anchor-permalink" href="#Seeking-using-an-Index" title="Permalink"></a></h3><p>With an <code>Index</code> attached to a <code>Reader</code>, you can do the following operation in O(1) time. In these examples, we will use the following FASTA file:</p><pre><code class="nohighlight hljs">&gt;seq1 sequence
julia&gt; rdr = FASTAReader(IOBuffer(str), index=idx);</code></pre><p>You can also add a index to an existing reader using the <code>index!</code> function:</p><article class="docstring"><header><a class="docstring-binding" id="FASTX.FASTA.index!" href="#FASTX.FASTA.index!"><code>FASTX.FASTA.index!</code></a><span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">index!(r::FASTA.Reader, ind::Union{Nothing, Index, IO, AbstractString})</code></pre><p>Set the index of <code>r</code>, and return <code>r</code>. If <code>ind</code> isa <code>Union{Nothing, Index}</code>, directly set the index to <code>ind</code>. If <code>ind</code> isa <code>IO</code>, parse the index from the FAI-formatted IO first. If <code>ind</code> isa <code>AbstractString</code>, treat it as the path to a FAI file to parse.</p><p>See also: <a href="#FASTX.FASTA.Index"><code>Index</code></a>, <a href="../fasta/#FASTX.FASTA.Reader"><code>FASTA.Reader</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/FASTX.jl/blob/d0eb7ea97ab06b41f41e01f1be770380e6ee502d/src/fasta/reader.jl#L63-L72">source</a></section></article><h3 id="Seeking-using-an-Index"><a class="docs-heading-anchor" href="#Seeking-using-an-Index">Seeking using an <code>Index</code></a><a id="Seeking-using-an-Index-1"></a><a class="docs-heading-anchor-permalink" href="#Seeking-using-an-Index" title="Permalink"></a></h3><p>With an <code>Index</code> attached to a <code>Reader</code>, you can do the following operation in O(1) time. In these examples, we will use the following FASTA file:</p><pre><code class="nohighlight hljs">&gt;seq1 sequence
TAGAAAGCAA
TTAAAC
&gt;seq2 sequence
Expand All @@ -36,7 +36,7 @@
&quot;GAA&quot;</code></pre><p>FASTX.jl does not yet support indexing FASTQ files.</p><h3 id="Reference:"><a class="docs-heading-anchor" href="#Reference:">Reference:</a><a id="Reference:-1"></a><a class="docs-heading-anchor-permalink" href="#Reference:" title="Permalink"></a></h3><article class="docstring"><header><a class="docstring-binding" id="FASTX.FASTA.faidx" href="#FASTX.FASTA.faidx"><code>FASTX.FASTA.faidx</code></a><span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">faidx(io::IO)::Index</code></pre><p>Read a <code>FASTA.Index</code> from <code>io</code>.</p><p>See also: <a href="#FASTX.FASTA.Index"><code>Index</code></a></p><p><strong>Examples</strong></p><pre><code class="language-julia-repl hljs">julia&gt; ind = faidx(IOBuffer(&quot;&gt;ab\nTA\nT\n&gt;x y\nGAG\nGA&quot;))
Index:
ab 3 4 2 3
x 5 14 3 4</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/FASTX.jl/blob/36e42cd24459ecfeebe5d0acb6f2cf7a1e5ddef6/src/fasta/index.jl#L325-L339">source</a></section><section><div><pre><code class="nohighlight hljs">faidx(fnapath::AbstractString, [idxpath::AbstractString], check=true)</code></pre><p>Index FASTA path at <code>fnapath</code> and write index to <code>idxpath</code>. If <code>idxpath</code> is not given, default to same name as <code>fnapath * &quot;.fai&quot;</code>. If <code>check</code>, throw an error if the output file already exists</p><p>See also: <a href="#FASTX.FASTA.Index"><code>Index</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/FASTX.jl/blob/36e42cd24459ecfeebe5d0acb6f2cf7a1e5ddef6/src/fasta/index.jl#L344-L352">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="FASTX.FASTA.seekrecord" href="#FASTX.FASTA.seekrecord"><code>FASTX.FASTA.seekrecord</code></a><span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">seekrecord(reader::FASTAReader, i::Union{AbstractString, Integer})</code></pre><p>Seek <code>Reader</code> to the <code>i</code>&#39;th record. The next iterated record with be the <code>i</code>&#39;th record. <code>i</code> can be the identifier of a sequence, or the 1-based record number in the <code>Index</code>.</p><p>The <code>Reader</code> needs to be indexed for this to work.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/FASTX.jl/blob/36e42cd24459ecfeebe5d0acb6f2cf7a1e5ddef6/src/fasta/reader.jl#L130-L137">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="FASTX.FASTA.extract" href="#FASTX.FASTA.extract"><code>FASTX.FASTA.extract</code></a><span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">extract(reader::Reader, name::AbstractString, range::Union{Nothing, UnitRange})</code></pre><p>Extract a subsequence given by index <code>range</code> from the sequence <code>named</code> in a <code>Reader</code> with an index. Returns a <code>String</code>. If <code>range</code> is nothing (the default value), return the entire sequence.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/FASTX.jl/blob/36e42cd24459ecfeebe5d0acb6f2cf7a1e5ddef6/src/fasta/reader.jl#L158-L164">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="FASTX.FASTA.Index" href="#FASTX.FASTA.Index"><code>FASTX.FASTA.Index</code></a><span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">Index(src::Union{IO, AbstractString})</code></pre><p>FASTA index object, which allows constant-time seeking of FASTA files by name. The index is assumed to be in FAI format.</p><p>Notable methods:</p><ul><li><code>Index(::Union{IO, AbstractString})</code>: Read FAI file from IO or file at path</li><li><code>write(::IO, ::Index)</code>: Write index in FAI format</li><li><code>faidx(::IO)::Index</code>: Index FASTA file</li><li><code>seekrecord(::Reader, ::AbstractString)</code>: Go to position of seq</li><li><code>extract(::Reader, ::AbstractString)</code>: Extract part of sequence</li></ul><p>Note that the FAI specs are stricter than FASTX.jl&#39;s definition of FASTA, such that some valid FASTA records may not be indexable. See the specs at: http://www.htslib.org/doc/faidx.html</p><p>See also: <a href="../fasta/#FASTX.FASTA.Reader"><code>FASTA.Reader</code></a></p><p><strong>Examples</strong></p><pre><code class="language-julia-repl hljs">julia&gt; src = IOBuffer(&quot;seqname\t9\t14\t6\t8\nA\t1\t3\t1\t2&quot;);
x 5 14 3 4</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/FASTX.jl/blob/d0eb7ea97ab06b41f41e01f1be770380e6ee502d/src/fasta/index.jl#L331-L345">source</a></section><section><div><pre><code class="nohighlight hljs">faidx(fnapath::AbstractString, [idxpath::AbstractString], check=true)</code></pre><p>Index FASTA path at <code>fnapath</code> and write index to <code>idxpath</code>. If <code>idxpath</code> is not given, default to same name as <code>fnapath * &quot;.fai&quot;</code>. If <code>check</code>, throw an error if the output file already exists</p><p>See also: <a href="#FASTX.FASTA.Index"><code>Index</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/FASTX.jl/blob/d0eb7ea97ab06b41f41e01f1be770380e6ee502d/src/fasta/index.jl#L350-L358">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="FASTX.FASTA.seekrecord" href="#FASTX.FASTA.seekrecord"><code>FASTX.FASTA.seekrecord</code></a><span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">seekrecord(reader::FASTAReader, i::Union{AbstractString, Integer})</code></pre><p>Seek <code>Reader</code> to the <code>i</code>&#39;th record. The next iterated record with be the <code>i</code>&#39;th record. <code>i</code> can be the identifier of a sequence, or the 1-based record number in the <code>Index</code>.</p><p>The <code>Reader</code> needs to be indexed for this to work.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/FASTX.jl/blob/d0eb7ea97ab06b41f41e01f1be770380e6ee502d/src/fasta/reader.jl#L130-L137">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="FASTX.FASTA.extract" href="#FASTX.FASTA.extract"><code>FASTX.FASTA.extract</code></a><span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">extract(reader::Reader, name::AbstractString, range::Union{Nothing, UnitRange})</code></pre><p>Extract a subsequence given by index <code>range</code> from the sequence <code>named</code> in a <code>Reader</code> with an index. Returns a <code>String</code>. If <code>range</code> is nothing (the default value), return the entire sequence.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/FASTX.jl/blob/d0eb7ea97ab06b41f41e01f1be770380e6ee502d/src/fasta/reader.jl#L158-L164">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="FASTX.FASTA.Index" href="#FASTX.FASTA.Index"><code>FASTX.FASTA.Index</code></a><span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">Index(src::Union{IO, AbstractString})</code></pre><p>FASTA index object, which allows constant-time seeking of FASTA files by name. The index is assumed to be in FAI format.</p><p>Notable methods:</p><ul><li><code>Index(::Union{IO, AbstractString})</code>: Read FAI file from IO or file at path</li><li><code>write(::IO, ::Index)</code>: Write index in FAI format</li><li><code>faidx(::IO)::Index</code>: Index FASTA file</li><li><code>seekrecord(::Reader, ::AbstractString)</code>: Go to position of seq</li><li><code>extract(::Reader, ::AbstractString)</code>: Extract part of sequence</li></ul><p>Note that the FAI specs are stricter than FASTX.jl&#39;s definition of FASTA, such that some valid FASTA records may not be indexable. See the specs at: http://www.htslib.org/doc/faidx.html</p><p>See also: <a href="../fasta/#FASTX.FASTA.Reader"><code>FASTA.Reader</code></a></p><p><strong>Examples</strong></p><pre><code class="language-julia-repl hljs">julia&gt; src = IOBuffer(&quot;seqname\t9\t14\t6\t8\nA\t1\t3\t1\t2&quot;);

julia&gt; fna = IOBuffer(&quot;&gt;A\nG\n&gt;seqname\nACGTAC\r\nTTG&quot;);

Expand All @@ -45,4 +45,4 @@
julia&gt; seekrecord(rdr, &quot;seqname&quot;);

julia&gt; sequence(String, first(rdr))
&quot;ACGTACTTG&quot;</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/FASTX.jl/blob/36e42cd24459ecfeebe5d0acb6f2cf7a1e5ddef6/src/fasta/index.jl#L9-L41">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../fastq/">« FASTQ</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="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Sunday 24 September 2023 14:45">Sunday 24 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
&quot;ACGTACTTG&quot;</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/FASTX.jl/blob/d0eb7ea97ab06b41f41e01f1be770380e6ee502d/src/fasta/index.jl#L9-L41">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../fastq/">« FASTQ</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="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Sunday 24 September 2023 15:33">Sunday 24 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit 16f5466

Please sign in to comment.