diff --git a/dev/assets/themes/documenter-dark.css b/dev/assets/themes/documenter-dark.css index c6db4fa..65e34e4 100644 --- a/dev/assets/themes/documenter-dark.css +++ b/dev/assets/themes/documenter-dark.css @@ -1128,7 +1128,7 @@ html.theme--documenter-dark { color: #1dd2af; } html.theme--documenter-dark code { background-color: rgba(255, 255, 255, 0.05); - color: #e74c3c; + color: #ececec; font-size: 0.875em; font-weight: normal; padding: 0.1em; } @@ -7277,8 +7277,12 @@ html.theme--documenter-dark { position: absolute; right: 0.625rem; bottom: 0.5rem; } + html.theme--documenter-dark .docstring > section > a.docs-sourcelink:focus { + opacity: 1 !important; } html.theme--documenter-dark .docstring:hover > section > a.docs-sourcelink { opacity: 0.2; } + html.theme--documenter-dark .docstring:focus-within > section > a.docs-sourcelink { + opacity: 0.2; } html.theme--documenter-dark .docstring > section:hover a.docs-sourcelink { opacity: 1; } html.theme--documenter-dark .documenter-example-output { @@ -7338,10 +7342,13 @@ html.theme--documenter-dark { html.theme--documenter-dark html { -moz-osx-font-smoothing: auto; -webkit-font-smoothing: auto; } + html.theme--documenter-dark li.no-marker { + list-style: none; } html.theme--documenter-dark #documenter .docs-main > article { overflow-wrap: break-word; } html.theme--documenter-dark #documenter .docs-main > article .math-container { - overflow-x: auto; } + overflow-x: auto; + overflow-y: hidden; } @media screen and (min-width: 1056px) { html.theme--documenter-dark #documenter .docs-main { max-width: 52rem; @@ -7604,6 +7611,90 @@ html.theme--documenter-dark { overflow-y: scroll; text-rendering: optimizeLegibility; text-size-adjust: 100%; } + html.theme--documenter-dark .ansi span.sgr1 { + font-weight: bolder; } + html.theme--documenter-dark .ansi span.sgr2 { + font-weight: lighter; } + html.theme--documenter-dark .ansi span.sgr3 { + font-style: italic; } + html.theme--documenter-dark .ansi span.sgr4 { + text-decoration: underline; } + html.theme--documenter-dark .ansi span.sgr7 { + color: #1f2424; + background-color: #fff; } + html.theme--documenter-dark .ansi span.sgr8 { + color: transparent; } + html.theme--documenter-dark .ansi span.sgr8 span { + color: transparent; } + html.theme--documenter-dark .ansi span.sgr9 { + text-decoration: line-through; } + html.theme--documenter-dark .ansi span.sgr30 { + color: #242424; } + html.theme--documenter-dark .ansi span.sgr31 { + color: #f6705f; } + html.theme--documenter-dark .ansi span.sgr32 { + color: #4fb43a; } + html.theme--documenter-dark .ansi span.sgr33 { + color: #f4c72f; } + html.theme--documenter-dark .ansi span.sgr34 { + color: #7587f0; } + html.theme--documenter-dark .ansi span.sgr35 { + color: #bc89d3; } + html.theme--documenter-dark .ansi span.sgr36 { + color: #49b6ca; } + html.theme--documenter-dark .ansi span.sgr37 { + color: #b3bdbe; } + html.theme--documenter-dark .ansi span.sgr40 { + background-color: #242424; } + html.theme--documenter-dark .ansi span.sgr41 { + background-color: #f6705f; } + html.theme--documenter-dark .ansi span.sgr42 { + background-color: #4fb43a; } + html.theme--documenter-dark .ansi span.sgr43 { + background-color: #f4c72f; } + html.theme--documenter-dark .ansi span.sgr44 { + background-color: #7587f0; } + html.theme--documenter-dark .ansi span.sgr45 { + background-color: #bc89d3; } + html.theme--documenter-dark .ansi span.sgr46 { + background-color: #49b6ca; } + html.theme--documenter-dark .ansi span.sgr47 { + background-color: #b3bdbe; } + html.theme--documenter-dark .ansi span.sgr90 { + color: #92a0a2; } + html.theme--documenter-dark .ansi span.sgr91 { + color: #ff8674; } + html.theme--documenter-dark .ansi span.sgr92 { + color: #79d462; } + html.theme--documenter-dark .ansi span.sgr93 { + color: #ffe76b; } + html.theme--documenter-dark .ansi span.sgr94 { + color: #8a98ff; } + html.theme--documenter-dark .ansi span.sgr95 { + color: #d2a4e6; } + html.theme--documenter-dark .ansi span.sgr96 { + color: #6bc8db; } + html.theme--documenter-dark .ansi span.sgr97 { + color: #ecf0f1; } + html.theme--documenter-dark .ansi span.sgr100 { + background-color: #92a0a2; } + html.theme--documenter-dark .ansi span.sgr101 { + background-color: #ff8674; } + html.theme--documenter-dark .ansi span.sgr102 { + background-color: #79d462; } + html.theme--documenter-dark .ansi span.sgr103 { + background-color: #ffe76b; } + html.theme--documenter-dark .ansi span.sgr104 { + background-color: #8a98ff; } + html.theme--documenter-dark .ansi span.sgr105 { + background-color: #d2a4e6; } + html.theme--documenter-dark .ansi span.sgr106 { + background-color: #6bc8db; } + html.theme--documenter-dark .ansi span.sgr107 { + background-color: #ecf0f1; } + html.theme--documenter-dark code.language-julia-repl > span.hljs-meta { + color: #4fb43a; + font-weight: bolder; } html.theme--documenter-dark .hljs { background: #2b2b2b; color: #f8f8f2; } diff --git a/dev/assets/themes/documenter-light.css b/dev/assets/themes/documenter-light.css index b3291bc..14f6a0e 100644 --- a/dev/assets/themes/documenter-light.css +++ b/dev/assets/themes/documenter-light.css @@ -751,7 +751,7 @@ a.has-text-link:hover, a.has-text-link:focus { color: #209cee !important; } a.has-text-info:hover, a.has-text-info:focus { - color: #0f81cc !important; } + color: #1081cb !important; } .has-background-info { background-color: #209cee !important; } @@ -808,10 +808,10 @@ a.has-text-danger:hover, a.has-text-danger:focus { background-color: #4a4a4a !important; } .has-text-grey { - color: #7a7a7a !important; } + color: #6b6b6b !important; } .has-background-grey { - background-color: #7a7a7a !important; } + background-color: #6b6b6b !important; } .has-text-grey-light { color: #b5b5b5 !important; } @@ -1210,7 +1210,7 @@ a.box:active { border-color: #b5b5b5; color: #363636; } .button:focus, .button.is-focused { - border-color: #2e63b8; + border-color: #3c5dcd; color: #363636; } .button:focus:not(:active), .button.is-focused:not(:active) { box-shadow: 0 0 0 0.125em rgba(46, 99, 184, 0.25); } @@ -1658,7 +1658,7 @@ a.box:active { border-color: transparent; color: #fff; } .button.is-info:hover, .button.is-info.is-hovered { - background-color: #1496ed; + background-color: #1497ed; border-color: transparent; color: #fff; } .button.is-info:focus, .button.is-info.is-focused { @@ -1667,7 +1667,7 @@ a.box:active { .button.is-info:focus:not(:active), .button.is-info.is-focused:not(:active) { box-shadow: 0 0 0 0.125em rgba(32, 156, 238, 0.25); } .button.is-info:active, .button.is-info.is-active { - background-color: #118fe4; + background-color: #1190e3; border-color: transparent; color: #fff; } .button.is-info[disabled], @@ -1794,7 +1794,7 @@ a.box:active { border-color: transparent; color: rgba(0, 0, 0, 0.7); } .button.is-warning:hover, .button.is-warning.is-hovered { - background-color: #ffdb4a; + background-color: #ffda4a; border-color: transparent; color: rgba(0, 0, 0, 0.7); } .button.is-warning:focus, .button.is-warning.is-focused { @@ -1803,7 +1803,7 @@ a.box:active { .button.is-warning:focus:not(:active), .button.is-warning.is-focused:not(:active) { box-shadow: 0 0 0 0.125em rgba(255, 221, 87, 0.25); } .button.is-warning:active, .button.is-warning.is-active { - background-color: #ffd83d; + background-color: #ffd83e; border-color: transparent; color: rgba(0, 0, 0, 0.7); } .button.is-warning[disabled], @@ -1954,7 +1954,7 @@ a.box:active { .button.is-static { background-color: whitesmoke; border-color: #dbdbdb; - color: #7a7a7a; + color: #6b6b6b; box-shadow: none; pointer-events: none; } .button.is-rounded, #documenter .docs-sidebar form.docs-search > input.button { @@ -2862,7 +2862,7 @@ a.tag:hover, .docstring > section > a.docs-sourcelink:hover { background-color: whitesmoke; border-color: whitesmoke; box-shadow: none; - color: #7a7a7a; } + color: #6b6b6b; } .input[disabled]::-moz-placeholder, #documenter .docs-sidebar form.docs-search > input[disabled]::-moz-placeholder, .textarea[disabled]::-moz-placeholder, .select select[disabled]::-moz-placeholder, fieldset[disabled] .input::-moz-placeholder, fieldset[disabled] #documenter .docs-sidebar form.docs-search > input::-moz-placeholder, @@ -2870,7 +2870,7 @@ a.tag:hover, .docstring > section > a.docs-sourcelink:hover { fieldset[disabled] .textarea::-moz-placeholder, fieldset[disabled] .select select::-moz-placeholder, .select fieldset[disabled] select::-moz-placeholder { - color: rgba(122, 122, 122, 0.3); } + color: rgba(107, 107, 107, 0.3); } .input[disabled]::-webkit-input-placeholder, #documenter .docs-sidebar form.docs-search > input[disabled]::-webkit-input-placeholder, .textarea[disabled]::-webkit-input-placeholder, .select select[disabled]::-webkit-input-placeholder, fieldset[disabled] .input::-webkit-input-placeholder, fieldset[disabled] #documenter .docs-sidebar form.docs-search > input::-webkit-input-placeholder, @@ -2878,7 +2878,7 @@ a.tag:hover, .docstring > section > a.docs-sourcelink:hover { fieldset[disabled] .textarea::-webkit-input-placeholder, fieldset[disabled] .select select::-webkit-input-placeholder, .select fieldset[disabled] select::-webkit-input-placeholder { - color: rgba(122, 122, 122, 0.3); } + color: rgba(107, 107, 107, 0.3); } .input[disabled]:-moz-placeholder, #documenter .docs-sidebar form.docs-search > input[disabled]:-moz-placeholder, .textarea[disabled]:-moz-placeholder, .select select[disabled]:-moz-placeholder, fieldset[disabled] .input:-moz-placeholder, fieldset[disabled] #documenter .docs-sidebar form.docs-search > input:-moz-placeholder, @@ -2886,7 +2886,7 @@ a.tag:hover, .docstring > section > a.docs-sourcelink:hover { fieldset[disabled] .textarea:-moz-placeholder, fieldset[disabled] .select select:-moz-placeholder, .select fieldset[disabled] select:-moz-placeholder { - color: rgba(122, 122, 122, 0.3); } + color: rgba(107, 107, 107, 0.3); } .input[disabled]:-ms-input-placeholder, #documenter .docs-sidebar form.docs-search > input[disabled]:-ms-input-placeholder, .textarea[disabled]:-ms-input-placeholder, .select select[disabled]:-ms-input-placeholder, fieldset[disabled] .input:-ms-input-placeholder, fieldset[disabled] #documenter .docs-sidebar form.docs-search > input:-ms-input-placeholder, @@ -2894,7 +2894,7 @@ a.tag:hover, .docstring > section > a.docs-sourcelink:hover { fieldset[disabled] .textarea:-ms-input-placeholder, fieldset[disabled] .select select:-ms-input-placeholder, .select fieldset[disabled] select:-ms-input-placeholder { - color: rgba(122, 122, 122, 0.3); } + color: rgba(107, 107, 107, 0.3); } .input, #documenter .docs-sidebar form.docs-search > input, .textarea { box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.1); @@ -2994,7 +2994,7 @@ a.tag:hover, .docstring > section > a.docs-sourcelink:hover { .checkbox[disabled], .radio[disabled], fieldset[disabled] .checkbox, fieldset[disabled] .radio { - color: #7a7a7a; + color: #6b6b6b; cursor: not-allowed; } .radio + .radio { @@ -3087,7 +3087,7 @@ a.tag:hover, .docstring > section > a.docs-sourcelink:hover { .select.is-info select { border-color: #209cee; } .select.is-info select:hover, .select.is-info select.is-hovered { - border-color: #118fe4; } + border-color: #1190e3; } .select.is-info select:focus, .select.is-info select.is-focused, .select.is-info select:active, .select.is-info select.is-active { box-shadow: 0 0 0 0.125em rgba(32, 156, 238, 0.25); } .select.is-success:not(:hover)::after { @@ -3103,7 +3103,7 @@ a.tag:hover, .docstring > section > a.docs-sourcelink:hover { .select.is-warning select { border-color: #ffdd57; } .select.is-warning select:hover, .select.is-warning select.is-hovered { - border-color: #ffd83d; } + border-color: #ffd83e; } .select.is-warning select:focus, .select.is-warning select.is-focused, .select.is-warning select:active, .select.is-warning select.is-active { box-shadow: 0 0 0 0.125em rgba(255, 221, 87, 0.25); } .select.is-danger:not(:hover)::after { @@ -3122,7 +3122,7 @@ a.tag:hover, .docstring > section > a.docs-sourcelink:hover { .select.is-large { font-size: 1.5rem; } .select.is-disabled::after { - border-color: #7a7a7a; } + border-color: #6b6b6b; } .select.is-fullwidth { width: 100%; } .select.is-fullwidth select { @@ -3246,7 +3246,7 @@ a.tag:hover, .docstring > section > a.docs-sourcelink:hover { border-color: transparent; color: #fff; } .file.is-info:hover .file-cta, .file.is-info.is-hovered .file-cta { - background-color: #1496ed; + background-color: #1497ed; border-color: transparent; color: #fff; } .file.is-info:focus .file-cta, .file.is-info.is-focused .file-cta { @@ -3254,7 +3254,7 @@ a.tag:hover, .docstring > section > a.docs-sourcelink:hover { box-shadow: 0 0 0.5em rgba(32, 156, 238, 0.25); color: #fff; } .file.is-info:active .file-cta, .file.is-info.is-active .file-cta { - background-color: #118fe4; + background-color: #1190e3; border-color: transparent; color: #fff; } .file.is-success .file-cta { @@ -3278,7 +3278,7 @@ a.tag:hover, .docstring > section > a.docs-sourcelink:hover { border-color: transparent; color: rgba(0, 0, 0, 0.7); } .file.is-warning:hover .file-cta, .file.is-warning.is-hovered .file-cta { - background-color: #ffdb4a; + background-color: #ffda4a; border-color: transparent; color: rgba(0, 0, 0, 0.7); } .file.is-warning:focus .file-cta, .file.is-warning.is-focused .file-cta { @@ -3286,7 +3286,7 @@ a.tag:hover, .docstring > section > a.docs-sourcelink:hover { box-shadow: 0 0 0.5em rgba(255, 221, 87, 0.25); color: rgba(0, 0, 0, 0.7); } .file.is-warning:active .file-cta, .file.is-warning.is-active .file-cta { - background-color: #ffd83d; + background-color: #ffd83e; border-color: transparent; color: rgba(0, 0, 0, 0.7); } .file.is-danger .file-cta { @@ -3630,7 +3630,7 @@ a.tag:hover, .docstring > section > a.docs-sourcelink:hover { .control.has-icons-left .input:focus ~ .icon, .control.has-icons-left #documenter .docs-sidebar form.docs-search > input:focus ~ .icon, #documenter .docs-sidebar .control.has-icons-left form.docs-search > input:focus ~ .icon, .control.has-icons-left .select:focus ~ .icon, .control.has-icons-right .input:focus ~ .icon, .control.has-icons-right #documenter .docs-sidebar form.docs-search > input:focus ~ .icon, #documenter .docs-sidebar .control.has-icons-right form.docs-search > input:focus ~ .icon, .control.has-icons-right .select:focus ~ .icon { - color: #7a7a7a; } + color: #6b6b6b; } .control.has-icons-left .input.is-small ~ .icon, .control.has-icons-left #documenter .docs-sidebar form.docs-search > input ~ .icon, #documenter .docs-sidebar .control.has-icons-left form.docs-search > input ~ .icon, .control.has-icons-left .select.is-small ~ .icon, .control.has-icons-left #documenter .docs-sidebar form.docs-search > input.select ~ .icon, @@ -4021,7 +4021,7 @@ a.list-item { padding-left: 0.75em; } .menu-label { - color: #7a7a7a; + color: #6b6b6b; font-size: 0.75em; letter-spacing: 0.1em; text-transform: uppercase; } @@ -4100,7 +4100,7 @@ a.list-item { color: #fff; } .message.is-info .message-body { border-color: #209cee; - color: #12537e; } + color: #12537d; } .message.is-success { background-color: #f6fdf9; } .message.is-success .message-header { @@ -4116,7 +4116,7 @@ a.list-item { color: rgba(0, 0, 0, 0.7); } .message.is-warning .message-body { border-color: #ffdd57; - color: #3b3108; } + color: #3c3108; } .message.is-danger { background-color: #fff5f5; } .message.is-danger .message-header { @@ -4562,7 +4562,7 @@ a.list-item { .navbar.is-info .navbar-brand .navbar-link:focus, .navbar.is-info .navbar-brand .navbar-link:hover, .navbar.is-info .navbar-brand .navbar-link.is-active { - background-color: #118fe4; + background-color: #1190e3; color: #fff; } .navbar.is-info .navbar-brand .navbar-link::after { border-color: #fff; } @@ -4584,7 +4584,7 @@ a.list-item { .navbar.is-info .navbar-end .navbar-link:focus, .navbar.is-info .navbar-end .navbar-link:hover, .navbar.is-info .navbar-end .navbar-link.is-active { - background-color: #118fe4; + background-color: #1190e3; color: #fff; } .navbar.is-info .navbar-start .navbar-link::after, .navbar.is-info .navbar-end .navbar-link::after { @@ -4592,7 +4592,7 @@ a.list-item { .navbar.is-info .navbar-item.has-dropdown:focus .navbar-link, .navbar.is-info .navbar-item.has-dropdown:hover .navbar-link, .navbar.is-info .navbar-item.has-dropdown.is-active .navbar-link { - background-color: #118fe4; + background-color: #1190e3; color: #fff; } .navbar.is-info .navbar-dropdown a.navbar-item.is-active { background-color: #209cee; @@ -4652,7 +4652,7 @@ a.list-item { .navbar.is-warning .navbar-brand .navbar-link:focus, .navbar.is-warning .navbar-brand .navbar-link:hover, .navbar.is-warning .navbar-brand .navbar-link.is-active { - background-color: #ffd83d; + background-color: #ffd83e; color: rgba(0, 0, 0, 0.7); } .navbar.is-warning .navbar-brand .navbar-link::after { border-color: rgba(0, 0, 0, 0.7); } @@ -4674,7 +4674,7 @@ a.list-item { .navbar.is-warning .navbar-end .navbar-link:focus, .navbar.is-warning .navbar-end .navbar-link:hover, .navbar.is-warning .navbar-end .navbar-link.is-active { - background-color: #ffd83d; + background-color: #ffd83e; color: rgba(0, 0, 0, 0.7); } .navbar.is-warning .navbar-start .navbar-link::after, .navbar.is-warning .navbar-end .navbar-link::after { @@ -4682,7 +4682,7 @@ a.list-item { .navbar.is-warning .navbar-item.has-dropdown:focus .navbar-link, .navbar.is-warning .navbar-item.has-dropdown:hover .navbar-link, .navbar.is-warning .navbar-item.has-dropdown.is-active .navbar-link { - background-color: #ffd83d; + background-color: #ffd83e; color: rgba(0, 0, 0, 0.7); } .navbar.is-warning .navbar-dropdown a.navbar-item.is-active { background-color: #ffdd57; @@ -5119,7 +5119,7 @@ a.navbar-item, .pagination-previous:focus, .pagination-next:focus, .pagination-link:focus { - border-color: #2e63b8; } + border-color: #3c5dcd; } .pagination-previous:active, .pagination-next:active, .pagination-link:active { @@ -5130,7 +5130,7 @@ a.navbar-item, background-color: #dbdbdb; border-color: #dbdbdb; box-shadow: none; - color: #7a7a7a; + color: #6b6b6b; opacity: 0.5; } .pagination-previous, @@ -5267,7 +5267,7 @@ label.panel-block { text-align: center; vertical-align: top; width: 1em; - color: #7a7a7a; + color: #6b6b6b; margin-right: 0.75em; } .panel-icon .fa { font-size: inherit; @@ -6868,7 +6868,7 @@ label.panel-block { .hero.is-info a.navbar-item:hover, .hero.is-info a.navbar-item.is-active, .hero.is-info .navbar-link:hover, .hero.is-info .navbar-link.is-active { - background-color: #118fe4; + background-color: #1190e3; color: #fff; } .hero.is-info .tabs a { color: #fff; @@ -6886,10 +6886,10 @@ label.panel-block { border-color: #fff; color: #209cee; } .hero.is-info.is-bold { - background-image: linear-gradient(141deg, #04a6d7 0%, #209cee 71%, #3287f5 100%); } + background-image: linear-gradient(141deg, #05a6d6 0%, #209cee 71%, #3287f5 100%); } @media screen and (max-width: 768px) { .hero.is-info.is-bold .navbar-menu { - background-image: linear-gradient(141deg, #04a6d7 0%, #209cee 71%, #3287f5 100%); } } + background-image: linear-gradient(141deg, #05a6d6 0%, #209cee 71%, #3287f5 100%); } } .hero.is-success { background-color: #22c35b; color: #fff; } @@ -6956,7 +6956,7 @@ label.panel-block { .hero.is-warning a.navbar-item:hover, .hero.is-warning a.navbar-item.is-active, .hero.is-warning .navbar-link:hover, .hero.is-warning .navbar-link.is-active { - background-color: #ffd83d; + background-color: #ffd83e; color: rgba(0, 0, 0, 0.7); } .hero.is-warning .tabs a { color: rgba(0, 0, 0, 0.7); @@ -6974,10 +6974,10 @@ label.panel-block { border-color: rgba(0, 0, 0, 0.7); color: #ffdd57; } .hero.is-warning.is-bold { - background-image: linear-gradient(141deg, #ffaf24 0%, #ffdd57 71%, #fffa70 100%); } + background-image: linear-gradient(141deg, #ffae24 0%, #ffdd57 71%, #fffa71 100%); } @media screen and (max-width: 768px) { .hero.is-warning.is-bold .navbar-menu { - background-image: linear-gradient(141deg, #ffaf24 0%, #ffdd57 71%, #fffa70 100%); } } + background-image: linear-gradient(141deg, #ffae24 0%, #ffdd57 71%, #fffa71 100%); } } .hero.is-danger { background-color: #da0b00; color: #fff; } @@ -7138,7 +7138,7 @@ h1:hover .docs-heading-anchor-permalink, h2:hover .docs-heading-anchor-permalink .admonition.is-default > .admonition-body { color: #fff; } .admonition.is-info { - background-color: #def0fd; + background-color: #def0fc; border-color: #209cee; } .admonition.is-info > .admonition-header { background-color: #209cee; @@ -7234,8 +7234,12 @@ h1:hover .docs-heading-anchor-permalink, h2:hover .docs-heading-anchor-permalink position: absolute; right: 0.625rem; bottom: 0.5rem; } + .docstring > section > a.docs-sourcelink:focus { + opacity: 1 !important; } .docstring:hover > section > a.docs-sourcelink { opacity: 0.2; } + .docstring:focus-within > section > a.docs-sourcelink { + opacity: 0.2; } .docstring > section:hover a.docs-sourcelink { opacity: 1; } @@ -7311,6 +7315,9 @@ html { -moz-osx-font-smoothing: auto; -webkit-font-smoothing: auto; } +li.no-marker { + list-style: none; } + /* This file contain the overall layout. * * The main container is
that is identified by id #documenter. @@ -7318,7 +7325,8 @@ html { #documenter .docs-main > article { overflow-wrap: break-word; } #documenter .docs-main > article .math-container { - overflow-x: auto; } + overflow-x: auto; + overflow-y: hidden; } @media screen and (min-width: 1056px) { #documenter .docs-main { @@ -7582,6 +7590,130 @@ html { #documenter .docs-main #documenter-search-results .docs-highlight { background-color: yellow; } +.ansi span.sgr1 { + font-weight: bolder; } + +.ansi span.sgr2 { + font-weight: lighter; } + +.ansi span.sgr3 { + font-style: italic; } + +.ansi span.sgr4 { + text-decoration: underline; } + +.ansi span.sgr7 { + color: white; + background-color: #222222; } + +.ansi span.sgr8 { + color: transparent; } + .ansi span.sgr8 span { + color: transparent; } + +.ansi span.sgr9 { + text-decoration: line-through; } + +.ansi span.sgr30 { + color: #242424; } + +.ansi span.sgr31 { + color: #a7201f; } + +.ansi span.sgr32 { + color: #066f00; } + +.ansi span.sgr33 { + color: #856b00; } + +.ansi span.sgr34 { + color: #2149b0; } + +.ansi span.sgr35 { + color: #7d4498; } + +.ansi span.sgr36 { + color: #007989; } + +.ansi span.sgr37 { + color: gray; } + +.ansi span.sgr40 { + background-color: #242424; } + +.ansi span.sgr41 { + background-color: #a7201f; } + +.ansi span.sgr42 { + background-color: #066f00; } + +.ansi span.sgr43 { + background-color: #856b00; } + +.ansi span.sgr44 { + background-color: #2149b0; } + +.ansi span.sgr45 { + background-color: #7d4498; } + +.ansi span.sgr46 { + background-color: #007989; } + +.ansi span.sgr47 { + background-color: gray; } + +.ansi span.sgr90 { + color: #616161; } + +.ansi span.sgr91 { + color: #cb3c33; } + +.ansi span.sgr92 { + color: #0e8300; } + +.ansi span.sgr93 { + color: #a98800; } + +.ansi span.sgr94 { + color: #3c5dcd; } + +.ansi span.sgr95 { + color: #9256af; } + +.ansi span.sgr96 { + color: #008fa3; } + +.ansi span.sgr97 { + color: whitesmoke; } + +.ansi span.sgr100 { + background-color: #616161; } + +.ansi span.sgr101 { + background-color: #cb3c33; } + +.ansi span.sgr102 { + background-color: #0e8300; } + +.ansi span.sgr103 { + background-color: #a98800; } + +.ansi span.sgr104 { + background-color: #3c5dcd; } + +.ansi span.sgr105 { + background-color: #9256af; } + +.ansi span.sgr106 { + background-color: #008fa3; } + +.ansi span.sgr107 { + background-color: whitesmoke; } + +code.language-julia-repl > span.hljs-meta { + color: #066f00; + font-weight: bolder; } + /*! Theme: Default Description: Original highlight.js style diff --git a/dev/index.html b/dev/index.html index 1fe24e5..724fbdf 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,2 +1,2 @@ -Home · XAM.jl

XAM.jl

Project Status: Active – The project has reached a stable, usable state and is being actively developed. Latest Release MIT license Stable documentation Latest documentation Join the chat at https://gitter.im/BioJulia/XAM.jl

This project follows the semver pro forma and uses the git-flow branching model.

Description

The XAM package provides I/O and utilities for manipulating SAM and BAM formatted alignment map files.

Installation

You can install the XAM package from the Julia REPL. Press ] to enter pkg mode, then enter the following command:

