1
0
Fork 0
mirror of https://github.com/MillironX/XAM.jl.git synced 2024-12-24 13:48:19 +00:00
XAM.jl/dev/man/api/index.html
2020-03-21 06:36:13 +00:00

24 lines
54 KiB
HTML

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>API Reference · XAM.jl</title><link href="https://fonts.googleapis.com/css?family=Lato|Roboto+Mono" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.11.1/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="../.."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../../assets/documenter.js"></script><script src="../../siteinfo.js"></script><script src="../../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-dark.css" data-theme-name="documenter-dark"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="../../"><img src="../../assets/logo.svg" alt="XAM.jl logo"/></a><div class="docs-package-name"><span class="docs-autofit">XAM.jl</span></div><form class="docs-search" action="../../search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="../../">Home</a></li><li><a class="tocitem" href="../hts-files/">SAM and BAM</a></li><li class="is-active"><a class="tocitem" href>API Reference</a><ul class="internal"><li><a class="tocitem" href="#SAM-API-1"><span>SAM API</span></a></li><li><a class="tocitem" href="#BAM-API-1"><span>BAM API</span></a></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>API Reference</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>API Reference</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/BioJulia/XAM.jl/blob/develop/docs/src/man/api.md" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="API-Reference-1"><a class="docs-heading-anchor" href="#API-Reference-1">API Reference</a><a class="docs-heading-anchor-permalink" href="#API-Reference-1" title="Permalink"></a></h1><h2 id="SAM-API-1"><a class="docs-heading-anchor" href="#SAM-API-1">SAM API</a><a class="docs-heading-anchor-permalink" href="#SAM-API-1" title="Permalink"></a></h2><h3 id="Public-1"><a class="docs-heading-anchor" href="#Public-1">Public</a><a class="docs-heading-anchor-permalink" href="#Public-1" title="Permalink"></a></h3><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.FLAG_DUP" href="#XAM.SAM.FLAG_DUP"><code>XAM.SAM.FLAG_DUP</code></a><span class="docstring-category">Constant</span></header><section><div><p>0x0400: optical or PCR duplicate</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/flags.jl#L23">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.FLAG_MREVERSE" href="#XAM.SAM.FLAG_MREVERSE"><code>XAM.SAM.FLAG_MREVERSE</code></a><span class="docstring-category">Constant</span></header><section><div><p>0x0020: the mate is mapped to the reverse strand</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/flags.jl#L23">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.FLAG_MUNMAP" href="#XAM.SAM.FLAG_MUNMAP"><code>XAM.SAM.FLAG_MUNMAP</code></a><span class="docstring-category">Constant</span></header><section><div><p>0x0008: the mate is unmapped</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/flags.jl#L23">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.FLAG_PAIRED" href="#XAM.SAM.FLAG_PAIRED"><code>XAM.SAM.FLAG_PAIRED</code></a><span class="docstring-category">Constant</span></header><section><div><p>0x0001: the read is paired in sequencing, no matter whether it is mapped in a pair</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/flags.jl#L23">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.FLAG_PROPER_PAIR" href="#XAM.SAM.FLAG_PROPER_PAIR"><code>XAM.SAM.FLAG_PROPER_PAIR</code></a><span class="docstring-category">Constant</span></header><section><div><p>0x0002: the read is mapped in a proper pair</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/flags.jl#L23">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.FLAG_QCFAIL" href="#XAM.SAM.FLAG_QCFAIL"><code>XAM.SAM.FLAG_QCFAIL</code></a><span class="docstring-category">Constant</span></header><section><div><p>0x0200: QC failure</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/flags.jl#L23">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.FLAG_READ1" href="#XAM.SAM.FLAG_READ1"><code>XAM.SAM.FLAG_READ1</code></a><span class="docstring-category">Constant</span></header><section><div><p>0x0040: this is read1</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/flags.jl#L23">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.FLAG_READ2" href="#XAM.SAM.FLAG_READ2"><code>XAM.SAM.FLAG_READ2</code></a><span class="docstring-category">Constant</span></header><section><div><p>0x0080: this is read2</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/flags.jl#L23">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.FLAG_REVERSE" href="#XAM.SAM.FLAG_REVERSE"><code>XAM.SAM.FLAG_REVERSE</code></a><span class="docstring-category">Constant</span></header><section><div><p>0x0010: the read is mapped to the reverse strand</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/flags.jl#L23">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.FLAG_SECONDARY" href="#XAM.SAM.FLAG_SECONDARY"><code>XAM.SAM.FLAG_SECONDARY</code></a><span class="docstring-category">Constant</span></header><section><div><p>0x0100: not primary alignment</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/flags.jl#L23">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.FLAG_SUPPLEMENTARY" href="#XAM.SAM.FLAG_SUPPLEMENTARY"><code>XAM.SAM.FLAG_SUPPLEMENTARY</code></a><span class="docstring-category">Constant</span></header><section><div><p>0x0800: supplementary alignment</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/flags.jl#L23">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.FLAG_UNMAP" href="#XAM.SAM.FLAG_UNMAP"><code>XAM.SAM.FLAG_UNMAP</code></a><span class="docstring-category">Constant</span></header><section><div><p>0x0004: the read itself is unmapped; conflictive with SAM.FLAG<em>PROPER</em>PAIR</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/flags.jl#L23">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.Header-Tuple{}" href="#XAM.SAM.Header-Tuple{}"><code>XAM.SAM.Header</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">SAM.Header()</code></pre><p>Create an empty header.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/header.jl#L8-L12">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.MetaInfo-Tuple{AbstractString,Any}" href="#XAM.SAM.MetaInfo-Tuple{AbstractString,Any}"><code>XAM.SAM.MetaInfo</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">MetaInfo(tag::AbstractString, value)</code></pre><p>Create a SAM metainfo with <code>tag</code> and <code>value</code>.</p><p><code>tag</code> is a two-byte ASCII string. If <code>tag</code> is <code>&quot;CO&quot;</code>, <code>value</code> must be a string; otherwise, <code>value</code> is an iterable object with key and value pairs.</p><p><strong>Examples</strong></p><pre><code class="language-none">julia&gt; SAM.MetaInfo(&quot;CO&quot;, &quot;some comment&quot;)
BioAlignments.SAM.MetaInfo:
tag: CO
value: some comment
julia&gt; string(ans)
&quot;@CO some comment&quot;
julia&gt; SAM.MetaInfo(&quot;SQ&quot;, [&quot;SN&quot; =&gt; &quot;chr1&quot;, &quot;LN&quot; =&gt; 12345])
BioAlignments.SAM.MetaInfo:
tag: SQ
value: SN=chr1 LN=12345
julia&gt; string(ans)
&quot;@SQ SN:chr1 LN:12345&quot;</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/metainfo.jl#L54-L79">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.MetaInfo-Tuple{AbstractString}" href="#XAM.SAM.MetaInfo-Tuple{AbstractString}"><code>XAM.SAM.MetaInfo</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">MetaInfo(str::AbstractString)</code></pre><p>Create a SAM metainfo from <code>str</code>.</p><p><strong>Examples</strong></p><pre><code class="language-none">julia&gt; SAM.MetaInfo(&quot;@CO some comment&quot;)
BioAlignments.SAM.MetaInfo:
tag: CO
value: some comment
julia&gt; SAM.MetaInfo(&quot;@SQ SN:chr1 LN:12345&quot;)
BioAlignments.SAM.MetaInfo:
tag: SQ
value: SN=chr1 LN=12345</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/metainfo.jl#L32-L49">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.Reader-Tuple{IO}" href="#XAM.SAM.Reader-Tuple{IO}"><code>XAM.SAM.Reader</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">SAM.Reader(input::IO)</code></pre><p>Create a data reader of the SAM file format.</p><p><strong>Arguments</strong></p><ul><li><code>input</code>: data source</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/reader.jl#L22-L29">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.Record-Tuple{AbstractString}" href="#XAM.SAM.Record-Tuple{AbstractString}"><code>XAM.SAM.Record</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">SAM.Record(str::AbstractString)</code></pre><p>Create a SAM record from <code>str</code>. This function verifies the format and indexes fields for accessors.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/record.jl#L63-L68">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.Record-Tuple{Array{UInt8,1}}" href="#XAM.SAM.Record-Tuple{Array{UInt8,1}}"><code>XAM.SAM.Record</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">SAM.Record(data::Vector{UInt8})</code></pre><p>Create a SAM record from <code>data</code>. This function verifies the format and indexes fields for accessors. Note that the ownership of <code>data</code> is transferred to a new record object.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/record.jl#L39-L45">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.Record-Tuple{}" href="#XAM.SAM.Record-Tuple{}"><code>XAM.SAM.Record</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">SAM.Record()</code></pre><p>Create an unfilled SAM record.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/record.jl#L23-L27">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.Writer" href="#XAM.SAM.Writer"><code>XAM.SAM.Writer</code></a><span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia">Writer(output::IO, header::Header=Header())</code></pre><p>Create a data writer of the SAM file format.</p><p><strong>Arguments</strong></p><ul><li><code>output</code>: data sink</li><li><code>header=Header()</code>: SAM header object</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/writer.jl#L4-L12">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Base.findall-Tuple{XAM.SAM.Header,AbstractString}" href="#Base.findall-Tuple{XAM.SAM.Header,AbstractString}"><code>Base.findall</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">find(header::Header, key::AbstractString)::Vector{MetaInfo}</code></pre><p>Find metainfo objects satisfying <code>SAM.tag(metainfo) == key</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/header.jl#L40-L44">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="BioGenerics.header-Tuple{XAM.SAM.Reader}" href="#BioGenerics.header-Tuple{XAM.SAM.Reader}"><code>BioGenerics.header</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">header(reader::Reader)::Header</code></pre><p>Get the header of <code>reader</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/reader.jl#L50-L54">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.alignlength-Tuple{XAM.SAM.Record}" href="#XAM.SAM.alignlength-Tuple{XAM.SAM.Record}"><code>XAM.SAM.alignlength</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">alignlength(record::Record)::Int</code></pre><p>Get the alignment length of <code>record</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/record.jl#L312-L316">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.alignment-Tuple{XAM.SAM.Record}" href="#XAM.SAM.alignment-Tuple{XAM.SAM.Record}"><code>XAM.SAM.alignment</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">alignment(record::Record)::BioAlignments.Alignment</code></pre><p>Get the alignment of <code>record</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/record.jl#L294-L298">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.auxdata-Tuple{XAM.SAM.Record}" href="#XAM.SAM.auxdata-Tuple{XAM.SAM.Record}"><code>XAM.SAM.auxdata</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">auxdata(record::Record)::Dict{String,Any}</code></pre><p>Get the auxiliary data (optional fields) of <code>record</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/record.jl#L450-L454">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.cigar-Tuple{XAM.SAM.Record}" href="#XAM.SAM.cigar-Tuple{XAM.SAM.Record}"><code>XAM.SAM.cigar</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">cigar(record::Record)::String</code></pre><p>Get the CIGAR string of <code>record</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/record.jl#L277-L281">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.flag-Tuple{XAM.SAM.Record}" href="#XAM.SAM.flag-Tuple{XAM.SAM.Record}"><code>XAM.SAM.flag</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">flag(record::Record)::UInt16</code></pre><p>Get the bitwise flag of <code>record</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/record.jl#L133-L137">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.iscomment-Tuple{XAM.SAM.MetaInfo}" href="#XAM.SAM.iscomment-Tuple{XAM.SAM.MetaInfo}"><code>XAM.SAM.iscomment</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">iscomment(metainfo::MetaInfo)::Bool</code></pre><p>Test if <code>metainfo</code> is a comment (i.e. its tag is &quot;CO&quot;).</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/metainfo.jl#L162-L166">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.ismapped-Tuple{XAM.SAM.Record}" href="#XAM.SAM.ismapped-Tuple{XAM.SAM.Record}"><code>XAM.SAM.ismapped</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">ismapped(record::Record)::Bool</code></pre><p>Test if <code>record</code> is mapped.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/record.jl#L147-L151">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.isnextmapped-Tuple{XAM.SAM.Record}" href="#XAM.SAM.isnextmapped-Tuple{XAM.SAM.Record}"><code>XAM.SAM.isnextmapped</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">isnextmapped(record::Record)::Bool</code></pre><p>Test if the mate/next read of <code>record</code> is mapped.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/record.jl#L215-L219">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.isprimary-Tuple{XAM.SAM.Record}" href="#XAM.SAM.isprimary-Tuple{XAM.SAM.Record}"><code>XAM.SAM.isprimary</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">isprimary(record::Record)::Bool</code></pre><p>Test if <code>record</code> is a primary line of the read.</p><p>This is equivalent to <code>flag(record) &amp; 0x900 == 0</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/record.jl#L156-L162">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.keyvalues-Tuple{XAM.SAM.MetaInfo}" href="#XAM.SAM.keyvalues-Tuple{XAM.SAM.MetaInfo}"><code>XAM.SAM.keyvalues</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">keyvalues(metainfo::MetaInfo)::Vector{Pair{String,String}}</code></pre><p>Get the values of <code>metainfo</code> as string pairs.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/metainfo.jl#L191-L195">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.mappingquality-Tuple{XAM.SAM.Record}" href="#XAM.SAM.mappingquality-Tuple{XAM.SAM.Record}"><code>XAM.SAM.mappingquality</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">mappingquality(record::Record)::UInt8</code></pre><p>Get the mapping quality of <code>record</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/record.jl#L259-L263">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.nextposition-Tuple{XAM.SAM.Record}" href="#XAM.SAM.nextposition-Tuple{XAM.SAM.Record}"><code>XAM.SAM.nextposition</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">nextposition(record::Record)::Int</code></pre><p>Get the position of the mate/next read of <code>record</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/record.jl#L241-L245">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.nextrefname-Tuple{XAM.SAM.Record}" href="#XAM.SAM.nextrefname-Tuple{XAM.SAM.Record}"><code>XAM.SAM.nextrefname</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">nextrefname(record::Record)::String</code></pre><p>Get the reference name of the mate/next read of <code>record</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/record.jl#L224-L228">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.position-Tuple{XAM.SAM.Record}" href="#XAM.SAM.position-Tuple{XAM.SAM.Record}"><code>XAM.SAM.position</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">position(record::Record)::Int</code></pre><p>Get the 1-based leftmost mapping position of <code>record</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/record.jl#L184-L188">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.quality-Tuple{Type{String},XAM.SAM.Record}" href="#XAM.SAM.quality-Tuple{Type{String},XAM.SAM.Record}"><code>XAM.SAM.quality</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">quality(::Type{String}, record::Record)::String</code></pre><p>Get the ASCII-encoded base quality of <code>record</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/record.jl#L440-L444">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.quality-Tuple{XAM.SAM.Record}" href="#XAM.SAM.quality-Tuple{XAM.SAM.Record}"><code>XAM.SAM.quality</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">quality(record::Record)::Vector{UInt8}</code></pre><p>Get the Phred-scaled base quality of <code>record</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/record.jl#L419-L423">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.refname-Tuple{XAM.SAM.Record}" href="#XAM.SAM.refname-Tuple{XAM.SAM.Record}"><code>XAM.SAM.refname</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">refname(record::Record)::String</code></pre><p>Get the reference sequence name of <code>record</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/record.jl#L167-L171">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.rightposition-Tuple{XAM.SAM.Record}" href="#XAM.SAM.rightposition-Tuple{XAM.SAM.Record}"><code>XAM.SAM.rightposition</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">rightposition(record::Record)::Int</code></pre><p>Get the 1-based rightmost mapping position of <code>record</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/record.jl#L202-L206">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.seqlength-Tuple{XAM.SAM.Record}" href="#XAM.SAM.seqlength-Tuple{XAM.SAM.Record}"><code>XAM.SAM.seqlength</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">seqlength(record::Record)::Int</code></pre><p>Get the sequence length of <code>record</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/record.jl#L402-L406">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.sequence-Tuple{Type{String},XAM.SAM.Record}" href="#XAM.SAM.sequence-Tuple{Type{String},XAM.SAM.Record}"><code>XAM.SAM.sequence</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">sequence(::Type{String}, record::Record)::String</code></pre><p>Get the segment sequence of <code>record</code> as <code>String</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/record.jl#L392-L396">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.sequence-Tuple{XAM.SAM.Record}" href="#XAM.SAM.sequence-Tuple{XAM.SAM.Record}"><code>XAM.SAM.sequence</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">sequence(record::Record)::BioSequences.LongDNASeq</code></pre><p>Get the segment sequence of <code>record</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/record.jl#L373-L377">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.tag-Tuple{XAM.SAM.MetaInfo}" href="#XAM.SAM.tag-Tuple{XAM.SAM.MetaInfo}"><code>XAM.SAM.tag</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">tag(metainfo::MetaInfo)::String</code></pre><p>Get the tag of <code>metainfo</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/metainfo.jl#L171-L175">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.templength-Tuple{XAM.SAM.Record}" href="#XAM.SAM.templength-Tuple{XAM.SAM.Record}"><code>XAM.SAM.templength</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">templength(record::Record)::Int</code></pre><p>Get the template length of <code>record</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/record.jl#L355-L359">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.tempname-Tuple{XAM.SAM.Record}" href="#XAM.SAM.tempname-Tuple{XAM.SAM.Record}"><code>XAM.SAM.tempname</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">tempname(record::Record)::String</code></pre><p>Get the query template name of <code>record</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/record.jl#L338-L342">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.SAM.value-Tuple{XAM.SAM.MetaInfo}" href="#XAM.SAM.value-Tuple{XAM.SAM.MetaInfo}"><code>XAM.SAM.value</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">value(metainfo::MetaInfo)::String</code></pre><p>Get the value of <code>metainfo</code> as a string.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/sam/metainfo.jl#L181-L185">source</a></section></article><h3 id="Internal-1"><a class="docs-heading-anchor" href="#Internal-1">Internal</a><a class="docs-heading-anchor-permalink" href="#Internal-1" title="Permalink"></a></h3><h2 id="BAM-API-1"><a class="docs-heading-anchor" href="#BAM-API-1">BAM API</a><a class="docs-heading-anchor-permalink" href="#BAM-API-1" title="Permalink"></a></h2><h3 id="Public-2"><a class="docs-heading-anchor" href="#Public-2">Public</a><a class="docs-heading-anchor-permalink" href="#Public-2" title="Permalink"></a></h3><article class="docstring"><header><a class="docstring-binding" id="XAM.BAM.BAI-Tuple{AbstractString}" href="#XAM.BAM.BAI-Tuple{AbstractString}"><code>XAM.BAM.BAI</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">BAI(filename::AbstractString)</code></pre><p>Load a BAI index from <code>filename</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/bam/bai.jl#L16-L20">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.BAM.BAI-Tuple{IO}" href="#XAM.BAM.BAI-Tuple{IO}"><code>XAM.BAM.BAI</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">BAI(input::IO)</code></pre><p>Load a BAI index from <code>input</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/bam/bai.jl#L25-L29">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.BAM.Reader" href="#XAM.BAM.Reader"><code>XAM.BAM.Reader</code></a><span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia">BAM.Reader(input::IO; index=nothing)</code></pre><p>Create a data reader of the BAM file format.</p><p><strong>Arguments</strong></p><ul><li><code>input</code>: data source</li><li><code>index=nothing</code>: filepath to a random access index (currently <em>bai</em> is supported)</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/bam/reader.jl#L4-L12">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.BAM.Record" href="#XAM.BAM.Record"><code>XAM.BAM.Record</code></a><span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia">BAM.Record()</code></pre><p>Create an unfilled BAM record.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/bam/record.jl#L4-L8">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.BAM.Writer" href="#XAM.BAM.Writer"><code>XAM.BAM.Writer</code></a><span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia">BAM.Writer(output::BGZFStream, header::SAM.Header)</code></pre><p>Create a data writer of the BAM file format.</p><p><strong>Arguments</strong></p><ul><li><code>output</code>: data sink</li><li><code>header</code>: SAM header object</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/bam/writer.jl#L4-L12">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="BioGenerics.header-Tuple{XAM.BAM.Reader}" href="#BioGenerics.header-Tuple{XAM.BAM.Reader}"><code>BioGenerics.header</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">header(reader::Reader; fillSQ::Bool=false)::SAM.Header</code></pre><p>Get the header of <code>reader</code>.</p><p>If <code>fillSQ</code> is <code>true</code>, this function fills missing &quot;SQ&quot; metainfo in the header.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/bam/reader.jl#L46-L52">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.BAM.alignlength-Tuple{XAM.BAM.Record}" href="#XAM.BAM.alignlength-Tuple{XAM.BAM.Record}"><code>XAM.BAM.alignlength</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">alignlength(record::Record)::Int</code></pre><p>Get the alignment length of <code>record</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/bam/record.jl#L433-L437">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.BAM.alignment-Tuple{XAM.BAM.Record}" href="#XAM.BAM.alignment-Tuple{XAM.BAM.Record}"><code>XAM.BAM.alignment</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">alignment(record::Record)::BioAlignments.Alignment</code></pre><p>Get the alignment of <code>record</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/bam/record.jl#L400-L404">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.BAM.auxdata-Tuple{XAM.BAM.Record}" href="#XAM.BAM.auxdata-Tuple{XAM.BAM.Record}"><code>XAM.BAM.auxdata</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">auxdata(record::Record)::BAM.AuxData</code></pre><p>Get the auxiliary data of <code>record</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/bam/record.jl#L532-L536">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.BAM.cigar" href="#XAM.BAM.cigar"><code>XAM.BAM.cigar</code></a><span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia">cigar(record::Record)::String</code></pre><p>Get the CIGAR string of <code>record</code>.</p><p>Note that in the BAM specification, the field called <code>cigar</code> typically stores the cigar string of the record. However, this is not always true, sometimes the true cigar is very long, and due to some constraints of the BAM format, the actual cigar string is stored in an extra tag: <code>CG:B,I</code>, and the <code>cigar</code> field stores a pseudo-cigar string.</p><p>Calling this method with <code>checkCG</code> set to <code>true</code> (default) this method will always yield the true cigar string, because this is probably what you want the vast majority of the time.</p><p>If you have a record that stores the true cigar in a <code>CG:B,I</code> tag, but you still want to access the pseudo-cigar that is stored in the <code>cigar</code> field of the BAM record, then you can set checkCG to <code>false</code>.</p><p>See also <code>BAM.cigar_rle</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/bam/record.jl#L315-L328">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.BAM.cigar_rle" href="#XAM.BAM.cigar_rle"><code>XAM.BAM.cigar_rle</code></a><span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia">cigar_rle(record::Record, checkCG::Bool = true)::Tuple{Vector{BioAlignments.Operation},Vector{Int}}</code></pre><p>Get a run-length encoded tuple <code>(ops, lens)</code> of the CIGAR string in <code>record</code>.</p><p>Note that in the BAM specification, the field called <code>cigar</code> typically stores the cigar string of the record. However, this is not always true, sometimes the true cigar is very long, and due to some constraints of the BAM format, the actual cigar string is stored in an extra tag: <code>CG:B,I</code>, and the <code>cigar</code> field stores a pseudo-cigar string.</p><p>Calling this method with <code>checkCG</code> set to <code>true</code> (default) this method will always yield the true cigar string, because this is probably what you want the vast majority of the time.</p><p>If you have a record that stores the true cigar in a <code>CG:B,I</code> tag, but you still want to access the pseudo-cigar that is stored in the <code>cigar</code> field of the BAM record, then you can set checkCG to <code>false</code>.</p><p>See also <code>BAM.cigar</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/bam/record.jl#L337-L350">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.BAM.flag-Tuple{XAM.BAM.Record}" href="#XAM.BAM.flag-Tuple{XAM.BAM.Record}"><code>XAM.BAM.flag</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">flag(record::Record)::UInt16</code></pre><p>Get the bitwise flag of <code>record</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/bam/record.jl#L99-L103">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.BAM.ismapped-Tuple{XAM.BAM.Record}" href="#XAM.BAM.ismapped-Tuple{XAM.BAM.Record}"><code>XAM.BAM.ismapped</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">ismapped(record::Record)::Bool</code></pre><p>Test if <code>record</code> is mapped.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/bam/record.jl#L113-L117">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.BAM.isnextmapped-Tuple{XAM.BAM.Record}" href="#XAM.BAM.isnextmapped-Tuple{XAM.BAM.Record}"><code>XAM.BAM.isnextmapped</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">isnextmapped(record::Record)::Bool</code></pre><p>Test if the mate/next read of <code>record</code> is mapped.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/bam/record.jl#L229-L233">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.BAM.ispositivestrand-Tuple{XAM.BAM.Record}" href="#XAM.BAM.ispositivestrand-Tuple{XAM.BAM.Record}"><code>XAM.BAM.ispositivestrand</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">ispositivestrand(record::Record)::Bool</code></pre><p>Test if <code>record</code> is aligned to the positive strand.</p><p>This is equivalent to <code>flag(record) &amp; 0x10 == 0</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/bam/record.jl#L133-L139">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.BAM.isprimary-Tuple{XAM.BAM.Record}" href="#XAM.BAM.isprimary-Tuple{XAM.BAM.Record}"><code>XAM.BAM.isprimary</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">isprimary(record::Record)::Bool</code></pre><p>Test if <code>record</code> is a primary line of the read.</p><p>This is equivalent to <code>flag(record) &amp; 0x900 == 0</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/bam/record.jl#L122-L128">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.BAM.mappingquality-Tuple{XAM.BAM.Record}" href="#XAM.BAM.mappingquality-Tuple{XAM.BAM.Record}"><code>XAM.BAM.mappingquality</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">mappingquality(record::Record)::UInt8</code></pre><p>Get the mapping quality of <code>record</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/bam/record.jl#L286-L290">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.BAM.n_cigar_op" href="#XAM.BAM.n_cigar_op"><code>XAM.BAM.n_cigar_op</code></a><span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia">n_cigar_op(record::Record, checkCG::Bool = true)</code></pre><p>Return the number of operations in the CIGAR string of <code>record</code>.</p><p>Note that in the BAM specification, the field called <code>cigar</code> typically stores the cigar string of the record. However, this is not always true, sometimes the true cigar is very long, and due to some constraints of the BAM format, the actual cigar string is stored in an extra tag: <code>CG:B,I</code>, and the <code>cigar</code> field stores a pseudo-cigar string.</p><p>Calling this method with <code>checkCG</code> set to <code>true</code> (default) this method will always yield the number of operations in the true cigar string, because this is probably what you want, the vast majority of the time.</p><p>If you have a record that stores the true cigar in a <code>CG:B,I</code> tag, but you still want to get the number of operations in the <code>cigar</code> field of the BAM record, then set <code>checkCG</code> to <code>false</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/bam/record.jl#L299-L310">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.BAM.nextposition-Tuple{XAM.BAM.Record}" href="#XAM.BAM.nextposition-Tuple{XAM.BAM.Record}"><code>XAM.BAM.nextposition</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">nextposition(record::Record)::Int</code></pre><p>Get the 1-based leftmost mapping position of the next/mate read of <code>record</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/bam/record.jl#L272-L276">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.BAM.nextrefid-Tuple{XAM.BAM.Record}" href="#XAM.BAM.nextrefid-Tuple{XAM.BAM.Record}"><code>XAM.BAM.nextrefid</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">nextrefid(record::Record)::Int</code></pre><p>Get the next/mate reference sequence ID of <code>record</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/bam/record.jl#L238-L242">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.BAM.nextrefname-Tuple{XAM.BAM.Record}" href="#XAM.BAM.nextrefname-Tuple{XAM.BAM.Record}"><code>XAM.BAM.nextrefname</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">nextrefname(record::Record)::String</code></pre><p>Get the reference name of the mate/next read of <code>record</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/bam/record.jl#L252-L256">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.BAM.position-Tuple{XAM.BAM.Record}" href="#XAM.BAM.position-Tuple{XAM.BAM.Record}"><code>XAM.BAM.position</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">position(record::Record)::Int</code></pre><p>Get the 1-based leftmost mapping position of <code>record</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/bam/record.jl#L201-L205">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.BAM.quality-Tuple{XAM.BAM.Record}" href="#XAM.BAM.quality-Tuple{XAM.BAM.Record}"><code>XAM.BAM.quality</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">quality(record::Record)::Vector{UInt8}</code></pre><p>Get the base quality of <code>record</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/bam/record.jl#L516-L520">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.BAM.refid-Tuple{XAM.BAM.Record}" href="#XAM.BAM.refid-Tuple{XAM.BAM.Record}"><code>XAM.BAM.refid</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">refid(record::Record)::Int</code></pre><p>Get the reference sequence ID of <code>record</code>.</p><p>The ID is 1-based (i.e. the first sequence is 1) and is 0 for a record without a mapping position.</p><p>See also: <code>BAM.rname</code></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/bam/record.jl#L144-L152">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.BAM.reflen-Tuple{XAM.BAM.Record}" href="#XAM.BAM.reflen-Tuple{XAM.BAM.Record}"><code>XAM.BAM.reflen</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">reflen(record::Record)::Int</code></pre><p>Get the length of the reference sequence this record applies to.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/bam/record.jl#L186-L190">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.BAM.refname-Tuple{XAM.BAM.Record}" href="#XAM.BAM.refname-Tuple{XAM.BAM.Record}"><code>XAM.BAM.refname</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">refname(record::Record)::String</code></pre><p>Get the reference sequence name of <code>record</code>.</p><p>See also: <code>BAM.refid</code></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/bam/record.jl#L173-L179">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.BAM.rightposition-Tuple{XAM.BAM.Record}" href="#XAM.BAM.rightposition-Tuple{XAM.BAM.Record}"><code>XAM.BAM.rightposition</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">rightposition(record::Record)::Int</code></pre><p>Get the 1-based rightmost mapping position of <code>record</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/bam/record.jl#L215-L219">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.BAM.seqlength-Tuple{XAM.BAM.Record}" href="#XAM.BAM.seqlength-Tuple{XAM.BAM.Record}"><code>XAM.BAM.seqlength</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">seqlength(record::Record)::Int</code></pre><p>Get the sequence length of <code>record</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/bam/record.jl#L502-L506">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.BAM.sequence-Tuple{XAM.BAM.Record}" href="#XAM.BAM.sequence-Tuple{XAM.BAM.Record}"><code>XAM.BAM.sequence</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">sequence(record::Record)::BioSequences.LongDNASeq</code></pre><p>Get the segment sequence of <code>record</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/bam/record.jl#L480-L484">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.BAM.templength-Tuple{XAM.BAM.Record}" href="#XAM.BAM.templength-Tuple{XAM.BAM.Record}"><code>XAM.BAM.templength</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">templength(record::Record)::Int</code></pre><p>Get the template length of <code>record</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/bam/record.jl#L466-L470">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="XAM.BAM.tempname-Tuple{XAM.BAM.Record}" href="#XAM.BAM.tempname-Tuple{XAM.BAM.Record}"><code>XAM.BAM.tempname</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia">tempname(record::Record)::String</code></pre><p>Get the query template name of <code>record</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/aec919c713b11cde218c92818a8dad4f448b6169/src/bam/record.jl#L451-L455">source</a></section></article><h3 id="Internal-2"><a class="docs-heading-anchor" href="#Internal-2">Internal</a><a class="docs-heading-anchor-permalink" href="#Internal-2" title="Permalink"></a></h3></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../hts-files/">« SAM and BAM</a></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> on <span class="colophon-date" title="Saturday 21 March 2020 06:36">Saturday 21 March 2020</span>. Using Julia version 1.3.0.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>