1
0
Fork 0
mirror of https://github.com/MillironX/XAM.jl.git synced 2024-12-26 17:49:21 -05:00
XAM.jl/dev/api/public/index.html
2019-08-26 06:30:04 +00:00

24 lines
59 KiB
HTML

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Public · XAM.jl</title><link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/4.2.0/normalize.min.css" rel="stylesheet" type="text/css"/><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/4.6.3/css/font-awesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="../.."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.2.0/require.min.js" data-main="../../assets/documenter.js"></script><script src="../../siteinfo.js"></script><script src="../../../versions.js"></script><link href="../../assets/documenter.css" rel="stylesheet" type="text/css"/></head><body><nav class="toc"><h1>XAM.jl</h1><select id="version-selector" onChange="window.location.href=this.value" style="visibility: hidden"></select><form class="search" id="search-form" action="../../search/"><input id="search-query" name="q" type="text" placeholder="Search docs"/></form><ul><li><a class="toctext" href="../../">Home</a></li><li><a class="toctext" href="../../hts-files/">SAM and BAM</a></li><li><span class="toctext">API Reference</span><ul><li class="current"><a class="toctext" href>Public</a><ul class="internal"><li><a class="toctext" href="#Contents-1">Contents</a></li><li><a class="toctext" href="#SAM-API-1">SAM API</a></li><li><a class="toctext" href="#BAM-API-1">BAM API</a></li></ul></li></ul></li></ul></nav><article id="docs"><header><nav><ul><li>API Reference</li><li><a href>Public</a></li></ul><a class="edit-page" href="https://github.com/BioJulia/XAM.jl/blob/develop/docs/src/api/public.md"><span class="fa"></span> Edit on GitHub</a></nav><hr/><div id="topbar"><span>Public</span><a class="fa fa-bars" href="#"></a></div></header><h1><a class="nav-anchor" id="Public-API-Reference-1" href="#Public-API-Reference-1">Public API Reference</a></h1><h2><a class="nav-anchor" id="Contents-1" href="#Contents-1">Contents</a></h2><ul><li><a href="#Public-API-Reference-1">Public API Reference</a></li><ul><li><a href="#Contents-1">Contents</a></li><li><a href="#SAM-API-1">SAM API</a></li><li><a href="#BAM-API-1">BAM API</a></li></ul></ul><ul><li><a href="#XAM.SAM.FLAG_DUP"><code>XAM.SAM.FLAG_DUP</code></a></li><li><a href="#XAM.SAM.FLAG_MREVERSE"><code>XAM.SAM.FLAG_MREVERSE</code></a></li><li><a href="#XAM.SAM.FLAG_MUNMAP"><code>XAM.SAM.FLAG_MUNMAP</code></a></li><li><a href="#XAM.SAM.FLAG_PAIRED"><code>XAM.SAM.FLAG_PAIRED</code></a></li><li><a href="#XAM.SAM.FLAG_PROPER_PAIR"><code>XAM.SAM.FLAG_PROPER_PAIR</code></a></li><li><a href="#XAM.SAM.FLAG_QCFAIL"><code>XAM.SAM.FLAG_QCFAIL</code></a></li><li><a href="#XAM.SAM.FLAG_READ1"><code>XAM.SAM.FLAG_READ1</code></a></li><li><a href="#XAM.SAM.FLAG_READ2"><code>XAM.SAM.FLAG_READ2</code></a></li><li><a href="#XAM.SAM.FLAG_REVERSE"><code>XAM.SAM.FLAG_REVERSE</code></a></li><li><a href="#XAM.SAM.FLAG_SECONDARY"><code>XAM.SAM.FLAG_SECONDARY</code></a></li><li><a href="#XAM.SAM.FLAG_SUPPLEMENTARY"><code>XAM.SAM.FLAG_SUPPLEMENTARY</code></a></li><li><a href="#XAM.SAM.FLAG_UNMAP"><code>XAM.SAM.FLAG_UNMAP</code></a></li><li><a href="#XAM.BAM.BAI-Tuple{AbstractString}"><code>XAM.BAM.BAI</code></a></li><li><a href="#XAM.BAM.BAI-Tuple{IO}"><code>XAM.BAM.BAI</code></a></li><li><a href="#XAM.BAM.Reader"><code>XAM.BAM.Reader</code></a></li><li><a href="#XAM.BAM.Record"><code>XAM.BAM.Record</code></a></li><li><a href="#XAM.BAM.Writer"><code>XAM.BAM.Writer</code></a></li><li><a href="#XAM.SAM.Header-Tuple{}"><code>XAM.SAM.Header</code></a></li><li><a href="#XAM.SAM.MetaInfo-Tuple{AbstractString}"><code>XAM.SAM.MetaInfo</code></a></li><li><a href="#XAM.SAM.MetaInfo-Tuple{AbstractString,Any}"><code>XAM.SAM.MetaInfo</code></a></li><li><a href="#XAM.SAM.Reader-Tuple{IO}"><code>XAM.SAM.Reader</code></a></li><li><a href="#XAM.SAM.Record-Tuple{}"><code>XAM.SAM.Record</code></a></li><li><a href="#XAM.SAM.Record-Tuple{AbstractString}"><code>XAM.SAM.Record</code></a></li><li><a href="#XAM.SAM.Record-Tuple{Array{UInt8,1}}"><code>XAM.SAM.Record</code></a></li><li><a href="#XAM.SAM.Writer"><code>XAM.SAM.Writer</code></a></li><li><a href="#Base.findall-Tuple{XAM.SAM.Header,AbstractString}"><code>Base.findall</code></a></li><li><a href="#BioCore.header-Tuple{XAM.BAM.Reader}"><code>BioCore.header</code></a></li><li><a href="#BioCore.header-Tuple{XAM.SAM.Reader}"><code>BioCore.header</code></a></li><li><a href="#XAM.BAM.alignlength-Tuple{XAM.BAM.Record}"><code>XAM.BAM.alignlength</code></a></li><li><a href="#XAM.BAM.alignment-Tuple{XAM.BAM.Record}"><code>XAM.BAM.alignment</code></a></li><li><a href="#XAM.BAM.auxdata-Tuple{XAM.BAM.Record}"><code>XAM.BAM.auxdata</code></a></li><li><a href="#XAM.BAM.cigar"><code>XAM.BAM.cigar</code></a></li><li><a href="#XAM.BAM.cigar_rle"><code>XAM.BAM.cigar_rle</code></a></li><li><a href="#XAM.BAM.flag-Tuple{XAM.BAM.Record}"><code>XAM.BAM.flag</code></a></li><li><a href="#XAM.BAM.ismapped-Tuple{XAM.BAM.Record}"><code>XAM.BAM.ismapped</code></a></li><li><a href="#XAM.BAM.isnextmapped-Tuple{XAM.BAM.Record}"><code>XAM.BAM.isnextmapped</code></a></li><li><a href="#XAM.BAM.ispositivestrand-Tuple{XAM.BAM.Record}"><code>XAM.BAM.ispositivestrand</code></a></li><li><a href="#XAM.BAM.isprimary-Tuple{XAM.BAM.Record}"><code>XAM.BAM.isprimary</code></a></li><li><a href="#XAM.BAM.mappingquality-Tuple{XAM.BAM.Record}"><code>XAM.BAM.mappingquality</code></a></li><li><a href="#XAM.BAM.n_cigar_op"><code>XAM.BAM.n_cigar_op</code></a></li><li><a href="#XAM.BAM.nextposition-Tuple{XAM.BAM.Record}"><code>XAM.BAM.nextposition</code></a></li><li><a href="#XAM.BAM.nextrefid-Tuple{XAM.BAM.Record}"><code>XAM.BAM.nextrefid</code></a></li><li><a href="#XAM.BAM.nextrefname-Tuple{XAM.BAM.Record}"><code>XAM.BAM.nextrefname</code></a></li><li><a href="#XAM.BAM.position-Tuple{XAM.BAM.Record}"><code>XAM.BAM.position</code></a></li><li><a href="#XAM.BAM.quality-Tuple{XAM.BAM.Record}"><code>XAM.BAM.quality</code></a></li><li><a href="#XAM.BAM.refid-Tuple{XAM.BAM.Record}"><code>XAM.BAM.refid</code></a></li><li><a href="#XAM.BAM.reflen-Tuple{XAM.BAM.Record}"><code>XAM.BAM.reflen</code></a></li><li><a href="#XAM.BAM.refname-Tuple{XAM.BAM.Record}"><code>XAM.BAM.refname</code></a></li><li><a href="#XAM.BAM.rightposition-Tuple{XAM.BAM.Record}"><code>XAM.BAM.rightposition</code></a></li><li><a href="#XAM.BAM.seqlength-Tuple{XAM.BAM.Record}"><code>XAM.BAM.seqlength</code></a></li><li><a href="#XAM.BAM.sequence-Tuple{XAM.BAM.Record}"><code>XAM.BAM.sequence</code></a></li><li><a href="#XAM.BAM.templength-Tuple{XAM.BAM.Record}"><code>XAM.BAM.templength</code></a></li><li><a href="#XAM.BAM.tempname-Tuple{XAM.BAM.Record}"><code>XAM.BAM.tempname</code></a></li><li><a href="#XAM.SAM.alignlength-Tuple{XAM.SAM.Record}"><code>XAM.SAM.alignlength</code></a></li><li><a href="#XAM.SAM.alignment-Tuple{XAM.SAM.Record}"><code>XAM.SAM.alignment</code></a></li><li><a href="#XAM.SAM.auxdata-Tuple{XAM.SAM.Record}"><code>XAM.SAM.auxdata</code></a></li><li><a href="#XAM.SAM.cigar-Tuple{XAM.SAM.Record}"><code>XAM.SAM.cigar</code></a></li><li><a href="#XAM.SAM.flag-Tuple{XAM.SAM.Record}"><code>XAM.SAM.flag</code></a></li><li><a href="#XAM.SAM.iscomment-Tuple{XAM.SAM.MetaInfo}"><code>XAM.SAM.iscomment</code></a></li><li><a href="#XAM.SAM.ismapped-Tuple{XAM.SAM.Record}"><code>XAM.SAM.ismapped</code></a></li><li><a href="#XAM.SAM.isnextmapped-Tuple{XAM.SAM.Record}"><code>XAM.SAM.isnextmapped</code></a></li><li><a href="#XAM.SAM.isprimary-Tuple{XAM.SAM.Record}"><code>XAM.SAM.isprimary</code></a></li><li><a href="#XAM.SAM.keyvalues-Tuple{XAM.SAM.MetaInfo}"><code>XAM.SAM.keyvalues</code></a></li><li><a href="#XAM.SAM.mappingquality-Tuple{XAM.SAM.Record}"><code>XAM.SAM.mappingquality</code></a></li><li><a href="#XAM.SAM.nextposition-Tuple{XAM.SAM.Record}"><code>XAM.SAM.nextposition</code></a></li><li><a href="#XAM.SAM.nextrefname-Tuple{XAM.SAM.Record}"><code>XAM.SAM.nextrefname</code></a></li><li><a href="#XAM.SAM.position-Tuple{XAM.SAM.Record}"><code>XAM.SAM.position</code></a></li><li><a href="#XAM.SAM.quality-Tuple{XAM.SAM.Record}"><code>XAM.SAM.quality</code></a></li><li><a href="#XAM.SAM.quality-Tuple{Type{String},XAM.SAM.Record}"><code>XAM.SAM.quality</code></a></li><li><a href="#XAM.SAM.refname-Tuple{XAM.SAM.Record}"><code>XAM.SAM.refname</code></a></li><li><a href="#XAM.SAM.rightposition-Tuple{XAM.SAM.Record}"><code>XAM.SAM.rightposition</code></a></li><li><a href="#XAM.SAM.seqlength-Tuple{XAM.SAM.Record}"><code>XAM.SAM.seqlength</code></a></li><li><a href="#XAM.SAM.sequence-Tuple{XAM.SAM.Record}"><code>XAM.SAM.sequence</code></a></li><li><a href="#XAM.SAM.sequence-Tuple{Type{String},XAM.SAM.Record}"><code>XAM.SAM.sequence</code></a></li><li><a href="#XAM.SAM.tag-Tuple{XAM.SAM.MetaInfo}"><code>XAM.SAM.tag</code></a></li><li><a href="#XAM.SAM.templength-Tuple{XAM.SAM.Record}"><code>XAM.SAM.templength</code></a></li><li><a href="#XAM.SAM.tempname-Tuple{XAM.SAM.Record}"><code>XAM.SAM.tempname</code></a></li><li><a href="#XAM.SAM.value-Tuple{XAM.SAM.MetaInfo}"><code>XAM.SAM.value</code></a></li></ul><h2><a class="nav-anchor" id="SAM-API-1" href="#SAM-API-1">SAM API</a></h2><p>The following methods and types are provided by the SAM submodule for public use.</p><section class="docstring"><div 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>.</div><div><div><p>0x0400: optical or PCR duplicate</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/flags.jl#L23">source</a></section><section class="docstring"><div 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>.</div><div><div><p>0x0020: the mate is mapped to the reverse strand</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/flags.jl#L23">source</a></section><section class="docstring"><div 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>.</div><div><div><p>0x0008: the mate is unmapped</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/flags.jl#L23">source</a></section><section class="docstring"><div 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>.</div><div><div><p>0x0001: the read is paired in sequencing, no matter whether it is mapped in a pair</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/flags.jl#L23">source</a></section><section class="docstring"><div 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>.</div><div><div><p>0x0002: the read is mapped in a proper pair</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/flags.jl#L23">source</a></section><section class="docstring"><div 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>.</div><div><div><p>0x0200: QC failure</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/flags.jl#L23">source</a></section><section class="docstring"><div 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>.</div><div><div><p>0x0040: this is read1</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/flags.jl#L23">source</a></section><section class="docstring"><div 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>.</div><div><div><p>0x0080: this is read2</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/flags.jl#L23">source</a></section><section class="docstring"><div 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>.</div><div><div><p>0x0010: the read is mapped to the reverse strand</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/flags.jl#L23">source</a></section><section class="docstring"><div 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>.</div><div><div><p>0x0100: not primary alignment</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/flags.jl#L23">source</a></section><section class="docstring"><div 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>.</div><div><div><p>0x0800: supplementary alignment</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/flags.jl#L23">source</a></section><section class="docstring"><div 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>.</div><div><div><p>0x0004: the read itself is unmapped; conflictive with SAM.FLAG<em>PROPER</em>PAIR</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/flags.jl#L23">source</a></section><section class="docstring"><div 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>.</div><div><div><pre><code class="language-julia">SAM.Header()</code></pre><p>Create an empty header.</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/header.jl#L8-L12">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/metainfo.jl#L45-L71">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/metainfo.jl#L23-L40">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/reader.jl#L16-L23">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/record.jl#L63-L68">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/record.jl#L39-L45">source</a></section><section class="docstring"><div 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>.</div><div><div><pre><code class="language-julia">SAM.Record()</code></pre><p>Create an unfilled SAM record.</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/record.jl#L23-L27">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/writer.jl#L4-L12">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/header.jl#L36-L40">source</a></section><section class="docstring"><div class="docstring-header"><a class="docstring-binding" id="BioCore.header-Tuple{XAM.SAM.Reader}" href="#BioCore.header-Tuple{XAM.SAM.Reader}"><code>BioCore.header</code></a><span class="docstring-category">Method</span>.</div><div><div><pre><code class="language-julia">header(reader::Reader)::Header</code></pre><p>Get the header of <code>reader</code>.</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/reader.jl#L32-L36">source</a></section><section class="docstring"><div 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>.</div><div><div><pre><code class="language-julia">alignlength(record::Record)::Int</code></pre><p>Get the alignment length of <code>record</code>.</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/record.jl#L311-L315">source</a></section><section class="docstring"><div 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>.</div><div><div><pre><code class="language-julia">alignment(record::Record)::BioAlignments.Alignment</code></pre><p>Get the alignment of <code>record</code>.</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/record.jl#L294-L298">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/record.jl#L449-L453">source</a></section><section class="docstring"><div 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>.</div><div><div><pre><code class="language-julia">cigar(record::Record)::String</code></pre><p>Get the CIGAR string of <code>record</code>.</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/record.jl#L277-L281">source</a></section><section class="docstring"><div 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>.</div><div><div><pre><code class="language-julia">flag(record::Record)::UInt16</code></pre><p>Get the bitwise flag of <code>record</code>.</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/record.jl#L133-L137">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/metainfo.jl#L154-L158">source</a></section><section class="docstring"><div 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>.</div><div><div><pre><code class="language-julia">ismapped(record::Record)::Bool</code></pre><p>Test if <code>record</code> is mapped.</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/record.jl#L147-L151">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/record.jl#L215-L219">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/record.jl#L156-L162">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/metainfo.jl#L183-L187">source</a></section><section class="docstring"><div 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>.</div><div><div><pre><code class="language-julia">mappingquality(record::Record)::UInt8</code></pre><p>Get the mapping quality of <code>record</code>.</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/record.jl#L259-L263">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/record.jl#L241-L245">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/record.jl#L224-L228">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/record.jl#L184-L188">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/record.jl#L439-L443">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/record.jl#L418-L422">source</a></section><section class="docstring"><div 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>.</div><div><div><pre><code class="language-julia">refname(record::Record)::String</code></pre><p>Get the reference sequence name of <code>record</code>.</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/record.jl#L167-L171">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/record.jl#L202-L206">source</a></section><section class="docstring"><div 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>.</div><div><div><pre><code class="language-julia">seqlength(record::Record)::Int</code></pre><p>Get the sequence length of <code>record</code>.</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/record.jl#L401-L405">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/record.jl#L391-L395">source</a></section><section class="docstring"><div 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>.</div><div><div><pre><code class="language-julia">sequence(record::Record)::BioSequences.DNASequence</code></pre><p>Get the segment sequence of <code>record</code>.</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/record.jl#L372-L376">source</a></section><section class="docstring"><div 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>.</div><div><div><pre><code class="language-julia">tag(metainfo::MetaInfo)::String</code></pre><p>Get the tag of <code>metainfo</code>.</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/metainfo.jl#L163-L167">source</a></section><section class="docstring"><div 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>.</div><div><div><pre><code class="language-julia">templength(record::Record)::Int</code></pre><p>Get the template length of <code>record</code>.</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/record.jl#L354-L358">source</a></section><section class="docstring"><div 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>.</div><div><div><pre><code class="language-julia">tempname(record::Record)::String</code></pre><p>Get the query template name of <code>record</code>.</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/record.jl#L337-L341">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/sam/metainfo.jl#L173-L177">source</a></section><h2><a class="nav-anchor" id="BAM-API-1" href="#BAM-API-1">BAM API</a></h2><p>The following methods and types are provided by the BAM submodule for public use.</p><section class="docstring"><div 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>.</div><div><div><pre><code class="language-julia">BAI(filename::AbstractString)</code></pre><p>Load a BAI index from <code>filename</code>.</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/bam/bai.jl#L18-L22">source</a></section><section class="docstring"><div 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>.</div><div><div><pre><code class="language-julia">BAI(input::IO)</code></pre><p>Load a BAI index from <code>input</code>.</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/bam/bai.jl#L27-L31">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/bam/reader.jl#L4-L12">source</a></section><section class="docstring"><div 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>.</div><div><div><pre><code class="language-julia">BAM.Record()</code></pre><p>Create an unfilled BAM record.</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/bam/record.jl#L4-L8">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/bam/writer.jl#L4-L12">source</a></section><section class="docstring"><div class="docstring-header"><a class="docstring-binding" id="BioCore.header-Tuple{XAM.BAM.Reader}" href="#BioCore.header-Tuple{XAM.BAM.Reader}"><code>BioCore.header</code></a><span class="docstring-category">Method</span>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/bam/reader.jl#L48-L54">source</a></section><section class="docstring"><div 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>.</div><div><div><pre><code class="language-julia">alignlength(record::Record)::Int</code></pre><p>Get the alignment length of <code>record</code>.</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/bam/record.jl#L456-L460">source</a></section><section class="docstring"><div 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>.</div><div><div><pre><code class="language-julia">alignment(record::Record)::BioAlignments.Alignment</code></pre><p>Get the alignment of <code>record</code>.</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/bam/record.jl#L423-L427">source</a></section><section class="docstring"><div 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>.</div><div><div><pre><code class="language-julia">auxdata(record::Record)::BAM.AuxData</code></pre><p>Get the auxiliary data of <code>record</code>.</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/bam/record.jl#L555-L559">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/bam/record.jl#L322-L343">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/bam/record.jl#L352-L373">source</a></section><section class="docstring"><div 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>.</div><div><div><pre><code class="language-julia">flag(record::Record)::UInt16</code></pre><p>Get the bitwise flag of <code>record</code>.</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/bam/record.jl#L99-L103">source</a></section><section class="docstring"><div 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>.</div><div><div><pre><code class="language-julia">ismapped(record::Record)::Bool</code></pre><p>Test if <code>record</code> is mapped.</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/bam/record.jl#L113-L117">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/bam/record.jl#L228-L232">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/bam/record.jl#L133-L139">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/bam/record.jl#L122-L128">source</a></section><section class="docstring"><div 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>.</div><div><div><pre><code class="language-julia">mappingquality(record::Record)::UInt8</code></pre><p>Get the mapping quality of <code>record</code>.</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/bam/record.jl#L285-L289">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/bam/record.jl#L298-L317">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/bam/record.jl#L271-L275">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/bam/record.jl#L237-L241">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/bam/record.jl#L251-L255">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/bam/record.jl#L200-L204">source</a></section><section class="docstring"><div 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>.</div><div><div><pre><code class="language-julia">quality(record::Record)::Vector{UInt8}</code></pre><p>Get the base quality of <code>record</code>.</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/bam/record.jl#L539-L543">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/bam/record.jl#L144-L152">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/bam/record.jl#L185-L189">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/bam/record.jl#L172-L178">source</a></section><section class="docstring"><div 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>.</div><div><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></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/bam/record.jl#L214-L218">source</a></section><section class="docstring"><div 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>.</div><div><div><pre><code class="language-julia">seqlength(record::Record)::Int</code></pre><p>Get the sequence length of <code>record</code>.</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/bam/record.jl#L525-L529">source</a></section><section class="docstring"><div 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>.</div><div><div><pre><code class="language-julia">sequence(record::Record)::BioSequences.DNASequence</code></pre><p>Get the segment sequence of <code>record</code>.</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/bam/record.jl#L503-L507">source</a></section><section class="docstring"><div 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>.</div><div><div><pre><code class="language-julia">templength(record::Record)::Int</code></pre><p>Get the template length of <code>record</code>.</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/bam/record.jl#L489-L493">source</a></section><section class="docstring"><div 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>.</div><div><div><pre><code class="language-julia">tempname(record::Record)::String</code></pre><p>Get the query template name of <code>record</code>.</p></div></div><a class="source-link" target="_blank" href="https://github.com/BioJulia/XAM.jl/blob/8a43fc9f82a96404db7524510beb7c06ddb60db6/src/bam/record.jl#L474-L478">source</a></section><footer><hr/><a class="previous" href="../../hts-files/"><span class="direction">Previous</span><span class="title">SAM and BAM</span></a></footer></article></body></html>