add XAM

If you are interested in the cutting edge of the development, please check out the develop branch to try new features before release.

Testing

XAM is tested against Julia 1.X on Linux, OS X, and Windows.

Latest build status:

Unit tests Documentation codecov

Contributing

We appreciate contributions from users including reporting bugs, fixing issues, improving performance and adding new features.

Take a look at the contributing files detailed contributor and maintainer guidelines, and code of conduct.

Financial contributions

We also welcome financial contributions in full transparency on our open collective. Anyone can file an expense. If the expense makes sense for the development the core contributors and the person who filed the expense will be reimbursed.

Backers & Sponsors

Thank you to all our backers and sponsors!

Love our work and community? Become a backer.

backers

Does your company use BioJulia? Help keep BioJulia feature rich and healthy by sponsoring the project. Your logo will show up here with a link to your website.

Questions?

If you have a question about contributing or using BioJulia software, come on over and chat to us on Gitter, or you can try the Bio category of the Julia discourse site.

+Home · XAM.jl

XAM.jl

Project Status: Active – The project has reached a stable, usable state and is being actively developed. Latest Release MIT license Stable documentation Latest documentation Join the chat at https://gitter.im/BioJulia/XAM.jl

This project follows the semver pro forma and uses the git-flow branching model.

Description

The XAM package provides I/O and utilities for manipulating SAM and BAM formatted alignment map files.

