Showing preview only (1,178K chars total). Download the full file or copy to clipboard to get everything.
Repository: rust-bio/rust-htslib
Branch: master
Commit: 016866671e36
Files: 83
Total size: 1.1 MB
Directory structure:
gitextract_qygp9z8u/
├── .github/
│ ├── dependabot.yml
│ └── workflows/
│ ├── conventional-prs.yml
│ ├── release-please.yml
│ └── rust.yml
├── .gitignore
├── .gitmodules
├── CHANGELOG.md
├── Cargo.toml
├── LICENSE.md
├── README.md
├── config.toml
├── src/
│ ├── bam/
│ │ ├── buffer.rs
│ │ ├── ext.rs
│ │ ├── header.rs
│ │ ├── index.rs
│ │ ├── mod.rs
│ │ ├── pileup.rs
│ │ ├── record.rs
│ │ └── record_serde.rs
│ ├── bcf/
│ │ ├── buffer.rs
│ │ ├── header.rs
│ │ ├── index.rs
│ │ ├── mod.rs
│ │ └── record.rs
│ ├── bgzf/
│ │ └── mod.rs
│ ├── errors.rs
│ ├── faidx/
│ │ └── mod.rs
│ ├── htslib.rs
│ ├── lib.rs
│ ├── tbx/
│ │ └── mod.rs
│ ├── tpool.rs
│ └── utils.rs
└── test/
├── bam2sam_expected.sam
├── bam2sam_out.sam
├── bam2sam_test.bam
├── base_mods/
│ ├── MM-double.sam
│ └── MM-orient.sam
├── bgzip/
│ └── plain.vcf
├── obs-cornercase.vcf
├── results/
│ └── .gitignore
├── tabix_reader/
│ ├── bad_header.txt.gz.tbi
│ ├── genomic_positions_header.txt.gz.tbi
│ ├── genomic_regions_header.txt.gz.tbi
│ └── test_bed3.bed.gz.tbi
├── test-info-multi-string-number=A.vcf
├── test-info-multi-string.vcf
├── test.bam
├── test.bam.bai
├── test.bcf
├── test.bcf.csi
├── test_cram.bam
├── test_cram.bam.bai
├── test_cram.cram
├── test_cram.cram.crai
├── test_cram.fa
├── test_cram.fa.fai
├── test_cram.sam
├── test_different_index_name.bam
├── test_headers.out.vcf
├── test_headers.vcf
├── test_index_build.bam
├── test_issue_156_no_text.bam
├── test_left.vcf
├── test_left.vcf.gz.tbi
├── test_missing.vcf
├── test_multi.bcf
├── test_non_diploid.vcf
├── test_nonstandard_orientation.sam
├── test_orientation_supplementary.sam
├── test_paired.sam
├── test_right.vcf
├── test_right.vcf.gz.tbi
├── test_spliced_reads.bam
├── test_spliced_reads.bam.bai
├── test_string.vcf
├── test_svlen.vcf
├── test_trailing_omitted_format.vcf
├── test_unmapped.bam
├── test_unmapped.bam.bai
├── test_unmapped.cram
├── test_unmapped.cram.crai
├── test_various.out.vcf
└── test_various.vcf
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
================================================
FILE: .github/workflows/conventional-prs.yml
================================================
name: PR
on:
pull_request_target:
types:
- opened
- reopened
- edited
- synchronize
jobs:
title-format:
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v6.1.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
================================================
FILE: .github/workflows/release-please.yml
================================================
on:
push:
branches:
- master
name: release-please
jobs:
release-please:
if: github.repository_owner == 'rust-bio'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
submodules: recursive
- uses: GoogleCloudPlatform/release-please-action@v4
id: release_main
with:
release-type: rust
package-name: rust-htslib
bump-minor-pre-major: true
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
if: ${{ steps.release_main.outputs.release_created }}
with:
toolchain: stable
- name: Install system dependencies
if: ${{ steps.release_main.outputs.release_created }}
run: |
sudo apt-get install --yes zlib1g-dev libbz2-dev musl musl-dev musl-tools clang libc6-dev
- uses: Swatinem/rust-cache@v2
if: ${{ steps.release_main.outputs.release_created }}
- name: Publish rust-htslib
if: ${{ steps.release_main.outputs.release_created }}
run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }}
# - uses: katyo/publish-crates@v1
# if: ${{ steps.release_main.outputs.release_created || steps.release_sys.outputs.release_created }}
# with:
# registry-token: ${{ secrets.CRATES_IO_TOKEN }}
================================================
FILE: .github/workflows/rust.yml
================================================
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
Formatting:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt
- name: Check format
run: cargo fmt -- --check
Linting:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
submodules: recursive
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: clippy
- name: Lint with clippy
run: RUSTFLAGS="-Dwarnings" cargo clippy --all-features --all-targets -- -Dclippy::all -Dunused_imports
Testing:
needs: Formatting
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-22.04-arm]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
submodules: recursive
- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
- name: Install system dependencies
run: |
sudo apt-get install --yes zlib1g-dev libbz2-dev musl musl-dev musl-tools clang libc6-dev
- uses: Swatinem/rust-cache@v2
- name: Run cargo-tarpaulin
run: |
set -x
cargo install cargo-tarpaulin
cargo tarpaulin --all-features --tests --doc --out Lcov -- --test-threads 1
- name: Upload coverage
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./lcov.info
Testing-Features:
needs: Formatting
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-22.04-arm]
target:
- no-default-features
- all-features
include:
- target: no-default-features
args: --no-default-features
- target: all-features
os: ubuntu-22.04
args: --all-features
toolchain_target: x86_64-unknown-linux-musl
- target: all-features
os: ubuntu-22.04-arm
args: --all-features
toolchain_target: aarch64-unknown-linux-musl
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
submodules: recursive
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Install system dependencies
run: |
sudo apt-get install --yes zlib1g-dev libbz2-dev musl musl-dev musl-tools clang libc6-dev
- uses: Swatinem/rust-cache@v2
- name: Test
run: |
cargo test ${{ matrix.args }}
Testing-MacOS:
needs: Formatting
runs-on: macos-latest
strategy:
matrix:
target:
- intel-monterey
- intel-ventura
- silicon-sonoma
include:
- target: intel-monterey
os: macOS-12.0
toolchain_target: x86_64-apple-darwin
toolchain: stable
aux_args: --target x86_64-apple-darwin
default: true
- target: intel-ventura
os: macOS-13.0
toolchain_target: x86_64-apple-darwin
toolchain: stable
aux_args: --target x86_64-apple-darwin
default: true
- target: silicon-sonoma
os: macOS-14.0
toolchain_target: aarch64-apple-darwin
toolchain: stable
aux_args: ""
default: false
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
submodules: recursive
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.toolchain }}
targets: ${{ matrix.toolchain_target }}
override: true
- name: Install htslib dependencies
run: brew install bzip2 zlib xz curl-openssl
- name: Test
run: |
cargo test --release --all-features --verbose ${{ matrix.aux_args }}
# Testing-OSX-MUSL-BigSur:
# needs: Formatting
# runs-on: macOS-11.0
# steps:
# Test MUSL builds on OSX
#
# - uses: actions-rs/toolchain@v1.0.6
# with:
# toolchain: stable
# target: x86_64-unknown-linux-musl
# override: true
# - name: Install OSX musl-cross
# run: brew install FiloSottile/musl-cross/musl-cross
# # https://github.com/FiloSottile/homebrew-musl-cross/issues/16
# - name: Provide musl-gcc symlink for the right musl arch
# run: ln -sf /usr/local/opt/musl-cross/libexec/bin/x86_64-linux-musl-gcc /usr/local/bin/musl-gcc
# - name: Test musl build without default features
# uses: actions-rs/cargo@v1
# with:
# use-cross: false # cross is not supported on GHA OSX runner, see: https://github.community/t/why-is-docker-not-installed-on-macos/17017
# command: test
# args: --release --target x86_64-unknown-linux-musl --no-default-features
# - name: Test musl build with all features and debug symbols (non --release) on OSX
# uses: actions-rs/cargo@v1.0.1
# with:
# use-cross: false
# command: test
# args: --target x86_64-unknown-linux-musl --all-features --verbose
================================================
FILE: .gitignore
================================================
.vscode/
.idea
*~
target
Cargo.lock
htslib/*
test/out.bam
test/test_index_build.bam.csi
================================================
FILE: .gitmodules
================================================
================================================
FILE: CHANGELOG.md
================================================
# Change Log
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## [1.0.0](https://github.com/rust-bio/rust-htslib/compare/v0.51.0...v1.0.0) (2026-01-29)
### ⚠ BREAKING CHANGES
* make the inner header pointer accessible again, although only through unsafe ([#504](https://github.com/rust-bio/rust-htslib/issues/504))
* Reason about Send/Sync-ness of types and change Rcs to Arcs ([#488](https://github.com/rust-bio/rust-htslib/issues/488))
* Use Arc instead of Rc in bam::buffer, such that the buffer can be used in a multithreaded context ([#495](https://github.com/rust-bio/rust-htslib/issues/495))
### Features
* Reason about Send/Sync-ness of types and change Rcs to Arcs ([#488](https://github.com/rust-bio/rust-htslib/issues/488)) ([d743a34](https://github.com/rust-bio/rust-htslib/commit/d743a3477a774e0fbe258c346918c7717ad061d2))
* Use Arc instead of Rc in bam::buffer, such that the buffer can be used in a multithreaded context ([#495](https://github.com/rust-bio/rust-htslib/issues/495)) ([229d5a2](https://github.com/rust-bio/rust-htslib/commit/229d5a265685fd25e59e807524a5df27d4057c83))
### Bug Fixes
* apply clippy suggestion to use unwrap_or instead of match ([#501](https://github.com/rust-bio/rust-htslib/issues/501)) ([161f759](https://github.com/rust-bio/rust-htslib/commit/161f7594c8433ea1229722fd4a6cb7add57aa1ef))
* empty_header was making a deep copy of header ([#499](https://github.com/rust-bio/rust-htslib/issues/499)) ([60aad09](https://github.com/rust-bio/rust-htslib/commit/60aad095d9b5b4809de2797b9ab784566257b730)), closes [#493](https://github.com/rust-bio/rust-htslib/issues/493)
* make the inner header pointer accessible again, although only through unsafe ([#504](https://github.com/rust-bio/rust-htslib/issues/504)) ([4dc0fba](https://github.com/rust-bio/rust-htslib/commit/4dc0fba181301287afb10a19ad26aaedb30fab7d))
### Performance Improvements
* **bam:** Remove unnecessary heap allocation in `Record::aux` ([#498](https://github.com/rust-bio/rust-htslib/issues/498)) ([9680bb4](https://github.com/rust-bio/rust-htslib/commit/9680bb4810cc670203ca9148393ef75dd60f9d48))
## [0.51.0](https://github.com/rust-bio/rust-htslib/compare/v0.50.0...v0.51.0) (2025-10-15)
### Features
* Add support for updating existing aux tags inplace. ([#481](https://github.com/rust-bio/rust-htslib/issues/481)) ([f4a1106](https://github.com/rust-bio/rust-htslib/commit/f4a1106df49bde257b323d966fe4228b1a5ece15))
## [0.50.0](https://github.com/rust-bio/rust-htslib/compare/v0.49.0...v0.50.0) (2025-07-09)
### Features
* Add bam::Record::set_cigar ([#477](https://github.com/rust-bio/rust-htslib/issues/477)) ([f1bb470](https://github.com/rust-bio/rust-htslib/commit/f1bb470d836e3cd8affae000f0fc14308f156c88))
* Allow for non-diploid genotypes ([#476](https://github.com/rust-bio/rust-htslib/issues/476)) ([1c22ac5](https://github.com/rust-bio/rust-htslib/commit/1c22ac598edaa9fc1be354b857dc8f8f5c892984))
### Bug Fixes
* clippy and fmt after merging PR [#466](https://github.com/rust-bio/rust-htslib/issues/466) and [#467](https://github.com/rust-bio/rust-htslib/issues/467) ([141e01c](https://github.com/rust-bio/rust-htslib/commit/141e01c74aa3d087f4c2e7fe380d06b1e272865b))
## [0.49.0](https://github.com/rust-bio/rust-htslib/compare/v0.48.0...v0.49.0) (2024-12-02)
### Features
* move empty_record to header ([#453](https://github.com/rust-bio/rust-htslib/issues/453)) ([797965c](https://github.com/rust-bio/rust-htslib/commit/797965c5ab815112b1a2a1bcdb32716c1bc1f92a))
### Bug Fixes
* memory leak in faidx when fetching sequences ([#455](https://github.com/rust-bio/rust-htslib/issues/455)) ([d9fe03a](https://github.com/rust-bio/rust-htslib/commit/d9fe03acfb81278a09a7e6091b9e1c38dd7b6cb4))
## [0.48.0](https://github.com/rust-bio/rust-htslib/compare/v0.47.1...v0.48.0) (2024-11-12)
### Features
* Add to_vcf_string method for bcf::Record ([#443](https://github.com/rust-bio/rust-htslib/issues/443)) ([489c0d7](https://github.com/rust-bio/rust-htslib/commit/489c0d7677445cfe38580c8d4c843ad4f4e2d827))
### Bug Fixes
* return error when bgzf_open fails to open a file ([#444](https://github.com/rust-bio/rust-htslib/issues/444)) ([9bda5f7](https://github.com/rust-bio/rust-htslib/commit/9bda5f768a5c54767c7e08ef1cafd28ff3f2a3b3))
## [0.47.1](https://github.com/rust-bio/rust-htslib/compare/v0.47.0...v0.47.1) (2024-11-12)
### Bug Fixes
* allow leading deletions in read_pos method of CigarStringView. ([#447](https://github.com/rust-bio/rust-htslib/issues/447)) ([2986713](https://github.com/rust-bio/rust-htslib/commit/298671382ffeab8f1f057cde83e8474963fbfb9a))
## [0.47.0](https://github.com/rust-bio/rust-htslib/compare/v0.46.0...v0.47.0) (2024-05-22)
### Features
* Add fasta::build function + FaidxBuildError ([#418](https://github.com/rust-bio/rust-htslib/issues/418)) ([7c575ef](https://github.com/rust-bio/rust-htslib/commit/7c575ef549908745f34d9371986551f3d70ed444))
* Add rust_htslib::bcf::index::build ([#408](https://github.com/rust-bio/rust-htslib/issues/408)) ([79d70cd](https://github.com/rust-bio/rust-htslib/commit/79d70cd6683f1a019e9052baa495dada709db432))
* derive PartialEq and Eq for bam:: and bcf::Format ([#428](https://github.com/rust-bio/rust-htslib/issues/428)) ([528e543](https://github.com/rust-bio/rust-htslib/commit/528e54367367487a28bbc2566bd37de995f8ed1d))
### Bug Fixes
* bam::Record:new should return a valid record ([#361](https://github.com/rust-bio/rust-htslib/issues/361)) ([87f2011](https://github.com/rust-bio/rust-htslib/commit/87f20116c4337eda17a416ebafb8976abc188d87))
* build for macOS ([#431](https://github.com/rust-bio/rust-htslib/issues/431)) ([d869fdd](https://github.com/rust-bio/rust-htslib/commit/d869fdda03900cafae0f4f60b033121dcd57b723))
* in bam record buffer, change the start of the window to the first added item in last iteration ([#430](https://github.com/rust-bio/rust-htslib/issues/430)) ([56ee2bd](https://github.com/rust-bio/rust-htslib/commit/56ee2bd562788dad0dc8516d0e3db90ffa916320))
* Panic on trailing omitted FORMAT records ([#417](https://github.com/rust-bio/rust-htslib/issues/417)) ([9f575ee](https://github.com/rust-bio/rust-htslib/commit/9f575ee40e15737731bc8234812c0cf36c1157f4))
## [0.46.0](https://github.com/rust-bio/rust-htslib/compare/v0.45.0...v0.46.0) (2024-02-22)
### Features
* making several RecordBuffer methods public ([6757f52](https://github.com/rust-bio/rust-htslib/commit/6757f5219955fd4edba4f61e62978ce1e001068e))
### Bug Fixes
* fix building libz-sys ([#420](https://github.com/rust-bio/rust-htslib/issues/420)) ([01c8849](https://github.com/rust-bio/rust-htslib/commit/01c884945686e7a6756406b579fde28657f70b36))
## [0.45.0](https://github.com/rust-bio/rust-htslib/compare/v0.44.1...v0.45.0) (2024-02-07)
### Features
* adding function to get sequence length to faidx mod ([#410](https://github.com/rust-bio/rust-htslib/issues/410)) ([ae79eba](https://github.com/rust-bio/rust-htslib/commit/ae79eba82ef6929105bdbe08246a8e973660899e))
### Bug Fixes
* Loosen acceptable types to support current linux build on aarch64 ([#415](https://github.com/rust-bio/rust-htslib/issues/415)) ([1d78d12](https://github.com/rust-bio/rust-htslib/commit/1d78d1251a052461605d28cd8cf832ccad93ef73))
## [0.44.1](https://github.com/rust-bio/rust-htslib/compare/v0.44.0...v0.44.1) (2023-06-21)
### Bug Fixes
* use correct return value in bcf_get_format and bcf_get_info_values ([#398](https://github.com/rust-bio/rust-htslib/issues/398)) ([f9a1981](https://github.com/rust-bio/rust-htslib/commit/f9a1981fa84eef39e35f868ddfc773ea265b94b3))
## [0.44.0](https://github.com/rust-bio/rust-htslib/compare/v0.43.1...v0.44.0) (2023-06-20)
### Features
* implement Clone for bcf::Record ([#394](https://github.com/rust-bio/rust-htslib/issues/394)) ([e89538d](https://github.com/rust-bio/rust-htslib/commit/e89538d5a9971c6508ac38d92ac468f3d70241aa))
* implement htslib basemod api ([#385](https://github.com/rust-bio/rust-htslib/issues/385)) ([8beee14](https://github.com/rust-bio/rust-htslib/commit/8beee145a116f7ae936f1b6e36d876116dca18f1))
### Bug Fixes
* include doctests in test coverage calculations ([#397](https://github.com/rust-bio/rust-htslib/issues/397)) ([8ed0837](https://github.com/rust-bio/rust-htslib/commit/8ed083783fa1dce09535564a090d37f687fc832f))
## [0.43.1](https://github.com/rust-bio/rust-htslib/compare/v0.43.0...v0.43.1) (2023-05-16)
### Bug Fixes
* implement Drop for faidx::Reader, destroying the fai handle ([#391](https://github.com/rust-bio/rust-htslib/issues/391)) ([0e6d6ac](https://github.com/rust-bio/rust-htslib/commit/0e6d6acec9a6d24ed6baf810e56f02394737a046))
## [0.43.0](https://github.com/rust-bio/rust-htslib/compare/v0.42.0...v0.43.0) (2023-05-12)
### Features
* HeaderRecord::push_tag: Value may be owned ([#388](https://github.com/rust-bio/rust-htslib/issues/388)) ([b64537d](https://github.com/rust-bio/rust-htslib/commit/b64537db011b76e5ace73a5e74c598a62a0a018b))
* Index for `bam::IndexedReader` ([#387](https://github.com/rust-bio/rust-htslib/issues/387)) ([fb74387](https://github.com/rust-bio/rust-htslib/commit/fb743875182c9232894e07007367f09f05d6e275))
## [0.42.0](https://github.com/rust-bio/rust-htslib/compare/v0.41.1...v0.42.0) (2023-03-30)
### Features
* Add ability to fetch number of sequences and I-th sequence from FAI index ([#377](https://github.com/rust-bio/rust-htslib/issues/377)) ([6ecc4bd](https://github.com/rust-bio/rust-htslib/commit/6ecc4bd1f88110da278c7f934453024e4e64ac74))
## [0.41.1](https://github.com/rust-bio/rust-htslib/compare/v0.41.0...v0.41.1) (2023-03-03)
### Features
* Revised calculation of leading- and trailing-softclips ([#375](https://github.com/rust-bio/rust-htslib/issues/375)) ([b61dd2c](https://github.com/rust-bio/rust-htslib/commit/b61dd2cfb2b74c0180f2d76bbd4ed4eb14fa09b3))
### Performance Improvements
* update htslib and corresponding bindings to 1.16 ([#366](https://github.com/rust-bio/rust-htslib/issues/366)) ([f597ce0](https://github.com/rust-bio/rust-htslib/commit/f597ce0451e3f3c393166a7291486bbc2bde4c39))
## [0.40.2](https://github.com/rust-bio/rust-htslib/compare/rust-htslib-v0.40.1...rust-htslib-v0.40.2) (2022-10-13)
### Performance Improvements
* update htslib and corresponding bindings to 1.16 ([#366](https://github.com/rust-bio/rust-htslib/issues/366)) ([f597ce0](https://github.com/rust-bio/rust-htslib/commit/f597ce0451e3f3c393166a7291486bbc2bde4c39))
## [0.40.1](https://github.com/rust-bio/rust-htslib/compare/rust-htslib-v0.40.0...rust-htslib-v0.40.1) (2022-08-24)
### Bug Fixes
* Header::to_hashmap skips `@CO` tags, add `comments()` method ([#363](https://github.com/rust-bio/rust-htslib/issues/363)) ([c24a7f6](https://github.com/rust-bio/rust-htslib/commit/c24a7f69fbe5d2db4a6f1fbd6eda3922fe7f1c18))
## [0.40.0](https://github.com/rust-bio/rust-htslib/compare/rust-htslib-v0.39.5...rust-htslib-v0.40.0) (2022-07-05)
### Features
* Add wrapper of BGZF writer ([#349](https://github.com/rust-bio/rust-htslib/issues/349)) ([965ed88](https://github.com/rust-bio/rust-htslib/commit/965ed886a0c24ee3070e48cc192c0772ac5cbaf4))
### Bug Fixes
* update to latest release-please ([b130634](https://github.com/rust-bio/rust-htslib/commit/b130634b3d096e620dcfe59acae2200df3e4d847))
### [0.39.5](https://www.github.com/rust-bio/rust-htslib/compare/rust-htslib-v0.39.4...rust-htslib-v0.39.5) (2022-05-09)
### Bug Fixes
* set path in release-please config ([d8f7c6e](https://www.github.com/rust-bio/rust-htslib/commit/d8f7c6e8f31accb7576e150fa1439e177f7816cb))
### [0.39.4](https://www.github.com/rust-bio/rust-htslib/compare/rust-htslib-v0.39.3...rust-htslib-v0.39.4) (2022-05-09)
### Bug Fixes
* perform checkout before running release please ([cbc6a0a](https://www.github.com/rust-bio/rust-htslib/commit/cbc6a0ad37c5623d14f2ed0bcbb4c5289d012fcb))
### [0.39.3](https://www.github.com/rust-bio/rust-htslib/compare/rust-htslib-v0.39.2...rust-htslib-v0.39.3) (2021-11-20)
### Bug Fixes
* change the type to c_char so it can be compiled for aarch64 ([#337](https://www.github.com/rust-bio/rust-htslib/issues/337)) ([a21aff2](https://www.github.com/rust-bio/rust-htslib/commit/a21aff289bc03c7549afc7a958084ed57e8c93f2))
### [0.39.2](https://www.github.com/rust-bio/rust-htslib/compare/rust-htslib-v0.39.1...rust-htslib-v0.39.2) (2021-08-23)
### Bug Fixes
* Configuration when cross-compiling. Even when cross-compiling, build.rs runs on the build host. Hence within build.rs `#[cfg(target_os)]` always reflects the host, not the target. Use $CARGO_CFG_TARGET_OS instead to query target properties. ([#329](https://www.github.com/rust-bio/rust-htslib/issues/329)) ([d5198e6](https://www.github.com/rust-bio/rust-htslib/commit/d5198e6c777fdbbfdd9c73a820f1be983a458ce2))
### [0.39.1](https://www.github.com/rust-bio/rust-htslib/compare/rust-htslib-v0.39.0...rust-htslib-v0.39.1) (2021-07-06)
### Bug Fixes
* bump hts-sys version to 2.0.1 ([336c8b8](https://www.github.com/rust-bio/rust-htslib/commit/336c8b8a1779422afea1065e37bcc44f54abac42))
## [0.39.0](https://www.github.com/rust-bio/rust-htslib/compare/rust-htslib-vrust-htslib-0.38.3...rust-htslib-v0.39.0) (2021-07-06)
### ⚠ BREAKING CHANGES
* dummy major version bump to move away from previous versions that were following htslib versions.
* bump to new major version (for technical reasons).
* dummy breaking change to increase hts-sys major version.
### Bug Fixes
* bump to new major version (for technical reasons). ([9c6db30](https://www.github.com/rust-bio/rust-htslib/commit/9c6db3060818692070db1411d63e113dc7effd64))
* dummy breaking change to increase hts-sys major version. ([93415cb](https://www.github.com/rust-bio/rust-htslib/commit/93415cbb82e4f11d257a2b2cedba2664f86a034d))
* dummy changes ([3af5ede](https://www.github.com/rust-bio/rust-htslib/commit/3af5ede13a6b44ce5d1e7f0eb90836a692e711ec))
* dummy major version bump to move away from previous versions that were following htslib versions. ([aaa70a8](https://www.github.com/rust-bio/rust-htslib/commit/aaa70a85ef9a908d3b101f23879189e84a15d23f))
* dummy release ([74d1565](https://www.github.com/rust-bio/rust-htslib/commit/74d1565329fc862f1172c0925c7b66ceb8bcf988))
* dummy release ([af2f84e](https://www.github.com/rust-bio/rust-htslib/commit/af2f84eb0411507f8866b3cc05e9a6ba9d81d172))
* dummy release ([b97915f](https://www.github.com/rust-bio/rust-htslib/commit/b97915f2c70da4c914f2e69861bf78eec5979baf))
* handle subcrate with release-please ([0a4605f](https://www.github.com/rust-bio/rust-htslib/commit/0a4605f165cb2edf4428d8fb39f7e4787585f4e1))
* trigger dummy release ([7c5a7de](https://www.github.com/rust-bio/rust-htslib/commit/7c5a7de33e2a92052126e5f44389d421974d1e02))
* update changelog ([deef08f](https://www.github.com/rust-bio/rust-htslib/commit/deef08feb0b5ba2d8abf98f2cc6d327236da8aef))
### [0.38.3](https://www.github.com/rust-bio/rust-htslib/compare/v0.38.2...v0.38.3) (2021-07-06)
### Bug Fixes
* dummy fix for triggering release ([e92e6b1](https://www.github.com/rust-bio/rust-htslib/commit/e92e6b10b0a7e5db50b12e2fbe2c42b467eb369e))
### [0.38.2](https://www.github.com/rust-bio/rust-htslib/compare/v0.38.1...v0.38.2) (2021-07-06)
### Bug Fixes
* add ID to automatic release handling ([1244393](https://www.github.com/rust-bio/rust-htslib/commit/124439300e1e3e01e1d847f7549747d560c01989))
### [0.38.1](https://www.github.com/rust-bio/rust-htslib/compare/v0.38.0...v0.38.1) (2021-07-06)
### Bug Fixes
* improved documentation ([cb0b66c](https://www.github.com/rust-bio/rust-htslib/commit/cb0b66c4a92d4f03debe38dfb2a014b154c7dd96))
## [0.38.0](https://www.github.com/rust-bio/rust-htslib/compare/v0.37.0...v0.38.0) (2021-07-06)
### ⚠ BREAKING CHANGES
* Improve bcf Record filter interface and improve docs (#306)
### Features
* Improve bcf Record filter interface and improve docs ([#306](https://www.github.com/rust-bio/rust-htslib/issues/306)) ([f45e91d](https://www.github.com/rust-bio/rust-htslib/commit/f45e91dfdc64ecb662d676f2996ed4f14c079995))
### Bug Fixes
* enum name usage in doc example ([#311](https://www.github.com/rust-bio/rust-htslib/issues/311)) ([6e9ba49](https://www.github.com/rust-bio/rust-htslib/commit/6e9ba4928b60c3105490a8179d074c705ea06fd7))
## [Unreleased]
### Changes
- `bcf::Record` methods `has_filter`, `remove_filter`, `push_filter`, and `set_filter`
all now take a byte slice (`&[u8]`) or an `Id`.
[Unreleased]: https://github.com/rust-bio/rust-htslib/compare/v0.37.0...HEAD
## [0.37.0] - 2021-07-05
### Added
- `bcf::Record` methods `end`, `clear`, and `rlen` (@mbhall88).
### Changes
- `bcf::IndexReader::fetch` parameter `end` is now an `Option<u64>`. This is inline with
htslib regions, which do not require an end position (@mbhall88)
- Removed unused dependencies (@sreenathkrishnan).
- Improved documentation (@mbhall88).
- Improved error message when failing to load index files (@johanneskoester).
- Improved API for accessing AUX fields in BAM records (@jch-13).
- Fixed compiler warnings (@fxwiegand).
- BAM header representation is now always kept in sync between textual and binary (@jch-13).
## [0.36.0] - 2020-11-23
### Changes
- Improved genotype API in VCF/BCF records (@MaltheSR).
- Read pair orientation inference for BAM records (@johanneskoester).
## [0.35.2] - 2020-11-23
### Changes
- let hts-sys dependency comply to semver.
## [0.35.1] - 2020-11-23
### Changes
- Fixed wrongly define missing value constants in bcf::record (@johanneskoester).
- Bump hts-sys depedency to the latest version, containing build fixes for macOS (@johanneskoester).
## [0.35.0] - 2020-11-19
### Changes
- BREAKING: info and format field access in BCF records now allocates a separate buffer each time. In addition, it is also possible to pass a buffer that has been created manually before (@johanneskoester)
- Fixes for building on macOS (@brainstorm)
### Added
- ability to push genotypes into BCF record (@MaltheSR, @tedil).
## [0.34.0] - 2020-11-13
### Added
- Ability to set minimum refetch distance in `bam::RecordBuffer`.
## [0.33.0] - 2020-11-04
### Changes
- BREAKING: Rename feature 'serde' as 'serde_feature' (for technical reasons)
- BREAKING: Consolidate module-wide errors into a crate-wide error module
- Making `bcf::IndexedReader` always unpack records to reflect the behaviour of `bcf::Reader`.
- Adding `bcf::errors::Error::FileNotFound` and using it.
- Fixes for musl compilation (@brainstorm).
- Improved BCF constants handling (@juliangehring)
- Fixes for tabix reader (@felix-clark, @brainstorm).
- Fixes for BCF handling (@holtgrewe, @tedil).
- Documentation improvements (@vsoch, @brainstorm, @edmundlth).
- BREAKING: Improved, more ergonomic BAM fetch API (@TiberiusPrime, @brainstorm, @tedil).
- BREAKING: Let BamRecordExtensions return iterators instead of vectors (@TiberiusPrime).
- Handle all errors via a unified single thiserror based enum (@landesfeind).
- BREAKING: BAM read API now returns Option<Result> (@slazicoicr).
### Added
- Support for reading indexed FASTA files (@landesfeind, @pmarks, @brainstorm).
- Support for shared threadpools when reading and writing BAM (@pmarks, @nlhepler).
- Serde support for Cigar strings (@FelixMoelder, @pmarks, @johanneskoester).
- Expose bgzf functionality (@landesfeind).
- Iterator over BAM records using Rc-pointers (@TiberiusPrime, @tedil).
- Ability to obtain pairs of read and genome intervals from BAM (aligned_block_pairs) (@TiberiusPrime, @brainstorm).
## [0.32.0] - 2020-07-09
### Changes
- Method `seq_len()` of `bam::Record` is now public.
- Speedup when parsing BAM headers (thanks to @juliangehring).
- Compatibility fixes for older rust versions (thanks to @pmarks and @brainstorm).
## [0.31.0] - 2020-06-22
### Changes
- Bam record buffer now returns reference counted (Rc) objects. This makes the API more ergonomic to use.
- Switched to thiserror instead of snafu for error handling.
- Various cleanups and little fixes.
## [0.30.0] - 2020-04-03
### Changes
- Removed `fn header_mut()` from `bam::Read` trait.
- Fixed a major performance regression when reading bam files (issue #195).
## [0.29.0] - 2020-03-26
### Changes
- Migrate buffer intervals to u64.
## [0.28.0] - 2020-03-26
### Changes
- Return u64 wherever htslib has migrated to using 64 bit.
- Implement more bio-types (Interval, Locus, Strand).
## [0.27.0] - 2020-03-17
### Changes
- Updated to Htslib 1.10.2.
- bam::Record.set() will panic if seq.len() != qual.len(). Previously, mismatched length would cause
uninitialized memory to be written into the BAM file.
- use `serde_bytes` to serialize .data section of bam::Record when using serde - large speed improvement.
- change build.rs to avoid re-running when htslib or wrapper.h haven't changed.
- update some dependencies.
- refactor native dependency into htslib-sys crate, for greater versioning flexibility
- Record::from_sam require `&mut HeaderView`. Provide the appropriate accessor.
- set() no longer invalidates tag data.
- Various minor improvements.
## [0.26.1] - 2019-12-03
### Changes
- Various bug fixes in CIGAR string handling, INFO tag reading and FORMAT tag reading.
## [0.26.0] - 2019-09-27
### Changes
- Allow caching of CIGAR in bam::RecordBuffer.
## [0.25.0] - 2019-09-27
### Changes
- Migrated error handling to the snafu crate: https://docs.rs/snafu.
- Cleaned up and simplified API (including breaking changes).
- Allow writing SAM files from the bam::Writer.
## [0.24.0] - 2019-05-31
### Added
- Allow setting unmapped BAM record (without Cigar string).
- Various bug fixes and error handling improvements.
- Various Pysam-derived methods for interpreting Cigar strings.
## [0.23.0] - 2019-05-02
### Added
- Support for BAM indices that are not placed beside a file.bam as file.bam.bai
- Implement SequenceRead trait for BAM records.
- Add function to build an index for a BAM file.
- CRAM support for BAM reader and writer.
### Changes
- Allow to specify particular index filename when instantiating a BAM reader.
- Various bug and API fixes.
## [0.22.0] - 2018-11-02
### Changes
- Support compilation against musl.
- Support for removing alleles.
- Improvements to SyncedReader API.
## [0.21.0] - 2018-08-01
### Changes
- Adding `bcf::synced::SyncedReader::fetch()`, changing error type for `bcf::synced::SyncedReader::read_next()`.
- Adding `bcf::Record::unpack()` for explicitely unpacking BCF records.
- Fixed `bcf::synced::SyncedReader::record()`.
- `bam::Record::cigar()` now returns a reference (in constant time) and needs `bam::Record::unpack_cigar()` to be called first.
- Allow to create Cigar string from `bio_types::Alignment`.
- Provide a cached variant of obtaining cigar string.
- Lots of small usability improvements.
## [0.20.0] - 2018-06-18
### Added
- Initial implementation of synced BCF reader interface.
- Several small helper methods for BAM readers.
### Changes
- Not skipping `fileformat=` header any more.
- BCF records are always unpacked when reading.
## [0.19.1] - 2018-06-07
### Changed
- Moved unpacking of BCF records into constructor to prevent race conditions.
- Fixed bug in retrieving BCF record id.
- Fixed bug in the filter iterator of BCF.
## [0.19.0] - 2018-06-01
### Added
- more push functions for BCF.
## [0.18.0] - 2018-05-04
### Added
- bcf::IndexedReader
- support for writing bcf FILTER field
- setting thread count in all readers and writers
- setting ID and alleles in bcf records
- support for tabix indexes
- convert CIGAR to and from strings
## [0.17.0] - 2018-02-22
### Added
- Serde support for bam records.
### Changed
- Various convenience improvements in the API.
## [0.16.0] - 2018-01-05
### Changed
- Raw Htslib bindings are now generated on the fly.
- Switched to Htslib 1.6.
- Fixed a potential dangling pointer to the header in bcf records.
- Various small API improvements.
## [0.15.0] - 2017-12-05
### Changed
- HeaderView of bam and bcf can now be cloned.
## [0.14.0] - 2017-12-03
### Added
- An efficient ringbuffer for accessing BCF regions
- An efficient ringbuffer for accessing BAM regions
### Changed
- Improved mutability annotation for readers.
## [0.13.0] - 2017-09-22
### Added
- Ability to clone bam records.
- Ability to set only qname.
### Changed
- Further improved CIGAR string API.
- Improved documentation.
## [0.12.1] - 2017-06-12
### Changed
- Adapt to changes in Rust 1.18 that caused compilation issues.
## [0.12.0] - 2017-06-01
### Added
- Support seek and tell to handle virtual offsets.
### Changed
- Renamed previous seek method into fetch (in line with pysam).
- Improved CIGAR API.
- Updated dependencies.
## [0.11.0] - 2017-05-01
### Added
- A SAM writer.
### Changed
- Improved CIGAR string API using a newtype wrapper.
- Improved pileup API.
- Support threaded writing for BAM files.
## [0.10.0] - 2016-11-10
### Added
- Prelude module to easily import all relevant traits.
### Changed
- fine-grained constructors for STDIN/STDOUT, paths and URLs
- better template handling with bam files
## [0.9.0] - 2016-11-02
### Changed
- improved genotype handling
- improved error handling
- improved missing value handling
## [0.8.1] - 2016-08-17
### Changed
- Finally converted the last unit error types to real error types (really now!).
## [0.8.0] - 2016-08-17
### Changed
- More error types.
## [0.7.0] - 2016-08-16
### Changed
- Error types now properly implement the Display and the Error trait.
## [0.6.2] - 2016-07-22
### Changed
- Mark all records as Send and Sync.
## [0.6.1] - 2016-07-20
### Changed
- Improved error messages.
- Check existence of BAM when instantiating Readers.
## [0.6.0] - 2016-06-01
### Changed
- Improved handling of memory allocation for BCF and BAM records.
- Fixed a memory leak occuring when creating a new BAM record (thanks to @andrelmartins).
================================================
FILE: Cargo.toml
================================================
[package]
authors = ["Christopher Schröder <christopher.schroeder@tu-dortmund.de>", "Johannes Köster <johannes.koester@tu-dortmund.de>"]
description = "This library provides HTSlib bindings and a high level Rust API for reading and writing BAM files."
documentation = "https://docs.rs/rust-htslib"
edition = "2018"
include = ["src/**/*", "LICENSE.md", "README.md", "CHANGELOG.md"]
keywords = ["htslib", "bam", "bioinformatics", "pileup", "sequencing"]
license = "MIT"
name = "rust-htslib"
readme = "README.md"
repository = "https://github.com/rust-bio/rust-htslib.git"
version = "1.0.0"
[package.metadata.release]
pre-release-commit-message = "release version {{version}}"
tag-message = "Version {{version}} of Rust-HTSlib."
[dependencies]
libz-sys = ">=1.1.15"
bio-types = ">=0.9"
byteorder = "1.3"
custom_derive = "0.1"
derive-new = "0.7"
hts-sys = {version = "2.2.0", default-features = false, features = ["bindgen"]}
ieee754 = "0.2"
lazy_static = "1.4"
libc = "0.2"
linear-map = "1.2"
newtype_derive = "0.1"
regex = "1.3"
serde = {version = "^1", optional = true, features = ["derive"]}
serde_bytes = {version = "0.11", optional = true}
thiserror = {version = "^2" }
url = "2.5"
[features]
bindgen = ["hts-sys/bindgen"]
bzip2 = ["hts-sys/bzip2"]
curl = ["hts-sys/curl"]
default = ["bzip2", "lzma", "curl"]
gcs = ["hts-sys/gcs"]
libdeflate = ["hts-sys/libdeflate"]
lzma = ["hts-sys/lzma"]
s3 = ["hts-sys/s3"]
serde_feature = ["serde", "serde_bytes", "bio-types/serde"]
static = ["hts-sys/static"]
[dev-dependencies]
bincode = "1.2"
pretty_assertions = "1.4"
serde_json = "1.0"
tempfile = "3.1.0"
================================================
FILE: LICENSE.md
================================================
The MIT License (MIT)
Copyright (c) 2016 Johannes Köster, the Rust-Htslib team.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
================================================
FILE: README.md
================================================
[](https://crates.io/crates/rust-htslib)
[](https://crates.io/crates/rust-htslib)
[](https://crates.io/crates/rust-htslib)
[](https://docs.rs/rust-htslib)

[](https://coveralls.io/github/rust-bio/rust-htslib?branch=master)
# HTSlib bindings for Rust
This library provides HTSlib bindings and a high level Rust API for reading and writing BAM files.
To clone this repository, issue
```shell
$ git clone --recursive https://github.com/rust-bio/rust-htslib.git
```
ensuring that the HTSlib submodule is fetched, too.
If you only want to use the library, there is no need to clone the repository. Go on to the **Usage** section in this case.
## Requirements
rust-htslib comes with pre-built bindings to htslib for Mac and Linux. You will need a C toolchain compatible with the `cc` crate. The build script for this crate will automatically build a link htslib.
## Usage
Add this to your `Cargo.toml`:
```toml
[dependencies]
rust-htslib = "*"
```
By default `rust-htslib` links to `bzip2-sys` and `lzma-sys` for full CRAM support. If you do not need CRAM support, or you do need to support CRAM files
with these compression methods, you can deactivate these features to reduce you dependency count:
```toml
[dependencies]
rust-htslib = { version = "*", default-features = false }
```
`rust-htslib` has optional support for `serde`, to allow (de)serialization of `bam::Record` via any serde-supported format.
Http access to files is available with the `curl` feature.
Beta-level S3 and Google Cloud Storge support is available with the `s3` and `gcs` features.
`rust-htslib` can optionally use `bindgen` to generate bindings to htslib. This can slow down the build substantially. Enabling the `bindgen` feature will
cause `hts-sys` to use a create a binding file for your architecture. Pre-built bindings are supplied for Mac and Linux. The `bindgen` feature on Windows is untested - please file a bug if you need help.
```toml
[dependencies]
rust-htslib = { version = "*", features = ["serde_feature"] }
```
For more information, please see the [docs](https://docs.rs/rust-htslib).
# Alternatives
There's [noodles](https://github.com/zaeleus/noodles) by [Michael Macias](https://github.com/zaeleus) which implements a large part of htslib's C functionality in pure Rust (still experimental though).
# Authors
* [Johannes Köster](https://github.com/johanneskoester)
* [Christopher Schröder](https://github.com/christopher-schroeder)
* [Patrick Marks](https://github.com/pmarks)
* [David Lähnemann](https://github.com/dlaehnemann)
* [Manuel Holtgrewe](https://github.com/holtgrewe)
* [Julian Gehring](https://github.com/juliangehring)
For other contributors, see [here](https://github.com/rust-bio/rust-htslib/graphs/contributors).
## License
Licensed under the MIT license https://opensource.org/licenses/MIT. This project may not be copied, modified, or distributed except according to those terms.
Some test files are taken from https://github.com/samtools/htslib.
================================================
FILE: config.toml
================================================
[target.x86_64-unknown-linux-musl]
linker = "x86_64-linux-musl-gcc"
================================================
FILE: src/bam/buffer.rs
================================================
// Copyright 2017 Johannes Köster.
// Licensed under the MIT license (http://opensource.org/licenses/MIT)
// This file may not be copied, modified, or distributed
// except according to those terms.
use std::collections::{vec_deque, VecDeque};
use std::mem;
use std::str;
use std::sync::Arc;
use crate::bam;
use crate::bam::Read;
use crate::errors::{Error, Result};
/// A buffer for BAM records. This allows access regions in a sorted BAM file while iterating
/// over it in a single pass.
/// The buffer is implemented as a ringbuffer, such that extension or movement to the right has
/// linear complexity. The buffer makes use of indexed random access. Hence, when fetching a
/// region at the very end of the BAM, everything before is omitted without cost.
#[derive(Debug)]
pub struct RecordBuffer {
reader: bam::IndexedReader,
inner: VecDeque<Arc<bam::Record>>,
overflow: Option<Arc<bam::Record>>,
cache_cigar: bool,
min_refetch_distance: u64,
buffer_record: Arc<bam::Record>,
start_pos: Option<u64>,
}
unsafe impl Sync for RecordBuffer {}
unsafe impl Send for RecordBuffer {}
impl RecordBuffer {
/// Create a new `RecordBuffer`.
///
/// # Arguments
///
/// * `bam` - BAM reader
/// * `cache_cigar` - whether to call `bam::Record::cache_cigar()` for each record.
pub fn new(bam: bam::IndexedReader, cache_cigar: bool) -> Self {
RecordBuffer {
reader: bam,
inner: VecDeque::new(),
overflow: None,
cache_cigar,
min_refetch_distance: 1,
buffer_record: Arc::new(bam::Record::new()),
start_pos: Some(0),
}
}
/// maximum distance to previous fetch window such that a
/// new fetch operation is performed. If the distance is smaller, buffer will simply
/// read through until the start of the new fetch window (probably saving some time
/// by avoiding the random access).
pub fn set_min_refetch_distance(&mut self, min_refetch_distance: u64) {
self.min_refetch_distance = min_refetch_distance;
}
/// Return start position of buffer
pub fn start(&self) -> Option<u64> {
self.inner.front().map(|rec| rec.pos() as u64)
}
/// Return end position of buffer.
pub fn end(&self) -> Option<u64> {
self.inner.back().map(|rec| rec.pos() as u64)
}
pub fn tid(&self) -> Option<i32> {
self.inner.back().map(|rec| rec.tid())
}
/// Fill buffer at the given interval. If the start coordinate is left of
/// the previous start coordinate, this will use an additional BAM fetch IO operation.
/// Coordinates are 0-based, and end is exclusive.
/// Returns tuple with numbers of added and deleted records since the previous fetch.
#[allow(unused_assignments)] // TODO this is needed because rustc thinks that deleted is unused
pub fn fetch(&mut self, chrom: &[u8], start: u64, end: u64) -> Result<(usize, usize)> {
let mut added = 0;
// move overflow from last fetch into ringbuffer
if self.overflow.is_some() {
added += 1;
self.inner.push_back(self.overflow.take().unwrap());
}
if let Some(tid) = self.reader.header.tid(chrom) {
let mut deleted = 0;
let window_start = start;
if self.inner.is_empty()
|| window_start.saturating_sub(self.end().unwrap()) >= self.min_refetch_distance
|| self.tid().unwrap() != tid as i32
|| self.start().unwrap() > self.start_pos.unwrap()
{
let end = self.reader.header.target_len(tid).unwrap();
self.reader.fetch((tid, window_start, end))?;
deleted = self.inner.len();
self.inner.clear();
} else {
// remove records too far left
let to_remove = self
.inner
.iter()
.take_while(|rec| rec.pos() < window_start as i64)
.count();
for _ in 0..to_remove {
self.inner.pop_front();
}
deleted = to_remove;
}
// extend to the right
loop {
match self
.reader
.read(Arc::get_mut(&mut self.buffer_record).unwrap())
{
None => break,
Some(res) => res?,
}
if self.buffer_record.is_unmapped() {
continue;
}
let pos = self.buffer_record.pos();
// skip records before the start
if pos < start as i64 {
continue;
}
// Record is kept, do not reuse it for next iteration
// and thus create a new one.
let mut record =
mem::replace(&mut self.buffer_record, Arc::new(bam::Record::new()));
if self.cache_cigar {
Arc::get_mut(&mut record).unwrap().cache_cigar();
}
if pos >= end as i64 {
self.overflow = Some(record);
break;
} else {
self.inner.push_back(record);
added += 1;
}
}
self.start_pos = Some(self.start().unwrap_or(window_start));
Ok((added, deleted))
} else {
Err(Error::UnknownSequence {
sequence: str::from_utf8(chrom).unwrap().to_owned(),
})
}
}
/// Iterate over records that have been fetched with `fetch`.
pub fn iter(&self) -> vec_deque::Iter<'_, Arc<bam::Record>> {
self.inner.iter()
}
/// Iterate over mutable references to records that have been fetched with `fetch`.
pub fn iter_mut(&mut self) -> vec_deque::IterMut<'_, Arc<bam::Record>> {
self.inner.iter_mut()
}
pub fn len(&self) -> usize {
self.inner.len()
}
pub fn is_empty(&self) -> bool {
self.len() == 0
}
}
#[cfg(test)]
mod tests {
use super::*;
use crate::bam;
#[test]
fn test_buffer() {
let reader = bam::IndexedReader::from_path("test/test.bam").unwrap();
let mut buffer = RecordBuffer::new(reader, false);
buffer.fetch(b"CHROMOSOME_I", 1, 5).unwrap();
{
let records: Vec<_> = buffer.iter().collect();
assert_eq!(records.len(), 6);
assert_eq!(records[0].pos(), 1);
assert_eq!(records[1].pos(), 1);
assert_eq!(records[2].pos(), 1);
assert_eq!(records[3].pos(), 1);
assert_eq!(records[4].pos(), 1);
assert_eq!(records[5].pos(), 1);
}
}
}
================================================
FILE: src/bam/ext.rs
================================================
// Copyright 2019 Johannes Köster and Florian Finkernagel.
// Licensed under the MIT license (http://opensource.org/licenses/MIT)
// This file may not be copied, modified, or distributed
// except according to those terms.
//! Extensions for BAM records beyond htslib
use crate::bam;
use crate::bam::record::Cigar;
use crate::htslib;
use std::collections::HashMap;
pub struct IterAlignedBlockPairs {
genome_pos: i64,
read_pos: i64,
cigar_index: usize,
cigar: Vec<Cigar>,
}
impl Iterator for IterAlignedBlockPairs {
type Item = ([i64; 2], [i64; 2]);
fn next(&mut self) -> Option<Self::Item> {
while self.cigar_index < self.cigar.len() {
let entry = self.cigar[self.cigar_index];
match entry {
Cigar::Match(len) | Cigar::Equal(len) | Cigar::Diff(len) => {
let qstart = self.read_pos;
let qend = qstart + len as i64;
let rstart = self.genome_pos;
let rend = self.genome_pos + len as i64;
self.read_pos += len as i64;
self.genome_pos += len as i64;
self.cigar_index += 1;
return Some(([qstart, qend], [rstart, rend]));
}
Cigar::Ins(len) | Cigar::SoftClip(len) => {
self.read_pos += len as i64;
}
Cigar::Del(len) | Cigar::RefSkip(len) => {
self.genome_pos += len as i64;
}
Cigar::HardClip(_) => {} // no advance
Cigar::Pad(_) => panic!("Padding (Cigar::Pad) is not supported."), //padding is only used for multiple sequence alignment
}
self.cigar_index += 1;
}
None
}
}
pub struct IterAlignedBlocks {
pos: i64,
cigar_index: usize,
cigar: Vec<Cigar>,
}
impl Iterator for IterAlignedBlocks {
type Item = [i64; 2];
fn next(&mut self) -> Option<Self::Item> {
while self.cigar_index < self.cigar.len() {
let entry = self.cigar[self.cigar_index];
match entry {
Cigar::Match(len) | Cigar::Equal(len) | Cigar::Diff(len) => {
let out_pos = self.pos;
//result.push([pos, pos + *len as i64]);
self.pos += len as i64;
self.cigar_index += 1;
return Some([out_pos, out_pos + len as i64]);
}
Cigar::Del(len) => self.pos += len as i64,
Cigar::RefSkip(len) => self.pos += len as i64,
_ => (),
}
self.cigar_index += 1;
}
None
}
}
pub struct IterIntrons {
pos: i64,
cigar_index: usize,
cigar: Vec<Cigar>,
}
impl Iterator for IterIntrons {
type Item = [i64; 2];
fn next(&mut self) -> Option<Self::Item> {
while self.cigar_index < self.cigar.len() {
let entry = self.cigar[self.cigar_index];
match entry {
Cigar::Match(len) | Cigar::Equal(len) | Cigar::Diff(len) | Cigar::Del(len) => {
self.pos += len as i64
}
Cigar::RefSkip(len) => {
let junc_start = self.pos;
self.pos += len as i64;
self.cigar_index += 1;
return Some([junc_start, self.pos]); //self.pos is junc_start + len
}
_ => {}
}
self.cigar_index += 1;
}
None
}
}
pub struct IterAlignedPairs {
genome_pos: i64,
read_pos: i64,
cigar: Vec<Cigar>,
remaining_match_bp: u32,
cigar_index: usize,
}
impl Iterator for IterAlignedPairs {
type Item = [i64; 2];
fn next(&mut self) -> Option<Self::Item> {
if self.remaining_match_bp > 0 {
self.remaining_match_bp -= 1;
self.genome_pos += 1;
self.read_pos += 1;
return Some([self.read_pos - 1, self.genome_pos - 1]);
}
while self.cigar_index < self.cigar.len() {
let entry = self.cigar[self.cigar_index];
match entry {
Cigar::Match(len) | Cigar::Equal(len) | Cigar::Diff(len) => {
self.genome_pos += 1;
self.read_pos += 1;
self.remaining_match_bp = len - 1;
self.cigar_index += 1;
return Some([self.read_pos - 1, self.genome_pos - 1]);
}
Cigar::Ins(len) | Cigar::SoftClip(len) => {
self.read_pos += len as i64;
}
Cigar::Del(len) | Cigar::RefSkip(len) => {
self.genome_pos += len as i64;
}
Cigar::HardClip(_) => {} // no advance
Cigar::Pad(_) => panic!("Padding (Cigar::Pad) is not supported."), //padding is only used for multiple sequence alignment
}
self.cigar_index += 1;
}
None
}
}
pub struct IterAlignedPairsFull {
genome_pos: i64,
read_pos: i64,
cigar: Vec<Cigar>,
remaining_match_bp: u32,
remaining_ins_bp: u32,
remaining_del_bp: u32,
cigar_index: usize,
}
impl Iterator for IterAlignedPairsFull {
type Item = [Option<i64>; 2];
fn next(&mut self) -> Option<Self::Item> {
if self.remaining_match_bp > 0 {
self.remaining_match_bp -= 1;
self.genome_pos += 1;
self.read_pos += 1;
return Some([Some(self.read_pos - 1), Some(self.genome_pos - 1)]);
}
if self.remaining_ins_bp > 0 {
self.remaining_ins_bp -= 1;
self.read_pos += 1;
return Some([Some(self.read_pos - 1), None]);
}
if self.remaining_del_bp > 0 {
self.remaining_del_bp -= 1;
self.genome_pos += 1;
return Some([None, Some(self.genome_pos - 1)]);
}
while self.cigar_index < self.cigar.len() {
let entry = self.cigar[self.cigar_index];
match entry {
Cigar::Match(len) | Cigar::Equal(len) | Cigar::Diff(len) => {
self.genome_pos += 1;
self.read_pos += 1;
self.remaining_match_bp = len - 1;
self.cigar_index += 1;
return Some([Some(self.read_pos - 1), Some(self.genome_pos - 1)]);
}
Cigar::Ins(len) | Cigar::SoftClip(len) => {
self.read_pos += 1;
self.remaining_ins_bp = len - 1;
self.cigar_index += 1;
return Some([Some(self.read_pos - 1), None]);
}
Cigar::Del(len) | Cigar::RefSkip(len) => {
self.genome_pos += 1;
self.remaining_del_bp = len - 1;
self.cigar_index += 1;
return Some([None, Some(self.genome_pos - 1)]);
}
Cigar::HardClip(_) => {
// no advance
}
Cigar::Pad(_) => panic!("Padding (Cigar::Pad) is not supported."), //padding is only used for multiple sequence alignment
}
self.cigar_index += 1;
}
None
}
}
/// Extra functionality for BAM records
///
/// Inspired by pysam
pub trait BamRecordExtensions {
/// iterator over start and end positions of aligned gapless blocks
///
/// The start and end positions are in genomic coordinates.
/// There is not necessarily a gap between blocks on the genome,
/// this happens on insertions.
///
/// pysam: blocks
/// See also: [aligned_block_pairs](#tymethod.aligned_block_pairs) if you need
/// the read coordinates as well.
fn aligned_blocks(&self) -> IterAlignedBlocks;
///Iter over <([read_start, read_stop], [genome_start, genome_stop]) blocks
///of continously aligned reads.
///
///In contrast to [aligned_blocks](#tymethod.aligned_blocks), this returns
///read and genome coordinates.
///In contrast to aligned_pairs, this returns just the start-stop
///coordinates of each block.
///
///There is not necessarily a gap between blocks in either coordinate space
///(this happens in in-dels).
fn aligned_block_pairs(&self) -> IterAlignedBlockPairs;
/// This scans the CIGAR for reference skips
/// and reports their positions.
/// It does not inspect the reported regions
/// for actual splice sites.
/// pysam: get_introns
fn introns(&self) -> IterIntrons;
/// iter aligned read and reference positions on a basepair level
///
/// No entry for insertions, deletions or skipped pairs
///
/// pysam: get_aligned_pairs(matches_only = True)
///
/// See also [aligned_block_pairs](#tymethod.aligned_block_pairs)
/// if you just need start&end coordinates of each block.
/// That way you can allocate less memory for the same
/// informational content.
fn aligned_pairs(&self) -> IterAlignedPairs;
/// iter list of read and reference positions on a basepair level.
///
/// Unlike `aligned_pairs` this returns None in
/// either the read positions or the reference position
/// for insertions, deletions or skipped pairs
///
/// pysam: aligned_pairs(matches_only = False)
fn aligned_pairs_full(&self) -> IterAlignedPairsFull;
/// the number of nucleotides covered by each Cigar::* variant.
///
/// Result is a Hashmap Cigar::*(0) => covered nucleotides
///
/// pysam: first result from get_cigar_stats
fn cigar_stats_nucleotides(&self) -> HashMap<Cigar, i32>;
/// the number of occurrences of each each Cigar::* variant
///
/// Result is a Hashmap Cigar::*(0) => number of times this Cigar::
/// appeared
///
/// pysam: second result from get_cigar_stats
fn cigar_stats_blocks(&self) -> HashMap<Cigar, i32>;
/// iter over reference positions that this read aligns to
///
/// only returns positions that are aligned, excluding any soft-clipped
/// or unaligned positions within the read
///
/// pysam: get_reference_positions(full_length=False)
fn reference_positions(&self) -> Box<dyn Iterator<Item = i64>>;
///
/// iter over reference positions that this read aligns to
///
/// include soft-clipped or skipped positions as None
///
/// pysam: get_reference_positions(full_length=True)
fn reference_positions_full(&self) -> Box<dyn Iterator<Item = Option<i64>>>;
/// left most aligned reference position of the read on the reference genome.
fn reference_start(&self) -> i64;
/// right most aligned absolute reference position of the read on the reference genome.
fn reference_end(&self) -> i64;
/// infer the query length from the cigar string, optionally include hard clipped bases
///
/// Contrast with record::seq_len which returns the length of the sequence stored
/// in the BAM file, and as such is 0 if the BAM file omits sequences
///
/// pysam: infer_query_length / infer_read_length
fn seq_len_from_cigar(&self, include_hard_clip: bool) -> usize;
}
impl BamRecordExtensions for bam::Record {
fn aligned_blocks(&self) -> IterAlignedBlocks {
IterAlignedBlocks {
pos: self.pos(),
cigar: self.cigar().take().0,
cigar_index: 0,
}
}
fn introns(&self) -> IterIntrons {
IterIntrons {
pos: self.pos(),
cigar: self.cigar().take().0,
cigar_index: 0,
}
}
fn aligned_block_pairs(&self) -> IterAlignedBlockPairs {
IterAlignedBlockPairs {
genome_pos: self.pos(),
read_pos: 0,
cigar: self.cigar().take().0,
cigar_index: 0,
}
}
fn aligned_pairs(&self) -> IterAlignedPairs {
IterAlignedPairs {
genome_pos: self.pos(),
read_pos: 0,
cigar: self.cigar().take().0,
remaining_match_bp: 0,
cigar_index: 0,
}
}
fn aligned_pairs_full(&self) -> IterAlignedPairsFull {
IterAlignedPairsFull {
genome_pos: self.pos(),
read_pos: 0,
cigar: self.cigar().take().0,
remaining_match_bp: 0,
remaining_ins_bp: 0,
remaining_del_bp: 0,
cigar_index: 0,
}
}
fn cigar_stats_nucleotides(&self) -> HashMap<Cigar, i32> {
let mut result = HashMap::new();
result.insert(Cigar::Match(0), 0); // M
result.insert(Cigar::Ins(0), 0); // I
result.insert(Cigar::Del(0), 0); // D
result.insert(Cigar::RefSkip(0), 0); // N
result.insert(Cigar::SoftClip(0), 0); // S
result.insert(Cigar::HardClip(0), 0); // H
result.insert(Cigar::Pad(0), 0); // P
result.insert(Cigar::Equal(0), 0); // =
result.insert(Cigar::Diff(0), 0); // X
for entry in self.cigar().iter() {
match entry {
Cigar::Match(len) => *result.get_mut(&Cigar::Match(0)).unwrap() += *len as i32, // M
Cigar::Ins(len) => *result.get_mut(&Cigar::Ins(0)).unwrap() += *len as i32, // I
Cigar::Del(len) => *result.get_mut(&Cigar::Del(0)).unwrap() += *len as i32, // D
Cigar::RefSkip(len) => *result.get_mut(&Cigar::RefSkip(0)).unwrap() += *len as i32, // N
Cigar::SoftClip(len) => {
*result.get_mut(&Cigar::SoftClip(0)).unwrap() += *len as i32
} // S
Cigar::HardClip(len) => {
*result.get_mut(&Cigar::HardClip(0)).unwrap() += *len as i32
} // H
Cigar::Pad(len) => *result.get_mut(&Cigar::Pad(0)).unwrap() += *len as i32, // P
Cigar::Equal(len) => *result.get_mut(&Cigar::Equal(0)).unwrap() += *len as i32, // =
Cigar::Diff(len) => *result.get_mut(&Cigar::Diff(0)).unwrap() += *len as i32, // X
}
}
result
}
fn cigar_stats_blocks(&self) -> HashMap<Cigar, i32> {
let mut result = HashMap::new();
result.insert(Cigar::Match(0), 0); // M
result.insert(Cigar::Ins(0), 0); // I
result.insert(Cigar::Del(0), 0); // D
result.insert(Cigar::RefSkip(0), 0); // N
result.insert(Cigar::SoftClip(0), 0); // S
result.insert(Cigar::HardClip(0), 0); // H
result.insert(Cigar::Pad(0), 0); // P
result.insert(Cigar::Equal(0), 0); // =
result.insert(Cigar::Diff(0), 0); // X
for entry in self.cigar().iter() {
match entry {
Cigar::Match(_) => *result.get_mut(&Cigar::Match(0)).unwrap() += 1, // M
Cigar::Ins(_) => *result.get_mut(&Cigar::Ins(0)).unwrap() += 1, // I
Cigar::Del(_) => *result.get_mut(&Cigar::Del(0)).unwrap() += 1, // D
Cigar::RefSkip(_) => *result.get_mut(&Cigar::RefSkip(0)).unwrap() += 1, // N
Cigar::SoftClip(_) => *result.get_mut(&Cigar::SoftClip(0)).unwrap() += 1, // S
Cigar::HardClip(_) => *result.get_mut(&Cigar::HardClip(0)).unwrap() += 1, // H
Cigar::Pad(_) => *result.get_mut(&Cigar::Pad(0)).unwrap() += 1, // P
Cigar::Equal(_) => *result.get_mut(&Cigar::Equal(0)).unwrap() += 1, // =
Cigar::Diff(_) => *result.get_mut(&Cigar::Diff(0)).unwrap() += 1, // X
}
}
result
}
fn reference_positions(&self) -> Box<dyn Iterator<Item = i64>> {
Box::new(self.aligned_pairs().map(|x| x[1]))
}
fn reference_positions_full(&self) -> Box<dyn Iterator<Item = Option<i64>>> {
Box::new(
self.aligned_pairs_full()
.filter(|x| x[0].is_some())
.map(|x| x[1]),
)
}
fn reference_start(&self) -> i64 {
self.pos()
}
/// Calculate the rightmost absolute reference base position of an alignment on the reference genome.
/// Returns the coordinate of the first base after the alignment (0-based).
fn reference_end(&self) -> i64 {
unsafe { htslib::bam_endpos(self.inner_ptr()) }
}
fn seq_len_from_cigar(&self, include_hard_clip: bool) -> usize {
let mut result = 0;
for entry in self.cigar().iter() {
match entry {
Cigar::Match(len)
| Cigar::Ins(len)
| Cigar::SoftClip(len)
| Cigar::Equal(len)
| Cigar::Diff(len) => {
result += len;
}
Cigar::HardClip(len) => {
if include_hard_clip {
result += len;
}
}
_ => {}
}
}
result as usize
}
}
#[cfg(test)]
mod tests {
use crate::bam;
use crate::bam::ext::BamRecordExtensions;
use crate::bam::record::{Cigar, CigarString};
use crate::bam::Read;
use std::collections::HashMap;
#[test]
fn spliced_reads() {
let mut bam = bam::Reader::from_path("./test/test_spliced_reads.bam").unwrap();
let mut it = bam.records();
let blocks: Vec<_> = it.next().expect("iter").unwrap().aligned_blocks().collect();
//6S45M - 0
assert!(blocks[0] == [16050676, 16050721]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//7M2D44M - 1
assert!(blocks[0] == [16096878, 16096885]);
//7M2D44M - 1
assert!(blocks[1] == [16096887, 16096931]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//29M2D22M - 2
assert!(blocks[0] == [16097145, 16097174]);
//29M2D22M - 2
assert!(blocks[1] == [16097176, 16097198]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//51M - 3
assert!(blocks[0] == [16117350, 16117401]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//51M - 4
assert!(blocks[0] == [16118483, 16118534]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//51M - 5
assert!(blocks[0] == [16118499, 16118550]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//51M - 6
assert!(blocks[0] == [16118499, 16118550]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//51M - 7
assert!(blocks[0] == [16118499, 16118550]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//51M - 8
assert!(blocks[0] == [16123411, 16123462]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//6S45M - 9
assert!(blocks[0] == [16123417, 16123462]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//41M10S - 10
assert!(blocks[0] == [16165860, 16165901]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//51M - 11
assert!(blocks[0] == [16180871, 16180922]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//51M - 12
assert!(blocks[0] == [16189705, 16189756]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//51M - 13
assert!(blocks[0] == [16231271, 16231322]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//51M - 14
assert!(blocks[0] == [16237657, 16237708]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//9S42M - 15
assert!(blocks[0] == [16255012, 16255054]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//51M - 16
assert!(blocks[0] == [16255391, 16255442]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//50M1S - 17
assert!(blocks[0] == [16255392, 16255442]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//45M6S - 18
assert!(blocks[0] == [16256084, 16256129]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//3S48M - 19
assert!(blocks[0] == [16256224, 16256272]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//42M9S - 20
assert!(blocks[0] == [16325199, 16325241]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//13S38M - 21
assert!(blocks[0] == [16352865, 16352903]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//44M7S - 22
assert!(blocks[0] == [16352968, 16353012]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//5S46M - 23
assert!(blocks[0] == [16414998, 16415044]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//23M4I24M - 24
assert!(blocks[0] == [17031591, 17031614]);
//23M4I24M - 24
assert!(blocks[1] == [17031614, 17031638]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//18M1I32M - 25
assert!(blocks[0] == [17057382, 17057400]);
//18M1I32M - 25
assert!(blocks[1] == [17057400, 17057432]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//17M2183N34M - 26
assert!(blocks[0] == [17092766, 17092783]);
//17M2183N34M - 26
assert!(blocks[1] == [17094966, 17095000]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//1M2183N50M - 27
assert!(blocks[0] == [17092782, 17092783]);
//1M2183N50M - 27
assert!(blocks[1] == [17094966, 17095016]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//1M2183N50M - 28
assert!(blocks[0] == [17092782, 17092783]);
//1M2183N50M - 28
assert!(blocks[1] == [17094966, 17095016]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//9S33M9S - 29
assert!(blocks[0] == [17137287, 17137320]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//2S48M1S - 30
assert!(blocks[0] == [17306238, 17306286]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//4S45M2S - 31
assert!(blocks[0] == [17561868, 17561913]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//41M11832N10M - 32
assert!(blocks[0] == [17566078, 17566119]);
//41M11832N10M - 32
assert!(blocks[1] == [17577951, 17577961]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//11M11832N25M710N15M - 33
assert!(blocks[0] == [17566108, 17566119]);
//11M11832N25M710N15M - 33
assert!(blocks[1] == [17577951, 17577976]);
//11M11832N25M710N15M - 33
assert!(blocks[2] == [17578686, 17578701]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//8M11832N25M710N18M - 34
assert!(blocks[0] == [17566111, 17566119]);
//8M11832N25M710N18M - 34
assert!(blocks[1] == [17577951, 17577976]);
//8M11832N25M710N18M - 34
assert!(blocks[2] == [17578686, 17578704]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//8M11832N25M710N18M - 35
assert!(blocks[0] == [17566111, 17566119]);
//8M11832N25M710N18M - 35
assert!(blocks[1] == [17577951, 17577976]);
//8M11832N25M710N18M - 35
assert!(blocks[2] == [17578686, 17578704]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//8M11832N25M710N18M - 36
assert!(blocks[0] == [17566111, 17566119]);
//8M11832N25M710N18M - 36
assert!(blocks[1] == [17577951, 17577976]);
//8M11832N25M710N18M - 36
assert!(blocks[2] == [17578686, 17578704]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//8M11832N25M710N18M - 37
assert!(blocks[0] == [17566111, 17566119]);
//8M11832N25M710N18M - 37
assert!(blocks[1] == [17577951, 17577976]);
//8M11832N25M710N18M - 37
assert!(blocks[2] == [17578686, 17578704]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//7M11832N25M710N19M - 38
assert!(blocks[0] == [17566112, 17566119]);
//7M11832N25M710N19M - 38
assert!(blocks[1] == [17577951, 17577976]);
//7M11832N25M710N19M - 38
assert!(blocks[2] == [17578686, 17578705]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//6M11832N25M710N20M - 39
assert!(blocks[0] == [17566113, 17566119]);
//6M11832N25M710N20M - 39
assert!(blocks[1] == [17577951, 17577976]);
//6M11832N25M710N20M - 39
assert!(blocks[2] == [17578686, 17578706]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//6M11832N25M710N20M - 40
assert!(blocks[0] == [17566113, 17566119]);
//6M11832N25M710N20M - 40
assert!(blocks[1] == [17577951, 17577976]);
//6M11832N25M710N20M - 40
assert!(blocks[2] == [17578686, 17578706]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//1S44M1467N6M - 41
assert!(blocks[0] == [17579733, 17579777]);
//1S44M1467N6M - 41
assert!(blocks[1] == [17581244, 17581250]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//2M1514N48M95N1M - 42
assert!(blocks[0] == [17581369, 17581371]);
//2M1514N48M95N1M - 42
assert!(blocks[1] == [17582885, 17582933]);
//2M1514N48M95N1M - 42
assert!(blocks[2] == [17583028, 17583029]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//1M1514N48M95N2M - 43
assert!(blocks[0] == [17581370, 17581371]);
//1M1514N48M95N2M - 43
assert!(blocks[1] == [17582885, 17582933]);
//1M1514N48M95N2M - 43
assert!(blocks[2] == [17583028, 17583030]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//1M1514N48M95N2M - 44
assert!(blocks[0] == [17581370, 17581371]);
//1M1514N48M95N2M - 44
assert!(blocks[1] == [17582885, 17582933]);
//1M1514N48M95N2M - 44
assert!(blocks[2] == [17583028, 17583030]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//1S22M95N28M - 45
assert!(blocks[0] == [17582911, 17582933]);
//1S22M95N28M - 45
assert!(blocks[1] == [17583028, 17583056]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//37M538N13M1S - 46
assert!(blocks[0] == [17588621, 17588658]);
//37M538N13M1S - 46
assert!(blocks[1] == [17589196, 17589209]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//37M538N13M1S - 47
assert!(blocks[0] == [17588621, 17588658]);
//37M538N13M1S - 47
assert!(blocks[1] == [17589196, 17589209]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//37M538N13M1S - 48
assert!(blocks[0] == [17588621, 17588658]);
//37M538N13M1S - 48
assert!(blocks[1] == [17589196, 17589209]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//1S25M1D25M - 49
assert!(blocks[0] == [17591770, 17591795]);
//1S25M1D25M - 49
assert!(blocks[1] == [17591796, 17591821]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//24M1D24M3S - 50
assert!(blocks[0] == [17593855, 17593879]);
//24M1D24M3S - 50
assert!(blocks[1] == [17593880, 17593904]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//16M1D28M7S - 51
assert!(blocks[0] == [17593863, 17593879]);
//16M1D28M7S - 51
assert!(blocks[1] == [17593880, 17593908]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//11S7M1I32M - 52
assert!(blocks[0] == [17596476, 17596483]);
//11S7M1I32M - 52
assert!(blocks[1] == [17596483, 17596515]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//5S9M1892N37M - 53
assert!(blocks[0] == [17624012, 17624021]);
//5S9M1892N37M - 53
assert!(blocks[1] == [17625913, 17625950]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//2S9M1892N40M - 54
assert!(blocks[0] == [17624012, 17624021]);
//2S9M1892N40M - 54
assert!(blocks[1] == [17625913, 17625953]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//1S7M3D19M2285N24M - 55
assert!(blocks[0] == [31796700, 31796707]);
//1S7M3D19M2285N24M - 55
assert!(blocks[1] == [31796710, 31796729]);
//1S7M3D19M2285N24M - 55
assert!(blocks[2] == [31799014, 31799038]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//14M799N28M13881N7M2S - 56
assert!(blocks[0] == [36722692, 36722706]);
//14M799N28M13881N7M2S - 56
assert!(blocks[1] == [36723505, 36723533]);
//14M799N28M13881N7M2S - 56
assert!(blocks[2] == [36737414, 36737421]);
let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();
//4S21M1696N23M2331N3M - 57
assert!(blocks[0] == [44587963, 44587984]);
//4S21M1696N23M2331N3M - 57
assert!(blocks[1] == [44589680, 44589703]);
//4S21M1696N23M2331N3M - 57
assert!(blocks[2] == [44592034, 44592037]);
}
#[test]
fn test_introns() {
let mut bam = bam::Reader::from_path("./test/test_spliced_reads.bam").unwrap();
let mut it = bam.records();
//6S45M - 0
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 0);
//7M2D44M - 1
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 0);
//29M2D22M - 2
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 0);
//51M - 3
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 0);
//51M - 4
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 0);
//51M - 5
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 0);
//51M - 6
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 0);
//51M - 7
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 0);
//51M - 8
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 0);
//6S45M - 9
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 0);
//41M10S - 10
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 0);
//51M - 11
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 0);
//51M - 12
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 0);
//51M - 13
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 0);
//51M - 14
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 0);
//9S42M - 15
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 0);
//51M - 16
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 0);
//50M1S - 17
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 0);
//45M6S - 18
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 0);
//3S48M - 19
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 0);
//42M9S - 20
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 0);
//13S38M - 21
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 0);
//44M7S - 22
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 0);
//5S46M - 23
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 0);
//23M4I24M - 24
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 0);
//18M1I32M - 25
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 0);
//17M2183N34M - 26
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 1);
assert_eq!(introns[0], [17092783, 17094966]);
//1M2183N50M - 27
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 1);
assert_eq!(introns[0], [17092783, 17094966]);
//1M2183N50M - 28
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 1);
assert_eq!(introns[0], [17092783, 17094966]);
//9S33M9S - 29
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 0);
//2S48M1S - 30
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 0);
//4S45M2S - 31
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 0);
//41M11832N10M - 32
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 1);
assert_eq!(introns[0], [17566119, 17577951]);
//11M11832N25M710N15M - 33
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 2);
assert_eq!(introns[0], [17566119, 17577951]);
assert_eq!(introns[1], [17577976, 17578686]);
//8M11832N25M710N18M - 34
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 2);
assert_eq!(introns[0], [17566119, 17577951]);
assert_eq!(introns[1], [17577976, 17578686]);
//8M11832N25M710N18M - 35
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 2);
assert_eq!(introns[0], [17566119, 17577951]);
assert_eq!(introns[1], [17577976, 17578686]);
//8M11832N25M710N18M - 36
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 2);
assert_eq!(introns[0], [17566119, 17577951]);
assert_eq!(introns[1], [17577976, 17578686]);
//8M11832N25M710N18M - 37
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 2);
assert_eq!(introns[0], [17566119, 17577951]);
assert_eq!(introns[1], [17577976, 17578686]);
//7M11832N25M710N19M - 38
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 2);
assert_eq!(introns[0], [17566119, 17577951]);
assert_eq!(introns[1], [17577976, 17578686]);
//6M11832N25M710N20M - 39
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 2);
assert_eq!(introns[0], [17566119, 17577951]);
assert_eq!(introns[1], [17577976, 17578686]);
//6M11832N25M710N20M - 40
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 2);
assert_eq!(introns[0], [17566119, 17577951]);
assert_eq!(introns[1], [17577976, 17578686]);
//1S44M1467N6M - 41
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 1);
assert_eq!(introns[0], [17579777, 17581244]);
//2M1514N48M95N1M - 42
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 2);
assert_eq!(introns[0], [17581371, 17582885]);
assert_eq!(introns[1], [17582933, 17583028]);
//1M1514N48M95N2M - 43
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 2);
assert_eq!(introns[0], [17581371, 17582885]);
assert_eq!(introns[1], [17582933, 17583028]);
//1M1514N48M95N2M - 44
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 2);
assert_eq!(introns[0], [17581371, 17582885]);
assert_eq!(introns[1], [17582933, 17583028]);
//1S22M95N28M - 45
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 1);
assert_eq!(introns[0], [17582933, 17583028]);
//37M538N13M1S - 46
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 1);
assert_eq!(introns[0], [17588658, 17589196]);
//37M538N13M1S - 47
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 1);
assert_eq!(introns[0], [17588658, 17589196]);
//37M538N13M1S - 48
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 1);
assert_eq!(introns[0], [17588658, 17589196]);
//1S25M1D25M - 49
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 0);
//24M1D24M3S - 50
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 0);
//16M1D28M7S - 51
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 0);
//11S7M1I32M - 52
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 0);
//5S9M1892N37M - 53
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 1);
assert_eq!(introns[0], [17624021, 17625913]);
//2S9M1892N40M - 54
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 1);
assert_eq!(introns[0], [17624021, 17625913]);
//1S7M3D19M2285N24M - 55
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 1);
assert_eq!(introns[0], [31796729, 31799014]);
//14M799N28M13881N7M2S - 56
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 2);
assert_eq!(introns[0], [36722706, 36723505]);
assert_eq!(introns[1], [36723533, 36737414]);
//4S21M1696N23M2331N3M - 57
let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();
assert_eq!(introns.len(), 2);
assert_eq!(introns[0], [44587984, 44589680]);
assert_eq!(introns[1], [44589703, 44592034]);
}
#[test]
fn test_aligned_pairs() {
let mut bam = bam::Reader::from_path("./test/test_spliced_reads.bam").unwrap();
let mut it = bam.records();
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[6, 16050676],
[7, 16050677],
[8, 16050678],
[9, 16050679],
[10, 16050680],
[11, 16050681],
[12, 16050682],
[13, 16050683],
[14, 16050684],
[15, 16050685],
[16, 16050686],
[17, 16050687],
[18, 16050688],
[19, 16050689],
[20, 16050690],
[21, 16050691],
[22, 16050692],
[23, 16050693],
[24, 16050694],
[25, 16050695],
[26, 16050696],
[27, 16050697],
[28, 16050698],
[29, 16050699],
[30, 16050700],
[31, 16050701],
[32, 16050702],
[33, 16050703],
[34, 16050704],
[35, 16050705],
[36, 16050706],
[37, 16050707],
[38, 16050708],
[39, 16050709],
[40, 16050710],
[41, 16050711],
[42, 16050712],
[43, 16050713],
[44, 16050714],
[45, 16050715],
[46, 16050716],
[47, 16050717],
[48, 16050718],
[49, 16050719],
[50, 16050720]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 16096878],
[1, 16096879],
[2, 16096880],
[3, 16096881],
[4, 16096882],
[5, 16096883],
[6, 16096884],
[7, 16096887],
[8, 16096888],
[9, 16096889],
[10, 16096890],
[11, 16096891],
[12, 16096892],
[13, 16096893],
[14, 16096894],
[15, 16096895],
[16, 16096896],
[17, 16096897],
[18, 16096898],
[19, 16096899],
[20, 16096900],
[21, 16096901],
[22, 16096902],
[23, 16096903],
[24, 16096904],
[25, 16096905],
[26, 16096906],
[27, 16096907],
[28, 16096908],
[29, 16096909],
[30, 16096910],
[31, 16096911],
[32, 16096912],
[33, 16096913],
[34, 16096914],
[35, 16096915],
[36, 16096916],
[37, 16096917],
[38, 16096918],
[39, 16096919],
[40, 16096920],
[41, 16096921],
[42, 16096922],
[43, 16096923],
[44, 16096924],
[45, 16096925],
[46, 16096926],
[47, 16096927],
[48, 16096928],
[49, 16096929],
[50, 16096930]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 16097145],
[1, 16097146],
[2, 16097147],
[3, 16097148],
[4, 16097149],
[5, 16097150],
[6, 16097151],
[7, 16097152],
[8, 16097153],
[9, 16097154],
[10, 16097155],
[11, 16097156],
[12, 16097157],
[13, 16097158],
[14, 16097159],
[15, 16097160],
[16, 16097161],
[17, 16097162],
[18, 16097163],
[19, 16097164],
[20, 16097165],
[21, 16097166],
[22, 16097167],
[23, 16097168],
[24, 16097169],
[25, 16097170],
[26, 16097171],
[27, 16097172],
[28, 16097173],
[29, 16097176],
[30, 16097177],
[31, 16097178],
[32, 16097179],
[33, 16097180],
[34, 16097181],
[35, 16097182],
[36, 16097183],
[37, 16097184],
[38, 16097185],
[39, 16097186],
[40, 16097187],
[41, 16097188],
[42, 16097189],
[43, 16097190],
[44, 16097191],
[45, 16097192],
[46, 16097193],
[47, 16097194],
[48, 16097195],
[49, 16097196],
[50, 16097197]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 16117350],
[1, 16117351],
[2, 16117352],
[3, 16117353],
[4, 16117354],
[5, 16117355],
[6, 16117356],
[7, 16117357],
[8, 16117358],
[9, 16117359],
[10, 16117360],
[11, 16117361],
[12, 16117362],
[13, 16117363],
[14, 16117364],
[15, 16117365],
[16, 16117366],
[17, 16117367],
[18, 16117368],
[19, 16117369],
[20, 16117370],
[21, 16117371],
[22, 16117372],
[23, 16117373],
[24, 16117374],
[25, 16117375],
[26, 16117376],
[27, 16117377],
[28, 16117378],
[29, 16117379],
[30, 16117380],
[31, 16117381],
[32, 16117382],
[33, 16117383],
[34, 16117384],
[35, 16117385],
[36, 16117386],
[37, 16117387],
[38, 16117388],
[39, 16117389],
[40, 16117390],
[41, 16117391],
[42, 16117392],
[43, 16117393],
[44, 16117394],
[45, 16117395],
[46, 16117396],
[47, 16117397],
[48, 16117398],
[49, 16117399],
[50, 16117400]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 16118483],
[1, 16118484],
[2, 16118485],
[3, 16118486],
[4, 16118487],
[5, 16118488],
[6, 16118489],
[7, 16118490],
[8, 16118491],
[9, 16118492],
[10, 16118493],
[11, 16118494],
[12, 16118495],
[13, 16118496],
[14, 16118497],
[15, 16118498],
[16, 16118499],
[17, 16118500],
[18, 16118501],
[19, 16118502],
[20, 16118503],
[21, 16118504],
[22, 16118505],
[23, 16118506],
[24, 16118507],
[25, 16118508],
[26, 16118509],
[27, 16118510],
[28, 16118511],
[29, 16118512],
[30, 16118513],
[31, 16118514],
[32, 16118515],
[33, 16118516],
[34, 16118517],
[35, 16118518],
[36, 16118519],
[37, 16118520],
[38, 16118521],
[39, 16118522],
[40, 16118523],
[41, 16118524],
[42, 16118525],
[43, 16118526],
[44, 16118527],
[45, 16118528],
[46, 16118529],
[47, 16118530],
[48, 16118531],
[49, 16118532],
[50, 16118533]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 16118499],
[1, 16118500],
[2, 16118501],
[3, 16118502],
[4, 16118503],
[5, 16118504],
[6, 16118505],
[7, 16118506],
[8, 16118507],
[9, 16118508],
[10, 16118509],
[11, 16118510],
[12, 16118511],
[13, 16118512],
[14, 16118513],
[15, 16118514],
[16, 16118515],
[17, 16118516],
[18, 16118517],
[19, 16118518],
[20, 16118519],
[21, 16118520],
[22, 16118521],
[23, 16118522],
[24, 16118523],
[25, 16118524],
[26, 16118525],
[27, 16118526],
[28, 16118527],
[29, 16118528],
[30, 16118529],
[31, 16118530],
[32, 16118531],
[33, 16118532],
[34, 16118533],
[35, 16118534],
[36, 16118535],
[37, 16118536],
[38, 16118537],
[39, 16118538],
[40, 16118539],
[41, 16118540],
[42, 16118541],
[43, 16118542],
[44, 16118543],
[45, 16118544],
[46, 16118545],
[47, 16118546],
[48, 16118547],
[49, 16118548],
[50, 16118549]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 16118499],
[1, 16118500],
[2, 16118501],
[3, 16118502],
[4, 16118503],
[5, 16118504],
[6, 16118505],
[7, 16118506],
[8, 16118507],
[9, 16118508],
[10, 16118509],
[11, 16118510],
[12, 16118511],
[13, 16118512],
[14, 16118513],
[15, 16118514],
[16, 16118515],
[17, 16118516],
[18, 16118517],
[19, 16118518],
[20, 16118519],
[21, 16118520],
[22, 16118521],
[23, 16118522],
[24, 16118523],
[25, 16118524],
[26, 16118525],
[27, 16118526],
[28, 16118527],
[29, 16118528],
[30, 16118529],
[31, 16118530],
[32, 16118531],
[33, 16118532],
[34, 16118533],
[35, 16118534],
[36, 16118535],
[37, 16118536],
[38, 16118537],
[39, 16118538],
[40, 16118539],
[41, 16118540],
[42, 16118541],
[43, 16118542],
[44, 16118543],
[45, 16118544],
[46, 16118545],
[47, 16118546],
[48, 16118547],
[49, 16118548],
[50, 16118549]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 16118499],
[1, 16118500],
[2, 16118501],
[3, 16118502],
[4, 16118503],
[5, 16118504],
[6, 16118505],
[7, 16118506],
[8, 16118507],
[9, 16118508],
[10, 16118509],
[11, 16118510],
[12, 16118511],
[13, 16118512],
[14, 16118513],
[15, 16118514],
[16, 16118515],
[17, 16118516],
[18, 16118517],
[19, 16118518],
[20, 16118519],
[21, 16118520],
[22, 16118521],
[23, 16118522],
[24, 16118523],
[25, 16118524],
[26, 16118525],
[27, 16118526],
[28, 16118527],
[29, 16118528],
[30, 16118529],
[31, 16118530],
[32, 16118531],
[33, 16118532],
[34, 16118533],
[35, 16118534],
[36, 16118535],
[37, 16118536],
[38, 16118537],
[39, 16118538],
[40, 16118539],
[41, 16118540],
[42, 16118541],
[43, 16118542],
[44, 16118543],
[45, 16118544],
[46, 16118545],
[47, 16118546],
[48, 16118547],
[49, 16118548],
[50, 16118549]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 16123411],
[1, 16123412],
[2, 16123413],
[3, 16123414],
[4, 16123415],
[5, 16123416],
[6, 16123417],
[7, 16123418],
[8, 16123419],
[9, 16123420],
[10, 16123421],
[11, 16123422],
[12, 16123423],
[13, 16123424],
[14, 16123425],
[15, 16123426],
[16, 16123427],
[17, 16123428],
[18, 16123429],
[19, 16123430],
[20, 16123431],
[21, 16123432],
[22, 16123433],
[23, 16123434],
[24, 16123435],
[25, 16123436],
[26, 16123437],
[27, 16123438],
[28, 16123439],
[29, 16123440],
[30, 16123441],
[31, 16123442],
[32, 16123443],
[33, 16123444],
[34, 16123445],
[35, 16123446],
[36, 16123447],
[37, 16123448],
[38, 16123449],
[39, 16123450],
[40, 16123451],
[41, 16123452],
[42, 16123453],
[43, 16123454],
[44, 16123455],
[45, 16123456],
[46, 16123457],
[47, 16123458],
[48, 16123459],
[49, 16123460],
[50, 16123461]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[6, 16123417],
[7, 16123418],
[8, 16123419],
[9, 16123420],
[10, 16123421],
[11, 16123422],
[12, 16123423],
[13, 16123424],
[14, 16123425],
[15, 16123426],
[16, 16123427],
[17, 16123428],
[18, 16123429],
[19, 16123430],
[20, 16123431],
[21, 16123432],
[22, 16123433],
[23, 16123434],
[24, 16123435],
[25, 16123436],
[26, 16123437],
[27, 16123438],
[28, 16123439],
[29, 16123440],
[30, 16123441],
[31, 16123442],
[32, 16123443],
[33, 16123444],
[34, 16123445],
[35, 16123446],
[36, 16123447],
[37, 16123448],
[38, 16123449],
[39, 16123450],
[40, 16123451],
[41, 16123452],
[42, 16123453],
[43, 16123454],
[44, 16123455],
[45, 16123456],
[46, 16123457],
[47, 16123458],
[48, 16123459],
[49, 16123460],
[50, 16123461]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 16165860],
[1, 16165861],
[2, 16165862],
[3, 16165863],
[4, 16165864],
[5, 16165865],
[6, 16165866],
[7, 16165867],
[8, 16165868],
[9, 16165869],
[10, 16165870],
[11, 16165871],
[12, 16165872],
[13, 16165873],
[14, 16165874],
[15, 16165875],
[16, 16165876],
[17, 16165877],
[18, 16165878],
[19, 16165879],
[20, 16165880],
[21, 16165881],
[22, 16165882],
[23, 16165883],
[24, 16165884],
[25, 16165885],
[26, 16165886],
[27, 16165887],
[28, 16165888],
[29, 16165889],
[30, 16165890],
[31, 16165891],
[32, 16165892],
[33, 16165893],
[34, 16165894],
[35, 16165895],
[36, 16165896],
[37, 16165897],
[38, 16165898],
[39, 16165899],
[40, 16165900]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 16180871],
[1, 16180872],
[2, 16180873],
[3, 16180874],
[4, 16180875],
[5, 16180876],
[6, 16180877],
[7, 16180878],
[8, 16180879],
[9, 16180880],
[10, 16180881],
[11, 16180882],
[12, 16180883],
[13, 16180884],
[14, 16180885],
[15, 16180886],
[16, 16180887],
[17, 16180888],
[18, 16180889],
[19, 16180890],
[20, 16180891],
[21, 16180892],
[22, 16180893],
[23, 16180894],
[24, 16180895],
[25, 16180896],
[26, 16180897],
[27, 16180898],
[28, 16180899],
[29, 16180900],
[30, 16180901],
[31, 16180902],
[32, 16180903],
[33, 16180904],
[34, 16180905],
[35, 16180906],
[36, 16180907],
[37, 16180908],
[38, 16180909],
[39, 16180910],
[40, 16180911],
[41, 16180912],
[42, 16180913],
[43, 16180914],
[44, 16180915],
[45, 16180916],
[46, 16180917],
[47, 16180918],
[48, 16180919],
[49, 16180920],
[50, 16180921]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 16189705],
[1, 16189706],
[2, 16189707],
[3, 16189708],
[4, 16189709],
[5, 16189710],
[6, 16189711],
[7, 16189712],
[8, 16189713],
[9, 16189714],
[10, 16189715],
[11, 16189716],
[12, 16189717],
[13, 16189718],
[14, 16189719],
[15, 16189720],
[16, 16189721],
[17, 16189722],
[18, 16189723],
[19, 16189724],
[20, 16189725],
[21, 16189726],
[22, 16189727],
[23, 16189728],
[24, 16189729],
[25, 16189730],
[26, 16189731],
[27, 16189732],
[28, 16189733],
[29, 16189734],
[30, 16189735],
[31, 16189736],
[32, 16189737],
[33, 16189738],
[34, 16189739],
[35, 16189740],
[36, 16189741],
[37, 16189742],
[38, 16189743],
[39, 16189744],
[40, 16189745],
[41, 16189746],
[42, 16189747],
[43, 16189748],
[44, 16189749],
[45, 16189750],
[46, 16189751],
[47, 16189752],
[48, 16189753],
[49, 16189754],
[50, 16189755]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 16231271],
[1, 16231272],
[2, 16231273],
[3, 16231274],
[4, 16231275],
[5, 16231276],
[6, 16231277],
[7, 16231278],
[8, 16231279],
[9, 16231280],
[10, 16231281],
[11, 16231282],
[12, 16231283],
[13, 16231284],
[14, 16231285],
[15, 16231286],
[16, 16231287],
[17, 16231288],
[18, 16231289],
[19, 16231290],
[20, 16231291],
[21, 16231292],
[22, 16231293],
[23, 16231294],
[24, 16231295],
[25, 16231296],
[26, 16231297],
[27, 16231298],
[28, 16231299],
[29, 16231300],
[30, 16231301],
[31, 16231302],
[32, 16231303],
[33, 16231304],
[34, 16231305],
[35, 16231306],
[36, 16231307],
[37, 16231308],
[38, 16231309],
[39, 16231310],
[40, 16231311],
[41, 16231312],
[42, 16231313],
[43, 16231314],
[44, 16231315],
[45, 16231316],
[46, 16231317],
[47, 16231318],
[48, 16231319],
[49, 16231320],
[50, 16231321]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 16237657],
[1, 16237658],
[2, 16237659],
[3, 16237660],
[4, 16237661],
[5, 16237662],
[6, 16237663],
[7, 16237664],
[8, 16237665],
[9, 16237666],
[10, 16237667],
[11, 16237668],
[12, 16237669],
[13, 16237670],
[14, 16237671],
[15, 16237672],
[16, 16237673],
[17, 16237674],
[18, 16237675],
[19, 16237676],
[20, 16237677],
[21, 16237678],
[22, 16237679],
[23, 16237680],
[24, 16237681],
[25, 16237682],
[26, 16237683],
[27, 16237684],
[28, 16237685],
[29, 16237686],
[30, 16237687],
[31, 16237688],
[32, 16237689],
[33, 16237690],
[34, 16237691],
[35, 16237692],
[36, 16237693],
[37, 16237694],
[38, 16237695],
[39, 16237696],
[40, 16237697],
[41, 16237698],
[42, 16237699],
[43, 16237700],
[44, 16237701],
[45, 16237702],
[46, 16237703],
[47, 16237704],
[48, 16237705],
[49, 16237706],
[50, 16237707]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[9, 16255012],
[10, 16255013],
[11, 16255014],
[12, 16255015],
[13, 16255016],
[14, 16255017],
[15, 16255018],
[16, 16255019],
[17, 16255020],
[18, 16255021],
[19, 16255022],
[20, 16255023],
[21, 16255024],
[22, 16255025],
[23, 16255026],
[24, 16255027],
[25, 16255028],
[26, 16255029],
[27, 16255030],
[28, 16255031],
[29, 16255032],
[30, 16255033],
[31, 16255034],
[32, 16255035],
[33, 16255036],
[34, 16255037],
[35, 16255038],
[36, 16255039],
[37, 16255040],
[38, 16255041],
[39, 16255042],
[40, 16255043],
[41, 16255044],
[42, 16255045],
[43, 16255046],
[44, 16255047],
[45, 16255048],
[46, 16255049],
[47, 16255050],
[48, 16255051],
[49, 16255052],
[50, 16255053]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 16255391],
[1, 16255392],
[2, 16255393],
[3, 16255394],
[4, 16255395],
[5, 16255396],
[6, 16255397],
[7, 16255398],
[8, 16255399],
[9, 16255400],
[10, 16255401],
[11, 16255402],
[12, 16255403],
[13, 16255404],
[14, 16255405],
[15, 16255406],
[16, 16255407],
[17, 16255408],
[18, 16255409],
[19, 16255410],
[20, 16255411],
[21, 16255412],
[22, 16255413],
[23, 16255414],
[24, 16255415],
[25, 16255416],
[26, 16255417],
[27, 16255418],
[28, 16255419],
[29, 16255420],
[30, 16255421],
[31, 16255422],
[32, 16255423],
[33, 16255424],
[34, 16255425],
[35, 16255426],
[36, 16255427],
[37, 16255428],
[38, 16255429],
[39, 16255430],
[40, 16255431],
[41, 16255432],
[42, 16255433],
[43, 16255434],
[44, 16255435],
[45, 16255436],
[46, 16255437],
[47, 16255438],
[48, 16255439],
[49, 16255440],
[50, 16255441]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 16255392],
[1, 16255393],
[2, 16255394],
[3, 16255395],
[4, 16255396],
[5, 16255397],
[6, 16255398],
[7, 16255399],
[8, 16255400],
[9, 16255401],
[10, 16255402],
[11, 16255403],
[12, 16255404],
[13, 16255405],
[14, 16255406],
[15, 16255407],
[16, 16255408],
[17, 16255409],
[18, 16255410],
[19, 16255411],
[20, 16255412],
[21, 16255413],
[22, 16255414],
[23, 16255415],
[24, 16255416],
[25, 16255417],
[26, 16255418],
[27, 16255419],
[28, 16255420],
[29, 16255421],
[30, 16255422],
[31, 16255423],
[32, 16255424],
[33, 16255425],
[34, 16255426],
[35, 16255427],
[36, 16255428],
[37, 16255429],
[38, 16255430],
[39, 16255431],
[40, 16255432],
[41, 16255433],
[42, 16255434],
[43, 16255435],
[44, 16255436],
[45, 16255437],
[46, 16255438],
[47, 16255439],
[48, 16255440],
[49, 16255441]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 16256084],
[1, 16256085],
[2, 16256086],
[3, 16256087],
[4, 16256088],
[5, 16256089],
[6, 16256090],
[7, 16256091],
[8, 16256092],
[9, 16256093],
[10, 16256094],
[11, 16256095],
[12, 16256096],
[13, 16256097],
[14, 16256098],
[15, 16256099],
[16, 16256100],
[17, 16256101],
[18, 16256102],
[19, 16256103],
[20, 16256104],
[21, 16256105],
[22, 16256106],
[23, 16256107],
[24, 16256108],
[25, 16256109],
[26, 16256110],
[27, 16256111],
[28, 16256112],
[29, 16256113],
[30, 16256114],
[31, 16256115],
[32, 16256116],
[33, 16256117],
[34, 16256118],
[35, 16256119],
[36, 16256120],
[37, 16256121],
[38, 16256122],
[39, 16256123],
[40, 16256124],
[41, 16256125],
[42, 16256126],
[43, 16256127],
[44, 16256128]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[3, 16256224],
[4, 16256225],
[5, 16256226],
[6, 16256227],
[7, 16256228],
[8, 16256229],
[9, 16256230],
[10, 16256231],
[11, 16256232],
[12, 16256233],
[13, 16256234],
[14, 16256235],
[15, 16256236],
[16, 16256237],
[17, 16256238],
[18, 16256239],
[19, 16256240],
[20, 16256241],
[21, 16256242],
[22, 16256243],
[23, 16256244],
[24, 16256245],
[25, 16256246],
[26, 16256247],
[27, 16256248],
[28, 16256249],
[29, 16256250],
[30, 16256251],
[31, 16256252],
[32, 16256253],
[33, 16256254],
[34, 16256255],
[35, 16256256],
[36, 16256257],
[37, 16256258],
[38, 16256259],
[39, 16256260],
[40, 16256261],
[41, 16256262],
[42, 16256263],
[43, 16256264],
[44, 16256265],
[45, 16256266],
[46, 16256267],
[47, 16256268],
[48, 16256269],
[49, 16256270],
[50, 16256271]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 16325199],
[1, 16325200],
[2, 16325201],
[3, 16325202],
[4, 16325203],
[5, 16325204],
[6, 16325205],
[7, 16325206],
[8, 16325207],
[9, 16325208],
[10, 16325209],
[11, 16325210],
[12, 16325211],
[13, 16325212],
[14, 16325213],
[15, 16325214],
[16, 16325215],
[17, 16325216],
[18, 16325217],
[19, 16325218],
[20, 16325219],
[21, 16325220],
[22, 16325221],
[23, 16325222],
[24, 16325223],
[25, 16325224],
[26, 16325225],
[27, 16325226],
[28, 16325227],
[29, 16325228],
[30, 16325229],
[31, 16325230],
[32, 16325231],
[33, 16325232],
[34, 16325233],
[35, 16325234],
[36, 16325235],
[37, 16325236],
[38, 16325237],
[39, 16325238],
[40, 16325239],
[41, 16325240]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[13, 16352865],
[14, 16352866],
[15, 16352867],
[16, 16352868],
[17, 16352869],
[18, 16352870],
[19, 16352871],
[20, 16352872],
[21, 16352873],
[22, 16352874],
[23, 16352875],
[24, 16352876],
[25, 16352877],
[26, 16352878],
[27, 16352879],
[28, 16352880],
[29, 16352881],
[30, 16352882],
[31, 16352883],
[32, 16352884],
[33, 16352885],
[34, 16352886],
[35, 16352887],
[36, 16352888],
[37, 16352889],
[38, 16352890],
[39, 16352891],
[40, 16352892],
[41, 16352893],
[42, 16352894],
[43, 16352895],
[44, 16352896],
[45, 16352897],
[46, 16352898],
[47, 16352899],
[48, 16352900],
[49, 16352901],
[50, 16352902]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 16352968],
[1, 16352969],
[2, 16352970],
[3, 16352971],
[4, 16352972],
[5, 16352973],
[6, 16352974],
[7, 16352975],
[8, 16352976],
[9, 16352977],
[10, 16352978],
[11, 16352979],
[12, 16352980],
[13, 16352981],
[14, 16352982],
[15, 16352983],
[16, 16352984],
[17, 16352985],
[18, 16352986],
[19, 16352987],
[20, 16352988],
[21, 16352989],
[22, 16352990],
[23, 16352991],
[24, 16352992],
[25, 16352993],
[26, 16352994],
[27, 16352995],
[28, 16352996],
[29, 16352997],
[30, 16352998],
[31, 16352999],
[32, 16353000],
[33, 16353001],
[34, 16353002],
[35, 16353003],
[36, 16353004],
[37, 16353005],
[38, 16353006],
[39, 16353007],
[40, 16353008],
[41, 16353009],
[42, 16353010],
[43, 16353011]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[5, 16414998],
[6, 16414999],
[7, 16415000],
[8, 16415001],
[9, 16415002],
[10, 16415003],
[11, 16415004],
[12, 16415005],
[13, 16415006],
[14, 16415007],
[15, 16415008],
[16, 16415009],
[17, 16415010],
[18, 16415011],
[19, 16415012],
[20, 16415013],
[21, 16415014],
[22, 16415015],
[23, 16415016],
[24, 16415017],
[25, 16415018],
[26, 16415019],
[27, 16415020],
[28, 16415021],
[29, 16415022],
[30, 16415023],
[31, 16415024],
[32, 16415025],
[33, 16415026],
[34, 16415027],
[35, 16415028],
[36, 16415029],
[37, 16415030],
[38, 16415031],
[39, 16415032],
[40, 16415033],
[41, 16415034],
[42, 16415035],
[43, 16415036],
[44, 16415037],
[45, 16415038],
[46, 16415039],
[47, 16415040],
[48, 16415041],
[49, 16415042],
[50, 16415043]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 17031591],
[1, 17031592],
[2, 17031593],
[3, 17031594],
[4, 17031595],
[5, 17031596],
[6, 17031597],
[7, 17031598],
[8, 17031599],
[9, 17031600],
[10, 17031601],
[11, 17031602],
[12, 17031603],
[13, 17031604],
[14, 17031605],
[15, 17031606],
[16, 17031607],
[17, 17031608],
[18, 17031609],
[19, 17031610],
[20, 17031611],
[21, 17031612],
[22, 17031613],
[27, 17031614],
[28, 17031615],
[29, 17031616],
[30, 17031617],
[31, 17031618],
[32, 17031619],
[33, 17031620],
[34, 17031621],
[35, 17031622],
[36, 17031623],
[37, 17031624],
[38, 17031625],
[39, 17031626],
[40, 17031627],
[41, 17031628],
[42, 17031629],
[43, 17031630],
[44, 17031631],
[45, 17031632],
[46, 17031633],
[47, 17031634],
[48, 17031635],
[49, 17031636],
[50, 17031637]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 17057382],
[1, 17057383],
[2, 17057384],
[3, 17057385],
[4, 17057386],
[5, 17057387],
[6, 17057388],
[7, 17057389],
[8, 17057390],
[9, 17057391],
[10, 17057392],
[11, 17057393],
[12, 17057394],
[13, 17057395],
[14, 17057396],
[15, 17057397],
[16, 17057398],
[17, 17057399],
[19, 17057400],
[20, 17057401],
[21, 17057402],
[22, 17057403],
[23, 17057404],
[24, 17057405],
[25, 17057406],
[26, 17057407],
[27, 17057408],
[28, 17057409],
[29, 17057410],
[30, 17057411],
[31, 17057412],
[32, 17057413],
[33, 17057414],
[34, 17057415],
[35, 17057416],
[36, 17057417],
[37, 17057418],
[38, 17057419],
[39, 17057420],
[40, 17057421],
[41, 17057422],
[42, 17057423],
[43, 17057424],
[44, 17057425],
[45, 17057426],
[46, 17057427],
[47, 17057428],
[48, 17057429],
[49, 17057430],
[50, 17057431]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 17092766],
[1, 17092767],
[2, 17092768],
[3, 17092769],
[4, 17092770],
[5, 17092771],
[6, 17092772],
[7, 17092773],
[8, 17092774],
[9, 17092775],
[10, 17092776],
[11, 17092777],
[12, 17092778],
[13, 17092779],
[14, 17092780],
[15, 17092781],
[16, 17092782],
[17, 17094966],
[18, 17094967],
[19, 17094968],
[20, 17094969],
[21, 17094970],
[22, 17094971],
[23, 17094972],
[24, 17094973],
[25, 17094974],
[26, 17094975],
[27, 17094976],
[28, 17094977],
[29, 17094978],
[30, 17094979],
[31, 17094980],
[32, 17094981],
[33, 17094982],
[34, 17094983],
[35, 17094984],
[36, 17094985],
[37, 17094986],
[38, 17094987],
[39, 17094988],
[40, 17094989],
[41, 17094990],
[42, 17094991],
[43, 17094992],
[44, 17094993],
[45, 17094994],
[46, 17094995],
[47, 17094996],
[48, 17094997],
[49, 17094998],
[50, 17094999]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 17092782],
[1, 17094966],
[2, 17094967],
[3, 17094968],
[4, 17094969],
[5, 17094970],
[6, 17094971],
[7, 17094972],
[8, 17094973],
[9, 17094974],
[10, 17094975],
[11, 17094976],
[12, 17094977],
[13, 17094978],
[14, 17094979],
[15, 17094980],
[16, 17094981],
[17, 17094982],
[18, 17094983],
[19, 17094984],
[20, 17094985],
[21, 17094986],
[22, 17094987],
[23, 17094988],
[24, 17094989],
[25, 17094990],
[26, 17094991],
[27, 17094992],
[28, 17094993],
[29, 17094994],
[30, 17094995],
[31, 17094996],
[32, 17094997],
[33, 17094998],
[34, 17094999],
[35, 17095000],
[36, 17095001],
[37, 17095002],
[38, 17095003],
[39, 17095004],
[40, 17095005],
[41, 17095006],
[42, 17095007],
[43, 17095008],
[44, 17095009],
[45, 17095010],
[46, 17095011],
[47, 17095012],
[48, 17095013],
[49, 17095014],
[50, 17095015]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 17092782],
[1, 17094966],
[2, 17094967],
[3, 17094968],
[4, 17094969],
[5, 17094970],
[6, 17094971],
[7, 17094972],
[8, 17094973],
[9, 17094974],
[10, 17094975],
[11, 17094976],
[12, 17094977],
[13, 17094978],
[14, 17094979],
[15, 17094980],
[16, 17094981],
[17, 17094982],
[18, 17094983],
[19, 17094984],
[20, 17094985],
[21, 17094986],
[22, 17094987],
[23, 17094988],
[24, 17094989],
[25, 17094990],
[26, 17094991],
[27, 17094992],
[28, 17094993],
[29, 17094994],
[30, 17094995],
[31, 17094996],
[32, 17094997],
[33, 17094998],
[34, 17094999],
[35, 17095000],
[36, 17095001],
[37, 17095002],
[38, 17095003],
[39, 17095004],
[40, 17095005],
[41, 17095006],
[42, 17095007],
[43, 17095008],
[44, 17095009],
[45, 17095010],
[46, 17095011],
[47, 17095012],
[48, 17095013],
[49, 17095014],
[50, 17095015]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[9, 17137287],
[10, 17137288],
[11, 17137289],
[12, 17137290],
[13, 17137291],
[14, 17137292],
[15, 17137293],
[16, 17137294],
[17, 17137295],
[18, 17137296],
[19, 17137297],
[20, 17137298],
[21, 17137299],
[22, 17137300],
[23, 17137301],
[24, 17137302],
[25, 17137303],
[26, 17137304],
[27, 17137305],
[28, 17137306],
[29, 17137307],
[30, 17137308],
[31, 17137309],
[32, 17137310],
[33, 17137311],
[34, 17137312],
[35, 17137313],
[36, 17137314],
[37, 17137315],
[38, 17137316],
[39, 17137317],
[40, 17137318],
[41, 17137319]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[2, 17306238],
[3, 17306239],
[4, 17306240],
[5, 17306241],
[6, 17306242],
[7, 17306243],
[8, 17306244],
[9, 17306245],
[10, 17306246],
[11, 17306247],
[12, 17306248],
[13, 17306249],
[14, 17306250],
[15, 17306251],
[16, 17306252],
[17, 17306253],
[18, 17306254],
[19, 17306255],
[20, 17306256],
[21, 17306257],
[22, 17306258],
[23, 17306259],
[24, 17306260],
[25, 17306261],
[26, 17306262],
[27, 17306263],
[28, 17306264],
[29, 17306265],
[30, 17306266],
[31, 17306267],
[32, 17306268],
[33, 17306269],
[34, 17306270],
[35, 17306271],
[36, 17306272],
[37, 17306273],
[38, 17306274],
[39, 17306275],
[40, 17306276],
[41, 17306277],
[42, 17306278],
[43, 17306279],
[44, 17306280],
[45, 17306281],
[46, 17306282],
[47, 17306283],
[48, 17306284],
[49, 17306285]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[4, 17561868],
[5, 17561869],
[6, 17561870],
[7, 17561871],
[8, 17561872],
[9, 17561873],
[10, 17561874],
[11, 17561875],
[12, 17561876],
[13, 17561877],
[14, 17561878],
[15, 17561879],
[16, 17561880],
[17, 17561881],
[18, 17561882],
[19, 17561883],
[20, 17561884],
[21, 17561885],
[22, 17561886],
[23, 17561887],
[24, 17561888],
[25, 17561889],
[26, 17561890],
[27, 17561891],
[28, 17561892],
[29, 17561893],
[30, 17561894],
[31, 17561895],
[32, 17561896],
[33, 17561897],
[34, 17561898],
[35, 17561899],
[36, 17561900],
[37, 17561901],
[38, 17561902],
[39, 17561903],
[40, 17561904],
[41, 17561905],
[42, 17561906],
[43, 17561907],
[44, 17561908],
[45, 17561909],
[46, 17561910],
[47, 17561911],
[48, 17561912]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 17566078],
[1, 17566079],
[2, 17566080],
[3, 17566081],
[4, 17566082],
[5, 17566083],
[6, 17566084],
[7, 17566085],
[8, 17566086],
[9, 17566087],
[10, 17566088],
[11, 17566089],
[12, 17566090],
[13, 17566091],
[14, 17566092],
[15, 17566093],
[16, 17566094],
[17, 17566095],
[18, 17566096],
[19, 17566097],
[20, 17566098],
[21, 17566099],
[22, 17566100],
[23, 17566101],
[24, 17566102],
[25, 17566103],
[26, 17566104],
[27, 17566105],
[28, 17566106],
[29, 17566107],
[30, 17566108],
[31, 17566109],
[32, 17566110],
[33, 17566111],
[34, 17566112],
[35, 17566113],
[36, 17566114],
[37, 17566115],
[38, 17566116],
[39, 17566117],
[40, 17566118],
[41, 17577951],
[42, 17577952],
[43, 17577953],
[44, 17577954],
[45, 17577955],
[46, 17577956],
[47, 17577957],
[48, 17577958],
[49, 17577959],
[50, 17577960]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 17566108],
[1, 17566109],
[2, 17566110],
[3, 17566111],
[4, 17566112],
[5, 17566113],
[6, 17566114],
[7, 17566115],
[8, 17566116],
[9, 17566117],
[10, 17566118],
[11, 17577951],
[12, 17577952],
[13, 17577953],
[14, 17577954],
[15, 17577955],
[16, 17577956],
[17, 17577957],
[18, 17577958],
[19, 17577959],
[20, 17577960],
[21, 17577961],
[22, 17577962],
[23, 17577963],
[24, 17577964],
[25, 17577965],
[26, 17577966],
[27, 17577967],
[28, 17577968],
[29, 17577969],
[30, 17577970],
[31, 17577971],
[32, 17577972],
[33, 17577973],
[34, 17577974],
[35, 17577975],
[36, 17578686],
[37, 17578687],
[38, 17578688],
[39, 17578689],
[40, 17578690],
[41, 17578691],
[42, 17578692],
[43, 17578693],
[44, 17578694],
[45, 17578695],
[46, 17578696],
[47, 17578697],
[48, 17578698],
[49, 17578699],
[50, 17578700]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 17566111],
[1, 17566112],
[2, 17566113],
[3, 17566114],
[4, 17566115],
[5, 17566116],
[6, 17566117],
[7, 17566118],
[8, 17577951],
[9, 17577952],
[10, 17577953],
[11, 17577954],
[12, 17577955],
[13, 17577956],
[14, 17577957],
[15, 17577958],
[16, 17577959],
[17, 17577960],
[18, 17577961],
[19, 17577962],
[20, 17577963],
[21, 17577964],
[22, 17577965],
[23, 17577966],
[24, 17577967],
[25, 17577968],
[26, 17577969],
[27, 17577970],
[28, 17577971],
[29, 17577972],
[30, 17577973],
[31, 17577974],
[32, 17577975],
[33, 17578686],
[34, 17578687],
[35, 17578688],
[36, 17578689],
[37, 17578690],
[38, 17578691],
[39, 17578692],
[40, 17578693],
[41, 17578694],
[42, 17578695],
[43, 17578696],
[44, 17578697],
[45, 17578698],
[46, 17578699],
[47, 17578700],
[48, 17578701],
[49, 17578702],
[50, 17578703]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 17566111],
[1, 17566112],
[2, 17566113],
[3, 17566114],
[4, 17566115],
[5, 17566116],
[6, 17566117],
[7, 17566118],
[8, 17577951],
[9, 17577952],
[10, 17577953],
[11, 17577954],
[12, 17577955],
[13, 17577956],
[14, 17577957],
[15, 17577958],
[16, 17577959],
[17, 17577960],
[18, 17577961],
[19, 17577962],
[20, 17577963],
[21, 17577964],
[22, 17577965],
[23, 17577966],
[24, 17577967],
[25, 17577968],
[26, 17577969],
[27, 17577970],
[28, 17577971],
[29, 17577972],
[30, 17577973],
[31, 17577974],
[32, 17577975],
[33, 17578686],
[34, 17578687],
[35, 17578688],
[36, 17578689],
[37, 17578690],
[38, 17578691],
[39, 17578692],
[40, 17578693],
[41, 17578694],
[42, 17578695],
[43, 17578696],
[44, 17578697],
[45, 17578698],
[46, 17578699],
[47, 17578700],
[48, 17578701],
[49, 17578702],
[50, 17578703]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 17566111],
[1, 17566112],
[2, 17566113],
[3, 17566114],
[4, 17566115],
[5, 17566116],
[6, 17566117],
[7, 17566118],
[8, 17577951],
[9, 17577952],
[10, 17577953],
[11, 17577954],
[12, 17577955],
[13, 17577956],
[14, 17577957],
[15, 17577958],
[16, 17577959],
[17, 17577960],
[18, 17577961],
[19, 17577962],
[20, 17577963],
[21, 17577964],
[22, 17577965],
[23, 17577966],
[24, 17577967],
[25, 17577968],
[26, 17577969],
[27, 17577970],
[28, 17577971],
[29, 17577972],
[30, 17577973],
[31, 17577974],
[32, 17577975],
[33, 17578686],
[34, 17578687],
[35, 17578688],
[36, 17578689],
[37, 17578690],
[38, 17578691],
[39, 17578692],
[40, 17578693],
[41, 17578694],
[42, 17578695],
[43, 17578696],
[44, 17578697],
[45, 17578698],
[46, 17578699],
[47, 17578700],
[48, 17578701],
[49, 17578702],
[50, 17578703]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 17566111],
[1, 17566112],
[2, 17566113],
[3, 17566114],
[4, 17566115],
[5, 17566116],
[6, 17566117],
[7, 17566118],
[8, 17577951],
[9, 17577952],
[10, 17577953],
[11, 17577954],
[12, 17577955],
[13, 17577956],
[14, 17577957],
[15, 17577958],
[16, 17577959],
[17, 17577960],
[18, 17577961],
[19, 17577962],
[20, 17577963],
[21, 17577964],
[22, 17577965],
[23, 17577966],
[24, 17577967],
[25, 17577968],
[26, 17577969],
[27, 17577970],
[28, 17577971],
[29, 17577972],
[30, 17577973],
[31, 17577974],
[32, 17577975],
[33, 17578686],
[34, 17578687],
[35, 17578688],
[36, 17578689],
[37, 17578690],
[38, 17578691],
[39, 17578692],
[40, 17578693],
[41, 17578694],
[42, 17578695],
[43, 17578696],
[44, 17578697],
[45, 17578698],
[46, 17578699],
[47, 17578700],
[48, 17578701],
[49, 17578702],
[50, 17578703]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 17566112],
[1, 17566113],
[2, 17566114],
[3, 17566115],
[4, 17566116],
[5, 17566117],
[6, 17566118],
[7, 17577951],
[8, 17577952],
[9, 17577953],
[10, 17577954],
[11, 17577955],
[12, 17577956],
[13, 17577957],
[14, 17577958],
[15, 17577959],
[16, 17577960],
[17, 17577961],
[18, 17577962],
[19, 17577963],
[20, 17577964],
[21, 17577965],
[22, 17577966],
[23, 17577967],
[24, 17577968],
[25, 17577969],
[26, 17577970],
[27, 17577971],
[28, 17577972],
[29, 17577973],
[30, 17577974],
[31, 17577975],
[32, 17578686],
[33, 17578687],
[34, 17578688],
[35, 17578689],
[36, 17578690],
[37, 17578691],
[38, 17578692],
[39, 17578693],
[40, 17578694],
[41, 17578695],
[42, 17578696],
[43, 17578697],
[44, 17578698],
[45, 17578699],
[46, 17578700],
[47, 17578701],
[48, 17578702],
[49, 17578703],
[50, 17578704]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 17566113],
[1, 17566114],
[2, 17566115],
[3, 17566116],
[4, 17566117],
[5, 17566118],
[6, 17577951],
[7, 17577952],
[8, 17577953],
[9, 17577954],
[10, 17577955],
[11, 17577956],
[12, 17577957],
[13, 17577958],
[14, 17577959],
[15, 17577960],
[16, 17577961],
[17, 17577962],
[18, 17577963],
[19, 17577964],
[20, 17577965],
[21, 17577966],
[22, 17577967],
[23, 17577968],
[24, 17577969],
[25, 17577970],
[26, 17577971],
[27, 17577972],
[28, 17577973],
[29, 17577974],
[30, 17577975],
[31, 17578686],
[32, 17578687],
[33, 17578688],
[34, 17578689],
[35, 17578690],
[36, 17578691],
[37, 17578692],
[38, 17578693],
[39, 17578694],
[40, 17578695],
[41, 17578696],
[42, 17578697],
[43, 17578698],
[44, 17578699],
[45, 17578700],
[46, 17578701],
[47, 17578702],
[48, 17578703],
[49, 17578704],
[50, 17578705]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 17566113],
[1, 17566114],
[2, 17566115],
[3, 17566116],
[4, 17566117],
[5, 17566118],
[6, 17577951],
[7, 17577952],
[8, 17577953],
[9, 17577954],
[10, 17577955],
[11, 17577956],
[12, 17577957],
[13, 17577958],
[14, 17577959],
[15, 17577960],
[16, 17577961],
[17, 17577962],
[18, 17577963],
[19, 17577964],
[20, 17577965],
[21, 17577966],
[22, 17577967],
[23, 17577968],
[24, 17577969],
[25, 17577970],
[26, 17577971],
[27, 17577972],
[28, 17577973],
[29, 17577974],
[30, 17577975],
[31, 17578686],
[32, 17578687],
[33, 17578688],
[34, 17578689],
[35, 17578690],
[36, 17578691],
[37, 17578692],
[38, 17578693],
[39, 17578694],
[40, 17578695],
[41, 17578696],
[42, 17578697],
[43, 17578698],
[44, 17578699],
[45, 17578700],
[46, 17578701],
[47, 17578702],
[48, 17578703],
[49, 17578704],
[50, 17578705]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[1, 17579733],
[2, 17579734],
[3, 17579735],
[4, 17579736],
[5, 17579737],
[6, 17579738],
[7, 17579739],
[8, 17579740],
[9, 17579741],
[10, 17579742],
[11, 17579743],
[12, 17579744],
[13, 17579745],
[14, 17579746],
[15, 17579747],
[16, 17579748],
[17, 17579749],
[18, 17579750],
[19, 17579751],
[20, 17579752],
[21, 17579753],
[22, 17579754],
[23, 17579755],
[24, 17579756],
[25, 17579757],
[26, 17579758],
[27, 17579759],
[28, 17579760],
[29, 17579761],
[30, 17579762],
[31, 17579763],
[32, 17579764],
[33, 17579765],
[34, 17579766],
[35, 17579767],
[36, 17579768],
[37, 17579769],
[38, 17579770],
[39, 17579771],
[40, 17579772],
[41, 17579773],
[42, 17579774],
[43, 17579775],
[44, 17579776],
[45, 17581244],
[46, 17581245],
[47, 17581246],
[48, 17581247],
[49, 17581248],
[50, 17581249]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 17581369],
[1, 17581370],
[2, 17582885],
[3, 17582886],
[4, 17582887],
[5, 17582888],
[6, 17582889],
[7, 17582890],
[8, 17582891],
[9, 17582892],
[10, 17582893],
[11, 17582894],
[12, 17582895],
[13, 17582896],
[14, 17582897],
[15, 17582898],
[16, 17582899],
[17, 17582900],
[18, 17582901],
[19, 17582902],
[20, 17582903],
[21, 17582904],
[22, 17582905],
[23, 17582906],
[24, 17582907],
[25, 17582908],
[26, 17582909],
[27, 17582910],
[28, 17582911],
[29, 17582912],
[30, 17582913],
[31, 17582914],
[32, 17582915],
[33, 17582916],
[34, 17582917],
[35, 17582918],
[36, 17582919],
[37, 17582920],
[38, 17582921],
[39, 17582922],
[40, 17582923],
[41, 17582924],
[42, 17582925],
[43, 17582926],
[44, 17582927],
[45, 17582928],
[46, 17582929],
[47, 17582930],
[48, 17582931],
[49, 17582932],
[50, 17583028]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 17581370],
[1, 17582885],
[2, 17582886],
[3, 17582887],
[4, 17582888],
[5, 17582889],
[6, 17582890],
[7, 17582891],
[8, 17582892],
[9, 17582893],
[10, 17582894],
[11, 17582895],
[12, 17582896],
[13, 17582897],
[14, 17582898],
[15, 17582899],
[16, 17582900],
[17, 17582901],
[18, 17582902],
[19, 17582903],
[20, 17582904],
[21, 17582905],
[22, 17582906],
[23, 17582907],
[24, 17582908],
[25, 17582909],
[26, 17582910],
[27, 17582911],
[28, 17582912],
[29, 17582913],
[30, 17582914],
[31, 17582915],
[32, 17582916],
[33, 17582917],
[34, 17582918],
[35, 17582919],
[36, 17582920],
[37, 17582921],
[38, 17582922],
[39, 17582923],
[40, 17582924],
[41, 17582925],
[42, 17582926],
[43, 17582927],
[44, 17582928],
[45, 17582929],
[46, 17582930],
[47, 17582931],
[48, 17582932],
[49, 17583028],
[50, 17583029]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 17581370],
[1, 17582885],
[2, 17582886],
[3, 17582887],
[4, 17582888],
[5, 17582889],
[6, 17582890],
[7, 17582891],
[8, 17582892],
[9, 17582893],
[10, 17582894],
[11, 17582895],
[12, 17582896],
[13, 17582897],
[14, 17582898],
[15, 17582899],
[16, 17582900],
[17, 17582901],
[18, 17582902],
[19, 17582903],
[20, 17582904],
[21, 17582905],
[22, 17582906],
[23, 17582907],
[24, 17582908],
[25, 17582909],
[26, 17582910],
[27, 17582911],
[28, 17582912],
[29, 17582913],
[30, 17582914],
[31, 17582915],
[32, 17582916],
[33, 17582917],
[34, 17582918],
[35, 17582919],
[36, 17582920],
[37, 17582921],
[38, 17582922],
[39, 17582923],
[40, 17582924],
[41, 17582925],
[42, 17582926],
[43, 17582927],
[44, 17582928],
[45, 17582929],
[46, 17582930],
[47, 17582931],
[48, 17582932],
[49, 17583028],
[50, 17583029]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[1, 17582911],
[2, 17582912],
[3, 17582913],
[4, 17582914],
[5, 17582915],
[6, 17582916],
[7, 17582917],
[8, 17582918],
[9, 17582919],
[10, 17582920],
[11, 17582921],
[12, 17582922],
[13, 17582923],
[14, 17582924],
[15, 17582925],
[16, 17582926],
[17, 17582927],
[18, 17582928],
[19, 17582929],
[20, 17582930],
[21, 17582931],
[22, 17582932],
[23, 17583028],
[24, 17583029],
[25, 17583030],
[26, 17583031],
[27, 17583032],
[28, 17583033],
[29, 17583034],
[30, 17583035],
[31, 17583036],
[32, 17583037],
[33, 17583038],
[34, 17583039],
[35, 17583040],
[36, 17583041],
[37, 17583042],
[38, 17583043],
[39, 17583044],
[40, 17583045],
[41, 17583046],
[42, 17583047],
[43, 17583048],
[44, 17583049],
[45, 17583050],
[46, 17583051],
[47, 17583052],
[48, 17583053],
[49, 17583054],
[50, 17583055]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 17588621],
[1, 17588622],
[2, 17588623],
[3, 17588624],
[4, 17588625],
[5, 17588626],
[6, 17588627],
[7, 17588628],
[8, 17588629],
[9, 17588630],
[10, 17588631],
[11, 17588632],
[12, 17588633],
[13, 17588634],
[14, 17588635],
[15, 17588636],
[16, 17588637],
[17, 17588638],
[18, 17588639],
[19, 17588640],
[20, 17588641],
[21, 17588642],
[22, 17588643],
[23, 17588644],
[24, 17588645],
[25, 17588646],
[26, 17588647],
[27, 17588648],
[28, 17588649],
[29, 17588650],
[30, 17588651],
[31, 17588652],
[32, 17588653],
[33, 17588654],
[34, 17588655],
[35, 17588656],
[36, 17588657],
[37, 17589196],
[38, 17589197],
[39, 17589198],
[40, 17589199],
[41, 17589200],
[42, 17589201],
[43, 17589202],
[44, 17589203],
[45, 17589204],
[46, 17589205],
[47, 17589206],
[48, 17589207],
[49, 17589208]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 17588621],
[1, 17588622],
[2, 17588623],
[3, 17588624],
[4, 17588625],
[5, 17588626],
[6, 17588627],
[7, 17588628],
[8, 17588629],
[9, 17588630],
[10, 17588631],
[11, 17588632],
[12, 17588633],
[13, 17588634],
[14, 17588635],
[15, 17588636],
[16, 17588637],
[17, 17588638],
[18, 17588639],
[19, 17588640],
[20, 17588641],
[21, 17588642],
[22, 17588643],
[23, 17588644],
[24, 17588645],
[25, 17588646],
[26, 17588647],
[27, 17588648],
[28, 17588649],
[29, 17588650],
[30, 17588651],
[31, 17588652],
[32, 17588653],
[33, 17588654],
[34, 17588655],
[35, 17588656],
[36, 17588657],
[37, 17589196],
[38, 17589197],
[39, 17589198],
[40, 17589199],
[41, 17589200],
[42, 17589201],
[43, 17589202],
[44, 17589203],
[45, 17589204],
[46, 17589205],
[47, 17589206],
[48, 17589207],
[49, 17589208]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 17588621],
[1, 17588622],
[2, 17588623],
[3, 17588624],
[4, 17588625],
[5, 17588626],
[6, 17588627],
[7, 17588628],
[8, 17588629],
[9, 17588630],
[10, 17588631],
[11, 17588632],
[12, 17588633],
[13, 17588634],
[14, 17588635],
[15, 17588636],
[16, 17588637],
[17, 17588638],
[18, 17588639],
[19, 17588640],
[20, 17588641],
[21, 17588642],
[22, 17588643],
[23, 17588644],
[24, 17588645],
[25, 17588646],
[26, 17588647],
[27, 17588648],
[28, 17588649],
[29, 17588650],
[30, 17588651],
[31, 17588652],
[32, 17588653],
[33, 17588654],
[34, 17588655],
[35, 17588656],
[36, 17588657],
[37, 17589196],
[38, 17589197],
[39, 17589198],
[40, 17589199],
[41, 17589200],
[42, 17589201],
[43, 17589202],
[44, 17589203],
[45, 17589204],
[46, 17589205],
[47, 17589206],
[48, 17589207],
[49, 17589208]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[1, 17591770],
[2, 17591771],
[3, 17591772],
[4, 17591773],
[5, 17591774],
[6, 17591775],
[7, 17591776],
[8, 17591777],
[9, 17591778],
[10, 17591779],
[11, 17591780],
[12, 17591781],
[13, 17591782],
[14, 17591783],
[15, 17591784],
[16, 17591785],
[17, 17591786],
[18, 17591787],
[19, 17591788],
[20, 17591789],
[21, 17591790],
[22, 17591791],
[23, 17591792],
[24, 17591793],
[25, 17591794],
[26, 17591796],
[27, 17591797],
[28, 17591798],
[29, 17591799],
[30, 17591800],
[31, 17591801],
[32, 17591802],
[33, 17591803],
[34, 17591804],
[35, 17591805],
[36, 17591806],
[37, 17591807],
[38, 17591808],
[39, 17591809],
[40, 17591810],
[41, 17591811],
[42, 17591812],
[43, 17591813],
[44, 17591814],
[45, 17591815],
[46, 17591816],
[47, 17591817],
[48, 17591818],
[49, 17591819],
[50, 17591820]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 17593855],
[1, 17593856],
[2, 17593857],
[3, 17593858],
[4, 17593859],
[5, 17593860],
[6, 17593861],
[7, 17593862],
[8, 17593863],
[9, 17593864],
[10, 17593865],
[11, 17593866],
[12, 17593867],
[13, 17593868],
[14, 17593869],
[15, 17593870],
[16, 17593871],
[17, 17593872],
[18, 17593873],
[19, 17593874],
[20, 17593875],
[21, 17593876],
[22, 17593877],
[23, 17593878],
[24, 17593880],
[25, 17593881],
[26, 17593882],
[27, 17593883],
[28, 17593884],
[29, 17593885],
[30, 17593886],
[31, 17593887],
[32, 17593888],
[33, 17593889],
[34, 17593890],
[35, 17593891],
[36, 17593892],
[37, 17593893],
[38, 17593894],
[39, 17593895],
[40, 17593896],
[41, 17593897],
[42, 17593898],
[43, 17593899],
[44, 17593900],
[45, 17593901],
[46, 17593902],
[47, 17593903]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 17593863],
[1, 17593864],
[2, 17593865],
[3, 17593866],
[4, 17593867],
[5, 17593868],
[6, 17593869],
[7, 17593870],
[8, 17593871],
[9, 17593872],
[10, 17593873],
[11, 17593874],
[12, 17593875],
[13, 17593876],
[14, 17593877],
[15, 17593878],
[16, 17593880],
[17, 17593881],
[18, 17593882],
[19, 17593883],
[20, 17593884],
[21, 17593885],
[22, 17593886],
[23, 17593887],
[24, 17593888],
[25, 17593889],
[26, 17593890],
[27, 17593891],
[28, 17593892],
[29, 17593893],
[30, 17593894],
[31, 17593895],
[32, 17593896],
[33, 17593897],
[34, 17593898],
[35, 17593899],
[36, 17593900],
[37, 17593901],
[38, 17593902],
[39, 17593903],
[40, 17593904],
[41, 17593905],
[42, 17593906],
[43, 17593907]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[11, 17596476],
[12, 17596477],
[13, 17596478],
[14, 17596479],
[15, 17596480],
[16, 17596481],
[17, 17596482],
[19, 17596483],
[20, 17596484],
[21, 17596485],
[22, 17596486],
[23, 17596487],
[24, 17596488],
[25, 17596489],
[26, 17596490],
[27, 17596491],
[28, 17596492],
[29, 17596493],
[30, 17596494],
[31, 17596495],
[32, 17596496],
[33, 17596497],
[34, 17596498],
[35, 17596499],
[36, 17596500],
[37, 17596501],
[38, 17596502],
[39, 17596503],
[40, 17596504],
[41, 17596505],
[42, 17596506],
[43, 17596507],
[44, 17596508],
[45, 17596509],
[46, 17596510],
[47, 17596511],
[48, 17596512],
[49, 17596513],
[50, 17596514]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[5, 17624012],
[6, 17624013],
[7, 17624014],
[8, 17624015],
[9, 17624016],
[10, 17624017],
[11, 17624018],
[12, 17624019],
[13, 17624020],
[14, 17625913],
[15, 17625914],
[16, 17625915],
[17, 17625916],
[18, 17625917],
[19, 17625918],
[20, 17625919],
[21, 17625920],
[22, 17625921],
[23, 17625922],
[24, 17625923],
[25, 17625924],
[26, 17625925],
[27, 17625926],
[28, 17625927],
[29, 17625928],
[30, 17625929],
[31, 17625930],
[32, 17625931],
[33, 17625932],
[34, 17625933],
[35, 17625934],
[36, 17625935],
[37, 17625936],
[38, 17625937],
[39, 17625938],
[40, 17625939],
[41, 17625940],
[42, 17625941],
[43, 17625942],
[44, 17625943],
[45, 17625944],
[46, 17625945],
[47, 17625946],
[48, 17625947],
[49, 17625948],
[50, 17625949]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[2, 17624012],
[3, 17624013],
[4, 17624014],
[5, 17624015],
[6, 17624016],
[7, 17624017],
[8, 17624018],
[9, 17624019],
[10, 17624020],
[11, 17625913],
[12, 17625914],
[13, 17625915],
[14, 17625916],
[15, 17625917],
[16, 17625918],
[17, 17625919],
[18, 17625920],
[19, 17625921],
[20, 17625922],
[21, 17625923],
[22, 17625924],
[23, 17625925],
[24, 17625926],
[25, 17625927],
[26, 17625928],
[27, 17625929],
[28, 17625930],
[29, 17625931],
[30, 17625932],
[31, 17625933],
[32, 17625934],
[33, 17625935],
[34, 17625936],
[35, 17625937],
[36, 17625938],
[37, 17625939],
[38, 17625940],
[39, 17625941],
[40, 17625942],
[41, 17625943],
[42, 17625944],
[43, 17625945],
[44, 17625946],
[45, 17625947],
[46, 17625948],
[47, 17625949],
[48, 17625950],
[49, 17625951],
[50, 17625952]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[1, 31796700],
[2, 31796701],
[3, 31796702],
[4, 31796703],
[5, 31796704],
[6, 31796705],
[7, 31796706],
[8, 31796710],
[9, 31796711],
[10, 31796712],
[11, 31796713],
[12, 31796714],
[13, 31796715],
[14, 31796716],
[15, 31796717],
[16, 31796718],
[17, 31796719],
[18, 31796720],
[19, 31796721],
[20, 31796722],
[21, 31796723],
[22, 31796724],
[23, 31796725],
[24, 31796726],
[25, 31796727],
[26, 31796728],
[27, 31799014],
[28, 31799015],
[29, 31799016],
[30, 31799017],
[31, 31799018],
[32, 31799019],
[33, 31799020],
[34, 31799021],
[35, 31799022],
[36, 31799023],
[37, 31799024],
[38, 31799025],
[39, 31799026],
[40, 31799027],
[41, 31799028],
[42, 31799029],
[43, 31799030],
[44, 31799031],
[45, 31799032],
[46, 31799033],
[47, 31799034],
[48, 31799035],
[49, 31799036],
[50, 31799037]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[0, 36722692],
[1, 36722693],
[2, 36722694],
[3, 36722695],
[4, 36722696],
[5, 36722697],
[6, 36722698],
[7, 36722699],
[8, 36722700],
[9, 36722701],
[10, 36722702],
[11, 36722703],
[12, 36722704],
[13, 36722705],
[14, 36723505],
[15, 36723506],
[16, 36723507],
[17, 36723508],
[18, 36723509],
[19, 36723510],
[20, 36723511],
[21, 36723512],
[22, 36723513],
[23, 36723514],
[24, 36723515],
[25, 36723516],
[26, 36723517],
[27, 36723518],
[28, 36723519],
[29, 36723520],
[30, 36723521],
[31, 36723522],
[32, 36723523],
[33, 36723524],
[34, 36723525],
[35, 36723526],
[36, 36723527],
[37, 36723528],
[38, 36723529],
[39, 36723530],
[40, 36723531],
[41, 36723532],
[42, 36737414],
[43, 36737415],
[44, 36737416],
[45, 36737417],
[46, 36737418],
[47, 36737419],
[48, 36737420]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();
assert_eq!(
pairs,
vec![
[4, 44587963],
[5, 44587964],
[6, 44587965],
[7, 44587966],
[8, 44587967],
[9, 44587968],
[10, 44587969],
[11, 44587970],
[12, 44587971],
[13, 44587972],
[14, 44587973],
[15, 44587974],
[16, 44587975],
[17, 44587976],
[18, 44587977],
[19, 44587978],
[20, 44587979],
[21, 44587980],
[22, 44587981],
[23, 44587982],
[24, 44587983],
[25, 44589680],
[26, 44589681],
[27, 44589682],
[28, 44589683],
[29, 44589684],
[30, 44589685],
[31, 44589686],
[32, 44589687],
[33, 44589688],
[34, 44589689],
[35, 44589690],
[36, 44589691],
[37, 44589692],
[38, 44589693],
[39, 44589694],
[40, 44589695],
[41, 44589696],
[42, 44589697],
[43, 44589698],
[44, 44589699],
[45, 44589700],
[46, 44589701],
[47, 44589702],
[48, 44592034],
[49, 44592035],
[50, 44592036]
]
);
}
#[test]
fn test_aligned_pairs_full() {
let mut bam = bam::Reader::from_path("./test/test_spliced_reads.bam").unwrap();
let mut it = bam.records();
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
assert_eq!(
pairs,
vec![
[Some(0), None],
[Some(1), None],
[Some(2), None],
[Some(3), None],
[Some(4), None],
[Some(5), None],
[Some(6), Some(16050676)],
[Some(7), Some(16050677)],
[Some(8), Some(16050678)],
[Some(9), Some(16050679)],
[Some(10), Some(16050680)],
[Some(11), Some(16050681)],
[Some(12), Some(16050682)],
[Some(13), Some(16050683)],
[Some(14), Some(16050684)],
[Some(15), Some(16050685)],
[Some(16), Some(16050686)],
[Some(17), Some(16050687)],
[Some(18), Some(16050688)],
[Some(19), Some(16050689)],
[Some(20), Some(16050690)],
[Some(21), Some(16050691)],
[Some(22), Some(16050692)],
[Some(23), Some(16050693)],
[Some(24), Some(16050694)],
[Some(25), Some(16050695)],
[Some(26), Some(16050696)],
[Some(27), Some(16050697)],
[Some(28), Some(16050698)],
[Some(29), Some(16050699)],
[Some(30), Some(16050700)],
[Some(31), Some(16050701)],
[Some(32), Some(16050702)],
[Some(33), Some(16050703)],
[Some(34), Some(16050704)],
[Some(35), Some(16050705)],
[Some(36), Some(16050706)],
[Some(37), Some(16050707)],
[Some(38), Some(16050708)],
[Some(39), Some(16050709)],
[Some(40), Some(16050710)],
[Some(41), Some(16050711)],
[Some(42), Some(16050712)],
[Some(43), Some(16050713)],
[Some(44), Some(16050714)],
[Some(45), Some(16050715)],
[Some(46), Some(16050716)],
[Some(47), Some(16050717)],
[Some(48), Some(16050718)],
[Some(49), Some(16050719)],
[Some(50), Some(16050720)]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
assert_eq!(
pairs,
vec![
[Some(0), Some(16096878)],
[Some(1), Some(16096879)],
[Some(2), Some(16096880)],
[Some(3), Some(16096881)],
[Some(4), Some(16096882)],
[Some(5), Some(16096883)],
[Some(6), Some(16096884)],
[None, Some(16096885)],
[None, Some(16096886)],
[Some(7), Some(16096887)],
[Some(8), Some(16096888)],
[Some(9), Some(16096889)],
[Some(10), Some(16096890)],
[Some(11), Some(16096891)],
[Some(12), Some(16096892)],
[Some(13), Some(16096893)],
[Some(14), Some(16096894)],
[Some(15), Some(16096895)],
[Some(16), Some(16096896)],
[Some(17), Some(16096897)],
[Some(18), Some(16096898)],
[Some(19), Some(16096899)],
[Some(20), Some(16096900)],
[Some(21), Some(16096901)],
[Some(22), Some(16096902)],
[Some(23), Some(16096903)],
[Some(24), Some(16096904)],
[Some(25), Some(16096905)],
[Some(26), Some(16096906)],
[Some(27), Some(16096907)],
[Some(28), Some(16096908)],
[Some(29), Some(16096909)],
[Some(30), Some(16096910)],
[Some(31), Some(16096911)],
[Some(32), Some(16096912)],
[Some(33), Some(16096913)],
[Some(34), Some(16096914)],
[Some(35), Some(16096915)],
[Some(36), Some(16096916)],
[Some(37), Some(16096917)],
[Some(38), Some(16096918)],
[Some(39), Some(16096919)],
[Some(40), Some(16096920)],
[Some(41), Some(16096921)],
[Some(42), Some(16096922)],
[Some(43), Some(16096923)],
[Some(44), Some(16096924)],
[Some(45), Some(16096925)],
[Some(46), Some(16096926)],
[Some(47), Some(16096927)],
[Some(48), Some(16096928)],
[Some(49), Some(16096929)],
[Some(50), Some(16096930)]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
assert_eq!(
pairs,
vec![
[Some(0), Some(16097145)],
[Some(1), Some(16097146)],
[Some(2), Some(16097147)],
[Some(3), Some(16097148)],
[Some(4), Some(16097149)],
[Some(5), Some(16097150)],
[Some(6), Some(16097151)],
[Some(7), Some(16097152)],
[Some(8), Some(16097153)],
[Some(9), Some(16097154)],
[Some(10), Some(16097155)],
[Some(11), Some(16097156)],
[Some(12), Some(16097157)],
[Some(13), Some(16097158)],
[Some(14), Some(16097159)],
[Some(15), Some(16097160)],
[Some(16), Some(16097161)],
[Some(17), Some(16097162)],
[Some(18), Some(16097163)],
[Some(19), Some(16097164)],
[Some(20), Some(16097165)],
[Some(21), Some(16097166)],
[Some(22), Some(16097167)],
[Some(23), Some(16097168)],
[Some(24), Some(16097169)],
[Some(25), Some(16097170)],
[Some(26), Some(16097171)],
[Some(27), Some(16097172)],
[Some(28), Some(16097173)],
[None, Some(16097174)],
[None, Some(16097175)],
[Some(29), Some(16097176)],
[Some(30), Some(16097177)],
[Some(31), Some(16097178)],
[Some(32), Some(16097179)],
[Some(33), Some(16097180)],
[Some(34), Some(16097181)],
[Some(35), Some(16097182)],
[Some(36), Some(16097183)],
[Some(37), Some(16097184)],
[Some(38), Some(16097185)],
[Some(39), Some(16097186)],
[Some(40), Some(16097187)],
[Some(41), Some(16097188)],
[Some(42), Some(16097189)],
[Some(43), Some(16097190)],
[Some(44), Some(16097191)],
[Some(45), Some(16097192)],
[Some(46), Some(16097193)],
[Some(47), Some(16097194)],
[Some(48), Some(16097195)],
[Some(49), Some(16097196)],
[Some(50), Some(16097197)]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
assert_eq!(
pairs,
vec![
[Some(0), Some(16117350)],
[Some(1), Some(16117351)],
[Some(2), Some(16117352)],
[Some(3), Some(16117353)],
[Some(4), Some(16117354)],
[Some(5), Some(16117355)],
[Some(6), Some(16117356)],
[Some(7), Some(16117357)],
[Some(8), Some(16117358)],
[Some(9), Some(16117359)],
[Some(10), Some(16117360)],
[Some(11), Some(16117361)],
[Some(12), Some(16117362)],
[Some(13), Some(16117363)],
[Some(14), Some(16117364)],
[Some(15), Some(16117365)],
[Some(16), Some(16117366)],
[Some(17), Some(16117367)],
[Some(18), Some(16117368)],
[Some(19), Some(16117369)],
[Some(20), Some(16117370)],
[Some(21), Some(16117371)],
[Some(22), Some(16117372)],
[Some(23), Some(16117373)],
[Some(24), Some(16117374)],
[Some(25), Some(16117375)],
[Some(26), Some(16117376)],
[Some(27), Some(16117377)],
[Some(28), Some(16117378)],
[Some(29), Some(16117379)],
[Some(30), Some(16117380)],
[Some(31), Some(16117381)],
[Some(32), Some(16117382)],
[Some(33), Some(16117383)],
[Some(34), Some(16117384)],
[Some(35), Some(16117385)],
[Some(36), Some(16117386)],
[Some(37), Some(16117387)],
[Some(38), Some(16117388)],
[Some(39), Some(16117389)],
[Some(40), Some(16117390)],
[Some(41), Some(16117391)],
[Some(42), Some(16117392)],
[Some(43), Some(16117393)],
[Some(44), Some(16117394)],
[Some(45), Some(16117395)],
[Some(46), Some(16117396)],
[Some(47), Some(16117397)],
[Some(48), Some(16117398)],
[Some(49), Some(16117399)],
[Some(50), Some(16117400)]
]
);
let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();
assert_eq!(
pairs,
vec![
[Some(0), Some(16118483)],
[Some(1), Some(16118484)],
[Some(2), Some(16118485)],
[Some(3), Some(16118486)],
[Some(4), Some(16118487)],
[Some(5), Some(16118488)],
[Some(6), Some(16118489)],
[Some(7), Some(16118490)],
[Some(8), Some(16118491)],
[Some(9), Some(16118492)],
[Some(10), Some(16118493)],
[Some(11), Some(16118494)],
[Some(12), Some(16118495)],
[Some(13), Some(16118496)],
[Some(14), Some(16118497)],
[Some(15), Some(16118498)],
[Some(16), Some(16118499)],
[Some(17), Some(16118500)],
[Some(18), Some(16118501)],
[Some(19), Some(16118502)],
[Some(20), Some(16118503)],
[Some(21), Some(16118504)],
[Some(22), Some(16118505)],
[Some(23), Some(16118506)],
[Some(24), Some(16118507)],
[Some(25), Some(16118508)],
[Some(26), Some(16118509)],
[Some(27), Some(16118510)],
[Some(28), Some(16118511)],
[Some(29), Some(16118512)],
[Some(30), Some(16118513)],
[Some(31), Some(16118514)],
[Some(32), Some(16118515)],
[Some(33), Some(16118516)],
[Some(34), Some(16118517)],
[S
gitextract_qygp9z8u/
├── .github/
│ ├── dependabot.yml
│ └── workflows/
│ ├── conventional-prs.yml
│ ├── release-please.yml
│ └── rust.yml
├── .gitignore
├── .gitmodules
├── CHANGELOG.md
├── Cargo.toml
├── LICENSE.md
├── README.md
├── config.toml
├── src/
│ ├── bam/
│ │ ├── buffer.rs
│ │ ├── ext.rs
│ │ ├── header.rs
│ │ ├── index.rs
│ │ ├── mod.rs
│ │ ├── pileup.rs
│ │ ├── record.rs
│ │ └── record_serde.rs
│ ├── bcf/
│ │ ├── buffer.rs
│ │ ├── header.rs
│ │ ├── index.rs
│ │ ├── mod.rs
│ │ └── record.rs
│ ├── bgzf/
│ │ └── mod.rs
│ ├── errors.rs
│ ├── faidx/
│ │ └── mod.rs
│ ├── htslib.rs
│ ├── lib.rs
│ ├── tbx/
│ │ └── mod.rs
│ ├── tpool.rs
│ └── utils.rs
└── test/
├── bam2sam_expected.sam
├── bam2sam_out.sam
├── bam2sam_test.bam
├── base_mods/
│ ├── MM-double.sam
│ └── MM-orient.sam
├── bgzip/
│ └── plain.vcf
├── obs-cornercase.vcf
├── results/
│ └── .gitignore
├── tabix_reader/
│ ├── bad_header.txt.gz.tbi
│ ├── genomic_positions_header.txt.gz.tbi
│ ├── genomic_regions_header.txt.gz.tbi
│ └── test_bed3.bed.gz.tbi
├── test-info-multi-string-number=A.vcf
├── test-info-multi-string.vcf
├── test.bam
├── test.bam.bai
├── test.bcf
├── test.bcf.csi
├── test_cram.bam
├── test_cram.bam.bai
├── test_cram.cram
├── test_cram.cram.crai
├── test_cram.fa
├── test_cram.fa.fai
├── test_cram.sam
├── test_different_index_name.bam
├── test_headers.out.vcf
├── test_headers.vcf
├── test_index_build.bam
├── test_issue_156_no_text.bam
├── test_left.vcf
├── test_left.vcf.gz.tbi
├── test_missing.vcf
├── test_multi.bcf
├── test_non_diploid.vcf
├── test_nonstandard_orientation.sam
├── test_orientation_supplementary.sam
├── test_paired.sam
├── test_right.vcf
├── test_right.vcf.gz.tbi
├── test_spliced_reads.bam
├── test_spliced_reads.bam.bai
├── test_string.vcf
├── test_svlen.vcf
├── test_trailing_omitted_format.vcf
├── test_unmapped.bam
├── test_unmapped.bam.bai
├── test_unmapped.cram
├── test_unmapped.cram.crai
├── test_various.out.vcf
└── test_various.vcf
SYMBOL INDEX (862 symbols across 19 files)
FILE: src/bam/buffer.rs
type RecordBuffer (line 20) | pub struct RecordBuffer {
method new (line 40) | pub fn new(bam: bam::IndexedReader, cache_cigar: bool) -> Self {
method set_min_refetch_distance (line 56) | pub fn set_min_refetch_distance(&mut self, min_refetch_distance: u64) {
method start (line 61) | pub fn start(&self) -> Option<u64> {
method end (line 66) | pub fn end(&self) -> Option<u64> {
method tid (line 70) | pub fn tid(&self) -> Option<i32> {
method fetch (line 79) | pub fn fetch(&mut self, chrom: &[u8], start: u64, end: u64) -> Result<...
method iter (line 161) | pub fn iter(&self) -> vec_deque::Iter<'_, Arc<bam::Record>> {
method iter_mut (line 166) | pub fn iter_mut(&mut self) -> vec_deque::IterMut<'_, Arc<bam::Record>> {
method len (line 170) | pub fn len(&self) -> usize {
method is_empty (line 174) | pub fn is_empty(&self) -> bool {
function test_buffer (line 185) | fn test_buffer() {
FILE: src/bam/ext.rs
type IterAlignedBlockPairs (line 13) | pub struct IterAlignedBlockPairs {
type Item (line 21) | type Item = ([i64; 2], [i64; 2]);
method next (line 22) | fn next(&mut self) -> Option<Self::Item> {
type IterAlignedBlocks (line 51) | pub struct IterAlignedBlocks {
type Item (line 58) | type Item = [i64; 2];
method next (line 59) | fn next(&mut self) -> Option<Self::Item> {
type IterIntrons (line 80) | pub struct IterIntrons {
type Item (line 87) | type Item = [i64; 2];
method next (line 88) | fn next(&mut self) -> Option<Self::Item> {
type IterAlignedPairs (line 109) | pub struct IterAlignedPairs {
type Item (line 118) | type Item = [i64; 2];
method next (line 119) | fn next(&mut self) -> Option<Self::Item> {
type IterAlignedPairsFull (line 152) | pub struct IterAlignedPairsFull {
type Item (line 163) | type Item = [Option<i64>; 2];
method next (line 164) | fn next(&mut self) -> Option<Self::Item> {
type BamRecordExtensions (line 218) | pub trait BamRecordExtensions {
method aligned_blocks (line 228) | fn aligned_blocks(&self) -> IterAlignedBlocks;
method aligned_block_pairs (line 240) | fn aligned_block_pairs(&self) -> IterAlignedBlockPairs;
method introns (line 247) | fn introns(&self) -> IterIntrons;
method aligned_pairs (line 259) | fn aligned_pairs(&self) -> IterAlignedPairs;
method aligned_pairs_full (line 268) | fn aligned_pairs_full(&self) -> IterAlignedPairsFull;
method cigar_stats_nucleotides (line 275) | fn cigar_stats_nucleotides(&self) -> HashMap<Cigar, i32>;
method cigar_stats_blocks (line 283) | fn cigar_stats_blocks(&self) -> HashMap<Cigar, i32>;
method reference_positions (line 291) | fn reference_positions(&self) -> Box<dyn Iterator<Item = i64>>;
method reference_positions_full (line 299) | fn reference_positions_full(&self) -> Box<dyn Iterator<Item = Option<i...
method reference_start (line 302) | fn reference_start(&self) -> i64;
method reference_end (line 305) | fn reference_end(&self) -> i64;
method seq_len_from_cigar (line 313) | fn seq_len_from_cigar(&self, include_hard_clip: bool) -> usize;
method aligned_blocks (line 317) | fn aligned_blocks(&self) -> IterAlignedBlocks {
method introns (line 325) | fn introns(&self) -> IterIntrons {
method aligned_block_pairs (line 333) | fn aligned_block_pairs(&self) -> IterAlignedBlockPairs {
method aligned_pairs (line 342) | fn aligned_pairs(&self) -> IterAlignedPairs {
method aligned_pairs_full (line 352) | fn aligned_pairs_full(&self) -> IterAlignedPairsFull {
method cigar_stats_nucleotides (line 364) | fn cigar_stats_nucleotides(&self) -> HashMap<Cigar, i32> {
method cigar_stats_blocks (line 395) | fn cigar_stats_blocks(&self) -> HashMap<Cigar, i32> {
method reference_positions (line 422) | fn reference_positions(&self) -> Box<dyn Iterator<Item = i64>> {
method reference_positions_full (line 426) | fn reference_positions_full(&self) -> Box<dyn Iterator<Item = Option<i...
method reference_start (line 434) | fn reference_start(&self) -> i64 {
method reference_end (line 440) | fn reference_end(&self) -> i64 {
method seq_len_from_cigar (line 444) | fn seq_len_from_cigar(&self, include_hard_clip: bool) -> usize {
function spliced_reads (line 476) | fn spliced_reads() {
function test_introns (line 807) | fn test_introns() {
function test_aligned_pairs (line 1026) | fn test_aligned_pairs() {
function test_aligned_pairs_full (line 4190) | fn test_aligned_pairs_full() {
function test_aligned_block_pairs (line 4761) | fn test_aligned_block_pairs() {
function test_get_cigar_stats (line 4802) | fn test_get_cigar_stats() {
function test_reference_positions (line 5113) | fn test_reference_positions() {
function test_reference_positions_full (line 5852) | fn test_reference_positions_full() {
function test_reference_start_end (line 9455) | fn test_reference_start_end() {
function test_infer_seq_len (line 9635) | fn test_infer_seq_len() {
FILE: src/bam/header.rs
type Header (line 15) | pub struct Header {
method new (line 27) | pub fn new() -> Self {
method from_template (line 33) | pub fn from_template(header: &HeaderView) -> Self {
method push_record (line 52) | pub fn push_record(&mut self, record: &HeaderRecord<'_>) -> &mut Self {
method push_comment (line 58) | pub fn push_comment(&mut self, comment: &[u8]) -> &mut Self {
method to_bytes (line 63) | pub fn to_bytes(&self) -> Vec<u8> {
method to_hashmap (line 70) | pub fn to_hashmap(&self) -> HashMap<String, Vec<LinearMap<String, Stri...
method comments (line 109) | pub fn comments(&'_ self) -> impl Iterator<Item = Cow<'_, str>> {
method default (line 20) | fn default() -> Self {
type HeaderRecord (line 120) | pub struct HeaderRecord<'a> {
function new (line 128) | pub fn new(rec_type: &'a [u8]) -> Self {
function push_tag (line 142) | pub fn push_tag<V: ToString>(&mut self, tag: &'a [u8], value: V) -> &mut...
function to_bytes (line 147) | fn to_bytes(&self) -> Vec<u8> {
function test_push_tag (line 165) | fn test_push_tag() {
FILE: src/bam/index.rs
type Type (line 16) | pub enum Type {
function build (line 24) | pub fn build<P: AsRef<Path>>(
function test_index_build (line 67) | fn test_index_build() {
FILE: src/bam/mod.rs
function set_threads (line 43) | unsafe fn set_threads(htsfile: *mut htslib::htsFile, n_threads: usize) -...
function set_thread_pool (line 53) | unsafe fn set_thread_pool(htsfile: *mut htslib::htsFile, tpool: &ThreadP...
function set_fai_filename (line 66) | pub unsafe fn set_fai_filename<P: AsRef<Path>>(
type Read (line 87) | pub trait Read: Sized {
method read (line 119) | fn read(&mut self, record: &mut record::Record) -> Option<Result<()>>;
method records (line 129) | fn records(&mut self) -> Records<'_, Self>;
method rc_records (line 162) | fn rc_records(&mut self) -> RcRecords<'_, Self>;
method pileup (line 165) | fn pileup(&mut self) -> pileup::Pileups<'_, Self>;
method htsfile (line 168) | fn htsfile(&self) -> *mut htslib::htsFile;
method header (line 171) | fn header(&self) -> &HeaderView;
method seek (line 174) | fn seek(&mut self, offset: i64) -> Result<()> {
method tell (line 195) | fn tell(&self) -> i64 {
method set_threads (line 211) | fn set_threads(&mut self, n_threads: usize) -> Result<()> {
method set_thread_pool (line 222) | fn set_thread_pool(&mut self, tpool: &ThreadPool) -> Result<()>;
method set_cram_options (line 239) | fn set_cram_options(&mut self, fmt_opt: hts_fmt_option, fields: sam_fi...
method read (line 375) | fn read(&mut self, record: &mut record::Record) -> Option<Result<()>> {
method records (line 398) | fn records(&mut self) -> Records<'_, Self> {
method rc_records (line 402) | fn rc_records(&mut self) -> RcRecords<'_, Self> {
method pileup (line 409) | fn pileup(&mut self) -> pileup::Pileups<'_, Self> {
method htsfile (line 420) | fn htsfile(&self) -> *mut htslib::htsFile {
method header (line 424) | fn header(&self) -> &HeaderView {
method set_thread_pool (line 428) | fn set_thread_pool(&mut self, tpool: &ThreadPool) -> Result<()> {
method read (line 970) | fn read(&mut self, record: &mut record::Record) -> Option<Result<()>> {
method records (line 992) | fn records(&mut self) -> Records<'_, Self> {
method rc_records (line 996) | fn rc_records(&mut self) -> RcRecords<'_, Self> {
method pileup (line 1003) | fn pileup(&mut self) -> pileup::Pileups<'_, Self> {
method htsfile (line 1014) | fn htsfile(&self) -> *mut htslib::htsFile {
method header (line 1018) | fn header(&self) -> &HeaderView {
method set_thread_pool (line 1022) | fn set_thread_pool(&mut self, tpool: &ThreadPool) -> Result<()> {
type Reader (line 252) | pub struct Reader {
method from_path (line 266) | pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self> {
method from_stdin (line 271) | pub fn from_stdin() -> Result<Self> {
method from_url (line 276) | pub fn from_url(url: &Url) -> Result<Self> {
method new (line 285) | fn new(path: &[u8]) -> Result<Self> {
method pileup_read (line 307) | extern "C" fn pileup_read(
method iter_chunk (line 329) | pub fn iter_chunk(&mut self, start: Option<i64>, end: Option<i64>) -> ...
method set_reference (line 343) | pub fn set_reference<P: AsRef<Path>>(&mut self, path: P) -> Result<()> {
method drop (line 436) | fn drop(&mut self) {
type FetchCoordinate (line 446) | pub struct FetchCoordinate(i64);
method from (line 450) | fn from(coord: i32) -> FetchCoordinate {
method from (line 457) | fn from(coord: u32) -> FetchCoordinate {
method from (line 464) | fn from(coord: i64) -> FetchCoordinate {
method from (line 471) | fn from(coord: u64) -> FetchCoordinate {
type FetchDefinition (line 488) | pub enum FetchDefinition<'a> {
function from (line 506) | fn from(tup: (i32, X, Y)) -> FetchDefinition<'a> {
function from (line 516) | fn from(tup: (u32, X, Y)) -> FetchDefinition<'a> {
function from (line 529) | fn from(tid: i32) -> FetchDefinition<'a> {
function from (line 535) | fn from(tid: u32) -> FetchDefinition<'a> {
function from (line 542) | fn from(s: &'a str) -> FetchDefinition<'a> {
function from (line 549) | fn from(s: &'a [u8]) -> FetchDefinition<'a> {
function from (line 556) | fn from(s: &'a T) -> FetchDefinition<'a> {
function from (line 564) | fn from(tup: (&'a str, X, Y)) -> FetchDefinition<'a> {
function from (line 574) | fn from(tup: (&'a [u8], X, Y)) -> FetchDefinition<'a> {
function from (line 585) | fn from(tup: (&'a T, X, Y)) -> FetchDefinition<'a> {
type IndexedReader (line 593) | pub struct IndexedReader {
method from_path (line 609) | pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self> {
method from_path_and_index (line 613) | pub fn from_path_and_index<P: AsRef<Path>>(path: P, index_path: P) -> ...
method from_url (line 620) | pub fn from_url(url: &Url) -> Result<Self> {
method new (line 629) | fn new(path: &[u8]) -> Result<Self> {
method new_with_index_path (line 654) | fn new_with_index_path(path: &[u8], index_path: &[u8]) -> Result<Self> {
method fetch (line 710) | pub fn fetch<'a, T: Into<FetchDefinition<'a>>>(&mut self, fetch_defini...
method _inner_fetch (line 716) | fn _inner_fetch(&mut self, fetch_definition: FetchDefinition) -> Resul...
method _fetch_by_coord_tuple (line 752) | fn _fetch_by_coord_tuple(&mut self, tid: i32, beg: i64, end: i64) -> R...
method _fetch_by_str (line 766) | fn _fetch_by_str(&mut self, region: &[u8]) -> Result<()> {
method pileup_read (line 788) | extern "C" fn pileup_read(
method set_reference (line 810) | pub fn set_reference<P: AsRef<Path>>(&mut self, path: P) -> Result<()> {
method index (line 814) | pub fn index(&self) -> &IndexView {
method slow_idxstats (line 820) | unsafe fn slow_idxstats(&mut self) -> Result<Vec<(i64, u64, u64, u64)>> {
method index_stats (line 886) | pub fn index_stats(&mut self) -> Result<Vec<(i64, u64, u64, u64)>> {
type IndexView (line 910) | pub struct IndexView {
method new (line 918) | fn new(hts_idx: *mut hts_sys::hts_idx_t) -> Self {
method inner (line 923) | pub fn inner(&self) -> &hts_sys::hts_idx_t {
method inner_ptr (line 929) | pub fn inner_ptr(&self) -> *const hts_sys::hts_idx_t {
method inner_mut (line 934) | pub fn inner_mut(&mut self) -> &mut hts_sys::hts_idx_t {
method inner_ptr_mut (line 940) | pub fn inner_ptr_mut(&mut self) -> *mut hts_sys::hts_idx_t {
method number_mapped_unmapped (line 946) | fn number_mapped_unmapped(&self, tid: u32) -> (u64, u64) {
method number_unmapped (line 956) | fn number_unmapped(&self) -> u64 {
method drop (line 962) | fn drop(&mut self) {
method drop (line 1030) | fn drop(&mut self) {
type Format (line 1041) | pub enum Format {
method write_mode (line 1048) | fn write_mode(self) -> &'static [u8] {
type Writer (line 1059) | pub struct Writer {
method from_path (line 1075) | pub fn from_path<P: AsRef<Path>>(
method from_stdout (line 1089) | pub fn from_stdout(header: &header::Header, format: Format) -> Result<...
method new (line 1100) | fn new(path: &[u8], mode: &[u8], header: &header::Header) -> Result<Se...
method set_threads (line 1146) | pub fn set_threads(&mut self, n_threads: usize) -> Result<()> {
method set_thread_pool (line 1157) | pub fn set_thread_pool(&mut self, tpool: &ThreadPool) -> Result<()> {
method write (line 1168) | pub fn write(&mut self, record: &record::Record) -> Result<()> {
method header (line 1177) | pub fn header(&self) -> &HeaderView {
method set_reference (line 1186) | pub fn set_reference<P: AsRef<Path>>(&mut self, path: P) -> Result<()> {
method set_compression_level (line 1195) | pub fn set_compression_level(&mut self, compression_level: Compression...
type CompressionLevel (line 1217) | pub enum CompressionLevel {
method convert (line 1226) | fn convert(self) -> Result<u32> {
method drop (line 1238) | fn drop(&mut self) {
type Records (line 1247) | pub struct Records<'a, R: Read> {
type Item (line 1252) | type Item = Result<record::Record>;
method next (line 1254) | fn next(&mut self) -> Option<Result<record::Record>> {
type RcRecords (line 1268) | pub struct RcRecords<'a, R: Read> {
type Item (line 1274) | type Item = Result<Rc<record::Record>>;
method next (line 1276) | fn next(&mut self) -> Option<Self::Item> {
type ChunkIterator (line 1295) | pub struct ChunkIterator<'a, R: Read> {
type Item (line 1301) | type Item = Result<record::Record>;
method next (line 1302) | fn next(&mut self) -> Option<Result<record::Record>> {
function hts_open (line 1318) | fn hts_open(path: &[u8], mode: &[u8]) -> Result<*mut htslib::htsFile> {
function itr_next (line 1347) | fn itr_next(
type HeaderView (line 1363) | pub struct HeaderView {
method from_header (line 1372) | pub fn from_header(header: &Header) -> Self {
method from_bytes (line 1381) | pub fn from_bytes(header_string: &[u8]) -> Self {
method new (line 1402) | fn new(inner: *mut htslib::bam_hdr_t) -> Self {
method inner (line 1407) | pub fn inner(&self) -> &htslib::bam_hdr_t {
method inner_ptr (line 1413) | pub fn inner_ptr(&self) -> *const htslib::bam_hdr_t {
method inner_mut (line 1418) | pub fn inner_mut(&mut self) -> &mut htslib::bam_hdr_t {
method inner_ptr_mut (line 1424) | pub fn inner_ptr_mut(&mut self) -> *mut htslib::bam_hdr_t {
method tid (line 1428) | pub fn tid(&self, name: &[u8]) -> Option<u32> {
method tid2name (line 1438) | pub fn tid2name(&self, tid: u32) -> &[u8] {
method target_count (line 1442) | pub fn target_count(&self) -> u32 {
method target_names (line 1446) | pub fn target_names(&self) -> Vec<&[u8]> {
method target_len (line 1456) | pub fn target_len(&self, tid: u32) -> Option<u64> {
method as_bytes (line 1468) | pub fn as_bytes(&self) -> &[u8] {
method clone (line 1480) | fn clone(&self) -> Self {
method drop (line 1488) | fn drop(&mut self) {
type GoldType (line 1505) | type GoldType = (
function gold (line 1512) | fn gold() -> GoldType {
function compare_inner_bam_cram_records (line 1561) | fn compare_inner_bam_cram_records(cram_records: &[Record], bam_records: ...
function test_read (line 1584) | fn test_read() {
function test_seek (line 1622) | fn test_seek() {
function test_read_sam_header (line 1649) | fn test_read_sam_header() {
function test_read_against_sam (line 1661) | fn test_read_against_sam() {
function _test_read_indexed_common (line 1668) | fn _test_read_indexed_common(mut bam: IndexedReader) {
function test_read_indexed (line 1788) | fn test_read_indexed() {
function test_read_indexed_different_index_name (line 1794) | fn test_read_indexed_different_index_name() {
function test_set_record (line 1804) | fn test_set_record() {
function test_set_repeated (line 1823) | fn test_set_repeated() {
function test_set_qname (line 1861) | fn test_set_qname() {
function test_set_qname2 (line 1916) | fn test_set_qname2() {
function test_set_cigar (line 1935) | fn test_set_cigar() {
function test_remove_aux (line 1996) | fn test_remove_aux() {
function test_write (line 2019) | fn test_write() {
function test_write_threaded (line 2070) | fn test_write_threaded() {
function test_write_shared_tpool (line 2124) | fn test_write_shared_tpool() {
function test_copy_template (line 2203) | fn test_copy_template() {
function test_pileup (line 2240) | fn test_pileup() {
function test_idx_pileup (line 2261) | fn test_idx_pileup() {
function parse_from_sam (line 2276) | fn parse_from_sam() {
function test_cigar_modes (line 2302) | fn test_cigar_modes() {
function test_read_cram (line 2328) | fn test_read_cram() {
function test_write_cram (line 2346) | fn test_write_cram() {
function test_compression_level_conversion (line 2417) | fn test_compression_level_conversion() {
function test_write_compression (line 2432) | fn test_write_compression() {
function test_bam_fails_on_vcf (line 2481) | fn test_bam_fails_on_vcf() {
function test_indexde_bam_fails_on_vcf (line 2488) | fn test_indexde_bam_fails_on_vcf() {
function test_bam_fails_on_toml (line 2495) | fn test_bam_fails_on_toml() {
function test_sam_writer_example (line 2502) | fn test_sam_writer_example() {
function test_rc_records (line 2562) | fn test_rc_records() {
function test_aux_arrays (line 2602) | fn test_aux_arrays() {
function test_aux_scalars (line 2933) | fn test_aux_scalars() {
function test_aux_array_partial_eq (line 2989) | fn test_aux_array_partial_eq() {
function test_bam_header_sync (line 3050) | fn test_bam_header_sync() {
function test_bam_new (line 3059) | fn test_bam_new() {
function test_idxstats_bam (line 3111) | fn test_idxstats_bam() {
function test_number_mapped_and_unmapped_bam (line 3126) | fn test_number_mapped_and_unmapped_bam() {
function test_number_unmapped_global_bam (line 3134) | fn test_number_unmapped_global_bam() {
function test_idxstats_cram (line 3142) | fn test_idxstats_cram() {
function test_slow_idxstats_cram (line 3156) | fn test_slow_idxstats_cram() {
FILE: src/bam/pileup.rs
type Alignments (line 17) | pub type Alignments<'a> = iter::Map<
type Pileup (line 24) | pub struct Pileup {
method tid (line 32) | pub fn tid(&self) -> u32 {
method pos (line 36) | pub fn pos(&self) -> u32 {
method depth (line 40) | pub fn depth(&self) -> u32 {
method alignments (line 44) | pub fn alignments(&self) -> Alignments<'_> {
method inner (line 48) | fn inner(&self) -> &[htslib::bam_pileup1_t] {
type Alignment (line 59) | pub struct Alignment<'a> {
function fmt (line 64) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
function new (line 70) | pub fn new(inner: &'a htslib::bam_pileup1_t) -> Self {
function qpos (line 75) | pub fn qpos(&self) -> Option<usize> {
function indel (line 85) | pub fn indel(&self) -> Indel {
function is_del (line 94) | pub fn is_del(&self) -> bool {
function is_head (line 99) | pub fn is_head(&self) -> bool {
function is_tail (line 104) | pub fn is_tail(&self) -> bool {
function is_refskip (line 109) | pub fn is_refskip(&self) -> bool {
function record (line 114) | pub fn record(&self) -> record::Record {
type Indel (line 120) | pub enum Indel {
type Pileups (line 128) | pub struct Pileups<'a, R: bam::Read> {
function new (line 135) | pub fn new(reader: &'a mut R, itr: htslib::bam_plp_t) -> Self {
function set_max_depth (line 141) | pub fn set_max_depth(&mut self, depth: u32) {
type Item (line 157) | type Item = Result<Pileup>;
method next (line 160) | fn next(&mut self) -> Option<Result<Pileup>> {
method drop (line 178) | fn drop(&mut self) {
function test_max_pileup (line 193) | fn test_max_pileup() {
function test_max_pileup_to_high (line 202) | fn test_max_pileup_to_high() {
FILE: src/bam/record.rs
type Record (line 52) | pub struct Record {
method fmt (line 88) | fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
method new (line 115) | pub fn new() -> Self {
method from_inner (line 135) | pub fn from_inner(from: *mut htslib::bam1_t) -> Self {
method from_sam (line 156) | pub fn from_sam(header_view: &HeaderView, sam: &[u8]) -> Result<Record> {
method set_header (line 186) | pub fn set_header(&mut self, header: Arc<HeaderView>) {
method data (line 190) | pub(super) fn data(&self) -> &[u8] {
method inner_mut (line 195) | pub fn inner_mut(&mut self) -> &mut htslib::bam1_t {
method inner_ptr_mut (line 200) | pub(super) fn inner_ptr_mut(&mut self) -> *mut htslib::bam1_t {
method inner (line 205) | pub fn inner(&self) -> &htslib::bam1_t {
method inner_ptr (line 210) | pub(super) fn inner_ptr(&self) -> *const htslib::bam1_t {
method tid (line 215) | pub fn tid(&self) -> i32 {
method set_tid (line 220) | pub fn set_tid(&mut self, tid: i32) {
method pos (line 225) | pub fn pos(&self) -> i64 {
method set_pos (line 230) | pub fn set_pos(&mut self, pos: i64) {
method bin (line 234) | pub fn bin(&self) -> u16 {
method set_bin (line 238) | pub fn set_bin(&mut self, bin: u16) {
method mapq (line 243) | pub fn mapq(&self) -> u8 {
method set_mapq (line 248) | pub fn set_mapq(&mut self, mapq: u8) {
method strand (line 253) | pub fn strand(&self) -> ReqStrand {
method flags (line 263) | pub fn flags(&self) -> u16 {
method set_flags (line 268) | pub fn set_flags(&mut self, flags: u16) {
method unset_flags (line 273) | pub fn unset_flags(&mut self) {
method mtid (line 278) | pub fn mtid(&self) -> i32 {
method set_mtid (line 283) | pub fn set_mtid(&mut self, mtid: i32) {
method mpos (line 288) | pub fn mpos(&self) -> i64 {
method set_mpos (line 293) | pub fn set_mpos(&mut self, mpos: i64) {
method insert_size (line 298) | pub fn insert_size(&self) -> i64 {
method set_insert_size (line 303) | pub fn set_insert_size(&mut self, insert_size: i64) {
method qname_capacity (line 307) | fn qname_capacity(&self) -> usize {
method qname_len (line 311) | fn qname_len(&self) -> usize {
method qname (line 317) | pub fn qname(&self) -> &[u8] {
method set_data (line 322) | pub fn set_data(&mut self, new_data: &[u8]) {
method set (line 345) | pub fn set(&mut self, qname: &[u8], cigar: Option<&CigarString>, seq: ...
method set_qname (line 427) | pub fn set_qname(&mut self, new_qname: &[u8]) {
method set_cigar (line 477) | pub fn set_cigar(&mut self, new_cigar: Option<&CigarString>) {
method realloc_var_data (line 532) | fn realloc_var_data(&mut self, new_len: usize) {
method cigar_len (line 557) | pub fn cigar_len(&self) -> usize {
method raw_cigar (line 563) | pub fn raw_cigar(&self) -> &[u32] {
method cigar (line 575) | pub fn cigar(&self) -> CigarStringView {
method cigar_cached (line 583) | pub fn cigar_cached(&self) -> Option<&CigarStringView> {
method cache_cigar (line 588) | pub fn cache_cigar(&mut self) {
method unpack_cigar (line 593) | fn unpack_cigar(&self) -> CigarStringView {
method seq_len (line 617) | pub fn seq_len(&self) -> usize {
method seq_data (line 621) | fn seq_data(&self) -> &[u8] {
method seq (line 627) | pub fn seq(&self) -> Seq<'_> {
method qual (line 637) | pub fn qual(&self) -> &[u8] {
method aux (line 646) | pub fn aux(&self, tag: &[u8]) -> Result<Aux<'_>> {
method read_aux_field (line 659) | unsafe fn read_aux_field<'a>(aux: *const u8) -> Result<(Aux<'a>, usize...
method aux_iter (line 838) | pub fn aux_iter(&'_ self) -> AuxIter<'_> {
method push_aux (line 855) | pub fn push_aux(&mut self, tag: &[u8], value: Aux<'_>) -> Result<()> {
method push_aux_unchecked (line 869) | pub fn push_aux_unchecked(&mut self, tag: &[u8], value: Aux<'_>) -> Re...
method update_aux (line 1081) | pub fn update_aux(&mut self, tag: &[u8], value: Aux<'_>) -> Result<()> {
method remove_aux (line 1235) | pub fn remove_aux(&mut self, tag: &[u8]) -> Result<()> {
method basemods_iter (line 1286) | pub fn basemods_iter(&'_ self) -> Result<BaseModificationsIter<'_>> {
method basemods_position_iter (line 1293) | pub fn basemods_position_iter(&'_ self) -> Result<BaseModificationsPos...
method read_pair_orientation (line 1300) | pub fn read_pair_orientation(&self) -> SequenceReadPairOrientation {
method contig (line 1418) | fn contig(&self) -> &str {
method range (line 1435) | fn range(&self) -> ops::Range<genome::Position> {
method clone (line 63) | fn clone(&self) -> Self {
method eq (line 71) | fn eq(&self, other: &Record) -> bool {
method default (line 98) | fn default() -> Self {
function extranul_from_qname (line 104) | fn extranul_from_qname(qname: &[u8]) -> usize {
method drop (line 1387) | fn drop(&mut self) {
method name (line 1395) | fn name(&self) -> &[u8] {
method base (line 1399) | fn base(&self, i: usize) -> u8 {
method base_qual (line 1403) | fn base_qual(&self, i: usize) -> u8 {
method len (line 1407) | fn len(&self) -> usize {
method is_empty (line 1411) | fn is_empty(&self) -> bool {
type Aux (line 1504) | pub enum Aux<'a> {
type AuxArrayElement (line 1529) | pub trait AuxArrayElement: Copy {
method from_le_bytes (line 1530) | fn from_le_bytes(bytes: &[u8]) -> Option<Self>;
method from_le_bytes (line 1534) | fn from_le_bytes(bytes: &[u8]) -> Option<Self> {
method from_le_bytes (line 1539) | fn from_le_bytes(bytes: &[u8]) -> Option<Self> {
method from_le_bytes (line 1544) | fn from_le_bytes(bytes: &[u8]) -> Option<Self> {
method from_le_bytes (line 1549) | fn from_le_bytes(bytes: &[u8]) -> Option<Self> {
method from_le_bytes (line 1554) | fn from_le_bytes(bytes: &[u8]) -> Option<Self> {
method from_le_bytes (line 1559) | fn from_le_bytes(bytes: &[u8]) -> Option<Self> {
method from_le_bytes (line 1564) | fn from_le_bytes(bytes: &[u8]) -> Option<Self> {
type AuxArray (line 1613) | pub enum AuxArray<'a, T> {
function eq (line 1622) | fn eq(&self, other: &AuxArray<'_, T>) -> bool {
function from (line 1639) | fn from(src: &'a T) -> Self {
function get (line 1651) | pub fn get(&self, index: usize) -> Option<T> {
function len (line 1659) | pub fn len(&self) -> usize {
function is_empty (line 1667) | pub fn is_empty(&self) -> bool {
function iter (line 1672) | pub fn iter(&'_ self) -> AuxArrayIter<'_, T> {
function from_bytes (line 1680) | fn from_bytes(bytes: &'a [u8]) -> Self {
type AuxArrayTargetType (line 1691) | pub struct AuxArrayTargetType<'a, T> {
function get (line 1699) | fn get(&self, index: usize) -> Option<T> {
function len (line 1703) | fn len(&self) -> usize {
type AuxArrayRawLeBytes (line 1711) | pub struct AuxArrayRawLeBytes<'a, T> {
function get (line 1720) | fn get(&self, index: usize) -> Option<T> {
function len (line 1728) | fn len(&self) -> usize {
type AuxArrayIter (line 1736) | pub struct AuxArrayIter<'a, T> {
type Item (line 1745) | type Item = T;
method next (line 1746) | fn next(&mut self) -> Option<Self::Item> {
method size_hint (line 1752) | fn size_hint(&self) -> (usize, Option<usize>) {
type AuxIter (line 1768) | pub struct AuxIter<'a> {
type Item (line 1773) | type Item = Result<(&'a [u8], Aux<'a>)>;
method next (line 1775) | fn next(&mut self) -> Option<Self::Item> {
function encoded_base (line 1818) | fn encoded_base(encoded_seq: &[u8], i: usize) -> u8 {
function encoded_base_unchecked (line 1823) | unsafe fn encoded_base_unchecked(encoded_seq: &[u8], i: usize) -> u8 {
function decode_base_unchecked (line 1828) | fn decode_base_unchecked(base: u8) -> &'static u8 {
type Seq (line 1834) | pub struct Seq<'a> {
function encoded_base (line 1842) | pub fn encoded_base(&self, i: usize) -> u8 {
function encoded_base_unchecked (line 1852) | pub unsafe fn encoded_base_unchecked(&self, i: usize) -> u8 {
function decoded_base_unchecked (line 1864) | pub unsafe fn decoded_base_unchecked(&self, i: usize) -> u8 {
function as_bytes (line 1869) | pub fn as_bytes(&self) -> Vec<u8> {
function len (line 1874) | pub fn len(&self) -> usize {
function is_empty (line 1878) | pub fn is_empty(&self) -> bool {
type Output (line 1884) | type Output = u8;
function index (line 1887) | fn index(&self, index: usize) -> &u8 {
type Cigar (line 1897) | pub enum Cigar {
method encode (line 1910) | fn encode(self) -> u32 {
method len (line 1925) | pub fn len(self) -> u32 {
method is_empty (line 1939) | pub fn is_empty(self) -> bool {
method char (line 1944) | pub fn char(self) -> char {
method fmt (line 1960) | fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
method into_view (line 2005) | pub fn into_view(self, pos: i64) -> CigarStringView {
method from_alignment (line 2013) | pub fn from_alignment(alignment: &Alignment, hard_clip: bool) -> Self {
type Error (line 2068) | type Error = Error;
method try_from (line 2090) | fn try_from(bytes: &[u8]) -> Result<Self> {
type Error (line 2158) | type Error = Error;
method try_from (line 2180) | fn try_from(text: &str) -> Result<Self> {
method iter (line 2192) | pub fn iter(&'a self) -> ::std::slice::Iter<'a, Cigar> {
type Item (line 2198) | type Item = &'a Cigar;
type IntoIter (line 2199) | type IntoIter = ::std::slice::Iter<'a, Cigar>;
method into_iter (line 2201) | fn into_iter(self) -> Self::IntoIter {
method fmt (line 2207) | fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
function calc_softclips (line 2216) | fn calc_softclips<'a>(mut cigar: impl DoubleEndedIterator<Item = &'a Cig...
type CigarStringView (line 2226) | pub struct CigarStringView {
method new (line 2233) | pub fn new(c: CigarString, pos: i64) -> CigarStringView {
method end_pos (line 2238) | pub fn end_pos(&self) -> i64 {
method pos (line 2255) | pub fn pos(&self) -> i64 {
method leading_softclips (line 2260) | pub fn leading_softclips(&self) -> i64 {
method trailing_softclips (line 2265) | pub fn trailing_softclips(&self) -> i64 {
method leading_hardclips (line 2270) | pub fn leading_hardclips(&self) -> i64 {
method trailing_hardclips (line 2281) | pub fn trailing_hardclips(&self) -> i64 {
method read_pos (line 2300) | pub fn read_pos(
method take (line 2418) | pub fn take(self) -> CigarString {
type Target (line 2424) | type Target = CigarString;
method deref (line 2426) | fn deref(&self) -> &CigarString {
type Output (line 2432) | type Output = Cigar;
method index (line 2434) | fn index(&self, index: usize) -> &Cigar {
method index_mut (line 2440) | fn index_mut(&mut self, index: usize) -> &mut Cigar {
method iter (line 2446) | pub fn iter(&'a self) -> ::std::slice::Iter<'a, Cigar> {
method fmt (line 2461) | fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
type Item (line 2452) | type Item = &'a Cigar;
type IntoIter (line 2453) | type IntoIter = ::std::slice::Iter<'a, Cigar>;
method into_iter (line 2455) | fn into_iter(self) -> Self::IntoIter {
type BaseModificationMetadata (line 2466) | pub struct BaseModificationMetadata {
type BaseModificationState (line 2474) | pub struct BaseModificationState<'a> {
function new (line 2486) | fn new(r: &Record) -> Result<BaseModificationState<'_>> {
function buffer_next_mods (line 2513) | pub fn buffer_next_mods(&mut self) -> Result<usize> {
function recorded (line 2544) | pub fn recorded<'a>(&self) -> &'a [i32] {
function query_type (line 2563) | pub fn query_type(&self, code: i32) -> Result<BaseModificationMetadata> {
method drop (line 2591) | fn drop<'a>(&mut self) {
type BaseModificationsPositionIter (line 2600) | pub struct BaseModificationsPositionIter<'a> {
function new (line 2605) | fn new(r: &Record) -> Result<BaseModificationsPositionIter<'_>> {
function recorded (line 2610) | pub fn recorded<'a>(&self) -> &'a [i32] {
function query_type (line 2614) | pub fn query_type(&self, code: i32) -> Result<BaseModificationMetadata> {
type Item (line 2620) | type Item = Result<(i32, Vec<hts_sys::hts_base_mod>)>;
method next (line 2622) | fn next(&mut self) -> Option<Self::Item> {
type BaseModificationsIter (line 2645) | pub struct BaseModificationsIter<'a> {
function new (line 2651) | fn new(r: &Record) -> Result<BaseModificationsIter<'_>> {
function recorded (line 2659) | pub fn recorded<'a>(&self) -> &'a [i32] {
function query_type (line 2663) | pub fn query_type(&self, code: i32) -> Result<BaseModificationMetadata> {
type Item (line 2669) | type Item = Result<(i32, hts_sys::hts_base_mod)>;
method next (line 2671) | fn next(&mut self) -> Option<Self::Item> {
function test_cigar_string (line 2707) | fn test_cigar_string() {
function test_cigar_string_view_pos (line 2718) | fn test_cigar_string_view_pos() {
function test_cigar_string_leading_softclips (line 2724) | fn test_cigar_string_leading_softclips() {
function test_cigar_string_trailing_softclips (line 2737) | fn test_cigar_string_trailing_softclips() {
function test_cigar_read_pos (line 2750) | fn test_cigar_read_pos() {
function test_clone (line 2929) | fn test_clone() {
function test_flags (line 2938) | fn test_flags() {
function test_cigar_parse (line 2958) | fn test_cigar_parse() {
function test_cigar (line 2973) | fn test_cigar() {
function test_read_orientation_f1r2 (line 3068) | fn test_read_orientation_f1r2() {
function test_read_orientation_f2r1 (line 3081) | fn test_read_orientation_f2r1() {
function test_read_orientation_supplementary (line 3094) | fn test_read_orientation_supplementary() {
function test_cigar_parsing_non_ascii_error (line 3107) | pub fn test_cigar_parsing_non_ascii_error() {
function test_cigar_parsing (line 3118) | pub fn test_cigar_parsing() {
function test_count_recorded (line 3179) | pub fn test_count_recorded() {
function test_query_type (line 3192) | pub fn test_query_type() {
function test_mod_iter (line 3218) | pub fn test_mod_iter() {
function test_position_iter (line 3234) | pub fn test_position_iter() {
FILE: src/bam/record_serde.rs
function fix_l_extranul (line 10) | fn fix_l_extranul(rec: &mut Record) {
method serialize (line 18) | fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
method deserialize (line 41) | fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
function test_bincode (line 323) | fn test_bincode() {
function test_serde_json (line 337) | fn test_serde_json() {
FILE: src/bcf/buffer.rs
type RecordBuffer (line 20) | pub struct RecordBuffer {
method new (line 32) | pub fn new(reader: bcf::Reader) -> Self {
method last_rid (line 41) | fn last_rid(&self) -> Option<u32> {
method next_rid (line 45) | fn next_rid(&self) -> Option<u32> {
method swap_buffers (line 49) | fn swap_buffers(&mut self) {
method drain_left (line 56) | fn drain_left(&mut self, rid: u32, window_start: u64) -> usize {
method fetch (line 73) | pub fn fetch(&mut self, chrom: &[u8], start: u64, end: u64) -> Result<...
method iter (line 170) | pub fn iter(&self) -> vec_deque::Iter<'_, bcf::Record> {
method iter_mut (line 175) | pub fn iter_mut(&mut self) -> vec_deque::IterMut<'_, bcf::Record> {
method len (line 179) | pub fn len(&self) -> usize {
method is_empty (line 183) | pub fn is_empty(&self) -> bool {
function test_buffer (line 194) | fn test_buffer() {
FILE: src/bcf/header.rs
type SampleSubset (line 47) | pub type SampleSubset = Vec<i32>;
type Header (line 67) | pub struct Header {
method new (line 83) | pub fn new() -> Self {
method inner_ptr (line 96) | pub unsafe fn inner_ptr(&self) -> *mut htslib::bcf_hdr_t {
method from_template (line 107) | pub fn from_template(header: &HeaderView) -> Self {
method from_template_subset (line 121) | pub fn from_template_subset(header: &HeaderView, samples: &[&[u8]]) ->...
method push_sample (line 153) | pub fn push_sample(&mut self, sample: &[u8]) -> &mut Self {
method push_record (line 170) | pub fn push_record(&mut self, record: &[u8]) -> &mut Self {
method remove_filter (line 181) | pub fn remove_filter(&mut self, tag: &[u8]) -> &mut Self {
method remove_info (line 190) | pub fn remove_info(&mut self, tag: &[u8]) -> &mut Self {
method remove_format (line 199) | pub fn remove_format(&mut self, tag: &[u8]) -> &mut Self {
method remove_contig (line 208) | pub fn remove_contig(&mut self, tag: &[u8]) -> &mut Self {
method remove_structured (line 217) | pub fn remove_structured(&mut self, tag: &[u8]) -> &mut Self {
method remove_generic (line 226) | pub fn remove_generic(&mut self, tag: &[u8]) -> &mut Self {
method remove_impl (line 231) | fn remove_impl(&mut self, tag: &[u8], type_: u32) -> &mut Self {
method default (line 76) | fn default() -> Self {
method drop (line 242) | fn drop(&mut self) {
type HeaderRecord (line 249) | pub enum HeaderRecord {
type HeaderView (line 280) | pub struct HeaderView {
method from_ptr (line 292) | pub unsafe fn from_ptr(inner: *mut htslib::bcf_hdr_t) -> Self {
method as_ptr (line 301) | pub unsafe fn as_ptr(&self) -> *mut htslib::bcf_hdr_t {
method inner (line 306) | fn inner(&self) -> htslib::bcf_hdr_t {
method sample_count (line 311) | pub fn sample_count(&self) -> u32 {
method samples (line 316) | pub fn samples(&self) -> Vec<&[u8]> {
method sample_id (line 327) | pub fn sample_id(&self, sample: &[u8]) -> Option<usize> {
method contig_count (line 332) | pub fn contig_count(&self) -> u32 {
method rid2name (line 336) | pub fn rid2name(&self, rid: u32) -> Result<&[u8]> {
method name2rid (line 367) | pub fn name2rid(&self, name: &[u8]) -> Result<u32> {
method info_type (line 383) | pub fn info_type(&self, tag: &[u8]) -> Result<(TagType, TagLength)> {
method format_type (line 387) | pub fn format_type(&self, tag: &[u8]) -> Result<(TagType, TagLength)> {
method tag_type (line 391) | fn tag_type(&self, tag: &[u8], hdr_type: ::libc::c_uint) -> Result<(Ta...
method name_to_id (line 429) | pub fn name_to_id(&self, id: &[u8]) -> Result<Id> {
method id_to_name (line 447) | pub fn id_to_name(&self, id: Id) -> Vec<u8> {
method sample_to_id (line 457) | pub fn sample_to_id(&self, id: &[u8]) -> Result<Id> {
method id_to_sample (line 474) | pub fn id_to_sample(&self, id: Id) -> Vec<u8> {
method header_records (line 484) | pub fn header_records(&self) -> Vec<HeaderRecord> {
method empty_record (line 544) | pub fn empty_record(self: &Arc<Self>) -> crate::bcf::Record {
method clone (line 550) | fn clone(&self) -> Self {
method drop (line 558) | fn drop(&mut self) {
type TagType (line 566) | pub enum TagType {
type TagLength (line 574) | pub enum TagLength {
function test_header_view_empty_record (line 589) | fn test_header_view_empty_record() {
function test_header_add_sample_via_raw_pointer (line 605) | fn test_header_add_sample_via_raw_pointer() {
function test_header_view_version_via_raw_pointer (line 625) | fn test_header_view_version_via_raw_pointer() {
FILE: src/bcf/index.rs
type BcfBuildError (line 4) | pub struct BcfBuildError {
method error_message (line 26) | pub fn error_message(error: i32) -> &'static str {
method fmt (line 39) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
type Type (line 9) | pub enum Type {
method min_shift (line 17) | fn min_shift(&self) -> i32 {
function build (line 66) | pub fn build<P: AsRef<std::path::Path>>(
FILE: src/bcf/mod.rs
type Read (line 126) | pub trait Read: Sized {
method read (line 135) | fn read(&mut self, record: &mut record::Record) -> Option<Result<()>>;
method records (line 138) | fn records(&mut self) -> Records<'_, Self>;
method header (line 141) | fn header(&self) -> &HeaderView;
method empty_record (line 144) | fn empty_record(&self) -> Record;
method set_threads (line 155) | fn set_threads(&mut self, n_threads: usize) -> Result<()>;
method read (line 212) | fn read(&mut self, record: &mut record::Record) -> Option<Result<()>> {
method records (line 227) | fn records(&mut self) -> Records<'_, Self> {
method set_threads (line 231) | fn set_threads(&mut self, n_threads: usize) -> Result<()> {
method header (line 235) | fn header(&self) -> &HeaderView {
method empty_record (line 240) | fn empty_record(&self) -> Record {
method read (line 347) | fn read(&mut self, record: &mut record::Record) -> Option<Result<()>> {
method records (line 391) | fn records(&mut self) -> Records<'_, Self> {
method set_threads (line 395) | fn set_threads(&mut self, n_threads: usize) -> Result<()> {
method header (line 406) | fn header(&self) -> &HeaderView {
method empty_record (line 410) | fn empty_record(&self) -> Record {
type Reader (line 160) | pub struct Reader {
method from_path (line 183) | pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self> {
method from_url (line 192) | pub fn from_url(url: &Url) -> Result<Self> {
method from_stdin (line 197) | pub fn from_stdin() -> Result<Self> {
method new (line 201) | fn new(path: &[u8]) -> Result<Self> {
function set_threads (line 170) | pub unsafe fn set_threads(hts_file: *mut htslib::htsFile, n_threads: usi...
method drop (line 246) | fn drop(&mut self) {
type IndexedReader (line 255) | pub struct IndexedReader {
method from_path (line 273) | pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self> {
method from_url (line 285) | pub fn from_url(url: &Url) -> Result<Self> {
method new (line 294) | fn new(path: &ffi::CStr) -> Result<Self> {
method fetch (line 331) | pub fn fetch(&mut self, rid: u32, start: u64, end: Option<u64>) -> Res...
method drop (line 416) | fn drop(&mut self) {
constant SNPS (line 429) | pub const SNPS: u32 = crate::htslib::BCF_SR_PAIR_SNPS;
constant INDELS (line 431) | pub const INDELS: u32 = crate::htslib::BCF_SR_PAIR_INDELS;
constant ANY (line 433) | pub const ANY: u32 = crate::htslib::BCF_SR_PAIR_ANY;
constant SOME (line 435) | pub const SOME: u32 = crate::htslib::BCF_SR_PAIR_SOME;
constant SNP_REF (line 437) | pub const SNP_REF: u32 = crate::htslib::BCF_SR_PAIR_SNP_REF;
constant INDEL_REF (line 439) | pub const INDEL_REF: u32 = crate::htslib::BCF_SR_PAIR_INDEL_REF;
constant EXACT (line 441) | pub const EXACT: u32 = crate::htslib::BCF_SR_PAIR_EXACT;
constant BOTH (line 443) | pub const BOTH: u32 = crate::htslib::BCF_SR_PAIR_BOTH;
constant BOTH_REF (line 445) | pub const BOTH_REF: u32 = crate::htslib::BCF_SR_PAIR_BOTH_REF;
type SyncedReader (line 450) | pub struct SyncedReader {
method new (line 463) | pub fn new() -> Result<Self> {
method set_require_index (line 477) | pub fn set_require_index(&mut self, do_require: bool) {
method set_pairing (line 484) | pub fn set_pairing(&mut self, bitmask: u32) {
method add_reader (line 492) | pub fn add_reader<P: AsRef<Path>>(&mut self, path: P) -> Result<()> {
method remove_reader (line 519) | pub fn remove_reader(&mut self, idx: u32) {
method reader_count (line 531) | pub fn reader_count(&self) -> u32 {
method read_next (line 536) | pub fn read_next(&mut self) -> Result<u32> {
method has_line (line 569) | pub fn has_line(&self, idx: u32) -> bool {
method record (line 578) | pub fn record(&self, idx: u32) -> Option<Record> {
method header (line 596) | pub fn header(&self, idx: u32) -> &HeaderView {
method fetch (line 613) | pub fn fetch(&mut self, rid: u32, start: u64, end: u64) -> Result<()> {
method drop (line 631) | fn drop(&mut self) {
type Format (line 638) | pub enum Format {
type Writer (line 645) | pub struct Writer {
method from_path (line 662) | pub fn from_path<P: AsRef<Path>>(
method from_url (line 683) | pub fn from_url(
method from_stdout (line 699) | pub fn from_stdout(header: &Header, uncompressed: bool, format: Format...
method new (line 703) | fn new(path: &[u8], header: &Header, uncompressed: bool, format: Forma...
method header (line 721) | pub fn header(&self) -> &HeaderView {
method empty_record (line 728) | pub fn empty_record(&self) -> Record {
method translate (line 737) | pub fn translate(&mut self, record: &mut record::Record) {
method subset (line 749) | pub fn subset(&mut self, record: &mut record::Record) {
method write (line 767) | pub fn write(&mut self, record: &record::Record) -> Result<()> {
method set_threads (line 781) | pub fn set_threads(&mut self, n_threads: usize) -> Result<()> {
method drop (line 787) | fn drop(&mut self) {
type Records (line 795) | pub struct Records<'a, R: Read> {
function new (line 800) | pub fn new(reader: &'a mut R) -> Self {
type Item (line 806) | type Item = Result<record::Record>;
method next (line 808) | fn next(&mut self) -> Option<Result<record::Record>> {
function bcf_open (line 819) | fn bcf_open(target: &[u8], mode: &[u8]) -> Result<*mut htslib::htsFile> {
function _test_read (line 858) | fn _test_read<P: AsRef<Path>>(path: &P) {
function test_read (line 907) | fn test_read() {
function test_reader_set_threads (line 912) | fn test_reader_set_threads() {
function test_writer_set_threads (line 919) | fn test_writer_set_threads() {
function test_fetch (line 935) | fn test_fetch() {
function test_fetch_all (line 948) | fn test_fetch_all() {
function test_fetch_open_ended (line 960) | fn test_fetch_open_ended() {
function test_fetch_start_greater_than_last_vcf_pos (line 972) | fn test_fetch_start_greater_than_last_vcf_pos() {
function test_write (line 984) | fn test_write() {
function test_strings (line 1012) | fn test_strings() {
function test_missing (line 1051) | fn test_missing() {
function test_genotypes (line 1091) | fn test_genotypes() {
function test_genotypes_read_mixed_ploidy (line 1102) | fn test_genotypes_read_mixed_ploidy() {
function test_genotypes_write_and_read_mixed_ploidy (line 1122) | fn test_genotypes_write_and_read_mixed_ploidy() {
function test_genotypes_wrong_max_ploidy (line 1196) | fn test_genotypes_wrong_max_ploidy() {
function test_header_ids (line 1225) | fn test_header_ids() {
function test_header_samples (line 1236) | fn test_header_samples() {
function test_header_contigs (line 1248) | fn test_header_contigs() {
function test_header_records (line 1267) | fn test_header_records() {
function test_header_info_types (line 1287) | fn test_header_info_types() {
function test_remove_alleles (line 1360) | fn test_remove_alleles() {
function read_all (line 1372) | fn read_all<P: AsRef<Path>>(path: P) -> String {
function test_write_various (line 1385) | fn test_write_various() {
function test_remove_headers (line 1470) | fn test_remove_headers() {
function test_synced_reader (line 1497) | fn test_synced_reader() {
function test_synced_reader_fetch (line 1527) | fn test_synced_reader_fetch() {
function test_svlen (line 1558) | fn test_svlen() {
function test_fails_on_bam (line 1571) | fn test_fails_on_bam() {
function test_fails_on_non_existiant (line 1577) | fn test_fails_on_non_existiant() {
function test_multi_string_info_tag (line 1583) | fn test_multi_string_info_tag() {
function test_multi_string_info_tag_number_a (line 1599) | fn test_multi_string_info_tag_number_a() {
function test_genotype_allele_conversion (line 1615) | fn test_genotype_allele_conversion() {
function test_genotype_missing_allele_conversion (line 1625) | fn test_genotype_missing_allele_conversion() {
function test_alt_allele_dosage (line 1635) | fn test_alt_allele_dosage() {
function test_obs_cornercase (line 1665) | fn test_obs_cornercase() {
function test_trailing_omitted_format_fields (line 1684) | fn test_trailing_omitted_format_fields() {
FILE: src/bcf/record.rs
constant MISSING_INTEGER (line 27) | const MISSING_INTEGER: i32 = i32::MIN;
constant VECTOR_END_INTEGER (line 28) | const VECTOR_END_INTEGER: i32 = i32::MIN + 1;
type Numeric (line 36) | pub trait Numeric {
method is_missing (line 38) | fn is_missing(&self) -> bool;
method missing (line 41) | fn missing() -> Self;
method is_missing (line 45) | fn is_missing(&self) -> bool {
method missing (line 49) | fn missing() -> f32 {
method is_missing (line 55) | fn is_missing(&self) -> bool {
method missing (line 59) | fn missing() -> i32 {
type NumericUtils (line 64) | trait NumericUtils {
method is_vector_end (line 66) | fn is_vector_end(&self) -> bool;
method is_vector_end (line 70) | fn is_vector_end(&self) -> bool {
method is_vector_end (line 76) | fn is_vector_end(&self) -> bool {
type FilterId (line 82) | pub trait FilterId {
method id_from_header (line 83) | fn id_from_header(&self, header: &HeaderView) -> Result<Id>;
method is_pass (line 84) | fn is_pass(&self) -> bool;
method id_from_header (line 88) | fn id_from_header(&self, header: &HeaderView) -> Result<Id> {
method is_pass (line 91) | fn is_pass(&self) -> bool {
method id_from_header (line 97) | fn id_from_header(&self, _header: &HeaderView) -> Result<Id> {
method is_pass (line 100) | fn is_pass(&self) -> bool {
type Buffer (line 107) | pub struct Buffer {
method new (line 113) | pub fn new() -> Self {
method default (line 122) | fn default() -> Self {
method drop (line 128) | fn drop(&mut self) {
type BufferBacked (line 136) | pub struct BufferBacked<'a, T: 'a + fmt::Debug, B: Borrow<Buffer> + 'a> {
type Target (line 144) | type Target = T;
method deref (line 146) | fn deref(&self) -> &T {
function fmt (line 154) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
type Record (line 176) | pub struct Record {
method new (line 183) | pub fn new(header: Arc<HeaderView>) -> Self {
method unpack (line 194) | pub fn unpack(&mut self) {
method header (line 199) | pub fn header(&self) -> &HeaderView {
method translate (line 204) | pub fn translate(&mut self, dst_header: &mut Arc<HeaderView>) -> Resul...
method set_header (line 215) | pub(crate) fn set_header(&mut self, header: Arc<HeaderView>) {
method inner (line 225) | pub fn inner(&self) -> &htslib::bcf1_t {
method inner_mut (line 235) | pub fn inner_mut(&mut self) -> &mut htslib::bcf1_t {
method rid (line 248) | pub fn rid(&self) -> Option<u32> {
method set_rid (line 281) | pub fn set_rid(&mut self, rid: Option<u32>) {
method pos (line 289) | pub fn pos(&self) -> i64 {
method set_pos (line 294) | pub fn set_pos(&mut self, pos: i64) {
method end (line 315) | pub fn end(&self) -> i64 {
method id (line 322) | pub fn id(&self) -> Vec<u8> {
method set_id (line 332) | pub fn set_id(&mut self, id: &[u8]) -> Result<()> {
method clear_id (line 349) | pub fn clear_id(&mut self) -> Result<()> {
method push_id (line 366) | pub fn push_id(&mut self, id: &[u8]) -> Result<()> {
method filters (line 385) | pub fn filters(&self) -> Filters<'_> {
method has_filter (line 413) | pub fn has_filter<T: FilterId + ?Sized>(&self, flt_id: &T) -> bool {
method set_filters (line 464) | pub fn set_filters<T: FilterId + ?Sized>(&mut self, flt_ids: &[&T]) ->...
method push_filter (line 511) | pub fn push_filter<T: FilterId + ?Sized>(&mut self, flt_id: &T) -> Res...
method remove_filter (line 557) | pub fn remove_filter<T: FilterId + ?Sized>(
method alleles (line 577) | pub fn alleles(&self) -> Vec<&[u8]> {
method set_alleles (line 607) | pub fn set_alleles(&mut self, alleles: &[&[u8]]) -> Result<()> {
method qual (line 632) | pub fn qual(&self) -> f32 {
method set_qual (line 637) | pub fn set_qual(&mut self, qual: f32) {
method info (line 641) | pub fn info<'a>(&'a self, tag: &'a [u8]) -> Info<'a, Buffer> {
method info_shared_buffer (line 646) | pub fn info_shared_buffer<'a, 'b, B: BorrowMut<Buffer> + Borrow<Buffer...
method sample_count (line 659) | pub fn sample_count(&self) -> u32 {
method allele_count (line 664) | pub fn allele_count(&self) -> u32 {
method push_genotypes (line 701) | pub fn push_genotypes(&mut self, genotypes: &[GenotypeAllele]) -> Resu...
method push_genotype_structured (line 750) | pub fn push_genotype_structured<GT>(
method genotypes (line 790) | pub fn genotypes(&self) -> Result<Genotypes<'_, Buffer>> {
method genotypes_shared_buffer (line 796) | pub fn genotypes_shared_buffer<'a, B>(&self, buffer: B) -> Result<Geno...
method format (line 836) | pub fn format<'a>(&'a self, tag: &'a [u8]) -> Format<'a, Buffer> {
method format_shared_buffer (line 841) | pub fn format_shared_buffer<'a, 'b, B: BorrowMut<Buffer> + Borrow<Buff...
method push_format_integer (line 860) | pub fn push_format_integer(&mut self, tag: &[u8], data: &[i32]) -> Res...
method push_format_float (line 897) | pub fn push_format_float(&mut self, tag: &[u8], data: &[f32]) -> Resul...
method push_format_char (line 912) | pub fn push_format_char(&mut self, tag: &[u8], data: &[u8]) -> Result<...
method push_format (line 918) | fn push_format<T>(&mut self, tag: &[u8], data: &[T], ht: u32) -> Resul...
method push_format_string (line 953) | pub fn push_format_string<D: Borrow<[u8]>>(&mut self, tag: &[u8], data...
method push_info_integer (line 986) | pub fn push_info_integer(&mut self, tag: &[u8], data: &[i32]) -> Resul...
method clear_info_integer (line 991) | pub fn clear_info_integer(&mut self, tag: &[u8]) -> Result<()> {
method push_info_float (line 996) | pub fn push_info_float(&mut self, tag: &[u8], data: &[f32]) -> Result<...
method clear_info_float (line 1001) | pub fn clear_info_float(&mut self, tag: &[u8]) -> Result<()> {
method push_info (line 1011) | fn push_info<T>(&mut self, tag: &[u8], data: &[T], ht: u32) -> Result<...
method push_info_flag (line 1033) | pub fn push_info_flag(&mut self, tag: &[u8]) -> Result<()> {
method clear_info_flag (line 1038) | pub fn clear_info_flag(&mut self, tag: &[u8]) -> Result<()> {
method push_info_string (line 1043) | pub fn push_info_string(&mut self, tag: &[u8], data: &[&[u8]]) -> Resu...
method clear_info_string (line 1048) | pub fn clear_info_string(&mut self, tag: &[u8]) -> Result<()> {
method push_info_string_impl (line 1053) | fn push_info_string_impl(&mut self, tag: &[u8], data: &[&[u8]], ht: u3...
method trim_alleles (line 1088) | pub fn trim_alleles(&mut self) -> Result<()> {
method remove_alleles (line 1095) | pub fn remove_alleles(&mut self, remove: &[bool]) -> Result<()> {
method rlen (line 1138) | pub fn rlen(&self) -> i64 {
method clear (line 1163) | pub fn clear(&self) {
method desc (line 1168) | pub fn desc(&self) -> String {
method to_vcf_string (line 1181) | pub fn to_vcf_string(&self) -> Result<String> {
method contig (line 1221) | fn contig(&self) -> &str {
method pos (line 1230) | fn pos(&self) -> u64 {
method clone (line 1211) | fn clone(&self) -> Self {
type GenotypeAllele (line 1237) | pub enum GenotypeAllele {
method from_encoded (line 1250) | pub fn from_encoded(encoded: i32) -> Self {
method index (line 1261) | pub fn index(self) -> Option<u32> {
method fmt (line 1270) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
method from (line 1291) | fn from(encoded: i32) -> GenotypeAllele {
function from (line 1279) | fn from(allele: GenotypeAllele) -> i32 {
method fmt (line 1309) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
type Genotypes (line 1325) | pub struct Genotypes<'a, B>
function get (line 1338) | pub fn get(&self, i: usize) -> Genotype {
method drop (line 1350) | fn drop(&mut self) {
type Info (line 1361) | pub struct Info<'a, B: BorrowMut<Buffer> + Borrow<Buffer>> {
type BufferBackedOption (line 1367) | pub type BufferBackedOption<'b, B> = Option<BufferBacked<'b, Vec<&'b [u8...
function desc (line 1371) | pub fn desc(&self) -> String {
function data (line 1375) | fn data(&mut self, data_type: u32) -> Result<Option<i32>> {
function integer (line 1406) | pub fn integer(mut self) -> Result<Option<BufferBacked<'b, &'b [i32], B>...
function float (line 1425) | pub fn float(mut self) -> Result<Option<BufferBacked<'b, &'b [f32], B>>> {
function flag (line 1437) | pub fn flag(&mut self) -> Result<bool> {
function string (line 1450) | pub fn string(mut self) -> Result<BufferBackedOption<'b, B>> {
function trim_slice (line 1476) | fn trim_slice<T: PartialEq + NumericUtils>(s: &[T]) -> &[T] {
type Format (line 1484) | pub struct Format<'a, B: BorrowMut<Buffer> + Borrow<Buffer>> {
function new (line 1493) | fn new(record: &'a Record, tag: &'a [u8], buffer: B) -> Format<'a, B> {
function desc (line 1511) | pub fn desc(&self) -> String {
function inner (line 1515) | pub fn inner(&self) -> &htslib::bcf_fmt_t {
function inner_mut (line 1519) | pub fn inner_mut(&mut self) -> &mut htslib::bcf_fmt_t {
function values_per_sample (line 1523) | fn values_per_sample(&self) -> usize {
function data (line 1528) | fn data(&mut self, data_type: u32) -> Result<i32> {
function integer (line 1559) | pub fn integer(mut self) -> Result<BufferBacked<'b, Vec<&'b [i32]>, B>> {
function float (line 1582) | pub fn float(mut self) -> Result<BufferBacked<'b, Vec<&'b [f32]>, B>> {
function string (line 1605) | pub fn string(mut self) -> Result<BufferBacked<'b, Vec<&'b [u8]>, B>> {
type Filters (line 1633) | pub struct Filters<'a> {
function new (line 1641) | pub fn new(record: &'a Record) -> Self {
type Item (line 1647) | type Item = Id;
method next (line 1649) | fn next(&mut self) -> Option<Id> {
function test_missing_float (line 1667) | fn test_missing_float() {
function test_vector_end_float (line 1673) | fn test_vector_end_float() {
function test_record_rlen (line 1679) | fn test_record_rlen() {
function test_record_end (line 1692) | fn test_record_end() {
function test_record_clear (line 1706) | fn test_record_clear() {
function test_record_clone (line 1724) | fn test_record_clone() {
function test_record_has_filter_pass_is_default (line 1744) | fn test_record_has_filter_pass_is_default() {
function test_record_has_filter_custom (line 1759) | fn test_record_has_filter_custom() {
function test_record_push_filter (line 1773) | fn test_record_push_filter() {
function test_record_set_filters (line 1792) | fn test_record_set_filters() {
function test_record_remove_filter (line 1817) | fn test_record_remove_filter() {
function test_record_to_vcf_string_err (line 1840) | fn test_record_to_vcf_string_err() {
function test_record_to_vcf_string (line 1850) | fn test_record_to_vcf_string() {
FILE: src/bgzf/mod.rs
function path_as_bytes (line 19) | fn path_as_bytes<'a, P: 'a + AsRef<Path>>(path: P, must_exist: bool) -> ...
function is_bgzip (line 43) | pub fn is_bgzip<P: AsRef<Path>>(path: P) -> Result<bool, Error> {
type Reader (line 52) | pub struct Reader {
method from_stdin (line 58) | pub fn from_stdin() -> Result<Self, Error> {
method from_path (line 67) | pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self, Error> {
method from_url (line 76) | pub fn from_url(url: &Url) -> Result<Self, Error> {
method new (line 86) | fn new(path: &[u8]) -> Result<Self, Error> {
method set_thread_pool (line 104) | pub fn set_thread_pool(&mut self, tpool: &ThreadPool) -> Result<()> {
method read (line 119) | fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {
type CompressionLevel (line 142) | pub enum CompressionLevel {
method convert (line 152) | fn convert(self) -> Result<i8> {
type Writer (line 167) | pub struct Writer {
method from_stdout (line 174) | pub fn from_stdout() -> Result<Self, Error> {
method from_stdout_with_compression (line 183) | pub fn from_stdout_with_compression(level: CompressionLevel) -> Result...
method from_path (line 192) | pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self, Error> {
method from_path_with_level (line 201) | pub fn from_path_with_level<P: AsRef<Path>>(
method new (line 213) | fn new(path: &[u8], level: CompressionLevel) -> Result<Self, Error> {
method get_open_mode (line 231) | fn get_open_mode(level: CompressionLevel) -> Result<ffi::CString, Erro...
method set_thread_pool (line 248) | pub fn set_thread_pool(&mut self, tpool: &ThreadPool) -> Result<()> {
method write (line 264) | fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
method flush (line 274) | fn flush(&mut self) -> std::io::Result<()> {
method drop (line 285) | fn drop(&mut self) {
constant FN_PLAIN (line 299) | const FN_PLAIN: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/test/bgzip/...
constant FN_GZIP (line 300) | const FN_GZIP: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/test/bgzip/g...
constant FN_BGZIP (line 301) | const FN_BGZIP: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/test/bgzip/...
constant CONTENT (line 303) | const CONTENT: &str = include_str!("../../test/bgzip/plain.vcf");
function test_is_bgzip_plain (line 306) | fn test_is_bgzip_plain() {
function test_open_plain (line 319) | fn test_open_plain() {
function test_open_gzip (line 341) | fn test_open_gzip() {
function test_open_bgzip (line 363) | fn test_open_bgzip() {
function test_set_threadpool (line 384) | fn test_set_threadpool() {
function test_write_plain (line 414) | fn test_write_plain() {
function test_write_default (line 450) | fn test_write_default() {
function test_write_compression_levels (line 494) | fn test_write_compression_levels() {
function test_write_with_threadpool (line 551) | fn test_write_with_threadpool() {
FILE: src/errors.rs
type Result (line 6) | pub type Result<T, E = Error> = std::result::Result<T, E>;
type Error (line 9) | pub enum Error {
FILE: src/faidx/mod.rs
type Reader (line 21) | pub struct Reader {
method from_path (line 56) | pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self, Error> {
method from_url (line 65) | pub fn from_url(url: &Url) -> Result<Self, Error> {
method new (line 75) | fn new(path: &[u8]) -> Result<Self, Error> {
method fetch_seq (line 88) | pub fn fetch_seq<N: AsRef<str>>(&self, name: N, begin: usize, end: usi...
method fetch_seq_string (line 118) | pub fn fetch_seq_string<N: AsRef<str>>(
method n_seqs (line 129) | pub fn n_seqs(&self) -> u64 {
method seq_name (line 139) | pub fn seq_name(&self, i: i32) -> Result<String> {
method fetch_seq_len (line 160) | pub fn fetch_seq_len<N: AsRef<str>>(&self, name: N) -> u64 {
method seq_names (line 180) | pub fn seq_names(&self) -> Result<Vec<String>> {
function build (line 37) | pub fn build(
method drop (line 191) | fn drop(&mut self) {
function open_reader (line 204) | fn open_reader() -> Reader {
function faidx_open (line 210) | fn faidx_open() {
function faidx_read_chr_first_base (line 215) | fn faidx_read_chr_first_base() {
function faidx_read_chr_start (line 228) | fn faidx_read_chr_start() {
function faidx_read_chr_between (line 243) | fn faidx_read_chr_between() {
function faidx_read_chr_end (line 256) | fn faidx_read_chr_end() {
function faidx_read_twice_string (line 269) | fn faidx_read_twice_string() {
function faidx_read_twice_bytes (line 281) | fn faidx_read_twice_bytes() {
function faidx_position_too_large (line 293) | fn faidx_position_too_large() {
function faidx_n_seqs (line 301) | fn faidx_n_seqs() {
function faidx_seq_name (line 307) | fn faidx_seq_name() {
function faidx_get_seq_len (line 314) | fn faidx_get_seq_len() {
function open_many_readers (line 323) | fn open_many_readers() {
FILE: src/tbx/mod.rs
type Read (line 54) | pub trait Read: Sized {
method read (line 66) | fn read(&mut self, record: &mut Vec<u8>) -> Result<bool>;
method records (line 73) | fn records(&mut self) -> Records<'_, Self>;
method header (line 76) | fn header(&self) -> &Vec<String>;
method read (line 268) | fn read(&mut self, record: &mut Vec<u8>) -> Result<bool> {
method records (line 307) | fn records(&mut self) -> Records<'_, Self> {
method header (line 311) | fn header(&self) -> &Vec<String> {
type Reader (line 87) | pub struct Reader {
method from_path (line 121) | pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self> {
method from_url (line 125) | pub fn from_url(url: &Url) -> Result<Self> {
method new (line 134) | fn new(path: &[u8]) -> Result<Self> {
method tid (line 177) | pub fn tid(&self, name: &str) -> Result<u64> {
method fetch (line 190) | pub fn fetch(&mut self, tid: u64, start: u64, end: u64) -> Result<()> {
method seqnames (line 219) | pub fn seqnames(&self) -> Vec<String> {
method set_threads (line 246) | pub fn set_threads(&mut self, n_threads: usize) -> Result<()> {
method hts_format (line 257) | pub fn hts_format(&self) -> htslib::htsExactFormat {
constant KS_SEP_LINE (line 113) | const KS_SEP_LINE: i32 = 2;
function overlap (line 263) | fn overlap(tid1: i64, begin1: i64, end1: i64, tid2: i64, begin2: i64, en...
method drop (line 317) | fn drop(&mut self) {
type Records (line 330) | pub struct Records<'a, R: Read> {
type Item (line 335) | type Item = Result<Vec<u8>>;
method next (line 338) | fn next(&mut self) -> Option<Result<Vec<u8>>> {
function bed_basic (line 353) | fn bed_basic() {
function bed_fetch_from_chr1_read_api (line 370) | fn bed_fetch_from_chr1_read_api() {
function bed_fetch_from_chr1_iterator_api (line 384) | fn bed_fetch_from_chr1_iterator_api() {
function test_fails_on_bam (line 396) | fn test_fails_on_bam() {
function test_fails_on_non_existiant (line 402) | fn test_fails_on_non_existiant() {
function test_fails_on_vcf (line 408) | fn test_fails_on_vcf() {
function test_text_header_regions (line 414) | fn test_text_header_regions() {
function test_text_header_positions (line 421) | fn test_text_header_positions() {
function test_text_bad_header (line 429) | fn test_text_bad_header() {
FILE: src/tpool.rs
type ThreadPool (line 13) | pub struct ThreadPool {
method new (line 19) | pub fn new(n_threads: u32) -> Result<ThreadPool> {
type InnerThreadPool (line 41) | pub struct InnerThreadPool {
method drop (line 46) | fn drop(&mut self) {
FILE: src/utils.rs
function copy_memory (line 18) | pub fn copy_memory(src: &[u8], dst: &mut [u8]) {
function path_to_cstring (line 33) | pub fn path_to_cstring<P: AsRef<Path>>(path: &P) -> Option<ffi::CString> {
function path_as_bytes (line 40) | pub fn path_as_bytes<'a, P: 'a + AsRef<Path>>(path: P, must_exist: bool)...
Condensed preview — 83 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,206K chars).
[
{
"path": ".github/dependabot.yml",
"chars": 210,
"preview": "version: 2\nupdates:\n - package-ecosystem: \"cargo\"\n directory: \"/\"\n schedule:\n interval: \"weekly\"\n\n - packag"
},
{
"path": ".github/workflows/conventional-prs.yml",
"chars": 296,
"preview": "name: PR\non:\n pull_request_target:\n types:\n - opened\n - reopened\n - edited\n - synchronize\n\njobs:"
},
{
"path": ".github/workflows/release-please.yml",
"chars": 1349,
"preview": "on:\n push:\n branches:\n - master\n\nname: release-please\n\njobs:\n release-please:\n if: github.repository_owner "
},
{
"path": ".github/workflows/rust.yml",
"chars": 5525,
"preview": "name: CI\n\non:\n push:\n branches: [master]\n pull_request:\n branches: [master]\n\njobs:\n Formatting:\n runs-on: ub"
},
{
"path": ".gitignore",
"chars": 88,
"preview": ".vscode/\n.idea\n*~\ntarget\nCargo.lock\nhtslib/*\ntest/out.bam\ntest/test_index_build.bam.csi\n"
},
{
"path": ".gitmodules",
"chars": 0,
"preview": ""
},
{
"path": "CHANGELOG.md",
"chars": 25876,
"preview": "# Change Log\nAll notable changes to this project will be documented in this file.\nThis project adheres to [Semantic Vers"
},
{
"path": "Cargo.toml",
"chars": 1603,
"preview": "[package]\nauthors = [\"Christopher Schröder <christopher.schroeder@tu-dortmund.de>\", \"Johannes Köster <johannes.koester@t"
},
{
"path": "LICENSE.md",
"chars": 1105,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2016 Johannes Köster, the Rust-Htslib team.\n\nPermission is hereby granted, free of "
},
{
"path": "README.md",
"chars": 3454,
"preview": "[](https://crates.io/crates/rust-htslib)\n[\n// This file m"
},
{
"path": "src/bam/ext.rs",
"chars": 349718,
"preview": "// Copyright 2019 Johannes Köster and Florian Finkernagel.\n// Licensed under the MIT license (http://opensource.org/lice"
},
{
"path": "src/bam/header.rs",
"chars": 5212,
"preview": "// Copyright 2014 Johannes Köster.\n// Licensed under the MIT license (http://opensource.org/licenses/MIT)\n// This file m"
},
{
"path": "src/bam/index.rs",
"chars": 2560,
"preview": "// Copyright 2019 Johannes Köster.\n// Licensed under the MIT license (http://opensource.org/licenses/MIT)\n// This file m"
},
{
"path": "src/bam/mod.rs",
"chars": 110882,
"preview": "// Copyright 2014 Christopher Schröder, Johannes Köster.\n// Licensed under the MIT license (http://opensource.org/licens"
},
{
"path": "src/bam/pileup.rs",
"chars": 5201,
"preview": "// Copyright 2014 Johannes Köster.\n// Licensed under the MIT license (http://opensource.org/licenses/MIT)\n// This file m"
},
{
"path": "src/bam/record.rs",
"chars": 113056,
"preview": "// Copyright 2014 Christopher Schröder, Johannes Köster.\n// Licensed under the MIT license (http://opensource.org/licens"
},
{
"path": "src/bam/record_serde.rs",
"chars": 13650,
"preview": "use std::fmt;\n\nuse serde::de::{self, Deserialize, Deserializer, MapAccess, SeqAccess, Visitor};\nuse serde::ser::Serializ"
},
{
"path": "src/bcf/buffer.rs",
"chars": 7258,
"preview": "// Copyright 2017 Johannes Köster.\n// Licensed under the MIT license (http://opensource.org/licenses/MIT)\n// This file m"
},
{
"path": "src/bcf/header.rs",
"chars": 20347,
"preview": "// Copyright 2014 Johannes Köster.\n// Licensed under the MIT license (http://opensource.org/licenses/MIT)\n// This file m"
},
{
"path": "src/bcf/index.rs",
"chars": 3484,
"preview": "use crate::{htslib, utils};\n\n#[derive(Debug)]\npub struct BcfBuildError {\n pub msg: String,\n}\n\n/// Index type to build"
},
{
"path": "src/bcf/mod.rs",
"chars": 59158,
"preview": "// Copyright 2014 Johannes Köster.\n// Licensed under the MIT license (http://opensource.org/licenses/MIT)\n// This file m"
},
{
"path": "src/bcf/record.rs",
"chars": 63807,
"preview": "// Copyright 2014 Johannes Köster.\n// Licensed under the MIT license (http://opensource.org/licenses/MIT)\n// This file m"
},
{
"path": "src/bgzf/mod.rs",
"chars": 19510,
"preview": "// Copyright 2020 Manuel Landesfeind, Evotec International GmbH\n// Licensed under the MIT license (http://opensource.org"
},
{
"path": "src/errors.rs",
"chars": 5773,
"preview": "use std::path::PathBuf;\nuse thiserror::Error;\n\n/// Generic result type for functions in this crate with\n/// a global err"
},
{
"path": "src/faidx/mod.rs",
"chars": 9702,
"preview": "// Copyright 2020 Manuel Landesfeind, Evotec International GmbH\n// Licensed under the MIT license (http://opensource.org"
},
{
"path": "src/htslib.rs",
"chars": 58,
"preview": "//! Re-export hts-sys htslib bindings\npub use hts_sys::*;\n"
},
{
"path": "src/lib.rs",
"chars": 4354,
"preview": "// Copyright 2014-2021 Johannes Köster.\n// Licensed under the MIT license (http://opensource.org/licenses/MIT)\n// This f"
},
{
"path": "src/tbx/mod.rs",
"chars": 13839,
"preview": "// Copyright 2018 Manuel Holtgrewe, Berlin Institute of Health.\n// Licensed under the MIT license (http://opensource.org"
},
{
"path": "src/tpool.rs",
"chars": 1632,
"preview": "use std::cell::RefCell;\nuse std::rc::Rc;\n\npub use crate::errors::{Error, Result};\nuse crate::htslib;\n\n/// An HTSlib thre"
},
{
"path": "src/utils.rs",
"chars": 1496,
"preview": "// Copyright 2014 Christopher Schröder, Johannes Köster.\n// Licensed under the MIT license (http://opensource.org/licens"
},
{
"path": "test/bam2sam_expected.sam",
"chars": 1890,
"preview": "@SQ\tSN:CHROMOSOME_I\tLN:15072423\n@SQ\tSN:CHROMOSOME_II\tLN:15279345\n@SQ\tSN:CHROMOSOME_III\tLN:13783700\n@SQ\tSN:CHROMOSOME_IV\t"
},
{
"path": "test/bam2sam_out.sam",
"chars": 1890,
"preview": "@SQ\tSN:CHROMOSOME_I\tLN:15072423\n@SQ\tSN:CHROMOSOME_II\tLN:15279345\n@SQ\tSN:CHROMOSOME_III\tLN:13783700\n@SQ\tSN:CHROMOSOME_IV\t"
},
{
"path": "test/base_mods/MM-double.sam",
"chars": 254,
"preview": "@CO\tModifications called on both strands of the same record,\n@CO\tincluding potentially at the same location simultaneous"
},
{
"path": "test/base_mods/MM-orient.sam",
"chars": 510,
"preview": "@CO\tTesting mods on top and bottom strand, but also in\n@CO\toriginal vs reverse-complemented orientation\ntop-fwd\t0\t*\t0\t0\t"
},
{
"path": "test/bgzip/plain.vcf",
"chars": 190,
"preview": "##fileformat=VCFv4.1\n##FORMAT=<ID=GT,Number=1,Type=String,Description=\"Genotype\">\n#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO"
},
{
"path": "test/obs-cornercase.vcf",
"chars": 2961,
"preview": "##fileformat=VCFv4.2\n##FILTER=<ID=PASS,Description=\"All filters passed\">\n##INFO=<ID=SVLEN,Number=A,Type=Integer,Descript"
},
{
"path": "test/results/.gitignore",
"chars": 14,
"preview": "*\n!.gitignore\n"
},
{
"path": "test/tabix_reader/bad_header.txt.gz.tbi",
"chars": 19,
"preview": "INVALID INDEX DATA\n"
},
{
"path": "test/test-info-multi-string-number=A.vcf",
"chars": 136798,
"preview": "##fileformat=VCFv4.2\n##FILTER=<ID=PASS,Description=\"All filters passed\">\n##INFO=<ID=PROB_GERMLINE_HET,Number=A,Type=Floa"
},
{
"path": "test/test-info-multi-string.vcf",
"chars": 136736,
"preview": "##fileformat=VCFv4.2\n##FILTER=<ID=PASS,Description=\"All filters passed\">\n##INFO=<ID=PROB_GERMLINE_HET,Number=A,Type=Floa"
},
{
"path": "test/test_cram.fa",
"chars": 384,
"preview": ">chr1\nGGGCACAGCCTCACCCAGGAAAGCAGCTGGGGGTCCACTGGGCTCAGGGAAGACCCCCTG\nCCAGGGAGACCCCAGGCGCCTGAATGGCCACGGGAAGGAAAACCTACCAGCCC"
},
{
"path": "test/test_cram.fa.fai",
"chars": 55,
"preview": "chr1\t120\t6\t60\t61\nchr2\t120\t134\t60\t61\nchr3\t120\t262\t60\t61\n"
},
{
"path": "test/test_cram.sam",
"chars": 1006,
"preview": "@HD\tVN:1.5\tSO:coordinate\n@SQ\tSN:chr1\tLN:120\tM5:20a9a0fb770814e6c5e49946750f9724\tUR:/stornext/snfs5/next-gen/scratch/fare"
},
{
"path": "test/test_headers.out.vcf",
"chars": 389,
"preview": "##fileformat=VCFv4.1\n##FILTER=<ID=PASS,Description=\"All filters passed\">\n##FILTER=<ID=FILTER1,Description=\"should stay\">"
},
{
"path": "test/test_headers.vcf",
"chars": 584,
"preview": "##fileformat=VCFv4.1\n##FILTER=<ID=PASS,Description=\"All filters passed\">\n##FILTER=<ID=FILTER1,Description=\"should stay\">"
},
{
"path": "test/test_left.vcf",
"chars": 190,
"preview": "##fileformat=VCFv4.1\n##FORMAT=<ID=GT,Number=1,Type=String,Description=\"Genotype\">\n#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO"
},
{
"path": "test/test_missing.vcf",
"chars": 826,
"preview": "##fileformat=VCFv4.1\n##INFO=<ID=S1,Number=1,Type=String,Description=\"Single INFO string\">\n##INFO=<ID=N1,Number=1,Type=In"
},
{
"path": "test/test_non_diploid.vcf",
"chars": 249,
"preview": "##fileformat=VCFv4.1\n##FORMAT=<ID=GT,Number=1,Type=String,Description=\"Genotype\">\n##contig=<ID=1,length=1000>\n#CHROM\tPOS"
},
{
"path": "test/test_nonstandard_orientation.sam",
"chars": 7717,
"preview": "@HD\tVN:1.6\tSO:coordinate\n@SQ\tSN:1\tLN:248956422\n@SQ\tSN:10\tLN:133797422\n@SQ\tSN:11\tLN:135086622\n@SQ\tSN:12\tLN:133275309\n@SQ\t"
},
{
"path": "test/test_orientation_supplementary.sam",
"chars": 2604,
"preview": "@HD\tVN:1.3\tSO:coordinate\n@SQ\tSN:chr10\tLN:135374737\n@SQ\tSN:chr11\tLN:134452384\n@SQ\tSN:chr12\tLN:132349534\n@SQ\tSN:chr13\tLN:1"
},
{
"path": "test/test_paired.sam",
"chars": 304,
"preview": "@SQ\tSN:xx\tLN:20\na1\t99\txx\t1\t1\t10M\t=\t11\t20\tAAAAAAAAAA\t**********\nb1\t99\txx\t1\t1\t10M\t=\t11\t20\tAAAAAAAAAA\t**********\nc1\t99\txx\t1"
},
{
"path": "test/test_right.vcf",
"chars": 193,
"preview": "##fileformat=VCFv4.1\n##FORMAT=<ID=GT,Number=1,Type=String,Description=\"Genotype\">\n#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO"
},
{
"path": "test/test_string.vcf",
"chars": 1144,
"preview": "##fileformat=VCFv4.1\n##INFO=<ID=S1,Number=1,Type=String,Description=\"Single INFO string\">\n##INFO=<ID=N1,Number=1,Type=In"
},
{
"path": "test/test_svlen.vcf",
"chars": 10925,
"preview": "##fileformat=VCFv4.1\n##FILTER=<ID=PASS,Description=\"All filters passed\">\n##fileDate=20181110\n##source=GenerateSVCandidat"
},
{
"path": "test/test_trailing_omitted_format.vcf",
"chars": 487,
"preview": "##fileformat=VCFv4.3\n##contig=<ID=chr1,length=10000>\n##INFO=<ID=FOO,Number=1,Type=Integer,Description=\"Some field\">\n##FO"
},
{
"path": "test/test_various.out.vcf",
"chars": 1019,
"preview": "##fileformat=VCFv4.1\n##FILTER=<ID=PASS,Description=\"All filters passed\">\n##FILTER=<ID=q10,Description=\"Quality below 10\""
},
{
"path": "test/test_various.vcf",
"chars": 847,
"preview": "##fileformat=VCFv4.1\n##FILTER=<ID=q10,Description=\"Quality below 10\">\n##FILTER=<ID=s50,Description=\"Less than 50% of sam"
}
]
// ... and 24 more files (download for full content)
About this extraction
This page contains the full source code of the rust-bio/rust-htslib GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 83 files (1.1 MB), approximately 362.8k tokens, and a symbol index with 862 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.