Installation

You can install the XAM package from the Julia REPL. Press ] to enter pkg mode, then enter the following command:

add XAM

If you are interested in the cutting edge of the development, please check out the develop branch to try new features before release.

Testing

XAM is tested against Julia 1.X on Linux, OS X, and Windows.

Latest build status:

Unit tests Documentation codecov

Contributing

We appreciate contributions from users including reporting bugs, fixing issues, improving performance and adding new features.

Take a look at the contributing files detailed contributor and maintainer guidelines, and code of conduct.

Financial contributions

We also welcome financial contributions in full transparency on our open collective. Anyone can file an expense. If the expense makes sense for the development the core contributors and the person who filed the expense will be reimbursed.

Backers & Sponsors

Thank you to all our backers and sponsors!

Love our work and community? Become a backer.

backers

Does your company use BioJulia? Help keep BioJulia feature rich and healthy by sponsoring the project. Your logo will show up here with a link to your website.

Questions?

If you have a question about contributing or using BioJulia software, come on over and chat to us on Gitter, or you can try the Bio category of the Julia discourse site.

diff --git a/dev/man/api/index.html b/dev/man/api/index.html index c7dbaeb..acda14b 100644 --- a/dev/man/api/index.html +++ b/dev/man/api/index.html @@ -1,5 +1,5 @@ -API Reference · XAM.jl

API Reference

SAM API

Public

XAM.SAM.MetaInfoMethod
MetaInfo(tag::AbstractString, value)

Create a SAM metainfo with tag and value.

tag is a two-byte ASCII string. If tag is "CO", value must be a string; otherwise, value is an iterable object with key and value pairs.

Examples

julia> SAM.MetaInfo("CO", "some comment")
+API Reference · XAM.jl

API Reference

SAM API

Public

XAM.SAM.MetaInfoMethod
MetaInfo(tag::AbstractString, value)

Create a SAM metainfo with tag and value.

tag is a two-byte ASCII string. If tag is "CO", value must be a string; otherwise, value is an iterable object with key and value pairs.

Examples

julia> SAM.MetaInfo("CO", "some comment")
 BioAlignments.SAM.MetaInfo:
     tag: CO
   value: some comment
@@ -13,7 +13,7 @@ BioAlignments.SAM.MetaInfo:
   value: SN=chr1 LN=12345
 
 julia> string(ans)
-"@SQ	SN:chr1	LN:12345"
source
XAM.SAM.MetaInfoMethod
MetaInfo(str::AbstractString)

Create a SAM metainfo from str.

Examples

julia> SAM.MetaInfo("@CO	some comment")
+"@SQ	SN:chr1	LN:12345"
source
XAM.SAM.MetaInfoMethod
MetaInfo(str::AbstractString)

Create a SAM metainfo from str.

Examples

julia> SAM.MetaInfo("@CO	some comment")
 BioAlignments.SAM.MetaInfo:
     tag: CO
   value: some comment
@@ -21,4 +21,4 @@ BioAlignments.SAM.MetaInfo:
 julia> SAM.MetaInfo("@SQ	SN:chr1	LN:12345")
 BioAlignments.SAM.MetaInfo:
     tag: SQ
-  value: SN=chr1 LN=12345
source
XAM.SAM.ReaderMethod
SAM.Reader(input::IO)

Create a data reader of the SAM file format.

Arguments

  • input: data source
source
XAM.SAM.RecordMethod
SAM.Record(str::AbstractString)

Create a SAM record from str. This function verifies the format and indexes fields for accessors.

source
XAM.SAM.RecordMethod
SAM.Record(data::Vector{UInt8})

Create a SAM record from data. This function verifies the format and indexes fields for accessors. Note that the ownership of data is transferred to a new record object.

source
XAM.SAM.WriterType
Writer(output::IO, header::Header=Header())

Create a data writer of the SAM file format.

Arguments

  • output: data sink
  • header=Header(): SAM header object
source
Base.findallMethod
find(header::Header, key::AbstractString)::Vector{MetaInfo}

Find metainfo objects satisfying SAM.tag(metainfo) == key.

source
Base.read!Method
read!(rdr::Reader, rec::Record)

Read a Record into rec; overwriting or adding to existing field values. It is assumed that rec is already initialized or empty.

source
XAM.SAM.auxdataMethod
auxdata(record::Record)::Dict{String,Any}

Get the auxiliary data (optional fields) of record.

source
XAM.SAM.iscommentMethod
iscomment(metainfo::MetaInfo)::Bool

Test if metainfo is a comment (i.e. its tag is "CO").

source
XAM.SAM.isprimaryMethod
isprimary(record::Record)::Bool

Test if record is a primary line of the read.

This is equivalent to flag(record) & 0x900 == 0.

source
XAM.SAM.keyvaluesMethod
keyvalues(metainfo::MetaInfo)::Vector{Pair{String,String}}

Get the values of metainfo as string pairs.

source
XAM.SAM.nextrefnameMethod
nextrefname(record::Record)::String

Get the reference name of the mate/next read of record.

source
XAM.SAM.positionMethod
position(record::Record)::Int

Get the 1-based leftmost mapping position of record.

source
XAM.SAM.qualityMethod
quality(::Type{String}, record::Record)::String

Get the ASCII-encoded base quality of record.

source
XAM.SAM.qualityMethod
quality(record::Record)::Vector{UInt8}

Get the Phred-scaled base quality of record.

source
XAM.SAM.refnameMethod
refname(record::Record)::String

Get the reference sequence name of record.

source
XAM.SAM.sequenceMethod
sequence(::Type{String}, record::Record)::String

Get the segment sequence of record as String.

source
XAM.SAM.sequenceMethod
sequence(record::Record)::BioSequences.LongDNASeq

Get the segment sequence of record.

source
XAM.SAM.valueMethod
value(metainfo::MetaInfo)::String

Get the value of metainfo as a string.

source

Internal

BAM API

Public

XAM.BAM.BAIMethod
BAI(filename::AbstractString)

Load a BAI index from filename.

source
XAM.BAM.ReaderType
BAM.Reader(input::IO; index=nothing)

Create a data reader of the BAM file format.

Arguments

  • input: data source
  • index=nothing: filepath to a random access index (currently bai is supported)
source
XAM.BAM.WriterType
BAM.Writer(output::BGZFStream, header::SAM.Header)

Create a data writer of the BAM file format.

Arguments

  • output: data sink
  • header: SAM header object
source
BioGenerics.headerMethod
header(reader::Reader; fillSQ::Bool=false)::SAM.Header

Get the header of reader.

If fillSQ is true, this function fills missing "SQ" metainfo in the header.

source
XAM.BAM.cigarFunction
cigar(record::Record)::String

Get the CIGAR string of record.

Note that in the BAM specification, the field called cigar 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: CG:B,I, and the cigar field stores a pseudo-cigar string.

Calling this method with checkCG set to true (default) this method will always yield the true cigar string, because this is probably what you want the vast majority of the time.

If you have a record that stores the true cigar in a CG:B,I tag, but you still want to access the pseudo-cigar that is stored in the cigar field of the BAM record, then you can set checkCG to false.

See also BAM.cigar_rle.

source
XAM.BAM.cigar_rleFunction
cigar_rle(record::Record, checkCG::Bool = true)::Tuple{Vector{BioAlignments.Operation},Vector{Int}}

Get a run-length encoded tuple (ops, lens) of the CIGAR string in record.

Note that in the BAM specification, the field called cigar 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: CG:B,I, and the cigar field stores a pseudo-cigar string.

Calling this method with checkCG set to true (default) this method will always yield the true cigar string, because this is probably what you want the vast majority of the time.

If you have a record that stores the true cigar in a CG:B,I tag, but you still want to access the pseudo-cigar that is stored in the cigar field of the BAM record, then you can set checkCG to false.

See also BAM.cigar.

source
XAM.BAM.ispositivestrandMethod
ispositivestrand(record::Record)::Bool

Test if record is aligned to the positive strand.

This is equivalent to flag(record) & 0x10 == 0.

source
XAM.BAM.isprimaryMethod
isprimary(record::Record)::Bool

Test if record is a primary line of the read.

This is equivalent to flag(record) & 0x900 == 0.

source
XAM.BAM.n_cigar_opFunction
n_cigar_op(record::Record, checkCG::Bool = true)

Return the number of operations in the CIGAR string of record.

Note that in the BAM specification, the field called cigar 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: CG:B,I, and the cigar field stores a pseudo-cigar string.

Calling this method with checkCG set to true (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.

If you have a record that stores the true cigar in a CG:B,I tag, but you still want to get the number of operations in the cigar field of the BAM record, then set checkCG to false.

source
XAM.BAM.nextpositionMethod
nextposition(record::Record)::Int

Get the 1-based leftmost mapping position of the next/mate read of record.

source
XAM.BAM.nextrefnameMethod
nextrefname(record::Record)::String

Get the reference name of the mate/next read of record.

source
XAM.BAM.positionMethod
position(record::Record)::Int

Get the 1-based leftmost mapping position of record.

source
XAM.BAM.refidMethod
refid(record::Record)::Int

Get the reference sequence ID of record.

The ID is 1-based (i.e. the first sequence is 1) and is 0 for a record without a mapping position.

See also: BAM.rname

source
XAM.BAM.reflenMethod
reflen(record::Record)::Int

Get the length of the reference sequence this record applies to.

source
XAM.BAM.refnameMethod
refname(record::Record)::String

Get the reference sequence name of record.

See also: BAM.refid

source
XAM.BAM.sequenceMethod
sequence(record::Record)::BioSequences.LongDNASeq

Get the segment sequence of record.

source

Internal

+ value: SN=chr1 LN=12345
source
XAM.SAM.ReaderMethod
SAM.Reader(input::IO)

Create a data reader of the SAM file format.

Arguments

  • input: data source
source
XAM.SAM.RecordMethod
SAM.Record(str::AbstractString)

Create a SAM record from str. This function verifies the format and indexes fields for accessors.

source
XAM.SAM.RecordMethod
SAM.Record(data::Vector{UInt8})

Create a SAM record from data. This function verifies the format and indexes fields for accessors. Note that the ownership of data is transferred to a new record object.

source
XAM.SAM.WriterType
Writer(output::IO, header::Header=Header())

Create a data writer of the SAM file format.

Arguments

  • output: data sink
  • header=Header(): SAM header object
source
Base.findallMethod
find(header::Header, key::AbstractString)::Vector{MetaInfo}

Find metainfo objects satisfying SAM.tag(metainfo) == key.

source
Base.read!Method
read!(rdr::Reader, rec::Record)

Read a Record into rec; overwriting or adding to existing field values. It is assumed that rec is already initialized or empty.

source
XAM.SAM.auxdataMethod
auxdata(record::Record)::Dict{String,Any}

Get the auxiliary data (optional fields) of record.

source
XAM.SAM.iscommentMethod
iscomment(metainfo::MetaInfo)::Bool

Test if metainfo is a comment (i.e. its tag is "CO").

source
XAM.SAM.isprimaryMethod
isprimary(record::Record)::Bool

Test if record is a primary line of the read.

This is equivalent to flag(record) & 0x900 == 0.

source
XAM.SAM.keyvaluesMethod
keyvalues(metainfo::MetaInfo)::Vector{Pair{String,String}}

Get the values of metainfo as string pairs.

source
XAM.SAM.nextrefnameMethod
nextrefname(record::Record)::String

Get the reference name of the mate/next read of record.

source
XAM.SAM.positionMethod
position(record::Record)::Int

Get the 1-based leftmost mapping position of record.

source
XAM.SAM.qualityMethod
quality(::Type{String}, record::Record)::String

Get the ASCII-encoded base quality of record.

source
XAM.SAM.qualityMethod
quality(record::Record)::Vector{UInt8}

Get the Phred-scaled base quality of record.

source
XAM.SAM.refnameMethod
refname(record::Record)::String

Get the reference sequence name of record.

source
XAM.SAM.sequenceMethod
sequence(::Type{String}, record::Record)::String

Get the segment sequence of record as String.

source
XAM.SAM.sequenceMethod
sequence(record::Record)::BioSequences.LongDNASeq

Get the segment sequence of record.

source
XAM.SAM.valueMethod
value(metainfo::MetaInfo)::String

Get the value of metainfo as a string.

source

Internal

BAM API

Public

XAM.BAM.BAIMethod
BAI(filename::AbstractString)

Load a BAI index from filename.

source
XAM.BAM.ReaderType
BAM.Reader(input::IO; index=nothing)

Create a data reader of the BAM file format.

Arguments

  • input: data source
  • index=nothing: filepath to a random access index (currently bai is supported)
source
XAM.BAM.WriterType
BAM.Writer(output::BGZFStream, header::SAM.Header)

Create a data writer of the BAM file format.

Arguments

  • output: data sink
  • header: SAM header object
source
BioGenerics.headerMethod
header(reader::Reader; fillSQ::Bool=false)::SAM.Header

Get the header of reader.

If fillSQ is true, this function fills missing "SQ" metainfo in the header.

source
XAM.BAM.cigarFunction
cigar(record::Record)::String

Get the CIGAR string of record.

Note that in the BAM specification, the field called cigar 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: CG:B,I, and the cigar field stores a pseudo-cigar string.

Calling this method with checkCG set to true (default) this method will always yield the true cigar string, because this is probably what you want the vast majority of the time.

If you have a record that stores the true cigar in a CG:B,I tag, but you still want to access the pseudo-cigar that is stored in the cigar field of the BAM record, then you can set checkCG to false.

See also BAM.cigar_rle.

source
XAM.BAM.cigar_rleFunction
cigar_rle(record::Record, checkCG::Bool = true)::Tuple{Vector{BioAlignments.Operation},Vector{Int}}

Get a run-length encoded tuple (ops, lens) of the CIGAR string in record.

Note that in the BAM specification, the field called cigar 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: CG:B,I, and the cigar field stores a pseudo-cigar string.

Calling this method with checkCG set to true (default) this method will always yield the true cigar string, because this is probably what you want the vast majority of the time.

If you have a record that stores the true cigar in a CG:B,I tag, but you still want to access the pseudo-cigar that is stored in the cigar field of the BAM record, then you can set checkCG to false.

See also BAM.cigar.

source
XAM.BAM.ispositivestrandMethod
ispositivestrand(record::Record)::Bool

Test if record is aligned to the positive strand.

This is equivalent to flag(record) & 0x10 == 0.

source
XAM.BAM.isprimaryMethod
isprimary(record::Record)::Bool

Test if record is a primary line of the read.

This is equivalent to flag(record) & 0x900 == 0.

source
XAM.BAM.n_cigar_opFunction
n_cigar_op(record::Record, checkCG::Bool = true)

Return the number of operations in the CIGAR string of record.

Note that in the BAM specification, the field called cigar 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: CG:B,I, and the cigar field stores a pseudo-cigar string.

Calling this method with checkCG set to true (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.

If you have a record that stores the true cigar in a CG:B,I tag, but you still want to get the number of operations in the cigar field of the BAM record, then set checkCG to false.

source
XAM.BAM.nextpositionMethod
nextposition(record::Record)::Int

Get the 1-based leftmost mapping position of the next/mate read of record.

source
XAM.BAM.nextrefnameMethod
nextrefname(record::Record)::String

Get the reference name of the mate/next read of record.

source
XAM.BAM.positionMethod
position(record::Record)::Int

Get the 1-based leftmost mapping position of record.

source
XAM.BAM.refidMethod
refid(record::Record)::Int

Get the reference sequence ID of record.

The ID is 1-based (i.e. the first sequence is 1) and is 0 for a record without a mapping position.

See also: BAM.rname

source
XAM.BAM.reflenMethod
reflen(record::Record)::Int

Get the length of the reference sequence this record applies to.

source
XAM.BAM.refnameMethod
refname(record::Record)::String

Get the reference sequence name of record.

See also: BAM.refid

source
XAM.BAM.sequenceMethod
sequence(record::Record)::BioSequences.LongDNASeq

Get the segment sequence of record.

source

Internal

diff --git a/dev/man/hts-files/index.html b/dev/man/hts-files/index.html index ad61899..34e7740 100644 --- a/dev/man/hts-files/index.html +++ b/dev/man/hts-files/index.html @@ -1,12 +1,12 @@ -SAM and BAM · XAM.jl

SAM and BAM

Introduction

The XAM package offers high-performance tools for SAM and BAM file formats, which are the most popular file formats.

If you have questions about the SAM and BAM formats or any of the terminology used when discussing these formats, see the published specification, which is maintained by the samtools group.

A very very simple SAM file looks like the following:

@HD VN:1.6 SO:coordinate
+SAM and BAM · XAM.jl

SAM and BAM

Introduction

The XAM package offers high-performance tools for SAM and BAM file formats, which are the most popular file formats.

If you have questions about the SAM and BAM formats or any of the terminology used when discussing these formats, see the published specification, which is maintained by the samtools group.

A very very simple SAM file looks like the following:

@HD VN:1.6 SO:coordinate
 @SQ SN:ref LN:45
 r001   99 ref  7 30 8M2I4M1D3M = 37  39 TTAGATAAAGGATACTG *
 r002    0 ref  9 30 3S6M1P1I4M *  0   0 AAAAGATAAGGATA    *
 r003    0 ref  9 30 5S6M       *  0   0 GCCTAAGCTAA       * SA:Z:ref,29,-,6H5M,17,0;
 r004    0 ref 16 30 6M14N5M    *  0   0 ATAGCTTCAGC       *
 r003 2064 ref 29 17 6H5M       *  0   0 TAGGC             * SA:Z:ref,9,+,5S6M,30,1;
-r001  147 ref 37 30 9M         =  7 -39 CAGCGGCAT         * NM:i:1

Where the first two lines are part of the "header", and the following lines are "records". Each record describes how a read aligns to some reference sequence. Sometimes one record describes one read, but there are other cases like chimeric reads and split alignments, where multiple records apply to one read. In the example above, r003 is a chimeric read, and r004 is a split alignment, and r001 are mate pair reads. Again, we refer you to the official specification for more details.

A BAM file stores this same information but in a binary and compressible format that does not make for pretty printing here!

Reading SAM and BAM files

A typical script iterating over all records in a file looks like below:

using XAM
+r001  147 ref 37 30 9M         =  7 -39 CAGCGGCAT         * NM:i:1

Where the first two lines are part of the "header", and the following lines are "records". Each record describes how a read aligns to some reference sequence. Sometimes one record describes one read, but there are other cases like chimeric reads and split alignments, where multiple records apply to one read. In the example above, r003 is a chimeric read, and r004 is a split alignment, and r001 are mate pair reads. Again, we refer you to the official specification for more details.

A BAM file stores this same information but in a binary and compressible format that does not make for pretty printing here!

Reading SAM and BAM files

A typical script iterating over all records in a file looks like below:

using XAM
 
 # Open a BAM file.
 reader = open(BAM.Reader, "data.bam")
@@ -21,13 +21,13 @@ for record in reader
 end
 
 # Close the BAM file.
-close(reader)

The size of a BAM file is often extremely large. The iterator interface demonstrated above allocates an object for each record and that may be a bottleneck of reading data from a BAM file. In-place reading reuses a pre-allocated object for every record and less memory allocation happens in reading:

reader = open(BAM.Reader, "data.bam")
+close(reader)

The size of a BAM file is often extremely large. The iterator interface demonstrated above allocates an object for each record and that may be a bottleneck of reading data from a BAM file. In-place reading reuses a pre-allocated object for every record and less memory allocation happens in reading:

reader = open(BAM.Reader, "data.bam")
 record = BAM.Record()
 while !eof(reader)
     empty!(record)
     read!(reader, record)
     # do something
-end

SAM and BAM Headers

Both SAM.Reader and BAM.Reader implement the header function, which returns a SAM.Header object. To extract certain information out of the headers, you can use the find method on the header to extract information according to SAM/BAM tag. Again we refer you to the specification for full details of all the different tags that can occur in headers, and what they mean.

Below is an example of extracting all the info about the reference sequences from the BAM header. In SAM/BAM, any description of a reference sequence is stored in the header, under a tag denoted SQ (think reference SeQuence!).

julia> reader = open(SAM.Reader, "data.sam");
+end

SAM and BAM Headers

Both SAM.Reader and BAM.Reader implement the header function, which returns a SAM.Header object. To extract certain information out of the headers, you can use the find method on the header to extract information according to SAM/BAM tag. Again we refer you to the specification for full details of all the different tags that can occur in headers, and what they mean.

Below is an example of extracting all the info about the reference sequences from the BAM header. In SAM/BAM, any description of a reference sequence is stored in the header, under a tag denoted SQ (think reference SeQuence!).

julia> reader = open(SAM.Reader, "data.sam");
 
 julia> find(header(reader), "SQ")
 7-element Array{Bio.Align.SAM.MetaInfo,1}:
@@ -52,17 +52,17 @@ julia> find(header(reader), "SQ")
  Bio.Align.SAM.MetaInfo:
     tag: SQ
   value: SN=mitochondria LN=366924
-

In the above we can see there were 7 sequences in the reference: 5 chromosomes, one chloroplast sequence, and one mitochondrial sequence.

SAM and BAM Records

SAM.Record

The XAM package supports the following accessors for SAM.Record types.

XAM.SAM.flagFunction
flag(record::Record)::UInt16

Get the bitwise flag of record.

source
XAM.SAM.isprimaryFunction
isprimary(record::Record)::Bool

Test if record is a primary line of the read.

This is equivalent to flag(record) & 0x900 == 0.

source
XAM.SAM.refnameFunction
refname(record::Record)::String

Get the reference sequence name of record.

source
XAM.SAM.positionFunction
position(record::Record)::Int

Get the 1-based leftmost mapping position of record.

source
XAM.SAM.nextrefnameFunction
nextrefname(record::Record)::String

Get the reference name of the mate/next read of record.

source
XAM.SAM.sequenceFunction
sequence(record::Record)::BioSequences.LongDNASeq

Get the segment sequence of record.

source
sequence(::Type{String}, record::Record)::String

Get the segment sequence of record as String.

source
XAM.SAM.qualityFunction
quality(record::Record)::Vector{UInt8}

Get the Phred-scaled base quality of record.

source
quality(::Type{String}, record::Record)::String

Get the ASCII-encoded base quality of record.

source
XAM.SAM.auxdataFunction
auxdata(record::Record)::Dict{String,Any}

Get the auxiliary data (optional fields) of record.

source

BAM.Record

The XAM package supports the following accessors for BAM.Record types.

XAM.BAM.flagFunction
flag(record::Record)::UInt16

Get the bitwise flag of record.

source
XAM.BAM.isprimaryFunction
isprimary(record::Record)::Bool

Test if record is a primary line of the read.

This is equivalent to flag(record) & 0x900 == 0.

source
XAM.BAM.refidFunction
refid(record::Record)::Int

Get the reference sequence ID of record.

The ID is 1-based (i.e. the first sequence is 1) and is 0 for a record without a mapping position.

See also: BAM.rname

source
XAM.BAM.refnameFunction
refname(record::Record)::String

Get the reference sequence name of record.

See also: BAM.refid

source
XAM.BAM.reflenFunction
reflen(record::Record)::Int

Get the length of the reference sequence this record applies to.

source
XAM.BAM.positionFunction
position(record::Record)::Int

Get the 1-based leftmost mapping position of record.

source
XAM.BAM.nextrefidFunction
nextrefid(record::Record)::Int

Get the next/mate reference sequence ID of record.

source
XAM.BAM.nextrefnameFunction
nextrefname(record::Record)::String

Get the reference name of the mate/next read of record.

source
XAM.BAM.nextpositionFunction
nextposition(record::Record)::Int

Get the 1-based leftmost mapping position of the next/mate read of record.

source
XAM.BAM.cigarFunction
cigar(record::Record)::String

Get the CIGAR string of record.

Note that in the BAM specification, the field called cigar 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: CG:B,I, and the cigar field stores a pseudo-cigar string.

Calling this method with checkCG set to true (default) this method will always yield the true cigar string, because this is probably what you want the vast majority of the time.

If you have a record that stores the true cigar in a CG:B,I tag, but you still want to access the pseudo-cigar that is stored in the cigar field of the BAM record, then you can set checkCG to false.

See also BAM.cigar_rle.

source
XAM.BAM.sequenceFunction
sequence(record::Record)::BioSequences.LongDNASeq

Get the segment sequence of record.

source

Accessing auxiliary data

SAM and BAM records support the storing of optional data fields associated with tags.

Tagged auxiliary data follows a format of TAG:TYPE:VALUE. TAG is a two-letter string, and each tag can only appear once per record. TYPE is a single case-sensetive letter which defined the format of VALUE.

TypeDescription
'A'Printable character
'i'Signed integer
'f'Single-precision floating number
'Z'Printable string, including space
'H'Byte array in Hex format
'B'Integer of numeric array

For more information about these tags and their types we refer you to the SAM/BAM specification and the additional optional fields specification document.

There are some tags that are reserved, predefined standard tags, for specific uses.

To access optional fields stored in tags, you use getindex indexing syntax on the record object. Note that accessing optional tag fields will result in type instability in Julia. This is because the type of the optional data is not known until run-time, as the tag is being read. This can have a significant impact on performance. To limit this, if the user knows the type of a value in advance, specifying it as a type annotation will alleviate the problem:

Below is an example of looping over records in a bam file and using indexing syntax to get the data stored in the "NM" tag. Note the UInt8 type assertion to alleviate type instability.

for record in open(BAM.Reader, "data.bam")
+

In the above we can see there were 7 sequences in the reference: 5 chromosomes, one chloroplast sequence, and one mitochondrial sequence.

SAM and BAM Records

SAM.Record

The XAM package supports the following accessors for SAM.Record types.

XAM.SAM.flagFunction
flag(record::Record)::UInt16

Get the bitwise flag of record.

source
XAM.SAM.isprimaryFunction
isprimary(record::Record)::Bool

Test if record is a primary line of the read.

This is equivalent to flag(record) & 0x900 == 0.

source
XAM.SAM.refnameFunction
refname(record::Record)::String

Get the reference sequence name of record.

source
XAM.SAM.positionFunction
position(record::Record)::Int

Get the 1-based leftmost mapping position of record.

source
XAM.SAM.nextrefnameFunction
nextrefname(record::Record)::String

Get the reference name of the mate/next read of record.

source
XAM.SAM.sequenceFunction
sequence(record::Record)::BioSequences.LongDNASeq

Get the segment sequence of record.

source
sequence(::Type{String}, record::Record)::String

Get the segment sequence of record as String.

source
XAM.SAM.qualityFunction
quality(record::Record)::Vector{UInt8}

Get the Phred-scaled base quality of record.

source
quality(::Type{String}, record::Record)::String

Get the ASCII-encoded base quality of record.

source
XAM.SAM.auxdataFunction
auxdata(record::Record)::Dict{String,Any}

Get the auxiliary data (optional fields) of record.

source

BAM.Record

The XAM package supports the following accessors for BAM.Record types.

XAM.BAM.flagFunction
flag(record::Record)::UInt16

Get the bitwise flag of record.

source
XAM.BAM.isprimaryFunction
isprimary(record::Record)::Bool

Test if record is a primary line of the read.

This is equivalent to flag(record) & 0x900 == 0.

source
XAM.BAM.refidFunction
refid(record::Record)::Int

Get the reference sequence ID of record.

The ID is 1-based (i.e. the first sequence is 1) and is 0 for a record without a mapping position.

See also: BAM.rname

source
XAM.BAM.refnameFunction
refname(record::Record)::String

Get the reference sequence name of record.

See also: BAM.refid

source
XAM.BAM.reflenFunction
reflen(record::Record)::Int

Get the length of the reference sequence this record applies to.

source
XAM.BAM.positionFunction
position(record::Record)::Int

Get the 1-based leftmost mapping position of record.

source
XAM.BAM.nextrefidFunction
nextrefid(record::Record)::Int

Get the next/mate reference sequence ID of record.

source
XAM.BAM.nextrefnameFunction
nextrefname(record::Record)::String

Get the reference name of the mate/next read of record.

source
XAM.BAM.nextpositionFunction
nextposition(record::Record)::Int

Get the 1-based leftmost mapping position of the next/mate read of record.

source
XAM.BAM.cigarFunction
cigar(record::Record)::String

Get the CIGAR string of record.

Note that in the BAM specification, the field called cigar 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: CG:B,I, and the cigar field stores a pseudo-cigar string.

Calling this method with checkCG set to true (default) this method will always yield the true cigar string, because this is probably what you want the vast majority of the time.

If you have a record that stores the true cigar in a CG:B,I tag, but you still want to access the pseudo-cigar that is stored in the cigar field of the BAM record, then you can set checkCG to false.

See also BAM.cigar_rle.

source
XAM.BAM.sequenceFunction
sequence(record::Record)::BioSequences.LongDNASeq

Get the segment sequence of record.

source

Accessing auxiliary data

SAM and BAM records support the storing of optional data fields associated with tags.

Tagged auxiliary data follows a format of TAG:TYPE:VALUE. TAG is a two-letter string, and each tag can only appear once per record. TYPE is a single case-sensetive letter which defined the format of VALUE.

TypeDescription
'A'Printable character
'i'Signed integer
'f'Single-precision floating number
'Z'Printable string, including space
'H'Byte array in Hex format
'B'Integer of numeric array

For more information about these tags and their types we refer you to the SAM/BAM specification and the additional optional fields specification document.

There are some tags that are reserved, predefined standard tags, for specific uses.

To access optional fields stored in tags, you use getindex indexing syntax on the record object. Note that accessing optional tag fields will result in type instability in Julia. This is because the type of the optional data is not known until run-time, as the tag is being read. This can have a significant impact on performance. To limit this, if the user knows the type of a value in advance, specifying it as a type annotation will alleviate the problem:

Below is an example of looping over records in a bam file and using indexing syntax to get the data stored in the "NM" tag. Note the UInt8 type assertion to alleviate type instability.

for record in open(BAM.Reader, "data.bam")
     nm = record["NM"]::UInt8
     # do something
-end

Getting records in a range

The XAM package supports the BAI index to fetch records in a specific range from a BAM file. Samtools provides index subcommand to create an index file (.bai) from a sorted BAM file.

$ samtools index -b SRR1238088.sort.bam
+end

Getting records in a range

The XAM package supports the BAI index to fetch records in a specific range from a BAM file. Samtools provides index subcommand to create an index file (.bai) from a sorted BAM file.

$ samtools index -b SRR1238088.sort.bam
 $ ls SRR1238088.sort.bam*
-SRR1238088.sort.bam     SRR1238088.sort.bam.bai

The method eachoverlap(reader, chrom, range) returns an iterator of BAM records overlapping the query interval:

reader = open(BAM.Reader, "SRR1238088.sort.bam", index="SRR1238088.sort.bam.bai")
+SRR1238088.sort.bam     SRR1238088.sort.bam.bai

The method eachoverlap(reader, chrom, range) returns an iterator of BAM records overlapping the query interval:

reader = open(BAM.Reader, "SRR1238088.sort.bam", index="SRR1238088.sort.bam.bai")
 for record in eachoverlap(reader, "Chr2", 10000:11000)
     # `record` is a BAM.Record object
     # ...
 end
-close(reader)

Getting records overlapping genomic features

The eachoverlap method also accepts the Interval type defined in GenomicFeatures.jl.

This allows you to do things like first read in the genomic features from a GFF3 file, and then for each feature, iterate over all the BAM records that overlap with that feature.

using GenomicFeatures
+close(reader)

Getting records overlapping genomic features

The eachoverlap method also accepts the Interval type defined in GenomicFeatures.jl.

This allows you to do things like first read in the genomic features from a GFF3 file, and then for each feature, iterate over all the BAM records that overlap with that feature.

using GenomicFeatures
 using GFF3
 using XAM
 
@@ -80,8 +80,8 @@ for feature in features
         # ...
     end
 end
-close(reader)

Writing files

In order to write a BAM or SAM file, you must first create a SAM.Header.

A SAM.Header is constructed from a vector of SAM.MetaInfo objects.

For example, to create the following simple header:

@HD VN:1.6 SO:coordinate
-@SQ SN:ref LN:45
julia> a = SAM.MetaInfo("HD", ["VN" => 1.6, "SO" => "coordinate"])
+close(reader)

Writing files

In order to write a BAM or SAM file, you must first create a SAM.Header.

A SAM.Header is constructed from a vector of SAM.MetaInfo objects.

For example, to create the following simple header:

@HD VN:1.6 SO:coordinate
+@SQ SN:ref LN:45
julia> a = SAM.MetaInfo("HD", ["VN" => 1.6, "SO" => "coordinate"])
 SAM.MetaInfo:
     tag: HD
   value: VN=1.6 SO=coordinate
@@ -97,11 +97,11 @@ SAM.Header(SAM.MetaInfo[SAM.MetaInfo:
   value: VN=1.6 SO=coordinate, SAM.MetaInfo:
     tag: SQ
   value: SN=ref LN=45])
-

Then to create the writer for a SAM file, construct a SAM.Writer using the header and an IO type:

julia> samw = SAM.Writer(open("my-data.sam", "w"), h)
+

Then to create the writer for a SAM file, construct a SAM.Writer using the header and an IO type:

julia> samw = SAM.Writer(open("my-data.sam", "w"), h)
 SAM.Writer(IOStream(<file my-data.sam>))
-

To make a BAM Writer is slightly different, as you need to use a specific stream type from the https://github.com/BioJulia/BGZFStreams.jl package:

julia> using BGZFStreams
+

To make a BAM Writer is slightly different, as you need to use a specific stream type from the https://github.com/BioJulia/BGZFStreams.jl package:

julia> using BGZFStreams
 
 julia> bamw = BAM.Writer(BGZFStream(open("my-data.bam", "w"), "w"))
 BAM.Writer(BGZFStreams.BGZFStream{IOStream}(<mode=write>))
-

Once you have a BAM or SAM writer, you can use the write method to write BAM.Records or SAM.Records to file:

julia> write(bamw, rec) # Here rec is a `BAM.Record`
-330780
+

Once you have a BAM or SAM writer, you can use the write method to write BAM.Records or SAM.Records to file:

julia> write(bamw, rec) # Here rec is a `BAM.Record`
+330780
diff --git a/dev/search/index.html b/dev/search/index.html index f528071..42cdfde 100644 --- a/dev/search/index.html +++ b/dev/search/index.html @@ -1,2 +1,2 @@ -Search · XAM.jl

Loading search...

    +Search · XAM.jl

    Loading search...

      diff --git a/index.html b/index.html new file mode 100644 index 0000000..6a5afc3 --- /dev/null +++ b/index.html @@ -0,0 +1,2 @@ + +