[
  {
    "path": ".github/dependabot.yml",
    "content": "version: 2\nupdates:\n  - package-ecosystem: \"cargo\"\n    directory: \"/\"\n    schedule:\n      interval: \"weekly\"\n\n  - package-ecosystem: \"github-actions\"\n    directory: \"/\"\n    schedule:\n      interval: \"weekly\"\n  "
  },
  {
    "path": ".github/workflows/conventional-prs.yml",
    "content": "name: PR\non:\n  pull_request_target:\n    types:\n      - opened\n      - reopened\n      - edited\n      - synchronize\n\njobs:\n  title-format:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: amannn/action-semantic-pull-request@v6.1.1\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}"
  },
  {
    "path": ".github/workflows/release-please.yml",
    "content": "on:\n  push:\n    branches:\n      - master\n\nname: release-please\n\njobs:\n  release-please:\n    if: github.repository_owner == 'rust-bio'\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v5\n        with:\n          submodules: recursive\n\n      - uses: GoogleCloudPlatform/release-please-action@v4\n        id: release_main\n        with:\n          release-type: rust\n          package-name: rust-htslib\n          bump-minor-pre-major: true\n\n      - name: Install stable toolchain\n        uses: dtolnay/rust-toolchain@stable\n        if: ${{ steps.release_main.outputs.release_created }}\n        with:\n          toolchain: stable\n\n      - name: Install system dependencies\n        if: ${{ steps.release_main.outputs.release_created }}\n        run: |\n          sudo apt-get install --yes zlib1g-dev libbz2-dev musl musl-dev musl-tools clang libc6-dev\n\n      - uses: Swatinem/rust-cache@v2\n        if: ${{ steps.release_main.outputs.release_created }}\n\n      - name: Publish rust-htslib\n        if: ${{ steps.release_main.outputs.release_created }}\n        run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }}\n\n      # - uses: katyo/publish-crates@v1\n      #   if: ${{ steps.release_main.outputs.release_created || steps.release_sys.outputs.release_created }}\n      #   with:\n      #     registry-token: ${{ secrets.CRATES_IO_TOKEN }}\n"
  },
  {
    "path": ".github/workflows/rust.yml",
    "content": "name: CI\n\non:\n  push:\n    branches: [master]\n  pull_request:\n    branches: [master]\n\njobs:\n  Formatting:\n    runs-on: ubuntu-22.04\n    steps:\n      - name: Checkout repository\n        uses: actions/checkout@v5\n\n      - name: Install stable toolchain\n        uses: dtolnay/rust-toolchain@stable\n        with:\n          toolchain: stable\n          components: rustfmt\n\n      - name: Check format\n        run: cargo fmt -- --check\n\n  Linting:\n    runs-on: ubuntu-22.04\n    steps:\n      - name: Checkout repository\n        uses: actions/checkout@v5\n        with:\n          submodules: recursive\n\n      - name: Install stable toolchain\n        uses: dtolnay/rust-toolchain@stable\n        with:\n          toolchain: stable\n          components: clippy\n\n      - name: Lint with clippy\n        run: RUSTFLAGS=\"-Dwarnings\" cargo clippy --all-features --all-targets -- -Dclippy::all -Dunused_imports\n\n  Testing:\n    needs: Formatting\n    strategy:\n      matrix:\n        os: [ubuntu-22.04, ubuntu-22.04-arm]\n    runs-on: ${{ matrix.os }}\n    steps:\n      - name: Checkout repository\n        uses: actions/checkout@v5\n        with:\n          submodules: recursive\n\n      - name: Install nightly toolchain\n        uses: dtolnay/rust-toolchain@stable\n        with:\n          toolchain: nightly\n\n      - name: Install system dependencies\n        run: |\n          sudo apt-get install --yes zlib1g-dev libbz2-dev musl musl-dev musl-tools clang libc6-dev\n\n      - uses: Swatinem/rust-cache@v2\n\n      - name: Run cargo-tarpaulin\n        run: |\n          set -x\n          cargo install cargo-tarpaulin\n          cargo tarpaulin --all-features --tests --doc --out Lcov -- --test-threads 1\n\n      - name: Upload coverage\n        uses: coverallsapp/github-action@v2\n        with:\n          github-token: ${{ secrets.GITHUB_TOKEN }}\n          path-to-lcov: ./lcov.info\n\n  Testing-Features:\n    needs: Formatting\n    strategy:\n      matrix:\n        os: [ubuntu-22.04, ubuntu-22.04-arm]\n        target:\n          - no-default-features\n          - all-features\n        include:\n          - target: no-default-features\n            args: --no-default-features\n          - target: all-features\n            os: ubuntu-22.04\n            args: --all-features\n            toolchain_target: x86_64-unknown-linux-musl\n          - target: all-features\n            os: ubuntu-22.04-arm\n            args: --all-features\n            toolchain_target: aarch64-unknown-linux-musl\n    runs-on: ${{ matrix.os }}\n\n    steps:\n      - name: Checkout repository\n        uses: actions/checkout@v5\n        with:\n          submodules: recursive\n\n      - name: Install stable toolchain\n        uses: dtolnay/rust-toolchain@stable\n        with:\n          toolchain: stable\n\n      - name: Install system dependencies\n        run: |\n          sudo apt-get install --yes zlib1g-dev libbz2-dev musl musl-dev musl-tools clang libc6-dev\n\n      - uses: Swatinem/rust-cache@v2\n\n      - name: Test\n        run: |\n          cargo test ${{ matrix.args }}\n\n  Testing-MacOS:\n    needs: Formatting\n    runs-on: macos-latest\n    strategy:\n      matrix:\n        target:\n          - intel-monterey\n          - intel-ventura\n          - silicon-sonoma\n        include:\n          - target: intel-monterey\n            os: macOS-12.0\n            toolchain_target: x86_64-apple-darwin\n            toolchain: stable\n            aux_args: --target x86_64-apple-darwin\n            default: true\n          - target: intel-ventura\n            os: macOS-13.0\n            toolchain_target: x86_64-apple-darwin\n            toolchain: stable\n            aux_args: --target x86_64-apple-darwin\n            default: true\n          - target: silicon-sonoma\n            os: macOS-14.0\n            toolchain_target: aarch64-apple-darwin\n            toolchain: stable\n            aux_args: \"\"\n            default: false\n\n    steps:\n      - name: Checkout repository\n        uses: actions/checkout@v5\n        with:\n          submodules: recursive\n\n      - name: Install stable toolchain\n        uses: dtolnay/rust-toolchain@stable\n        with:\n          toolchain: ${{ matrix.toolchain }}\n          targets: ${{ matrix.toolchain_target }}\n          override: true\n\n      - name: Install htslib dependencies\n        run: brew install bzip2 zlib xz curl-openssl\n\n      - name: Test\n        run: |\n          cargo test --release --all-features --verbose ${{ matrix.aux_args }}\n#  Testing-OSX-MUSL-BigSur:\n#   needs: Formatting\n#   runs-on: macOS-11.0\n#   steps:\n# Test MUSL builds on OSX\n#\n# - uses: actions-rs/toolchain@v1.0.6\n#   with:\n#     toolchain: stable\n#     target: x86_64-unknown-linux-musl\n#     override: true\n\n# - name: Install OSX musl-cross\n#   run: brew install FiloSottile/musl-cross/musl-cross\n\n# # https://github.com/FiloSottile/homebrew-musl-cross/issues/16\n# - name: Provide musl-gcc symlink for the right musl arch\n#   run: ln -sf /usr/local/opt/musl-cross/libexec/bin/x86_64-linux-musl-gcc /usr/local/bin/musl-gcc\n\n# - name: Test musl build without default features\n#   uses: actions-rs/cargo@v1\n#   with:\n#     use-cross: false  # cross is not supported on GHA OSX runner, see: https://github.community/t/why-is-docker-not-installed-on-macos/17017\n#     command: test\n#     args: --release --target x86_64-unknown-linux-musl --no-default-features\n\n# - name: Test musl build with all features and debug symbols (non --release) on OSX\n#   uses: actions-rs/cargo@v1.0.1\n#   with:\n#     use-cross: false\n#     command: test\n#     args: --target x86_64-unknown-linux-musl --all-features --verbose\n"
  },
  {
    "path": ".gitignore",
    "content": ".vscode/\n.idea\n*~\ntarget\nCargo.lock\nhtslib/*\ntest/out.bam\ntest/test_index_build.bam.csi\n"
  },
  {
    "path": ".gitmodules",
    "content": ""
  },
  {
    "path": "CHANGELOG.md",
    "content": "# Change Log\nAll notable changes to this project will be documented in this file.\nThis project adheres to [Semantic Versioning](http://semver.org/).\n\n## [1.0.0](https://github.com/rust-bio/rust-htslib/compare/v0.51.0...v1.0.0) (2026-01-29)\n\n\n### ⚠ BREAKING CHANGES\n\n* make the inner header pointer accessible again, although only through unsafe ([#504](https://github.com/rust-bio/rust-htslib/issues/504))\n* Reason about Send/Sync-ness of types and change Rcs to Arcs ([#488](https://github.com/rust-bio/rust-htslib/issues/488))\n* 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))\n\n### Features\n\n* 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))\n* 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))\n\n\n### Bug Fixes\n\n* 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))\n* 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)\n* 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))\n\n\n### Performance Improvements\n\n* **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))\n\n## [0.51.0](https://github.com/rust-bio/rust-htslib/compare/v0.50.0...v0.51.0) (2025-10-15)\n\n\n### Features\n\n* 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))\n\n## [0.50.0](https://github.com/rust-bio/rust-htslib/compare/v0.49.0...v0.50.0) (2025-07-09)\n\n\n### Features\n\n* 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))\n* 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))\n\n\n### Bug Fixes\n\n* 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))\n\n## [0.49.0](https://github.com/rust-bio/rust-htslib/compare/v0.48.0...v0.49.0) (2024-12-02)\n\n\n### Features\n\n* 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))\n\n\n### Bug Fixes\n\n* 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))\n\n## [0.48.0](https://github.com/rust-bio/rust-htslib/compare/v0.47.1...v0.48.0) (2024-11-12)\n\n\n### Features\n\n* 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))\n\n\n### Bug Fixes\n\n* 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))\n\n## [0.47.1](https://github.com/rust-bio/rust-htslib/compare/v0.47.0...v0.47.1) (2024-11-12)\n\n\n### Bug Fixes\n\n* 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))\n\n## [0.47.0](https://github.com/rust-bio/rust-htslib/compare/v0.46.0...v0.47.0) (2024-05-22)\n\n\n### Features\n\n* 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))\n* 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))\n* 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))\n\n\n### Bug Fixes\n\n* 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))\n* build for macOS ([#431](https://github.com/rust-bio/rust-htslib/issues/431)) ([d869fdd](https://github.com/rust-bio/rust-htslib/commit/d869fdda03900cafae0f4f60b033121dcd57b723))\n* 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))\n* 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))\n\n## [0.46.0](https://github.com/rust-bio/rust-htslib/compare/v0.45.0...v0.46.0) (2024-02-22)\n\n\n### Features\n\n* making several RecordBuffer methods public ([6757f52](https://github.com/rust-bio/rust-htslib/commit/6757f5219955fd4edba4f61e62978ce1e001068e))\n\n\n### Bug Fixes\n\n* fix building libz-sys ([#420](https://github.com/rust-bio/rust-htslib/issues/420)) ([01c8849](https://github.com/rust-bio/rust-htslib/commit/01c884945686e7a6756406b579fde28657f70b36))\n\n## [0.45.0](https://github.com/rust-bio/rust-htslib/compare/v0.44.1...v0.45.0) (2024-02-07)\n\n\n### Features\n\n* 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))\n\n\n### Bug Fixes\n\n* 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))\n\n## [0.44.1](https://github.com/rust-bio/rust-htslib/compare/v0.44.0...v0.44.1) (2023-06-21)\n\n\n### Bug Fixes\n\n* 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))\n\n## [0.44.0](https://github.com/rust-bio/rust-htslib/compare/v0.43.1...v0.44.0) (2023-06-20)\n\n\n### Features\n\n* 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))\n* implement htslib basemod api ([#385](https://github.com/rust-bio/rust-htslib/issues/385)) ([8beee14](https://github.com/rust-bio/rust-htslib/commit/8beee145a116f7ae936f1b6e36d876116dca18f1))\n\n\n### Bug Fixes\n\n* 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))\n\n## [0.43.1](https://github.com/rust-bio/rust-htslib/compare/v0.43.0...v0.43.1) (2023-05-16)\n\n\n### Bug Fixes\n\n* 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))\n\n## [0.43.0](https://github.com/rust-bio/rust-htslib/compare/v0.42.0...v0.43.0) (2023-05-12)\n\n\n### Features\n\n* 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))\n* Index for `bam::IndexedReader` ([#387](https://github.com/rust-bio/rust-htslib/issues/387)) ([fb74387](https://github.com/rust-bio/rust-htslib/commit/fb743875182c9232894e07007367f09f05d6e275))\n\n## [0.42.0](https://github.com/rust-bio/rust-htslib/compare/v0.41.1...v0.42.0) (2023-03-30)\n\n\n### Features\n\n* 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))\n\n## [0.41.1](https://github.com/rust-bio/rust-htslib/compare/v0.41.0...v0.41.1) (2023-03-03)\n\n### Features\n\n* 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))\n\n\n### Performance Improvements\n\n* 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))\n\n\n## [0.40.2](https://github.com/rust-bio/rust-htslib/compare/rust-htslib-v0.40.1...rust-htslib-v0.40.2) (2022-10-13)\n\n\n### Performance Improvements\n\n* 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))\n\n## [0.40.1](https://github.com/rust-bio/rust-htslib/compare/rust-htslib-v0.40.0...rust-htslib-v0.40.1) (2022-08-24)\n\n\n### Bug Fixes\n\n* 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))\n\n## [0.40.0](https://github.com/rust-bio/rust-htslib/compare/rust-htslib-v0.39.5...rust-htslib-v0.40.0) (2022-07-05)\n\n\n### Features\n\n* 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))\n\n\n### Bug Fixes\n\n* update to latest release-please ([b130634](https://github.com/rust-bio/rust-htslib/commit/b130634b3d096e620dcfe59acae2200df3e4d847))\n\n### [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)\n\n\n### Bug Fixes\n\n* set path in release-please config ([d8f7c6e](https://www.github.com/rust-bio/rust-htslib/commit/d8f7c6e8f31accb7576e150fa1439e177f7816cb))\n\n### [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)\n\n\n### Bug Fixes\n\n* perform checkout before running release please ([cbc6a0a](https://www.github.com/rust-bio/rust-htslib/commit/cbc6a0ad37c5623d14f2ed0bcbb4c5289d012fcb))\n\n### [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)\n\n\n### Bug Fixes\n\n* 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))\n\n### [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)\n\n\n### Bug Fixes\n\n* 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))\n\n### [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)\n\n\n### Bug Fixes\n\n* bump hts-sys version to 2.0.1 ([336c8b8](https://www.github.com/rust-bio/rust-htslib/commit/336c8b8a1779422afea1065e37bcc44f54abac42))\n\n## [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)\n\n\n### ⚠ BREAKING CHANGES\n\n* dummy major version bump to move away from previous versions that were following htslib versions.\n* bump to new major version (for technical reasons).\n* dummy breaking change to increase hts-sys major version.\n\n### Bug Fixes\n\n* bump to new major version (for technical reasons). ([9c6db30](https://www.github.com/rust-bio/rust-htslib/commit/9c6db3060818692070db1411d63e113dc7effd64))\n* dummy breaking change to increase hts-sys major version. ([93415cb](https://www.github.com/rust-bio/rust-htslib/commit/93415cbb82e4f11d257a2b2cedba2664f86a034d))\n* dummy changes ([3af5ede](https://www.github.com/rust-bio/rust-htslib/commit/3af5ede13a6b44ce5d1e7f0eb90836a692e711ec))\n* 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))\n* dummy release ([74d1565](https://www.github.com/rust-bio/rust-htslib/commit/74d1565329fc862f1172c0925c7b66ceb8bcf988))\n* dummy release ([af2f84e](https://www.github.com/rust-bio/rust-htslib/commit/af2f84eb0411507f8866b3cc05e9a6ba9d81d172))\n* dummy release ([b97915f](https://www.github.com/rust-bio/rust-htslib/commit/b97915f2c70da4c914f2e69861bf78eec5979baf))\n* handle subcrate with release-please ([0a4605f](https://www.github.com/rust-bio/rust-htslib/commit/0a4605f165cb2edf4428d8fb39f7e4787585f4e1))\n* trigger dummy release ([7c5a7de](https://www.github.com/rust-bio/rust-htslib/commit/7c5a7de33e2a92052126e5f44389d421974d1e02))\n* update changelog ([deef08f](https://www.github.com/rust-bio/rust-htslib/commit/deef08feb0b5ba2d8abf98f2cc6d327236da8aef))\n\n### [0.38.3](https://www.github.com/rust-bio/rust-htslib/compare/v0.38.2...v0.38.3) (2021-07-06)\n\n\n### Bug Fixes\n\n* dummy fix for triggering release ([e92e6b1](https://www.github.com/rust-bio/rust-htslib/commit/e92e6b10b0a7e5db50b12e2fbe2c42b467eb369e))\n\n### [0.38.2](https://www.github.com/rust-bio/rust-htslib/compare/v0.38.1...v0.38.2) (2021-07-06)\n\n\n### Bug Fixes\n\n* add ID to automatic release handling ([1244393](https://www.github.com/rust-bio/rust-htslib/commit/124439300e1e3e01e1d847f7549747d560c01989))\n\n### [0.38.1](https://www.github.com/rust-bio/rust-htslib/compare/v0.38.0...v0.38.1) (2021-07-06)\n\n\n### Bug Fixes\n\n* improved documentation ([cb0b66c](https://www.github.com/rust-bio/rust-htslib/commit/cb0b66c4a92d4f03debe38dfb2a014b154c7dd96))\n\n## [0.38.0](https://www.github.com/rust-bio/rust-htslib/compare/v0.37.0...v0.38.0) (2021-07-06)\n\n\n### ⚠ BREAKING CHANGES\n\n* Improve bcf Record filter interface and improve docs (#306)\n\n### Features\n\n* 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))\n\n\n### Bug Fixes\n\n* 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))\n\n## [Unreleased]\n### Changes\n- `bcf::Record` methods `has_filter`, `remove_filter`, `push_filter`, and `set_filter`\n  all now take a byte slice (`&[u8]`) or an `Id`. \n\n[Unreleased]: https://github.com/rust-bio/rust-htslib/compare/v0.37.0...HEAD\n\n## [0.37.0] - 2021-07-05\n### Added\n- `bcf::Record` methods `end`, `clear`, and `rlen` (@mbhall88).\n\n### Changes\n- `bcf::IndexReader::fetch` parameter `end` is now an `Option<u64>`. This is inline with\n  htslib regions, which do not require an end position (@mbhall88)\n- Removed unused dependencies (@sreenathkrishnan).\n- Improved documentation (@mbhall88).\n- Improved error message when failing to load index files (@johanneskoester).\n- Improved API for accessing AUX fields in BAM records (@jch-13).\n- Fixed compiler warnings (@fxwiegand).\n- BAM header representation is now always kept in sync between textual and binary (@jch-13).\n\n## [0.36.0] - 2020-11-23\n### Changes\n- Improved genotype API in VCF/BCF records (@MaltheSR).\n- Read pair orientation inference for BAM records (@johanneskoester).\n\n## [0.35.2] - 2020-11-23\n### Changes\n- let hts-sys dependency comply to semver.\n\n## [0.35.1] - 2020-11-23\n### Changes\n- Fixed wrongly define missing value constants in bcf::record (@johanneskoester).\n- Bump hts-sys depedency to the latest version, containing build fixes for macOS (@johanneskoester).\n\n\n## [0.35.0] - 2020-11-19\n### Changes\n- 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)\n- Fixes for building on macOS (@brainstorm)\n\n### Added\n- ability to push genotypes into BCF record (@MaltheSR, @tedil).\n\n## [0.34.0] - 2020-11-13\n### Added\n- Ability to set minimum refetch distance in `bam::RecordBuffer`.\n\n## [0.33.0] - 2020-11-04\n### Changes\n- BREAKING: Rename feature 'serde' as 'serde_feature' (for technical reasons)\n- BREAKING: Consolidate module-wide errors into a crate-wide error module\n- Making `bcf::IndexedReader` always unpack records to reflect the behaviour of `bcf::Reader`.\n- Adding `bcf::errors::Error::FileNotFound` and using it.\n- Fixes for musl compilation (@brainstorm).\n- Improved BCF constants handling (@juliangehring)\n- Fixes for tabix reader (@felix-clark, @brainstorm).\n- Fixes for BCF handling (@holtgrewe, @tedil).\n- Documentation improvements (@vsoch, @brainstorm, @edmundlth).\n- BREAKING: Improved, more ergonomic BAM fetch API (@TiberiusPrime, @brainstorm, @tedil).\n- BREAKING: Let BamRecordExtensions return iterators instead of vectors (@TiberiusPrime).\n- Handle all errors via a unified single thiserror based enum (@landesfeind).\n- BREAKING: BAM read API now returns Option<Result> (@slazicoicr).\n### Added\n- Support for reading indexed FASTA files (@landesfeind, @pmarks, @brainstorm).\n- Support for shared threadpools when reading and writing BAM (@pmarks, @nlhepler).\n- Serde support for Cigar strings (@FelixMoelder, @pmarks, @johanneskoester).\n- Expose bgzf functionality (@landesfeind).\n- Iterator over BAM records using Rc-pointers (@TiberiusPrime, @tedil).\n- Ability to obtain pairs of read and genome intervals from BAM (aligned_block_pairs) (@TiberiusPrime, @brainstorm).\n\n## [0.32.0] - 2020-07-09\n### Changes\n- Method `seq_len()` of `bam::Record` is now public.\n- Speedup when parsing BAM headers (thanks to @juliangehring).\n- Compatibility fixes for older rust versions (thanks to @pmarks and @brainstorm).\n\n## [0.31.0] - 2020-06-22\n### Changes\n- Bam record buffer now returns reference counted (Rc) objects. This makes the API more ergonomic to use.\n- Switched to thiserror instead of snafu for error handling.\n- Various cleanups and little fixes.\n\n## [0.30.0] - 2020-04-03\n### Changes\n- Removed `fn header_mut()` from `bam::Read` trait.\n- Fixed a major performance regression when reading bam files (issue #195).\n\n## [0.29.0] - 2020-03-26\n### Changes\n- Migrate buffer intervals to u64. \n\n## [0.28.0] - 2020-03-26\n### Changes\n- Return u64 wherever htslib has migrated to using 64 bit.\n- Implement more bio-types (Interval, Locus, Strand).\n\n## [0.27.0] - 2020-03-17\n### Changes\n- Updated to Htslib 1.10.2.\n- bam::Record.set() will panic if seq.len() != qual.len(). Previously, mismatched length would cause\n  uninitialized memory to be written into the BAM file.\n- use `serde_bytes` to serialize .data section of bam::Record when using serde - large speed improvement.\n- change build.rs to avoid re-running when htslib or wrapper.h haven't changed.\n- update some dependencies.\n- refactor native dependency into htslib-sys crate, for greater versioning flexibility\n- Record::from_sam require `&mut HeaderView`. Provide the appropriate accessor.\n- set() no longer invalidates tag data.\n- Various minor improvements.\n\n## [0.26.1] - 2019-12-03\n### Changes\n- Various bug fixes in CIGAR string handling, INFO tag reading and FORMAT tag reading.\n\n## [0.26.0] - 2019-09-27\n### Changes\n- Allow caching of CIGAR in bam::RecordBuffer.\n\n## [0.25.0] - 2019-09-27\n### Changes\n- Migrated error handling to the snafu crate: https://docs.rs/snafu.\n- Cleaned up and simplified API (including breaking changes).\n- Allow writing SAM files from the bam::Writer.\n\n## [0.24.0] - 2019-05-31\n### Added\n- Allow setting unmapped BAM record (without Cigar string).\n- Various bug fixes and error handling improvements.\n- Various Pysam-derived methods for interpreting Cigar strings.\n\n## [0.23.0] - 2019-05-02\n### Added\n- Support for BAM indices that are not placed beside a file.bam as file.bam.bai\n- Implement SequenceRead trait for BAM records.\n- Add function to build an index for a BAM file.\n- CRAM support for BAM reader and writer.\n### Changes\n- Allow to specify particular index filename when instantiating a BAM reader.\n- Various bug and API fixes.\n\n## [0.22.0] - 2018-11-02\n### Changes\n- Support compilation against musl.\n- Support for removing alleles.\n- Improvements to SyncedReader API.\n\n## [0.21.0] - 2018-08-01\n### Changes\n- Adding `bcf::synced::SyncedReader::fetch()`, changing error type for `bcf::synced::SyncedReader::read_next()`.\n- Adding `bcf::Record::unpack()` for explicitely unpacking BCF records.\n- Fixed `bcf::synced::SyncedReader::record()`.\n- `bam::Record::cigar()` now returns a reference (in constant time) and needs `bam::Record::unpack_cigar()` to be called first.\n- Allow to create Cigar string from `bio_types::Alignment`.\n- Provide a cached variant of obtaining cigar string.\n- Lots of small usability improvements.\n\n## [0.20.0] - 2018-06-18\n### Added\n- Initial implementation of synced BCF reader interface.\n- Several small helper methods for BAM readers.\n### Changes\n- Not skipping `fileformat=` header any more.\n- BCF records are always unpacked when reading.\n\n## [0.19.1] - 2018-06-07\n### Changed\n- Moved unpacking of BCF records into constructor to prevent race conditions.\n- Fixed bug in retrieving BCF record id.\n- Fixed bug in the filter iterator of BCF.\n\n## [0.19.0] - 2018-06-01\n### Added\n- more push functions for BCF.\n\n## [0.18.0] - 2018-05-04\n### Added\n- bcf::IndexedReader\n- support for writing bcf FILTER field\n- setting thread count in all readers and writers\n- setting ID and alleles in bcf records\n- support for tabix indexes\n- convert CIGAR to and from strings\n\n## [0.17.0] - 2018-02-22\n### Added\n- Serde support for bam records.\n### Changed\n- Various convenience improvements in the API.\n\n## [0.16.0] - 2018-01-05\n### Changed\n- Raw Htslib bindings are now generated on the fly.\n- Switched to Htslib 1.6.\n- Fixed a potential dangling pointer to the header in bcf records.\n- Various small API improvements.\n\n## [0.15.0] - 2017-12-05\n### Changed\n- HeaderView of bam and bcf can now be cloned.\n\n\n## [0.14.0] - 2017-12-03\n### Added\n- An efficient ringbuffer for accessing BCF regions\n- An efficient ringbuffer for accessing BAM regions\n### Changed\n- Improved mutability annotation for readers.\n\n## [0.13.0] - 2017-09-22\n### Added\n- Ability to clone bam records.\n- Ability to set only qname.\n### Changed\n- Further improved CIGAR string API.\n- Improved documentation.\n\n\n## [0.12.1] - 2017-06-12\n### Changed\n- Adapt to changes in Rust 1.18 that caused compilation issues.\n\n\n## [0.12.0] - 2017-06-01\n### Added\n- Support seek and tell to handle virtual offsets.\n### Changed\n- Renamed previous seek method into fetch (in line with pysam).\n- Improved CIGAR API.\n- Updated dependencies.\n\n## [0.11.0] - 2017-05-01\n### Added\n- A SAM writer.\n### Changed\n- Improved CIGAR string API using a newtype wrapper.\n- Improved pileup API.\n- Support threaded writing for BAM files.\n\n\n## [0.10.0] - 2016-11-10\n### Added\n- Prelude module to easily import all relevant traits.\n### Changed\n- fine-grained constructors for STDIN/STDOUT, paths and URLs\n- better template handling with bam files\n\n\n## [0.9.0] - 2016-11-02\n### Changed\n- improved genotype handling\n- improved error handling\n- improved missing value handling\n\n## [0.8.1] - 2016-08-17\n### Changed\n- Finally converted the last unit error types to real error types (really now!).\n\n## [0.8.0] - 2016-08-17\n### Changed\n- More error types.\n\n## [0.7.0] - 2016-08-16\n### Changed\n- Error types now properly implement the Display and the Error trait.\n\n## [0.6.2] - 2016-07-22\n### Changed\n- Mark all records as Send and Sync.\n\n## [0.6.1] - 2016-07-20\n### Changed\n- Improved error messages.\n- Check existence of BAM when instantiating Readers.\n\n## [0.6.0] - 2016-06-01\n### Changed\n- Improved handling of memory allocation for BCF and BAM records.\n- Fixed a memory leak occuring when creating a new BAM record (thanks to @andrelmartins).\n"
  },
  {
    "path": "Cargo.toml",
    "content": "[package]\nauthors = [\"Christopher Schröder <christopher.schroeder@tu-dortmund.de>\", \"Johannes Köster <johannes.koester@tu-dortmund.de>\"]\ndescription = \"This library provides HTSlib bindings and a high level Rust API for reading and writing BAM files.\"\ndocumentation = \"https://docs.rs/rust-htslib\"\nedition = \"2018\"\ninclude = [\"src/**/*\", \"LICENSE.md\", \"README.md\", \"CHANGELOG.md\"]\nkeywords = [\"htslib\", \"bam\", \"bioinformatics\", \"pileup\", \"sequencing\"]\nlicense = \"MIT\"\nname = \"rust-htslib\"\nreadme = \"README.md\"\nrepository = \"https://github.com/rust-bio/rust-htslib.git\"\nversion = \"1.0.0\"\n\n[package.metadata.release]\npre-release-commit-message = \"release version {{version}}\"\ntag-message = \"Version {{version}} of Rust-HTSlib.\"\n\n[dependencies]\nlibz-sys = \">=1.1.15\"\nbio-types = \">=0.9\"\nbyteorder = \"1.3\"\ncustom_derive = \"0.1\"\nderive-new = \"0.7\"\nhts-sys = {version = \"2.2.0\", default-features = false, features = [\"bindgen\"]}\nieee754 = \"0.2\"\nlazy_static = \"1.4\"\nlibc = \"0.2\"\nlinear-map = \"1.2\"\nnewtype_derive = \"0.1\"\nregex = \"1.3\"\nserde = {version = \"^1\", optional = true, features = [\"derive\"]}\nserde_bytes = {version = \"0.11\", optional = true}\nthiserror = {version = \"^2\" }\nurl = \"2.5\"\n\n[features]\nbindgen = [\"hts-sys/bindgen\"]\nbzip2 = [\"hts-sys/bzip2\"]\ncurl = [\"hts-sys/curl\"]\ndefault = [\"bzip2\", \"lzma\", \"curl\"]\ngcs = [\"hts-sys/gcs\"]\nlibdeflate = [\"hts-sys/libdeflate\"]\nlzma = [\"hts-sys/lzma\"]\ns3 = [\"hts-sys/s3\"]\nserde_feature = [\"serde\", \"serde_bytes\", \"bio-types/serde\"]\nstatic = [\"hts-sys/static\"]\n\n[dev-dependencies]\nbincode = \"1.2\"\npretty_assertions = \"1.4\"\nserde_json = \"1.0\"\ntempfile = \"3.1.0\"\n"
  },
  {
    "path": "LICENSE.md",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2016 Johannes Köster, the Rust-Htslib team.\n\nPermission 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:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE 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.\n"
  },
  {
    "path": "README.md",
    "content": "[![Crates.io](https://img.shields.io/crates/d/rust-htslib.svg)](https://crates.io/crates/rust-htslib)\n[![Crates.io](https://img.shields.io/crates/v/rust-htslib.svg)](https://crates.io/crates/rust-htslib)\n[![Crates.io](https://img.shields.io/crates/l/rust-htslib.svg)](https://crates.io/crates/rust-htslib)\n[![docs.rs](https://docs.rs/rust-htslib/badge.svg)](https://docs.rs/rust-htslib)\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/rust-bio/rust-htslib/rust.yml?branch=master&label=tests)\n[![Coverage Status](https://coveralls.io/repos/github/rust-bio/rust-htslib/badge.svg?branch=master)](https://coveralls.io/github/rust-bio/rust-htslib?branch=master)\n\n# HTSlib bindings for Rust\n\nThis library provides HTSlib bindings and a high level Rust API for reading and writing BAM files.\n\nTo clone this repository, issue\n\n```shell\n$ git clone --recursive https://github.com/rust-bio/rust-htslib.git\n```\n\nensuring that the HTSlib submodule is fetched, too.\nIf you only want to use the library, there is no need to clone the repository. Go on to the **Usage** section in this case.\n\n## Requirements\n\nrust-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.\n\n## Usage\n\nAdd this to your `Cargo.toml`:\n```toml\n[dependencies]\nrust-htslib = \"*\"\n```\n\nBy 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\nwith these compression methods, you can deactivate these features to reduce you dependency count:\n\n```toml\n[dependencies]\nrust-htslib = { version = \"*\", default-features = false }\n```\n\n`rust-htslib` has optional support for `serde`, to allow (de)serialization of `bam::Record` via any serde-supported format.\n\nHttp access to files is available with the `curl` feature.\n\nBeta-level S3 and Google Cloud Storge support is available with the `s3` and `gcs` features.\n\n`rust-htslib` can optionally use `bindgen` to generate bindings to htslib. This can slow down the build substantially. Enabling the `bindgen` feature will \ncause `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.\n\n\n\n```toml\n[dependencies]\nrust-htslib = { version = \"*\", features = [\"serde_feature\"] }\n```\n\nFor more information, please see the [docs](https://docs.rs/rust-htslib).\n\n# Alternatives\n\nThere'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).\n\n# Authors\n\n* [Johannes Köster](https://github.com/johanneskoester)\n* [Christopher Schröder](https://github.com/christopher-schroeder)\n* [Patrick Marks](https://github.com/pmarks)\n* [David Lähnemann](https://github.com/dlaehnemann)\n* [Manuel Holtgrewe](https://github.com/holtgrewe)\n* [Julian Gehring](https://github.com/juliangehring)\n\nFor other contributors, see [here](https://github.com/rust-bio/rust-htslib/graphs/contributors).\n\n## License\n\nLicensed under the MIT license https://opensource.org/licenses/MIT. This project may not be copied, modified, or distributed except according to those terms.\nSome test files are taken from https://github.com/samtools/htslib.\n"
  },
  {
    "path": "config.toml",
    "content": "[target.x86_64-unknown-linux-musl]\nlinker = \"x86_64-linux-musl-gcc\"\n"
  },
  {
    "path": "src/bam/buffer.rs",
    "content": "// Copyright 2017 Johannes Köster.\n// Licensed under the MIT license (http://opensource.org/licenses/MIT)\n// This file may not be copied, modified, or distributed\n// except according to those terms.\n\nuse std::collections::{vec_deque, VecDeque};\nuse std::mem;\nuse std::str;\nuse std::sync::Arc;\n\nuse crate::bam;\nuse crate::bam::Read;\nuse crate::errors::{Error, Result};\n/// A buffer for BAM records. This allows access regions in a sorted BAM file while iterating\n/// over it in a single pass.\n/// The buffer is implemented as a ringbuffer, such that extension or movement to the right has\n/// linear complexity. The buffer makes use of indexed random access. Hence, when fetching a\n/// region at the very end of the BAM, everything before is omitted without cost.\n#[derive(Debug)]\npub struct RecordBuffer {\n    reader: bam::IndexedReader,\n    inner: VecDeque<Arc<bam::Record>>,\n    overflow: Option<Arc<bam::Record>>,\n    cache_cigar: bool,\n    min_refetch_distance: u64,\n    buffer_record: Arc<bam::Record>,\n    start_pos: Option<u64>,\n}\n\nunsafe impl Sync for RecordBuffer {}\nunsafe impl Send for RecordBuffer {}\n\nimpl RecordBuffer {\n    /// Create a new `RecordBuffer`.\n    ///\n    /// # Arguments\n    ///\n    /// * `bam` - BAM reader\n    /// * `cache_cigar` - whether to call `bam::Record::cache_cigar()` for each record.\n    pub fn new(bam: bam::IndexedReader, cache_cigar: bool) -> Self {\n        RecordBuffer {\n            reader: bam,\n            inner: VecDeque::new(),\n            overflow: None,\n            cache_cigar,\n            min_refetch_distance: 1,\n            buffer_record: Arc::new(bam::Record::new()),\n            start_pos: Some(0),\n        }\n    }\n\n    /// maximum distance to previous fetch window such that a\n    /// new fetch operation is performed. If the distance is smaller, buffer will simply\n    /// read through until the start of the new fetch window (probably saving some time\n    /// by avoiding the random access).\n    pub fn set_min_refetch_distance(&mut self, min_refetch_distance: u64) {\n        self.min_refetch_distance = min_refetch_distance;\n    }\n\n    /// Return start position of buffer\n    pub fn start(&self) -> Option<u64> {\n        self.inner.front().map(|rec| rec.pos() as u64)\n    }\n\n    /// Return end position of buffer.\n    pub fn end(&self) -> Option<u64> {\n        self.inner.back().map(|rec| rec.pos() as u64)\n    }\n\n    pub fn tid(&self) -> Option<i32> {\n        self.inner.back().map(|rec| rec.tid())\n    }\n\n    /// Fill buffer at the given interval. If the start coordinate is left of\n    /// the previous start coordinate, this will use an additional BAM fetch IO operation.\n    /// Coordinates are 0-based, and end is exclusive.\n    /// Returns tuple with numbers of added and deleted records since the previous fetch.\n    #[allow(unused_assignments)] // TODO this is needed because rustc thinks that deleted is unused\n    pub fn fetch(&mut self, chrom: &[u8], start: u64, end: u64) -> Result<(usize, usize)> {\n        let mut added = 0;\n        // move overflow from last fetch into ringbuffer\n        if self.overflow.is_some() {\n            added += 1;\n            self.inner.push_back(self.overflow.take().unwrap());\n        }\n\n        if let Some(tid) = self.reader.header.tid(chrom) {\n            let mut deleted = 0;\n            let window_start = start;\n            if self.inner.is_empty()\n                || window_start.saturating_sub(self.end().unwrap()) >= self.min_refetch_distance\n                || self.tid().unwrap() != tid as i32\n                || self.start().unwrap() > self.start_pos.unwrap()\n            {\n                let end = self.reader.header.target_len(tid).unwrap();\n                self.reader.fetch((tid, window_start, end))?;\n                deleted = self.inner.len();\n                self.inner.clear();\n            } else {\n                // remove records too far left\n                let to_remove = self\n                    .inner\n                    .iter()\n                    .take_while(|rec| rec.pos() < window_start as i64)\n                    .count();\n                for _ in 0..to_remove {\n                    self.inner.pop_front();\n                }\n                deleted = to_remove;\n            }\n\n            // extend to the right\n            loop {\n                match self\n                    .reader\n                    .read(Arc::get_mut(&mut self.buffer_record).unwrap())\n                {\n                    None => break,\n                    Some(res) => res?,\n                }\n\n                if self.buffer_record.is_unmapped() {\n                    continue;\n                }\n\n                let pos = self.buffer_record.pos();\n\n                // skip records before the start\n                if pos < start as i64 {\n                    continue;\n                }\n\n                // Record is kept, do not reuse it for next iteration\n                // and thus create a new one.\n                let mut record =\n                    mem::replace(&mut self.buffer_record, Arc::new(bam::Record::new()));\n\n                if self.cache_cigar {\n                    Arc::get_mut(&mut record).unwrap().cache_cigar();\n                }\n\n                if pos >= end as i64 {\n                    self.overflow = Some(record);\n                    break;\n                } else {\n                    self.inner.push_back(record);\n                    added += 1;\n                }\n            }\n            self.start_pos = Some(self.start().unwrap_or(window_start));\n\n            Ok((added, deleted))\n        } else {\n            Err(Error::UnknownSequence {\n                sequence: str::from_utf8(chrom).unwrap().to_owned(),\n            })\n        }\n    }\n\n    /// Iterate over records that have been fetched with `fetch`.\n    pub fn iter(&self) -> vec_deque::Iter<'_, Arc<bam::Record>> {\n        self.inner.iter()\n    }\n\n    /// Iterate over mutable references to records that have been fetched with `fetch`.\n    pub fn iter_mut(&mut self) -> vec_deque::IterMut<'_, Arc<bam::Record>> {\n        self.inner.iter_mut()\n    }\n\n    pub fn len(&self) -> usize {\n        self.inner.len()\n    }\n\n    pub fn is_empty(&self) -> bool {\n        self.len() == 0\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n    use crate::bam;\n\n    #[test]\n    fn test_buffer() {\n        let reader = bam::IndexedReader::from_path(\"test/test.bam\").unwrap();\n        let mut buffer = RecordBuffer::new(reader, false);\n\n        buffer.fetch(b\"CHROMOSOME_I\", 1, 5).unwrap();\n        {\n            let records: Vec<_> = buffer.iter().collect();\n            assert_eq!(records.len(), 6);\n            assert_eq!(records[0].pos(), 1);\n            assert_eq!(records[1].pos(), 1);\n            assert_eq!(records[2].pos(), 1);\n            assert_eq!(records[3].pos(), 1);\n            assert_eq!(records[4].pos(), 1);\n            assert_eq!(records[5].pos(), 1);\n        }\n    }\n}\n"
  },
  {
    "path": "src/bam/ext.rs",
    "content": "// Copyright 2019 Johannes Köster and Florian Finkernagel.\n// Licensed under the MIT license (http://opensource.org/licenses/MIT)\n// This file may not be copied, modified, or distributed\n// except according to those terms.\n\n//! Extensions for BAM records beyond htslib\n\nuse crate::bam;\nuse crate::bam::record::Cigar;\nuse crate::htslib;\nuse std::collections::HashMap;\n\npub struct IterAlignedBlockPairs {\n    genome_pos: i64,\n    read_pos: i64,\n    cigar_index: usize,\n    cigar: Vec<Cigar>,\n}\n\nimpl Iterator for IterAlignedBlockPairs {\n    type Item = ([i64; 2], [i64; 2]);\n    fn next(&mut self) -> Option<Self::Item> {\n        while self.cigar_index < self.cigar.len() {\n            let entry = self.cigar[self.cigar_index];\n            match entry {\n                Cigar::Match(len) | Cigar::Equal(len) | Cigar::Diff(len) => {\n                    let qstart = self.read_pos;\n                    let qend = qstart + len as i64;\n                    let rstart = self.genome_pos;\n                    let rend = self.genome_pos + len as i64;\n                    self.read_pos += len as i64;\n                    self.genome_pos += len as i64;\n                    self.cigar_index += 1;\n                    return Some(([qstart, qend], [rstart, rend]));\n                }\n                Cigar::Ins(len) | Cigar::SoftClip(len) => {\n                    self.read_pos += len as i64;\n                }\n                Cigar::Del(len) | Cigar::RefSkip(len) => {\n                    self.genome_pos += len as i64;\n                }\n                Cigar::HardClip(_) => {} // no advance\n                Cigar::Pad(_) => panic!(\"Padding (Cigar::Pad) is not supported.\"), //padding is only used for multiple sequence alignment\n            }\n            self.cigar_index += 1;\n        }\n        None\n    }\n}\n\npub struct IterAlignedBlocks {\n    pos: i64,\n    cigar_index: usize,\n    cigar: Vec<Cigar>,\n}\n\nimpl Iterator for IterAlignedBlocks {\n    type Item = [i64; 2];\n    fn next(&mut self) -> Option<Self::Item> {\n        while self.cigar_index < self.cigar.len() {\n            let entry = self.cigar[self.cigar_index];\n            match entry {\n                Cigar::Match(len) | Cigar::Equal(len) | Cigar::Diff(len) => {\n                    let out_pos = self.pos;\n                    //result.push([pos, pos + *len as i64]);\n                    self.pos += len as i64;\n                    self.cigar_index += 1;\n                    return Some([out_pos, out_pos + len as i64]);\n                }\n                Cigar::Del(len) => self.pos += len as i64,\n                Cigar::RefSkip(len) => self.pos += len as i64,\n                _ => (),\n            }\n            self.cigar_index += 1;\n        }\n        None\n    }\n}\n\npub struct IterIntrons {\n    pos: i64,\n    cigar_index: usize,\n    cigar: Vec<Cigar>,\n}\n\nimpl Iterator for IterIntrons {\n    type Item = [i64; 2];\n    fn next(&mut self) -> Option<Self::Item> {\n        while self.cigar_index < self.cigar.len() {\n            let entry = self.cigar[self.cigar_index];\n            match entry {\n                Cigar::Match(len) | Cigar::Equal(len) | Cigar::Diff(len) | Cigar::Del(len) => {\n                    self.pos += len as i64\n                }\n                Cigar::RefSkip(len) => {\n                    let junc_start = self.pos;\n                    self.pos += len as i64;\n                    self.cigar_index += 1;\n                    return Some([junc_start, self.pos]); //self.pos is  junc_start + len\n                }\n                _ => {}\n            }\n            self.cigar_index += 1;\n        }\n        None\n    }\n}\n\npub struct IterAlignedPairs {\n    genome_pos: i64,\n    read_pos: i64,\n    cigar: Vec<Cigar>,\n    remaining_match_bp: u32,\n    cigar_index: usize,\n}\n\nimpl Iterator for IterAlignedPairs {\n    type Item = [i64; 2];\n    fn next(&mut self) -> Option<Self::Item> {\n        if self.remaining_match_bp > 0 {\n            self.remaining_match_bp -= 1;\n            self.genome_pos += 1;\n            self.read_pos += 1;\n            return Some([self.read_pos - 1, self.genome_pos - 1]);\n        }\n\n        while self.cigar_index < self.cigar.len() {\n            let entry = self.cigar[self.cigar_index];\n            match entry {\n                Cigar::Match(len) | Cigar::Equal(len) | Cigar::Diff(len) => {\n                    self.genome_pos += 1;\n                    self.read_pos += 1;\n                    self.remaining_match_bp = len - 1;\n                    self.cigar_index += 1;\n                    return Some([self.read_pos - 1, self.genome_pos - 1]);\n                }\n                Cigar::Ins(len) | Cigar::SoftClip(len) => {\n                    self.read_pos += len as i64;\n                }\n                Cigar::Del(len) | Cigar::RefSkip(len) => {\n                    self.genome_pos += len as i64;\n                }\n                Cigar::HardClip(_) => {} // no advance\n                Cigar::Pad(_) => panic!(\"Padding (Cigar::Pad) is not supported.\"), //padding is only used for multiple sequence alignment\n            }\n            self.cigar_index += 1;\n        }\n        None\n    }\n}\n\npub struct IterAlignedPairsFull {\n    genome_pos: i64,\n    read_pos: i64,\n    cigar: Vec<Cigar>,\n    remaining_match_bp: u32,\n    remaining_ins_bp: u32,\n    remaining_del_bp: u32,\n    cigar_index: usize,\n}\n\nimpl Iterator for IterAlignedPairsFull {\n    type Item = [Option<i64>; 2];\n    fn next(&mut self) -> Option<Self::Item> {\n        if self.remaining_match_bp > 0 {\n            self.remaining_match_bp -= 1;\n            self.genome_pos += 1;\n            self.read_pos += 1;\n            return Some([Some(self.read_pos - 1), Some(self.genome_pos - 1)]);\n        }\n        if self.remaining_ins_bp > 0 {\n            self.remaining_ins_bp -= 1;\n            self.read_pos += 1;\n            return Some([Some(self.read_pos - 1), None]);\n        }\n        if self.remaining_del_bp > 0 {\n            self.remaining_del_bp -= 1;\n            self.genome_pos += 1;\n            return Some([None, Some(self.genome_pos - 1)]);\n        }\n\n        while self.cigar_index < self.cigar.len() {\n            let entry = self.cigar[self.cigar_index];\n            match entry {\n                Cigar::Match(len) | Cigar::Equal(len) | Cigar::Diff(len) => {\n                    self.genome_pos += 1;\n                    self.read_pos += 1;\n                    self.remaining_match_bp = len - 1;\n                    self.cigar_index += 1;\n                    return Some([Some(self.read_pos - 1), Some(self.genome_pos - 1)]);\n                }\n                Cigar::Ins(len) | Cigar::SoftClip(len) => {\n                    self.read_pos += 1;\n                    self.remaining_ins_bp = len - 1;\n                    self.cigar_index += 1;\n                    return Some([Some(self.read_pos - 1), None]);\n                }\n                Cigar::Del(len) | Cigar::RefSkip(len) => {\n                    self.genome_pos += 1;\n                    self.remaining_del_bp = len - 1;\n                    self.cigar_index += 1;\n                    return Some([None, Some(self.genome_pos - 1)]);\n                }\n                Cigar::HardClip(_) => {\n                    // no advance\n                }\n                Cigar::Pad(_) => panic!(\"Padding (Cigar::Pad) is not supported.\"), //padding is only used for multiple sequence alignment\n            }\n            self.cigar_index += 1;\n        }\n        None\n    }\n}\n\n/// Extra functionality for BAM records\n///\n/// Inspired by pysam\npub trait BamRecordExtensions {\n    /// iterator over start and end positions of aligned gapless blocks\n    ///\n    /// The start and end positions are in genomic coordinates.\n    /// There is not necessarily a gap between blocks on the genome,\n    /// this happens on insertions.\n    ///\n    /// pysam: blocks\n    /// See also: [aligned_block_pairs](#tymethod.aligned_block_pairs) if you need\n    /// the read coordinates as well.\n    fn aligned_blocks(&self) -> IterAlignedBlocks;\n\n    ///Iter over <([read_start, read_stop], [genome_start, genome_stop]) blocks\n    ///of continously aligned reads.\n    ///\n    ///In contrast to [aligned_blocks](#tymethod.aligned_blocks), this returns\n    ///read and genome coordinates.\n    ///In contrast to aligned_pairs, this returns just the start-stop\n    ///coordinates of each block.\n    ///\n    ///There is not necessarily a gap between blocks in either coordinate space\n    ///(this happens in in-dels).\n    fn aligned_block_pairs(&self) -> IterAlignedBlockPairs;\n\n    /// This scans the CIGAR for reference skips\n    /// and reports their positions.\n    /// It does not inspect the reported regions\n    /// for actual splice sites.\n    /// pysam: get_introns\n    fn introns(&self) -> IterIntrons;\n\n    /// iter aligned read and reference positions on a basepair level\n    ///\n    /// No entry for insertions, deletions or skipped pairs\n    ///\n    /// pysam: get_aligned_pairs(matches_only = True)\n    ///\n    /// See also [aligned_block_pairs](#tymethod.aligned_block_pairs)\n    /// if you just need start&end coordinates of each block.\n    /// That way you can allocate less memory for the same\n    /// informational content.\n    fn aligned_pairs(&self) -> IterAlignedPairs;\n\n    /// iter list of read and reference positions on a basepair level.\n    ///\n    /// Unlike `aligned_pairs` this returns None in\n    /// either the read positions or the reference position\n    /// for insertions, deletions or skipped pairs\n    ///\n    /// pysam: aligned_pairs(matches_only = False)\n    fn aligned_pairs_full(&self) -> IterAlignedPairsFull;\n\n    /// the number of nucleotides covered by each Cigar::* variant.\n    ///\n    /// Result is a Hashmap Cigar::*(0) => covered nucleotides\n    ///\n    /// pysam: first result from get_cigar_stats\n    fn cigar_stats_nucleotides(&self) -> HashMap<Cigar, i32>;\n\n    /// the number of occurrences of each each Cigar::* variant\n    ///\n    /// Result is a Hashmap Cigar::*(0) => number of times this Cigar::\n    /// appeared\n    ///\n    /// pysam: second result from get_cigar_stats\n    fn cigar_stats_blocks(&self) -> HashMap<Cigar, i32>;\n\n    /// iter over  reference positions that this read aligns to\n    ///\n    /// only returns positions that are aligned, excluding any soft-clipped\n    /// or unaligned positions within the read\n    ///\n    /// pysam: get_reference_positions(full_length=False)\n    fn reference_positions(&self) -> Box<dyn Iterator<Item = i64>>;\n\n    ///\n    /// iter over reference positions that this read aligns to\n    ///\n    /// include soft-clipped or skipped positions as None\n    ///\n    /// pysam: get_reference_positions(full_length=True)\n    fn reference_positions_full(&self) -> Box<dyn Iterator<Item = Option<i64>>>;\n\n    /// left most aligned reference position of the read on the reference genome.\n    fn reference_start(&self) -> i64;\n\n    /// right most aligned absolute reference position of the read on the reference genome.\n    fn reference_end(&self) -> i64;\n\n    /// infer the query length from the cigar string, optionally include hard clipped bases\n    ///\n    /// Contrast with record::seq_len which returns the length of the sequence stored\n    /// in the BAM file, and as such is 0 if the BAM file omits sequences\n    ///\n    /// pysam: infer_query_length / infer_read_length\n    fn seq_len_from_cigar(&self, include_hard_clip: bool) -> usize;\n}\n\nimpl BamRecordExtensions for bam::Record {\n    fn aligned_blocks(&self) -> IterAlignedBlocks {\n        IterAlignedBlocks {\n            pos: self.pos(),\n            cigar: self.cigar().take().0,\n            cigar_index: 0,\n        }\n    }\n\n    fn introns(&self) -> IterIntrons {\n        IterIntrons {\n            pos: self.pos(),\n            cigar: self.cigar().take().0,\n            cigar_index: 0,\n        }\n    }\n\n    fn aligned_block_pairs(&self) -> IterAlignedBlockPairs {\n        IterAlignedBlockPairs {\n            genome_pos: self.pos(),\n            read_pos: 0,\n            cigar: self.cigar().take().0,\n            cigar_index: 0,\n        }\n    }\n\n    fn aligned_pairs(&self) -> IterAlignedPairs {\n        IterAlignedPairs {\n            genome_pos: self.pos(),\n            read_pos: 0,\n            cigar: self.cigar().take().0,\n            remaining_match_bp: 0,\n            cigar_index: 0,\n        }\n    }\n\n    fn aligned_pairs_full(&self) -> IterAlignedPairsFull {\n        IterAlignedPairsFull {\n            genome_pos: self.pos(),\n            read_pos: 0,\n            cigar: self.cigar().take().0,\n            remaining_match_bp: 0,\n            remaining_ins_bp: 0,\n            remaining_del_bp: 0,\n            cigar_index: 0,\n        }\n    }\n\n    fn cigar_stats_nucleotides(&self) -> HashMap<Cigar, i32> {\n        let mut result = HashMap::new();\n        result.insert(Cigar::Match(0), 0); // M\n        result.insert(Cigar::Ins(0), 0); // I\n        result.insert(Cigar::Del(0), 0); // D\n        result.insert(Cigar::RefSkip(0), 0); // N\n        result.insert(Cigar::SoftClip(0), 0); // S\n        result.insert(Cigar::HardClip(0), 0); // H\n        result.insert(Cigar::Pad(0), 0); // P\n        result.insert(Cigar::Equal(0), 0); // =\n        result.insert(Cigar::Diff(0), 0); // X\n        for entry in self.cigar().iter() {\n            match entry {\n                Cigar::Match(len) => *result.get_mut(&Cigar::Match(0)).unwrap() += *len as i32, // M\n                Cigar::Ins(len) => *result.get_mut(&Cigar::Ins(0)).unwrap() += *len as i32,     // I\n                Cigar::Del(len) => *result.get_mut(&Cigar::Del(0)).unwrap() += *len as i32,     // D\n                Cigar::RefSkip(len) => *result.get_mut(&Cigar::RefSkip(0)).unwrap() += *len as i32, // N\n                Cigar::SoftClip(len) => {\n                    *result.get_mut(&Cigar::SoftClip(0)).unwrap() += *len as i32\n                } // S\n                Cigar::HardClip(len) => {\n                    *result.get_mut(&Cigar::HardClip(0)).unwrap() += *len as i32\n                } // H\n                Cigar::Pad(len) => *result.get_mut(&Cigar::Pad(0)).unwrap() += *len as i32, // P\n                Cigar::Equal(len) => *result.get_mut(&Cigar::Equal(0)).unwrap() += *len as i32, // =\n                Cigar::Diff(len) => *result.get_mut(&Cigar::Diff(0)).unwrap() += *len as i32, // X\n            }\n        }\n        result\n    }\n\n    fn cigar_stats_blocks(&self) -> HashMap<Cigar, i32> {\n        let mut result = HashMap::new();\n        result.insert(Cigar::Match(0), 0); // M\n        result.insert(Cigar::Ins(0), 0); // I\n        result.insert(Cigar::Del(0), 0); // D\n        result.insert(Cigar::RefSkip(0), 0); // N\n        result.insert(Cigar::SoftClip(0), 0); // S\n        result.insert(Cigar::HardClip(0), 0); // H\n        result.insert(Cigar::Pad(0), 0); // P\n        result.insert(Cigar::Equal(0), 0); // =\n        result.insert(Cigar::Diff(0), 0); // X\n        for entry in self.cigar().iter() {\n            match entry {\n                Cigar::Match(_) => *result.get_mut(&Cigar::Match(0)).unwrap() += 1, // M\n                Cigar::Ins(_) => *result.get_mut(&Cigar::Ins(0)).unwrap() += 1,     // I\n                Cigar::Del(_) => *result.get_mut(&Cigar::Del(0)).unwrap() += 1,     // D\n                Cigar::RefSkip(_) => *result.get_mut(&Cigar::RefSkip(0)).unwrap() += 1, // N\n                Cigar::SoftClip(_) => *result.get_mut(&Cigar::SoftClip(0)).unwrap() += 1, // S\n                Cigar::HardClip(_) => *result.get_mut(&Cigar::HardClip(0)).unwrap() += 1, // H\n                Cigar::Pad(_) => *result.get_mut(&Cigar::Pad(0)).unwrap() += 1,     // P\n                Cigar::Equal(_) => *result.get_mut(&Cigar::Equal(0)).unwrap() += 1, // =\n                Cigar::Diff(_) => *result.get_mut(&Cigar::Diff(0)).unwrap() += 1,   // X\n            }\n        }\n        result\n    }\n\n    fn reference_positions(&self) -> Box<dyn Iterator<Item = i64>> {\n        Box::new(self.aligned_pairs().map(|x| x[1]))\n    }\n\n    fn reference_positions_full(&self) -> Box<dyn Iterator<Item = Option<i64>>> {\n        Box::new(\n            self.aligned_pairs_full()\n                .filter(|x| x[0].is_some())\n                .map(|x| x[1]),\n        )\n    }\n\n    fn reference_start(&self) -> i64 {\n        self.pos()\n    }\n\n    /// Calculate the rightmost absolute reference base position of an alignment on the reference genome.\n    /// Returns the coordinate of the first base after the alignment (0-based).\n    fn reference_end(&self) -> i64 {\n        unsafe { htslib::bam_endpos(self.inner_ptr()) }\n    }\n\n    fn seq_len_from_cigar(&self, include_hard_clip: bool) -> usize {\n        let mut result = 0;\n        for entry in self.cigar().iter() {\n            match entry {\n                Cigar::Match(len)\n                | Cigar::Ins(len)\n                | Cigar::SoftClip(len)\n                | Cigar::Equal(len)\n                | Cigar::Diff(len) => {\n                    result += len;\n                }\n                Cigar::HardClip(len) => {\n                    if include_hard_clip {\n                        result += len;\n                    }\n                }\n                _ => {}\n            }\n        }\n        result as usize\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use crate::bam;\n    use crate::bam::ext::BamRecordExtensions;\n    use crate::bam::record::{Cigar, CigarString};\n    use crate::bam::Read;\n    use std::collections::HashMap;\n\n    #[test]\n    fn spliced_reads() {\n        let mut bam = bam::Reader::from_path(\"./test/test_spliced_reads.bam\").unwrap();\n        let mut it = bam.records();\n        let blocks: Vec<_> = it.next().expect(\"iter\").unwrap().aligned_blocks().collect();\n        //6S45M - 0\n        assert!(blocks[0] == [16050676, 16050721]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //7M2D44M - 1\n        assert!(blocks[0] == [16096878, 16096885]);\n        //7M2D44M - 1\n        assert!(blocks[1] == [16096887, 16096931]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //29M2D22M - 2\n        assert!(blocks[0] == [16097145, 16097174]);\n        //29M2D22M - 2\n        assert!(blocks[1] == [16097176, 16097198]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //51M - 3\n        assert!(blocks[0] == [16117350, 16117401]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //51M - 4\n        assert!(blocks[0] == [16118483, 16118534]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //51M - 5\n        assert!(blocks[0] == [16118499, 16118550]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //51M - 6\n        assert!(blocks[0] == [16118499, 16118550]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //51M - 7\n        assert!(blocks[0] == [16118499, 16118550]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //51M - 8\n        assert!(blocks[0] == [16123411, 16123462]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //6S45M - 9\n        assert!(blocks[0] == [16123417, 16123462]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //41M10S - 10\n        assert!(blocks[0] == [16165860, 16165901]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //51M - 11\n        assert!(blocks[0] == [16180871, 16180922]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //51M - 12\n        assert!(blocks[0] == [16189705, 16189756]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //51M - 13\n        assert!(blocks[0] == [16231271, 16231322]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //51M - 14\n        assert!(blocks[0] == [16237657, 16237708]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //9S42M - 15\n        assert!(blocks[0] == [16255012, 16255054]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //51M - 16\n        assert!(blocks[0] == [16255391, 16255442]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //50M1S - 17\n        assert!(blocks[0] == [16255392, 16255442]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //45M6S - 18\n        assert!(blocks[0] == [16256084, 16256129]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //3S48M - 19\n        assert!(blocks[0] == [16256224, 16256272]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //42M9S - 20\n        assert!(blocks[0] == [16325199, 16325241]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //13S38M - 21\n        assert!(blocks[0] == [16352865, 16352903]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //44M7S - 22\n        assert!(blocks[0] == [16352968, 16353012]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //5S46M - 23\n        assert!(blocks[0] == [16414998, 16415044]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //23M4I24M - 24\n        assert!(blocks[0] == [17031591, 17031614]);\n        //23M4I24M - 24\n        assert!(blocks[1] == [17031614, 17031638]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //18M1I32M - 25\n        assert!(blocks[0] == [17057382, 17057400]);\n        //18M1I32M - 25\n        assert!(blocks[1] == [17057400, 17057432]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //17M2183N34M - 26\n        assert!(blocks[0] == [17092766, 17092783]);\n        //17M2183N34M - 26\n        assert!(blocks[1] == [17094966, 17095000]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //1M2183N50M - 27\n        assert!(blocks[0] == [17092782, 17092783]);\n        //1M2183N50M - 27\n        assert!(blocks[1] == [17094966, 17095016]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //1M2183N50M - 28\n        assert!(blocks[0] == [17092782, 17092783]);\n        //1M2183N50M - 28\n        assert!(blocks[1] == [17094966, 17095016]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //9S33M9S - 29\n        assert!(blocks[0] == [17137287, 17137320]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //2S48M1S - 30\n        assert!(blocks[0] == [17306238, 17306286]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //4S45M2S - 31\n        assert!(blocks[0] == [17561868, 17561913]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //41M11832N10M - 32\n        assert!(blocks[0] == [17566078, 17566119]);\n        //41M11832N10M - 32\n        assert!(blocks[1] == [17577951, 17577961]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //11M11832N25M710N15M - 33\n        assert!(blocks[0] == [17566108, 17566119]);\n        //11M11832N25M710N15M - 33\n        assert!(blocks[1] == [17577951, 17577976]);\n        //11M11832N25M710N15M - 33\n        assert!(blocks[2] == [17578686, 17578701]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //8M11832N25M710N18M - 34\n        assert!(blocks[0] == [17566111, 17566119]);\n        //8M11832N25M710N18M - 34\n        assert!(blocks[1] == [17577951, 17577976]);\n        //8M11832N25M710N18M - 34\n        assert!(blocks[2] == [17578686, 17578704]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //8M11832N25M710N18M - 35\n        assert!(blocks[0] == [17566111, 17566119]);\n        //8M11832N25M710N18M - 35\n        assert!(blocks[1] == [17577951, 17577976]);\n        //8M11832N25M710N18M - 35\n        assert!(blocks[2] == [17578686, 17578704]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //8M11832N25M710N18M - 36\n        assert!(blocks[0] == [17566111, 17566119]);\n        //8M11832N25M710N18M - 36\n        assert!(blocks[1] == [17577951, 17577976]);\n        //8M11832N25M710N18M - 36\n        assert!(blocks[2] == [17578686, 17578704]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //8M11832N25M710N18M - 37\n        assert!(blocks[0] == [17566111, 17566119]);\n        //8M11832N25M710N18M - 37\n        assert!(blocks[1] == [17577951, 17577976]);\n        //8M11832N25M710N18M - 37\n        assert!(blocks[2] == [17578686, 17578704]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //7M11832N25M710N19M - 38\n        assert!(blocks[0] == [17566112, 17566119]);\n        //7M11832N25M710N19M - 38\n        assert!(blocks[1] == [17577951, 17577976]);\n        //7M11832N25M710N19M - 38\n        assert!(blocks[2] == [17578686, 17578705]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //6M11832N25M710N20M - 39\n        assert!(blocks[0] == [17566113, 17566119]);\n        //6M11832N25M710N20M - 39\n        assert!(blocks[1] == [17577951, 17577976]);\n        //6M11832N25M710N20M - 39\n        assert!(blocks[2] == [17578686, 17578706]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //6M11832N25M710N20M - 40\n        assert!(blocks[0] == [17566113, 17566119]);\n        //6M11832N25M710N20M - 40\n        assert!(blocks[1] == [17577951, 17577976]);\n        //6M11832N25M710N20M - 40\n        assert!(blocks[2] == [17578686, 17578706]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //1S44M1467N6M - 41\n        assert!(blocks[0] == [17579733, 17579777]);\n        //1S44M1467N6M - 41\n        assert!(blocks[1] == [17581244, 17581250]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //2M1514N48M95N1M - 42\n        assert!(blocks[0] == [17581369, 17581371]);\n        //2M1514N48M95N1M - 42\n        assert!(blocks[1] == [17582885, 17582933]);\n        //2M1514N48M95N1M - 42\n        assert!(blocks[2] == [17583028, 17583029]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //1M1514N48M95N2M - 43\n        assert!(blocks[0] == [17581370, 17581371]);\n        //1M1514N48M95N2M - 43\n        assert!(blocks[1] == [17582885, 17582933]);\n        //1M1514N48M95N2M - 43\n        assert!(blocks[2] == [17583028, 17583030]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //1M1514N48M95N2M - 44\n        assert!(blocks[0] == [17581370, 17581371]);\n        //1M1514N48M95N2M - 44\n        assert!(blocks[1] == [17582885, 17582933]);\n        //1M1514N48M95N2M - 44\n        assert!(blocks[2] == [17583028, 17583030]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //1S22M95N28M - 45\n        assert!(blocks[0] == [17582911, 17582933]);\n        //1S22M95N28M - 45\n        assert!(blocks[1] == [17583028, 17583056]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //37M538N13M1S - 46\n        assert!(blocks[0] == [17588621, 17588658]);\n        //37M538N13M1S - 46\n        assert!(blocks[1] == [17589196, 17589209]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //37M538N13M1S - 47\n        assert!(blocks[0] == [17588621, 17588658]);\n        //37M538N13M1S - 47\n        assert!(blocks[1] == [17589196, 17589209]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //37M538N13M1S - 48\n        assert!(blocks[0] == [17588621, 17588658]);\n        //37M538N13M1S - 48\n        assert!(blocks[1] == [17589196, 17589209]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //1S25M1D25M - 49\n        assert!(blocks[0] == [17591770, 17591795]);\n        //1S25M1D25M - 49\n        assert!(blocks[1] == [17591796, 17591821]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //24M1D24M3S - 50\n        assert!(blocks[0] == [17593855, 17593879]);\n        //24M1D24M3S - 50\n        assert!(blocks[1] == [17593880, 17593904]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //16M1D28M7S - 51\n        assert!(blocks[0] == [17593863, 17593879]);\n        //16M1D28M7S - 51\n        assert!(blocks[1] == [17593880, 17593908]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //11S7M1I32M - 52\n        assert!(blocks[0] == [17596476, 17596483]);\n        //11S7M1I32M - 52\n        assert!(blocks[1] == [17596483, 17596515]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //5S9M1892N37M - 53\n        assert!(blocks[0] == [17624012, 17624021]);\n        //5S9M1892N37M - 53\n        assert!(blocks[1] == [17625913, 17625950]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //2S9M1892N40M - 54\n        assert!(blocks[0] == [17624012, 17624021]);\n        //2S9M1892N40M - 54\n        assert!(blocks[1] == [17625913, 17625953]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //1S7M3D19M2285N24M - 55\n        assert!(blocks[0] == [31796700, 31796707]);\n        //1S7M3D19M2285N24M - 55\n        assert!(blocks[1] == [31796710, 31796729]);\n        //1S7M3D19M2285N24M - 55\n        assert!(blocks[2] == [31799014, 31799038]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //14M799N28M13881N7M2S - 56\n        assert!(blocks[0] == [36722692, 36722706]);\n        //14M799N28M13881N7M2S - 56\n        assert!(blocks[1] == [36723505, 36723533]);\n        //14M799N28M13881N7M2S - 56\n        assert!(blocks[2] == [36737414, 36737421]);\n\n        let blocks: Vec<_> = it.next().unwrap().unwrap().aligned_blocks().collect();\n        //4S21M1696N23M2331N3M - 57\n        assert!(blocks[0] == [44587963, 44587984]);\n        //4S21M1696N23M2331N3M - 57\n        assert!(blocks[1] == [44589680, 44589703]);\n        //4S21M1696N23M2331N3M - 57\n        assert!(blocks[2] == [44592034, 44592037]);\n    }\n\n    #[test]\n    fn test_introns() {\n        let mut bam = bam::Reader::from_path(\"./test/test_spliced_reads.bam\").unwrap();\n        let mut it = bam.records();\n\n        //6S45M - 0\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 0);\n        //7M2D44M - 1\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 0);\n        //29M2D22M - 2\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 0);\n        //51M - 3\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 0);\n        //51M - 4\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 0);\n        //51M - 5\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 0);\n        //51M - 6\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 0);\n        //51M - 7\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 0);\n        //51M - 8\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 0);\n        //6S45M - 9\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 0);\n        //41M10S - 10\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 0);\n        //51M - 11\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 0);\n        //51M - 12\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 0);\n        //51M - 13\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 0);\n        //51M - 14\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 0);\n        //9S42M - 15\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 0);\n        //51M - 16\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 0);\n        //50M1S - 17\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 0);\n        //45M6S - 18\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 0);\n        //3S48M - 19\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 0);\n        //42M9S - 20\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 0);\n        //13S38M - 21\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 0);\n        //44M7S - 22\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 0);\n        //5S46M - 23\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 0);\n        //23M4I24M - 24\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 0);\n        //18M1I32M - 25\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 0);\n        //17M2183N34M - 26\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 1);\n        assert_eq!(introns[0], [17092783, 17094966]);\n        //1M2183N50M - 27\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 1);\n        assert_eq!(introns[0], [17092783, 17094966]);\n        //1M2183N50M - 28\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 1);\n        assert_eq!(introns[0], [17092783, 17094966]);\n        //9S33M9S - 29\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 0);\n        //2S48M1S - 30\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 0);\n        //4S45M2S - 31\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 0);\n        //41M11832N10M - 32\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 1);\n        assert_eq!(introns[0], [17566119, 17577951]);\n        //11M11832N25M710N15M - 33\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 2);\n        assert_eq!(introns[0], [17566119, 17577951]);\n        assert_eq!(introns[1], [17577976, 17578686]);\n        //8M11832N25M710N18M - 34\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 2);\n        assert_eq!(introns[0], [17566119, 17577951]);\n        assert_eq!(introns[1], [17577976, 17578686]);\n        //8M11832N25M710N18M - 35\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 2);\n        assert_eq!(introns[0], [17566119, 17577951]);\n        assert_eq!(introns[1], [17577976, 17578686]);\n        //8M11832N25M710N18M - 36\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 2);\n        assert_eq!(introns[0], [17566119, 17577951]);\n        assert_eq!(introns[1], [17577976, 17578686]);\n        //8M11832N25M710N18M - 37\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 2);\n        assert_eq!(introns[0], [17566119, 17577951]);\n        assert_eq!(introns[1], [17577976, 17578686]);\n        //7M11832N25M710N19M - 38\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 2);\n        assert_eq!(introns[0], [17566119, 17577951]);\n        assert_eq!(introns[1], [17577976, 17578686]);\n        //6M11832N25M710N20M - 39\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 2);\n        assert_eq!(introns[0], [17566119, 17577951]);\n        assert_eq!(introns[1], [17577976, 17578686]);\n        //6M11832N25M710N20M - 40\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 2);\n        assert_eq!(introns[0], [17566119, 17577951]);\n        assert_eq!(introns[1], [17577976, 17578686]);\n        //1S44M1467N6M - 41\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 1);\n        assert_eq!(introns[0], [17579777, 17581244]);\n        //2M1514N48M95N1M - 42\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 2);\n        assert_eq!(introns[0], [17581371, 17582885]);\n        assert_eq!(introns[1], [17582933, 17583028]);\n        //1M1514N48M95N2M - 43\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 2);\n        assert_eq!(introns[0], [17581371, 17582885]);\n        assert_eq!(introns[1], [17582933, 17583028]);\n        //1M1514N48M95N2M - 44\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 2);\n        assert_eq!(introns[0], [17581371, 17582885]);\n        assert_eq!(introns[1], [17582933, 17583028]);\n        //1S22M95N28M - 45\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 1);\n        assert_eq!(introns[0], [17582933, 17583028]);\n        //37M538N13M1S - 46\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 1);\n        assert_eq!(introns[0], [17588658, 17589196]);\n        //37M538N13M1S - 47\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 1);\n        assert_eq!(introns[0], [17588658, 17589196]);\n        //37M538N13M1S - 48\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 1);\n        assert_eq!(introns[0], [17588658, 17589196]);\n        //1S25M1D25M - 49\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 0);\n        //24M1D24M3S - 50\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 0);\n        //16M1D28M7S - 51\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 0);\n        //11S7M1I32M - 52\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 0);\n        //5S9M1892N37M - 53\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 1);\n        assert_eq!(introns[0], [17624021, 17625913]);\n        //2S9M1892N40M - 54\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 1);\n        assert_eq!(introns[0], [17624021, 17625913]);\n        //1S7M3D19M2285N24M - 55\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 1);\n        assert_eq!(introns[0], [31796729, 31799014]);\n        //14M799N28M13881N7M2S - 56\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 2);\n        assert_eq!(introns[0], [36722706, 36723505]);\n        assert_eq!(introns[1], [36723533, 36737414]);\n        //4S21M1696N23M2331N3M - 57\n        let introns: Vec<_> = it.next().unwrap().unwrap().introns().collect();\n        assert_eq!(introns.len(), 2);\n        assert_eq!(introns[0], [44587984, 44589680]);\n        assert_eq!(introns[1], [44589703, 44592034]);\n    }\n\n    #[test]\n    fn test_aligned_pairs() {\n        let mut bam = bam::Reader::from_path(\"./test/test_spliced_reads.bam\").unwrap();\n        let mut it = bam.records();\n\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [6, 16050676],\n                [7, 16050677],\n                [8, 16050678],\n                [9, 16050679],\n                [10, 16050680],\n                [11, 16050681],\n                [12, 16050682],\n                [13, 16050683],\n                [14, 16050684],\n                [15, 16050685],\n                [16, 16050686],\n                [17, 16050687],\n                [18, 16050688],\n                [19, 16050689],\n                [20, 16050690],\n                [21, 16050691],\n                [22, 16050692],\n                [23, 16050693],\n                [24, 16050694],\n                [25, 16050695],\n                [26, 16050696],\n                [27, 16050697],\n                [28, 16050698],\n                [29, 16050699],\n                [30, 16050700],\n                [31, 16050701],\n                [32, 16050702],\n                [33, 16050703],\n                [34, 16050704],\n                [35, 16050705],\n                [36, 16050706],\n                [37, 16050707],\n                [38, 16050708],\n                [39, 16050709],\n                [40, 16050710],\n                [41, 16050711],\n                [42, 16050712],\n                [43, 16050713],\n                [44, 16050714],\n                [45, 16050715],\n                [46, 16050716],\n                [47, 16050717],\n                [48, 16050718],\n                [49, 16050719],\n                [50, 16050720]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 16096878],\n                [1, 16096879],\n                [2, 16096880],\n                [3, 16096881],\n                [4, 16096882],\n                [5, 16096883],\n                [6, 16096884],\n                [7, 16096887],\n                [8, 16096888],\n                [9, 16096889],\n                [10, 16096890],\n                [11, 16096891],\n                [12, 16096892],\n                [13, 16096893],\n                [14, 16096894],\n                [15, 16096895],\n                [16, 16096896],\n                [17, 16096897],\n                [18, 16096898],\n                [19, 16096899],\n                [20, 16096900],\n                [21, 16096901],\n                [22, 16096902],\n                [23, 16096903],\n                [24, 16096904],\n                [25, 16096905],\n                [26, 16096906],\n                [27, 16096907],\n                [28, 16096908],\n                [29, 16096909],\n                [30, 16096910],\n                [31, 16096911],\n                [32, 16096912],\n                [33, 16096913],\n                [34, 16096914],\n                [35, 16096915],\n                [36, 16096916],\n                [37, 16096917],\n                [38, 16096918],\n                [39, 16096919],\n                [40, 16096920],\n                [41, 16096921],\n                [42, 16096922],\n                [43, 16096923],\n                [44, 16096924],\n                [45, 16096925],\n                [46, 16096926],\n                [47, 16096927],\n                [48, 16096928],\n                [49, 16096929],\n                [50, 16096930]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 16097145],\n                [1, 16097146],\n                [2, 16097147],\n                [3, 16097148],\n                [4, 16097149],\n                [5, 16097150],\n                [6, 16097151],\n                [7, 16097152],\n                [8, 16097153],\n                [9, 16097154],\n                [10, 16097155],\n                [11, 16097156],\n                [12, 16097157],\n                [13, 16097158],\n                [14, 16097159],\n                [15, 16097160],\n                [16, 16097161],\n                [17, 16097162],\n                [18, 16097163],\n                [19, 16097164],\n                [20, 16097165],\n                [21, 16097166],\n                [22, 16097167],\n                [23, 16097168],\n                [24, 16097169],\n                [25, 16097170],\n                [26, 16097171],\n                [27, 16097172],\n                [28, 16097173],\n                [29, 16097176],\n                [30, 16097177],\n                [31, 16097178],\n                [32, 16097179],\n                [33, 16097180],\n                [34, 16097181],\n                [35, 16097182],\n                [36, 16097183],\n                [37, 16097184],\n                [38, 16097185],\n                [39, 16097186],\n                [40, 16097187],\n                [41, 16097188],\n                [42, 16097189],\n                [43, 16097190],\n                [44, 16097191],\n                [45, 16097192],\n                [46, 16097193],\n                [47, 16097194],\n                [48, 16097195],\n                [49, 16097196],\n                [50, 16097197]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 16117350],\n                [1, 16117351],\n                [2, 16117352],\n                [3, 16117353],\n                [4, 16117354],\n                [5, 16117355],\n                [6, 16117356],\n                [7, 16117357],\n                [8, 16117358],\n                [9, 16117359],\n                [10, 16117360],\n                [11, 16117361],\n                [12, 16117362],\n                [13, 16117363],\n                [14, 16117364],\n                [15, 16117365],\n                [16, 16117366],\n                [17, 16117367],\n                [18, 16117368],\n                [19, 16117369],\n                [20, 16117370],\n                [21, 16117371],\n                [22, 16117372],\n                [23, 16117373],\n                [24, 16117374],\n                [25, 16117375],\n                [26, 16117376],\n                [27, 16117377],\n                [28, 16117378],\n                [29, 16117379],\n                [30, 16117380],\n                [31, 16117381],\n                [32, 16117382],\n                [33, 16117383],\n                [34, 16117384],\n                [35, 16117385],\n                [36, 16117386],\n                [37, 16117387],\n                [38, 16117388],\n                [39, 16117389],\n                [40, 16117390],\n                [41, 16117391],\n                [42, 16117392],\n                [43, 16117393],\n                [44, 16117394],\n                [45, 16117395],\n                [46, 16117396],\n                [47, 16117397],\n                [48, 16117398],\n                [49, 16117399],\n                [50, 16117400]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 16118483],\n                [1, 16118484],\n                [2, 16118485],\n                [3, 16118486],\n                [4, 16118487],\n                [5, 16118488],\n                [6, 16118489],\n                [7, 16118490],\n                [8, 16118491],\n                [9, 16118492],\n                [10, 16118493],\n                [11, 16118494],\n                [12, 16118495],\n                [13, 16118496],\n                [14, 16118497],\n                [15, 16118498],\n                [16, 16118499],\n                [17, 16118500],\n                [18, 16118501],\n                [19, 16118502],\n                [20, 16118503],\n                [21, 16118504],\n                [22, 16118505],\n                [23, 16118506],\n                [24, 16118507],\n                [25, 16118508],\n                [26, 16118509],\n                [27, 16118510],\n                [28, 16118511],\n                [29, 16118512],\n                [30, 16118513],\n                [31, 16118514],\n                [32, 16118515],\n                [33, 16118516],\n                [34, 16118517],\n                [35, 16118518],\n                [36, 16118519],\n                [37, 16118520],\n                [38, 16118521],\n                [39, 16118522],\n                [40, 16118523],\n                [41, 16118524],\n                [42, 16118525],\n                [43, 16118526],\n                [44, 16118527],\n                [45, 16118528],\n                [46, 16118529],\n                [47, 16118530],\n                [48, 16118531],\n                [49, 16118532],\n                [50, 16118533]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 16118499],\n                [1, 16118500],\n                [2, 16118501],\n                [3, 16118502],\n                [4, 16118503],\n                [5, 16118504],\n                [6, 16118505],\n                [7, 16118506],\n                [8, 16118507],\n                [9, 16118508],\n                [10, 16118509],\n                [11, 16118510],\n                [12, 16118511],\n                [13, 16118512],\n                [14, 16118513],\n                [15, 16118514],\n                [16, 16118515],\n                [17, 16118516],\n                [18, 16118517],\n                [19, 16118518],\n                [20, 16118519],\n                [21, 16118520],\n                [22, 16118521],\n                [23, 16118522],\n                [24, 16118523],\n                [25, 16118524],\n                [26, 16118525],\n                [27, 16118526],\n                [28, 16118527],\n                [29, 16118528],\n                [30, 16118529],\n                [31, 16118530],\n                [32, 16118531],\n                [33, 16118532],\n                [34, 16118533],\n                [35, 16118534],\n                [36, 16118535],\n                [37, 16118536],\n                [38, 16118537],\n                [39, 16118538],\n                [40, 16118539],\n                [41, 16118540],\n                [42, 16118541],\n                [43, 16118542],\n                [44, 16118543],\n                [45, 16118544],\n                [46, 16118545],\n                [47, 16118546],\n                [48, 16118547],\n                [49, 16118548],\n                [50, 16118549]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 16118499],\n                [1, 16118500],\n                [2, 16118501],\n                [3, 16118502],\n                [4, 16118503],\n                [5, 16118504],\n                [6, 16118505],\n                [7, 16118506],\n                [8, 16118507],\n                [9, 16118508],\n                [10, 16118509],\n                [11, 16118510],\n                [12, 16118511],\n                [13, 16118512],\n                [14, 16118513],\n                [15, 16118514],\n                [16, 16118515],\n                [17, 16118516],\n                [18, 16118517],\n                [19, 16118518],\n                [20, 16118519],\n                [21, 16118520],\n                [22, 16118521],\n                [23, 16118522],\n                [24, 16118523],\n                [25, 16118524],\n                [26, 16118525],\n                [27, 16118526],\n                [28, 16118527],\n                [29, 16118528],\n                [30, 16118529],\n                [31, 16118530],\n                [32, 16118531],\n                [33, 16118532],\n                [34, 16118533],\n                [35, 16118534],\n                [36, 16118535],\n                [37, 16118536],\n                [38, 16118537],\n                [39, 16118538],\n                [40, 16118539],\n                [41, 16118540],\n                [42, 16118541],\n                [43, 16118542],\n                [44, 16118543],\n                [45, 16118544],\n                [46, 16118545],\n                [47, 16118546],\n                [48, 16118547],\n                [49, 16118548],\n                [50, 16118549]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 16118499],\n                [1, 16118500],\n                [2, 16118501],\n                [3, 16118502],\n                [4, 16118503],\n                [5, 16118504],\n                [6, 16118505],\n                [7, 16118506],\n                [8, 16118507],\n                [9, 16118508],\n                [10, 16118509],\n                [11, 16118510],\n                [12, 16118511],\n                [13, 16118512],\n                [14, 16118513],\n                [15, 16118514],\n                [16, 16118515],\n                [17, 16118516],\n                [18, 16118517],\n                [19, 16118518],\n                [20, 16118519],\n                [21, 16118520],\n                [22, 16118521],\n                [23, 16118522],\n                [24, 16118523],\n                [25, 16118524],\n                [26, 16118525],\n                [27, 16118526],\n                [28, 16118527],\n                [29, 16118528],\n                [30, 16118529],\n                [31, 16118530],\n                [32, 16118531],\n                [33, 16118532],\n                [34, 16118533],\n                [35, 16118534],\n                [36, 16118535],\n                [37, 16118536],\n                [38, 16118537],\n                [39, 16118538],\n                [40, 16118539],\n                [41, 16118540],\n                [42, 16118541],\n                [43, 16118542],\n                [44, 16118543],\n                [45, 16118544],\n                [46, 16118545],\n                [47, 16118546],\n                [48, 16118547],\n                [49, 16118548],\n                [50, 16118549]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 16123411],\n                [1, 16123412],\n                [2, 16123413],\n                [3, 16123414],\n                [4, 16123415],\n                [5, 16123416],\n                [6, 16123417],\n                [7, 16123418],\n                [8, 16123419],\n                [9, 16123420],\n                [10, 16123421],\n                [11, 16123422],\n                [12, 16123423],\n                [13, 16123424],\n                [14, 16123425],\n                [15, 16123426],\n                [16, 16123427],\n                [17, 16123428],\n                [18, 16123429],\n                [19, 16123430],\n                [20, 16123431],\n                [21, 16123432],\n                [22, 16123433],\n                [23, 16123434],\n                [24, 16123435],\n                [25, 16123436],\n                [26, 16123437],\n                [27, 16123438],\n                [28, 16123439],\n                [29, 16123440],\n                [30, 16123441],\n                [31, 16123442],\n                [32, 16123443],\n                [33, 16123444],\n                [34, 16123445],\n                [35, 16123446],\n                [36, 16123447],\n                [37, 16123448],\n                [38, 16123449],\n                [39, 16123450],\n                [40, 16123451],\n                [41, 16123452],\n                [42, 16123453],\n                [43, 16123454],\n                [44, 16123455],\n                [45, 16123456],\n                [46, 16123457],\n                [47, 16123458],\n                [48, 16123459],\n                [49, 16123460],\n                [50, 16123461]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [6, 16123417],\n                [7, 16123418],\n                [8, 16123419],\n                [9, 16123420],\n                [10, 16123421],\n                [11, 16123422],\n                [12, 16123423],\n                [13, 16123424],\n                [14, 16123425],\n                [15, 16123426],\n                [16, 16123427],\n                [17, 16123428],\n                [18, 16123429],\n                [19, 16123430],\n                [20, 16123431],\n                [21, 16123432],\n                [22, 16123433],\n                [23, 16123434],\n                [24, 16123435],\n                [25, 16123436],\n                [26, 16123437],\n                [27, 16123438],\n                [28, 16123439],\n                [29, 16123440],\n                [30, 16123441],\n                [31, 16123442],\n                [32, 16123443],\n                [33, 16123444],\n                [34, 16123445],\n                [35, 16123446],\n                [36, 16123447],\n                [37, 16123448],\n                [38, 16123449],\n                [39, 16123450],\n                [40, 16123451],\n                [41, 16123452],\n                [42, 16123453],\n                [43, 16123454],\n                [44, 16123455],\n                [45, 16123456],\n                [46, 16123457],\n                [47, 16123458],\n                [48, 16123459],\n                [49, 16123460],\n                [50, 16123461]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 16165860],\n                [1, 16165861],\n                [2, 16165862],\n                [3, 16165863],\n                [4, 16165864],\n                [5, 16165865],\n                [6, 16165866],\n                [7, 16165867],\n                [8, 16165868],\n                [9, 16165869],\n                [10, 16165870],\n                [11, 16165871],\n                [12, 16165872],\n                [13, 16165873],\n                [14, 16165874],\n                [15, 16165875],\n                [16, 16165876],\n                [17, 16165877],\n                [18, 16165878],\n                [19, 16165879],\n                [20, 16165880],\n                [21, 16165881],\n                [22, 16165882],\n                [23, 16165883],\n                [24, 16165884],\n                [25, 16165885],\n                [26, 16165886],\n                [27, 16165887],\n                [28, 16165888],\n                [29, 16165889],\n                [30, 16165890],\n                [31, 16165891],\n                [32, 16165892],\n                [33, 16165893],\n                [34, 16165894],\n                [35, 16165895],\n                [36, 16165896],\n                [37, 16165897],\n                [38, 16165898],\n                [39, 16165899],\n                [40, 16165900]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 16180871],\n                [1, 16180872],\n                [2, 16180873],\n                [3, 16180874],\n                [4, 16180875],\n                [5, 16180876],\n                [6, 16180877],\n                [7, 16180878],\n                [8, 16180879],\n                [9, 16180880],\n                [10, 16180881],\n                [11, 16180882],\n                [12, 16180883],\n                [13, 16180884],\n                [14, 16180885],\n                [15, 16180886],\n                [16, 16180887],\n                [17, 16180888],\n                [18, 16180889],\n                [19, 16180890],\n                [20, 16180891],\n                [21, 16180892],\n                [22, 16180893],\n                [23, 16180894],\n                [24, 16180895],\n                [25, 16180896],\n                [26, 16180897],\n                [27, 16180898],\n                [28, 16180899],\n                [29, 16180900],\n                [30, 16180901],\n                [31, 16180902],\n                [32, 16180903],\n                [33, 16180904],\n                [34, 16180905],\n                [35, 16180906],\n                [36, 16180907],\n                [37, 16180908],\n                [38, 16180909],\n                [39, 16180910],\n                [40, 16180911],\n                [41, 16180912],\n                [42, 16180913],\n                [43, 16180914],\n                [44, 16180915],\n                [45, 16180916],\n                [46, 16180917],\n                [47, 16180918],\n                [48, 16180919],\n                [49, 16180920],\n                [50, 16180921]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 16189705],\n                [1, 16189706],\n                [2, 16189707],\n                [3, 16189708],\n                [4, 16189709],\n                [5, 16189710],\n                [6, 16189711],\n                [7, 16189712],\n                [8, 16189713],\n                [9, 16189714],\n                [10, 16189715],\n                [11, 16189716],\n                [12, 16189717],\n                [13, 16189718],\n                [14, 16189719],\n                [15, 16189720],\n                [16, 16189721],\n                [17, 16189722],\n                [18, 16189723],\n                [19, 16189724],\n                [20, 16189725],\n                [21, 16189726],\n                [22, 16189727],\n                [23, 16189728],\n                [24, 16189729],\n                [25, 16189730],\n                [26, 16189731],\n                [27, 16189732],\n                [28, 16189733],\n                [29, 16189734],\n                [30, 16189735],\n                [31, 16189736],\n                [32, 16189737],\n                [33, 16189738],\n                [34, 16189739],\n                [35, 16189740],\n                [36, 16189741],\n                [37, 16189742],\n                [38, 16189743],\n                [39, 16189744],\n                [40, 16189745],\n                [41, 16189746],\n                [42, 16189747],\n                [43, 16189748],\n                [44, 16189749],\n                [45, 16189750],\n                [46, 16189751],\n                [47, 16189752],\n                [48, 16189753],\n                [49, 16189754],\n                [50, 16189755]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 16231271],\n                [1, 16231272],\n                [2, 16231273],\n                [3, 16231274],\n                [4, 16231275],\n                [5, 16231276],\n                [6, 16231277],\n                [7, 16231278],\n                [8, 16231279],\n                [9, 16231280],\n                [10, 16231281],\n                [11, 16231282],\n                [12, 16231283],\n                [13, 16231284],\n                [14, 16231285],\n                [15, 16231286],\n                [16, 16231287],\n                [17, 16231288],\n                [18, 16231289],\n                [19, 16231290],\n                [20, 16231291],\n                [21, 16231292],\n                [22, 16231293],\n                [23, 16231294],\n                [24, 16231295],\n                [25, 16231296],\n                [26, 16231297],\n                [27, 16231298],\n                [28, 16231299],\n                [29, 16231300],\n                [30, 16231301],\n                [31, 16231302],\n                [32, 16231303],\n                [33, 16231304],\n                [34, 16231305],\n                [35, 16231306],\n                [36, 16231307],\n                [37, 16231308],\n                [38, 16231309],\n                [39, 16231310],\n                [40, 16231311],\n                [41, 16231312],\n                [42, 16231313],\n                [43, 16231314],\n                [44, 16231315],\n                [45, 16231316],\n                [46, 16231317],\n                [47, 16231318],\n                [48, 16231319],\n                [49, 16231320],\n                [50, 16231321]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 16237657],\n                [1, 16237658],\n                [2, 16237659],\n                [3, 16237660],\n                [4, 16237661],\n                [5, 16237662],\n                [6, 16237663],\n                [7, 16237664],\n                [8, 16237665],\n                [9, 16237666],\n                [10, 16237667],\n                [11, 16237668],\n                [12, 16237669],\n                [13, 16237670],\n                [14, 16237671],\n                [15, 16237672],\n                [16, 16237673],\n                [17, 16237674],\n                [18, 16237675],\n                [19, 16237676],\n                [20, 16237677],\n                [21, 16237678],\n                [22, 16237679],\n                [23, 16237680],\n                [24, 16237681],\n                [25, 16237682],\n                [26, 16237683],\n                [27, 16237684],\n                [28, 16237685],\n                [29, 16237686],\n                [30, 16237687],\n                [31, 16237688],\n                [32, 16237689],\n                [33, 16237690],\n                [34, 16237691],\n                [35, 16237692],\n                [36, 16237693],\n                [37, 16237694],\n                [38, 16237695],\n                [39, 16237696],\n                [40, 16237697],\n                [41, 16237698],\n                [42, 16237699],\n                [43, 16237700],\n                [44, 16237701],\n                [45, 16237702],\n                [46, 16237703],\n                [47, 16237704],\n                [48, 16237705],\n                [49, 16237706],\n                [50, 16237707]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [9, 16255012],\n                [10, 16255013],\n                [11, 16255014],\n                [12, 16255015],\n                [13, 16255016],\n                [14, 16255017],\n                [15, 16255018],\n                [16, 16255019],\n                [17, 16255020],\n                [18, 16255021],\n                [19, 16255022],\n                [20, 16255023],\n                [21, 16255024],\n                [22, 16255025],\n                [23, 16255026],\n                [24, 16255027],\n                [25, 16255028],\n                [26, 16255029],\n                [27, 16255030],\n                [28, 16255031],\n                [29, 16255032],\n                [30, 16255033],\n                [31, 16255034],\n                [32, 16255035],\n                [33, 16255036],\n                [34, 16255037],\n                [35, 16255038],\n                [36, 16255039],\n                [37, 16255040],\n                [38, 16255041],\n                [39, 16255042],\n                [40, 16255043],\n                [41, 16255044],\n                [42, 16255045],\n                [43, 16255046],\n                [44, 16255047],\n                [45, 16255048],\n                [46, 16255049],\n                [47, 16255050],\n                [48, 16255051],\n                [49, 16255052],\n                [50, 16255053]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 16255391],\n                [1, 16255392],\n                [2, 16255393],\n                [3, 16255394],\n                [4, 16255395],\n                [5, 16255396],\n                [6, 16255397],\n                [7, 16255398],\n                [8, 16255399],\n                [9, 16255400],\n                [10, 16255401],\n                [11, 16255402],\n                [12, 16255403],\n                [13, 16255404],\n                [14, 16255405],\n                [15, 16255406],\n                [16, 16255407],\n                [17, 16255408],\n                [18, 16255409],\n                [19, 16255410],\n                [20, 16255411],\n                [21, 16255412],\n                [22, 16255413],\n                [23, 16255414],\n                [24, 16255415],\n                [25, 16255416],\n                [26, 16255417],\n                [27, 16255418],\n                [28, 16255419],\n                [29, 16255420],\n                [30, 16255421],\n                [31, 16255422],\n                [32, 16255423],\n                [33, 16255424],\n                [34, 16255425],\n                [35, 16255426],\n                [36, 16255427],\n                [37, 16255428],\n                [38, 16255429],\n                [39, 16255430],\n                [40, 16255431],\n                [41, 16255432],\n                [42, 16255433],\n                [43, 16255434],\n                [44, 16255435],\n                [45, 16255436],\n                [46, 16255437],\n                [47, 16255438],\n                [48, 16255439],\n                [49, 16255440],\n                [50, 16255441]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 16255392],\n                [1, 16255393],\n                [2, 16255394],\n                [3, 16255395],\n                [4, 16255396],\n                [5, 16255397],\n                [6, 16255398],\n                [7, 16255399],\n                [8, 16255400],\n                [9, 16255401],\n                [10, 16255402],\n                [11, 16255403],\n                [12, 16255404],\n                [13, 16255405],\n                [14, 16255406],\n                [15, 16255407],\n                [16, 16255408],\n                [17, 16255409],\n                [18, 16255410],\n                [19, 16255411],\n                [20, 16255412],\n                [21, 16255413],\n                [22, 16255414],\n                [23, 16255415],\n                [24, 16255416],\n                [25, 16255417],\n                [26, 16255418],\n                [27, 16255419],\n                [28, 16255420],\n                [29, 16255421],\n                [30, 16255422],\n                [31, 16255423],\n                [32, 16255424],\n                [33, 16255425],\n                [34, 16255426],\n                [35, 16255427],\n                [36, 16255428],\n                [37, 16255429],\n                [38, 16255430],\n                [39, 16255431],\n                [40, 16255432],\n                [41, 16255433],\n                [42, 16255434],\n                [43, 16255435],\n                [44, 16255436],\n                [45, 16255437],\n                [46, 16255438],\n                [47, 16255439],\n                [48, 16255440],\n                [49, 16255441]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 16256084],\n                [1, 16256085],\n                [2, 16256086],\n                [3, 16256087],\n                [4, 16256088],\n                [5, 16256089],\n                [6, 16256090],\n                [7, 16256091],\n                [8, 16256092],\n                [9, 16256093],\n                [10, 16256094],\n                [11, 16256095],\n                [12, 16256096],\n                [13, 16256097],\n                [14, 16256098],\n                [15, 16256099],\n                [16, 16256100],\n                [17, 16256101],\n                [18, 16256102],\n                [19, 16256103],\n                [20, 16256104],\n                [21, 16256105],\n                [22, 16256106],\n                [23, 16256107],\n                [24, 16256108],\n                [25, 16256109],\n                [26, 16256110],\n                [27, 16256111],\n                [28, 16256112],\n                [29, 16256113],\n                [30, 16256114],\n                [31, 16256115],\n                [32, 16256116],\n                [33, 16256117],\n                [34, 16256118],\n                [35, 16256119],\n                [36, 16256120],\n                [37, 16256121],\n                [38, 16256122],\n                [39, 16256123],\n                [40, 16256124],\n                [41, 16256125],\n                [42, 16256126],\n                [43, 16256127],\n                [44, 16256128]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [3, 16256224],\n                [4, 16256225],\n                [5, 16256226],\n                [6, 16256227],\n                [7, 16256228],\n                [8, 16256229],\n                [9, 16256230],\n                [10, 16256231],\n                [11, 16256232],\n                [12, 16256233],\n                [13, 16256234],\n                [14, 16256235],\n                [15, 16256236],\n                [16, 16256237],\n                [17, 16256238],\n                [18, 16256239],\n                [19, 16256240],\n                [20, 16256241],\n                [21, 16256242],\n                [22, 16256243],\n                [23, 16256244],\n                [24, 16256245],\n                [25, 16256246],\n                [26, 16256247],\n                [27, 16256248],\n                [28, 16256249],\n                [29, 16256250],\n                [30, 16256251],\n                [31, 16256252],\n                [32, 16256253],\n                [33, 16256254],\n                [34, 16256255],\n                [35, 16256256],\n                [36, 16256257],\n                [37, 16256258],\n                [38, 16256259],\n                [39, 16256260],\n                [40, 16256261],\n                [41, 16256262],\n                [42, 16256263],\n                [43, 16256264],\n                [44, 16256265],\n                [45, 16256266],\n                [46, 16256267],\n                [47, 16256268],\n                [48, 16256269],\n                [49, 16256270],\n                [50, 16256271]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 16325199],\n                [1, 16325200],\n                [2, 16325201],\n                [3, 16325202],\n                [4, 16325203],\n                [5, 16325204],\n                [6, 16325205],\n                [7, 16325206],\n                [8, 16325207],\n                [9, 16325208],\n                [10, 16325209],\n                [11, 16325210],\n                [12, 16325211],\n                [13, 16325212],\n                [14, 16325213],\n                [15, 16325214],\n                [16, 16325215],\n                [17, 16325216],\n                [18, 16325217],\n                [19, 16325218],\n                [20, 16325219],\n                [21, 16325220],\n                [22, 16325221],\n                [23, 16325222],\n                [24, 16325223],\n                [25, 16325224],\n                [26, 16325225],\n                [27, 16325226],\n                [28, 16325227],\n                [29, 16325228],\n                [30, 16325229],\n                [31, 16325230],\n                [32, 16325231],\n                [33, 16325232],\n                [34, 16325233],\n                [35, 16325234],\n                [36, 16325235],\n                [37, 16325236],\n                [38, 16325237],\n                [39, 16325238],\n                [40, 16325239],\n                [41, 16325240]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [13, 16352865],\n                [14, 16352866],\n                [15, 16352867],\n                [16, 16352868],\n                [17, 16352869],\n                [18, 16352870],\n                [19, 16352871],\n                [20, 16352872],\n                [21, 16352873],\n                [22, 16352874],\n                [23, 16352875],\n                [24, 16352876],\n                [25, 16352877],\n                [26, 16352878],\n                [27, 16352879],\n                [28, 16352880],\n                [29, 16352881],\n                [30, 16352882],\n                [31, 16352883],\n                [32, 16352884],\n                [33, 16352885],\n                [34, 16352886],\n                [35, 16352887],\n                [36, 16352888],\n                [37, 16352889],\n                [38, 16352890],\n                [39, 16352891],\n                [40, 16352892],\n                [41, 16352893],\n                [42, 16352894],\n                [43, 16352895],\n                [44, 16352896],\n                [45, 16352897],\n                [46, 16352898],\n                [47, 16352899],\n                [48, 16352900],\n                [49, 16352901],\n                [50, 16352902]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 16352968],\n                [1, 16352969],\n                [2, 16352970],\n                [3, 16352971],\n                [4, 16352972],\n                [5, 16352973],\n                [6, 16352974],\n                [7, 16352975],\n                [8, 16352976],\n                [9, 16352977],\n                [10, 16352978],\n                [11, 16352979],\n                [12, 16352980],\n                [13, 16352981],\n                [14, 16352982],\n                [15, 16352983],\n                [16, 16352984],\n                [17, 16352985],\n                [18, 16352986],\n                [19, 16352987],\n                [20, 16352988],\n                [21, 16352989],\n                [22, 16352990],\n                [23, 16352991],\n                [24, 16352992],\n                [25, 16352993],\n                [26, 16352994],\n                [27, 16352995],\n                [28, 16352996],\n                [29, 16352997],\n                [30, 16352998],\n                [31, 16352999],\n                [32, 16353000],\n                [33, 16353001],\n                [34, 16353002],\n                [35, 16353003],\n                [36, 16353004],\n                [37, 16353005],\n                [38, 16353006],\n                [39, 16353007],\n                [40, 16353008],\n                [41, 16353009],\n                [42, 16353010],\n                [43, 16353011]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [5, 16414998],\n                [6, 16414999],\n                [7, 16415000],\n                [8, 16415001],\n                [9, 16415002],\n                [10, 16415003],\n                [11, 16415004],\n                [12, 16415005],\n                [13, 16415006],\n                [14, 16415007],\n                [15, 16415008],\n                [16, 16415009],\n                [17, 16415010],\n                [18, 16415011],\n                [19, 16415012],\n                [20, 16415013],\n                [21, 16415014],\n                [22, 16415015],\n                [23, 16415016],\n                [24, 16415017],\n                [25, 16415018],\n                [26, 16415019],\n                [27, 16415020],\n                [28, 16415021],\n                [29, 16415022],\n                [30, 16415023],\n                [31, 16415024],\n                [32, 16415025],\n                [33, 16415026],\n                [34, 16415027],\n                [35, 16415028],\n                [36, 16415029],\n                [37, 16415030],\n                [38, 16415031],\n                [39, 16415032],\n                [40, 16415033],\n                [41, 16415034],\n                [42, 16415035],\n                [43, 16415036],\n                [44, 16415037],\n                [45, 16415038],\n                [46, 16415039],\n                [47, 16415040],\n                [48, 16415041],\n                [49, 16415042],\n                [50, 16415043]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 17031591],\n                [1, 17031592],\n                [2, 17031593],\n                [3, 17031594],\n                [4, 17031595],\n                [5, 17031596],\n                [6, 17031597],\n                [7, 17031598],\n                [8, 17031599],\n                [9, 17031600],\n                [10, 17031601],\n                [11, 17031602],\n                [12, 17031603],\n                [13, 17031604],\n                [14, 17031605],\n                [15, 17031606],\n                [16, 17031607],\n                [17, 17031608],\n                [18, 17031609],\n                [19, 17031610],\n                [20, 17031611],\n                [21, 17031612],\n                [22, 17031613],\n                [27, 17031614],\n                [28, 17031615],\n                [29, 17031616],\n                [30, 17031617],\n                [31, 17031618],\n                [32, 17031619],\n                [33, 17031620],\n                [34, 17031621],\n                [35, 17031622],\n                [36, 17031623],\n                [37, 17031624],\n                [38, 17031625],\n                [39, 17031626],\n                [40, 17031627],\n                [41, 17031628],\n                [42, 17031629],\n                [43, 17031630],\n                [44, 17031631],\n                [45, 17031632],\n                [46, 17031633],\n                [47, 17031634],\n                [48, 17031635],\n                [49, 17031636],\n                [50, 17031637]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 17057382],\n                [1, 17057383],\n                [2, 17057384],\n                [3, 17057385],\n                [4, 17057386],\n                [5, 17057387],\n                [6, 17057388],\n                [7, 17057389],\n                [8, 17057390],\n                [9, 17057391],\n                [10, 17057392],\n                [11, 17057393],\n                [12, 17057394],\n                [13, 17057395],\n                [14, 17057396],\n                [15, 17057397],\n                [16, 17057398],\n                [17, 17057399],\n                [19, 17057400],\n                [20, 17057401],\n                [21, 17057402],\n                [22, 17057403],\n                [23, 17057404],\n                [24, 17057405],\n                [25, 17057406],\n                [26, 17057407],\n                [27, 17057408],\n                [28, 17057409],\n                [29, 17057410],\n                [30, 17057411],\n                [31, 17057412],\n                [32, 17057413],\n                [33, 17057414],\n                [34, 17057415],\n                [35, 17057416],\n                [36, 17057417],\n                [37, 17057418],\n                [38, 17057419],\n                [39, 17057420],\n                [40, 17057421],\n                [41, 17057422],\n                [42, 17057423],\n                [43, 17057424],\n                [44, 17057425],\n                [45, 17057426],\n                [46, 17057427],\n                [47, 17057428],\n                [48, 17057429],\n                [49, 17057430],\n                [50, 17057431]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 17092766],\n                [1, 17092767],\n                [2, 17092768],\n                [3, 17092769],\n                [4, 17092770],\n                [5, 17092771],\n                [6, 17092772],\n                [7, 17092773],\n                [8, 17092774],\n                [9, 17092775],\n                [10, 17092776],\n                [11, 17092777],\n                [12, 17092778],\n                [13, 17092779],\n                [14, 17092780],\n                [15, 17092781],\n                [16, 17092782],\n                [17, 17094966],\n                [18, 17094967],\n                [19, 17094968],\n                [20, 17094969],\n                [21, 17094970],\n                [22, 17094971],\n                [23, 17094972],\n                [24, 17094973],\n                [25, 17094974],\n                [26, 17094975],\n                [27, 17094976],\n                [28, 17094977],\n                [29, 17094978],\n                [30, 17094979],\n                [31, 17094980],\n                [32, 17094981],\n                [33, 17094982],\n                [34, 17094983],\n                [35, 17094984],\n                [36, 17094985],\n                [37, 17094986],\n                [38, 17094987],\n                [39, 17094988],\n                [40, 17094989],\n                [41, 17094990],\n                [42, 17094991],\n                [43, 17094992],\n                [44, 17094993],\n                [45, 17094994],\n                [46, 17094995],\n                [47, 17094996],\n                [48, 17094997],\n                [49, 17094998],\n                [50, 17094999]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 17092782],\n                [1, 17094966],\n                [2, 17094967],\n                [3, 17094968],\n                [4, 17094969],\n                [5, 17094970],\n                [6, 17094971],\n                [7, 17094972],\n                [8, 17094973],\n                [9, 17094974],\n                [10, 17094975],\n                [11, 17094976],\n                [12, 17094977],\n                [13, 17094978],\n                [14, 17094979],\n                [15, 17094980],\n                [16, 17094981],\n                [17, 17094982],\n                [18, 17094983],\n                [19, 17094984],\n                [20, 17094985],\n                [21, 17094986],\n                [22, 17094987],\n                [23, 17094988],\n                [24, 17094989],\n                [25, 17094990],\n                [26, 17094991],\n                [27, 17094992],\n                [28, 17094993],\n                [29, 17094994],\n                [30, 17094995],\n                [31, 17094996],\n                [32, 17094997],\n                [33, 17094998],\n                [34, 17094999],\n                [35, 17095000],\n                [36, 17095001],\n                [37, 17095002],\n                [38, 17095003],\n                [39, 17095004],\n                [40, 17095005],\n                [41, 17095006],\n                [42, 17095007],\n                [43, 17095008],\n                [44, 17095009],\n                [45, 17095010],\n                [46, 17095011],\n                [47, 17095012],\n                [48, 17095013],\n                [49, 17095014],\n                [50, 17095015]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 17092782],\n                [1, 17094966],\n                [2, 17094967],\n                [3, 17094968],\n                [4, 17094969],\n                [5, 17094970],\n                [6, 17094971],\n                [7, 17094972],\n                [8, 17094973],\n                [9, 17094974],\n                [10, 17094975],\n                [11, 17094976],\n                [12, 17094977],\n                [13, 17094978],\n                [14, 17094979],\n                [15, 17094980],\n                [16, 17094981],\n                [17, 17094982],\n                [18, 17094983],\n                [19, 17094984],\n                [20, 17094985],\n                [21, 17094986],\n                [22, 17094987],\n                [23, 17094988],\n                [24, 17094989],\n                [25, 17094990],\n                [26, 17094991],\n                [27, 17094992],\n                [28, 17094993],\n                [29, 17094994],\n                [30, 17094995],\n                [31, 17094996],\n                [32, 17094997],\n                [33, 17094998],\n                [34, 17094999],\n                [35, 17095000],\n                [36, 17095001],\n                [37, 17095002],\n                [38, 17095003],\n                [39, 17095004],\n                [40, 17095005],\n                [41, 17095006],\n                [42, 17095007],\n                [43, 17095008],\n                [44, 17095009],\n                [45, 17095010],\n                [46, 17095011],\n                [47, 17095012],\n                [48, 17095013],\n                [49, 17095014],\n                [50, 17095015]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [9, 17137287],\n                [10, 17137288],\n                [11, 17137289],\n                [12, 17137290],\n                [13, 17137291],\n                [14, 17137292],\n                [15, 17137293],\n                [16, 17137294],\n                [17, 17137295],\n                [18, 17137296],\n                [19, 17137297],\n                [20, 17137298],\n                [21, 17137299],\n                [22, 17137300],\n                [23, 17137301],\n                [24, 17137302],\n                [25, 17137303],\n                [26, 17137304],\n                [27, 17137305],\n                [28, 17137306],\n                [29, 17137307],\n                [30, 17137308],\n                [31, 17137309],\n                [32, 17137310],\n                [33, 17137311],\n                [34, 17137312],\n                [35, 17137313],\n                [36, 17137314],\n                [37, 17137315],\n                [38, 17137316],\n                [39, 17137317],\n                [40, 17137318],\n                [41, 17137319]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [2, 17306238],\n                [3, 17306239],\n                [4, 17306240],\n                [5, 17306241],\n                [6, 17306242],\n                [7, 17306243],\n                [8, 17306244],\n                [9, 17306245],\n                [10, 17306246],\n                [11, 17306247],\n                [12, 17306248],\n                [13, 17306249],\n                [14, 17306250],\n                [15, 17306251],\n                [16, 17306252],\n                [17, 17306253],\n                [18, 17306254],\n                [19, 17306255],\n                [20, 17306256],\n                [21, 17306257],\n                [22, 17306258],\n                [23, 17306259],\n                [24, 17306260],\n                [25, 17306261],\n                [26, 17306262],\n                [27, 17306263],\n                [28, 17306264],\n                [29, 17306265],\n                [30, 17306266],\n                [31, 17306267],\n                [32, 17306268],\n                [33, 17306269],\n                [34, 17306270],\n                [35, 17306271],\n                [36, 17306272],\n                [37, 17306273],\n                [38, 17306274],\n                [39, 17306275],\n                [40, 17306276],\n                [41, 17306277],\n                [42, 17306278],\n                [43, 17306279],\n                [44, 17306280],\n                [45, 17306281],\n                [46, 17306282],\n                [47, 17306283],\n                [48, 17306284],\n                [49, 17306285]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [4, 17561868],\n                [5, 17561869],\n                [6, 17561870],\n                [7, 17561871],\n                [8, 17561872],\n                [9, 17561873],\n                [10, 17561874],\n                [11, 17561875],\n                [12, 17561876],\n                [13, 17561877],\n                [14, 17561878],\n                [15, 17561879],\n                [16, 17561880],\n                [17, 17561881],\n                [18, 17561882],\n                [19, 17561883],\n                [20, 17561884],\n                [21, 17561885],\n                [22, 17561886],\n                [23, 17561887],\n                [24, 17561888],\n                [25, 17561889],\n                [26, 17561890],\n                [27, 17561891],\n                [28, 17561892],\n                [29, 17561893],\n                [30, 17561894],\n                [31, 17561895],\n                [32, 17561896],\n                [33, 17561897],\n                [34, 17561898],\n                [35, 17561899],\n                [36, 17561900],\n                [37, 17561901],\n                [38, 17561902],\n                [39, 17561903],\n                [40, 17561904],\n                [41, 17561905],\n                [42, 17561906],\n                [43, 17561907],\n                [44, 17561908],\n                [45, 17561909],\n                [46, 17561910],\n                [47, 17561911],\n                [48, 17561912]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 17566078],\n                [1, 17566079],\n                [2, 17566080],\n                [3, 17566081],\n                [4, 17566082],\n                [5, 17566083],\n                [6, 17566084],\n                [7, 17566085],\n                [8, 17566086],\n                [9, 17566087],\n                [10, 17566088],\n                [11, 17566089],\n                [12, 17566090],\n                [13, 17566091],\n                [14, 17566092],\n                [15, 17566093],\n                [16, 17566094],\n                [17, 17566095],\n                [18, 17566096],\n                [19, 17566097],\n                [20, 17566098],\n                [21, 17566099],\n                [22, 17566100],\n                [23, 17566101],\n                [24, 17566102],\n                [25, 17566103],\n                [26, 17566104],\n                [27, 17566105],\n                [28, 17566106],\n                [29, 17566107],\n                [30, 17566108],\n                [31, 17566109],\n                [32, 17566110],\n                [33, 17566111],\n                [34, 17566112],\n                [35, 17566113],\n                [36, 17566114],\n                [37, 17566115],\n                [38, 17566116],\n                [39, 17566117],\n                [40, 17566118],\n                [41, 17577951],\n                [42, 17577952],\n                [43, 17577953],\n                [44, 17577954],\n                [45, 17577955],\n                [46, 17577956],\n                [47, 17577957],\n                [48, 17577958],\n                [49, 17577959],\n                [50, 17577960]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 17566108],\n                [1, 17566109],\n                [2, 17566110],\n                [3, 17566111],\n                [4, 17566112],\n                [5, 17566113],\n                [6, 17566114],\n                [7, 17566115],\n                [8, 17566116],\n                [9, 17566117],\n                [10, 17566118],\n                [11, 17577951],\n                [12, 17577952],\n                [13, 17577953],\n                [14, 17577954],\n                [15, 17577955],\n                [16, 17577956],\n                [17, 17577957],\n                [18, 17577958],\n                [19, 17577959],\n                [20, 17577960],\n                [21, 17577961],\n                [22, 17577962],\n                [23, 17577963],\n                [24, 17577964],\n                [25, 17577965],\n                [26, 17577966],\n                [27, 17577967],\n                [28, 17577968],\n                [29, 17577969],\n                [30, 17577970],\n                [31, 17577971],\n                [32, 17577972],\n                [33, 17577973],\n                [34, 17577974],\n                [35, 17577975],\n                [36, 17578686],\n                [37, 17578687],\n                [38, 17578688],\n                [39, 17578689],\n                [40, 17578690],\n                [41, 17578691],\n                [42, 17578692],\n                [43, 17578693],\n                [44, 17578694],\n                [45, 17578695],\n                [46, 17578696],\n                [47, 17578697],\n                [48, 17578698],\n                [49, 17578699],\n                [50, 17578700]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 17566111],\n                [1, 17566112],\n                [2, 17566113],\n                [3, 17566114],\n                [4, 17566115],\n                [5, 17566116],\n                [6, 17566117],\n                [7, 17566118],\n                [8, 17577951],\n                [9, 17577952],\n                [10, 17577953],\n                [11, 17577954],\n                [12, 17577955],\n                [13, 17577956],\n                [14, 17577957],\n                [15, 17577958],\n                [16, 17577959],\n                [17, 17577960],\n                [18, 17577961],\n                [19, 17577962],\n                [20, 17577963],\n                [21, 17577964],\n                [22, 17577965],\n                [23, 17577966],\n                [24, 17577967],\n                [25, 17577968],\n                [26, 17577969],\n                [27, 17577970],\n                [28, 17577971],\n                [29, 17577972],\n                [30, 17577973],\n                [31, 17577974],\n                [32, 17577975],\n                [33, 17578686],\n                [34, 17578687],\n                [35, 17578688],\n                [36, 17578689],\n                [37, 17578690],\n                [38, 17578691],\n                [39, 17578692],\n                [40, 17578693],\n                [41, 17578694],\n                [42, 17578695],\n                [43, 17578696],\n                [44, 17578697],\n                [45, 17578698],\n                [46, 17578699],\n                [47, 17578700],\n                [48, 17578701],\n                [49, 17578702],\n                [50, 17578703]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 17566111],\n                [1, 17566112],\n                [2, 17566113],\n                [3, 17566114],\n                [4, 17566115],\n                [5, 17566116],\n                [6, 17566117],\n                [7, 17566118],\n                [8, 17577951],\n                [9, 17577952],\n                [10, 17577953],\n                [11, 17577954],\n                [12, 17577955],\n                [13, 17577956],\n                [14, 17577957],\n                [15, 17577958],\n                [16, 17577959],\n                [17, 17577960],\n                [18, 17577961],\n                [19, 17577962],\n                [20, 17577963],\n                [21, 17577964],\n                [22, 17577965],\n                [23, 17577966],\n                [24, 17577967],\n                [25, 17577968],\n                [26, 17577969],\n                [27, 17577970],\n                [28, 17577971],\n                [29, 17577972],\n                [30, 17577973],\n                [31, 17577974],\n                [32, 17577975],\n                [33, 17578686],\n                [34, 17578687],\n                [35, 17578688],\n                [36, 17578689],\n                [37, 17578690],\n                [38, 17578691],\n                [39, 17578692],\n                [40, 17578693],\n                [41, 17578694],\n                [42, 17578695],\n                [43, 17578696],\n                [44, 17578697],\n                [45, 17578698],\n                [46, 17578699],\n                [47, 17578700],\n                [48, 17578701],\n                [49, 17578702],\n                [50, 17578703]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 17566111],\n                [1, 17566112],\n                [2, 17566113],\n                [3, 17566114],\n                [4, 17566115],\n                [5, 17566116],\n                [6, 17566117],\n                [7, 17566118],\n                [8, 17577951],\n                [9, 17577952],\n                [10, 17577953],\n                [11, 17577954],\n                [12, 17577955],\n                [13, 17577956],\n                [14, 17577957],\n                [15, 17577958],\n                [16, 17577959],\n                [17, 17577960],\n                [18, 17577961],\n                [19, 17577962],\n                [20, 17577963],\n                [21, 17577964],\n                [22, 17577965],\n                [23, 17577966],\n                [24, 17577967],\n                [25, 17577968],\n                [26, 17577969],\n                [27, 17577970],\n                [28, 17577971],\n                [29, 17577972],\n                [30, 17577973],\n                [31, 17577974],\n                [32, 17577975],\n                [33, 17578686],\n                [34, 17578687],\n                [35, 17578688],\n                [36, 17578689],\n                [37, 17578690],\n                [38, 17578691],\n                [39, 17578692],\n                [40, 17578693],\n                [41, 17578694],\n                [42, 17578695],\n                [43, 17578696],\n                [44, 17578697],\n                [45, 17578698],\n                [46, 17578699],\n                [47, 17578700],\n                [48, 17578701],\n                [49, 17578702],\n                [50, 17578703]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 17566111],\n                [1, 17566112],\n                [2, 17566113],\n                [3, 17566114],\n                [4, 17566115],\n                [5, 17566116],\n                [6, 17566117],\n                [7, 17566118],\n                [8, 17577951],\n                [9, 17577952],\n                [10, 17577953],\n                [11, 17577954],\n                [12, 17577955],\n                [13, 17577956],\n                [14, 17577957],\n                [15, 17577958],\n                [16, 17577959],\n                [17, 17577960],\n                [18, 17577961],\n                [19, 17577962],\n                [20, 17577963],\n                [21, 17577964],\n                [22, 17577965],\n                [23, 17577966],\n                [24, 17577967],\n                [25, 17577968],\n                [26, 17577969],\n                [27, 17577970],\n                [28, 17577971],\n                [29, 17577972],\n                [30, 17577973],\n                [31, 17577974],\n                [32, 17577975],\n                [33, 17578686],\n                [34, 17578687],\n                [35, 17578688],\n                [36, 17578689],\n                [37, 17578690],\n                [38, 17578691],\n                [39, 17578692],\n                [40, 17578693],\n                [41, 17578694],\n                [42, 17578695],\n                [43, 17578696],\n                [44, 17578697],\n                [45, 17578698],\n                [46, 17578699],\n                [47, 17578700],\n                [48, 17578701],\n                [49, 17578702],\n                [50, 17578703]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 17566112],\n                [1, 17566113],\n                [2, 17566114],\n                [3, 17566115],\n                [4, 17566116],\n                [5, 17566117],\n                [6, 17566118],\n                [7, 17577951],\n                [8, 17577952],\n                [9, 17577953],\n                [10, 17577954],\n                [11, 17577955],\n                [12, 17577956],\n                [13, 17577957],\n                [14, 17577958],\n                [15, 17577959],\n                [16, 17577960],\n                [17, 17577961],\n                [18, 17577962],\n                [19, 17577963],\n                [20, 17577964],\n                [21, 17577965],\n                [22, 17577966],\n                [23, 17577967],\n                [24, 17577968],\n                [25, 17577969],\n                [26, 17577970],\n                [27, 17577971],\n                [28, 17577972],\n                [29, 17577973],\n                [30, 17577974],\n                [31, 17577975],\n                [32, 17578686],\n                [33, 17578687],\n                [34, 17578688],\n                [35, 17578689],\n                [36, 17578690],\n                [37, 17578691],\n                [38, 17578692],\n                [39, 17578693],\n                [40, 17578694],\n                [41, 17578695],\n                [42, 17578696],\n                [43, 17578697],\n                [44, 17578698],\n                [45, 17578699],\n                [46, 17578700],\n                [47, 17578701],\n                [48, 17578702],\n                [49, 17578703],\n                [50, 17578704]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 17566113],\n                [1, 17566114],\n                [2, 17566115],\n                [3, 17566116],\n                [4, 17566117],\n                [5, 17566118],\n                [6, 17577951],\n                [7, 17577952],\n                [8, 17577953],\n                [9, 17577954],\n                [10, 17577955],\n                [11, 17577956],\n                [12, 17577957],\n                [13, 17577958],\n                [14, 17577959],\n                [15, 17577960],\n                [16, 17577961],\n                [17, 17577962],\n                [18, 17577963],\n                [19, 17577964],\n                [20, 17577965],\n                [21, 17577966],\n                [22, 17577967],\n                [23, 17577968],\n                [24, 17577969],\n                [25, 17577970],\n                [26, 17577971],\n                [27, 17577972],\n                [28, 17577973],\n                [29, 17577974],\n                [30, 17577975],\n                [31, 17578686],\n                [32, 17578687],\n                [33, 17578688],\n                [34, 17578689],\n                [35, 17578690],\n                [36, 17578691],\n                [37, 17578692],\n                [38, 17578693],\n                [39, 17578694],\n                [40, 17578695],\n                [41, 17578696],\n                [42, 17578697],\n                [43, 17578698],\n                [44, 17578699],\n                [45, 17578700],\n                [46, 17578701],\n                [47, 17578702],\n                [48, 17578703],\n                [49, 17578704],\n                [50, 17578705]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 17566113],\n                [1, 17566114],\n                [2, 17566115],\n                [3, 17566116],\n                [4, 17566117],\n                [5, 17566118],\n                [6, 17577951],\n                [7, 17577952],\n                [8, 17577953],\n                [9, 17577954],\n                [10, 17577955],\n                [11, 17577956],\n                [12, 17577957],\n                [13, 17577958],\n                [14, 17577959],\n                [15, 17577960],\n                [16, 17577961],\n                [17, 17577962],\n                [18, 17577963],\n                [19, 17577964],\n                [20, 17577965],\n                [21, 17577966],\n                [22, 17577967],\n                [23, 17577968],\n                [24, 17577969],\n                [25, 17577970],\n                [26, 17577971],\n                [27, 17577972],\n                [28, 17577973],\n                [29, 17577974],\n                [30, 17577975],\n                [31, 17578686],\n                [32, 17578687],\n                [33, 17578688],\n                [34, 17578689],\n                [35, 17578690],\n                [36, 17578691],\n                [37, 17578692],\n                [38, 17578693],\n                [39, 17578694],\n                [40, 17578695],\n                [41, 17578696],\n                [42, 17578697],\n                [43, 17578698],\n                [44, 17578699],\n                [45, 17578700],\n                [46, 17578701],\n                [47, 17578702],\n                [48, 17578703],\n                [49, 17578704],\n                [50, 17578705]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [1, 17579733],\n                [2, 17579734],\n                [3, 17579735],\n                [4, 17579736],\n                [5, 17579737],\n                [6, 17579738],\n                [7, 17579739],\n                [8, 17579740],\n                [9, 17579741],\n                [10, 17579742],\n                [11, 17579743],\n                [12, 17579744],\n                [13, 17579745],\n                [14, 17579746],\n                [15, 17579747],\n                [16, 17579748],\n                [17, 17579749],\n                [18, 17579750],\n                [19, 17579751],\n                [20, 17579752],\n                [21, 17579753],\n                [22, 17579754],\n                [23, 17579755],\n                [24, 17579756],\n                [25, 17579757],\n                [26, 17579758],\n                [27, 17579759],\n                [28, 17579760],\n                [29, 17579761],\n                [30, 17579762],\n                [31, 17579763],\n                [32, 17579764],\n                [33, 17579765],\n                [34, 17579766],\n                [35, 17579767],\n                [36, 17579768],\n                [37, 17579769],\n                [38, 17579770],\n                [39, 17579771],\n                [40, 17579772],\n                [41, 17579773],\n                [42, 17579774],\n                [43, 17579775],\n                [44, 17579776],\n                [45, 17581244],\n                [46, 17581245],\n                [47, 17581246],\n                [48, 17581247],\n                [49, 17581248],\n                [50, 17581249]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 17581369],\n                [1, 17581370],\n                [2, 17582885],\n                [3, 17582886],\n                [4, 17582887],\n                [5, 17582888],\n                [6, 17582889],\n                [7, 17582890],\n                [8, 17582891],\n                [9, 17582892],\n                [10, 17582893],\n                [11, 17582894],\n                [12, 17582895],\n                [13, 17582896],\n                [14, 17582897],\n                [15, 17582898],\n                [16, 17582899],\n                [17, 17582900],\n                [18, 17582901],\n                [19, 17582902],\n                [20, 17582903],\n                [21, 17582904],\n                [22, 17582905],\n                [23, 17582906],\n                [24, 17582907],\n                [25, 17582908],\n                [26, 17582909],\n                [27, 17582910],\n                [28, 17582911],\n                [29, 17582912],\n                [30, 17582913],\n                [31, 17582914],\n                [32, 17582915],\n                [33, 17582916],\n                [34, 17582917],\n                [35, 17582918],\n                [36, 17582919],\n                [37, 17582920],\n                [38, 17582921],\n                [39, 17582922],\n                [40, 17582923],\n                [41, 17582924],\n                [42, 17582925],\n                [43, 17582926],\n                [44, 17582927],\n                [45, 17582928],\n                [46, 17582929],\n                [47, 17582930],\n                [48, 17582931],\n                [49, 17582932],\n                [50, 17583028]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 17581370],\n                [1, 17582885],\n                [2, 17582886],\n                [3, 17582887],\n                [4, 17582888],\n                [5, 17582889],\n                [6, 17582890],\n                [7, 17582891],\n                [8, 17582892],\n                [9, 17582893],\n                [10, 17582894],\n                [11, 17582895],\n                [12, 17582896],\n                [13, 17582897],\n                [14, 17582898],\n                [15, 17582899],\n                [16, 17582900],\n                [17, 17582901],\n                [18, 17582902],\n                [19, 17582903],\n                [20, 17582904],\n                [21, 17582905],\n                [22, 17582906],\n                [23, 17582907],\n                [24, 17582908],\n                [25, 17582909],\n                [26, 17582910],\n                [27, 17582911],\n                [28, 17582912],\n                [29, 17582913],\n                [30, 17582914],\n                [31, 17582915],\n                [32, 17582916],\n                [33, 17582917],\n                [34, 17582918],\n                [35, 17582919],\n                [36, 17582920],\n                [37, 17582921],\n                [38, 17582922],\n                [39, 17582923],\n                [40, 17582924],\n                [41, 17582925],\n                [42, 17582926],\n                [43, 17582927],\n                [44, 17582928],\n                [45, 17582929],\n                [46, 17582930],\n                [47, 17582931],\n                [48, 17582932],\n                [49, 17583028],\n                [50, 17583029]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 17581370],\n                [1, 17582885],\n                [2, 17582886],\n                [3, 17582887],\n                [4, 17582888],\n                [5, 17582889],\n                [6, 17582890],\n                [7, 17582891],\n                [8, 17582892],\n                [9, 17582893],\n                [10, 17582894],\n                [11, 17582895],\n                [12, 17582896],\n                [13, 17582897],\n                [14, 17582898],\n                [15, 17582899],\n                [16, 17582900],\n                [17, 17582901],\n                [18, 17582902],\n                [19, 17582903],\n                [20, 17582904],\n                [21, 17582905],\n                [22, 17582906],\n                [23, 17582907],\n                [24, 17582908],\n                [25, 17582909],\n                [26, 17582910],\n                [27, 17582911],\n                [28, 17582912],\n                [29, 17582913],\n                [30, 17582914],\n                [31, 17582915],\n                [32, 17582916],\n                [33, 17582917],\n                [34, 17582918],\n                [35, 17582919],\n                [36, 17582920],\n                [37, 17582921],\n                [38, 17582922],\n                [39, 17582923],\n                [40, 17582924],\n                [41, 17582925],\n                [42, 17582926],\n                [43, 17582927],\n                [44, 17582928],\n                [45, 17582929],\n                [46, 17582930],\n                [47, 17582931],\n                [48, 17582932],\n                [49, 17583028],\n                [50, 17583029]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [1, 17582911],\n                [2, 17582912],\n                [3, 17582913],\n                [4, 17582914],\n                [5, 17582915],\n                [6, 17582916],\n                [7, 17582917],\n                [8, 17582918],\n                [9, 17582919],\n                [10, 17582920],\n                [11, 17582921],\n                [12, 17582922],\n                [13, 17582923],\n                [14, 17582924],\n                [15, 17582925],\n                [16, 17582926],\n                [17, 17582927],\n                [18, 17582928],\n                [19, 17582929],\n                [20, 17582930],\n                [21, 17582931],\n                [22, 17582932],\n                [23, 17583028],\n                [24, 17583029],\n                [25, 17583030],\n                [26, 17583031],\n                [27, 17583032],\n                [28, 17583033],\n                [29, 17583034],\n                [30, 17583035],\n                [31, 17583036],\n                [32, 17583037],\n                [33, 17583038],\n                [34, 17583039],\n                [35, 17583040],\n                [36, 17583041],\n                [37, 17583042],\n                [38, 17583043],\n                [39, 17583044],\n                [40, 17583045],\n                [41, 17583046],\n                [42, 17583047],\n                [43, 17583048],\n                [44, 17583049],\n                [45, 17583050],\n                [46, 17583051],\n                [47, 17583052],\n                [48, 17583053],\n                [49, 17583054],\n                [50, 17583055]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 17588621],\n                [1, 17588622],\n                [2, 17588623],\n                [3, 17588624],\n                [4, 17588625],\n                [5, 17588626],\n                [6, 17588627],\n                [7, 17588628],\n                [8, 17588629],\n                [9, 17588630],\n                [10, 17588631],\n                [11, 17588632],\n                [12, 17588633],\n                [13, 17588634],\n                [14, 17588635],\n                [15, 17588636],\n                [16, 17588637],\n                [17, 17588638],\n                [18, 17588639],\n                [19, 17588640],\n                [20, 17588641],\n                [21, 17588642],\n                [22, 17588643],\n                [23, 17588644],\n                [24, 17588645],\n                [25, 17588646],\n                [26, 17588647],\n                [27, 17588648],\n                [28, 17588649],\n                [29, 17588650],\n                [30, 17588651],\n                [31, 17588652],\n                [32, 17588653],\n                [33, 17588654],\n                [34, 17588655],\n                [35, 17588656],\n                [36, 17588657],\n                [37, 17589196],\n                [38, 17589197],\n                [39, 17589198],\n                [40, 17589199],\n                [41, 17589200],\n                [42, 17589201],\n                [43, 17589202],\n                [44, 17589203],\n                [45, 17589204],\n                [46, 17589205],\n                [47, 17589206],\n                [48, 17589207],\n                [49, 17589208]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 17588621],\n                [1, 17588622],\n                [2, 17588623],\n                [3, 17588624],\n                [4, 17588625],\n                [5, 17588626],\n                [6, 17588627],\n                [7, 17588628],\n                [8, 17588629],\n                [9, 17588630],\n                [10, 17588631],\n                [11, 17588632],\n                [12, 17588633],\n                [13, 17588634],\n                [14, 17588635],\n                [15, 17588636],\n                [16, 17588637],\n                [17, 17588638],\n                [18, 17588639],\n                [19, 17588640],\n                [20, 17588641],\n                [21, 17588642],\n                [22, 17588643],\n                [23, 17588644],\n                [24, 17588645],\n                [25, 17588646],\n                [26, 17588647],\n                [27, 17588648],\n                [28, 17588649],\n                [29, 17588650],\n                [30, 17588651],\n                [31, 17588652],\n                [32, 17588653],\n                [33, 17588654],\n                [34, 17588655],\n                [35, 17588656],\n                [36, 17588657],\n                [37, 17589196],\n                [38, 17589197],\n                [39, 17589198],\n                [40, 17589199],\n                [41, 17589200],\n                [42, 17589201],\n                [43, 17589202],\n                [44, 17589203],\n                [45, 17589204],\n                [46, 17589205],\n                [47, 17589206],\n                [48, 17589207],\n                [49, 17589208]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 17588621],\n                [1, 17588622],\n                [2, 17588623],\n                [3, 17588624],\n                [4, 17588625],\n                [5, 17588626],\n                [6, 17588627],\n                [7, 17588628],\n                [8, 17588629],\n                [9, 17588630],\n                [10, 17588631],\n                [11, 17588632],\n                [12, 17588633],\n                [13, 17588634],\n                [14, 17588635],\n                [15, 17588636],\n                [16, 17588637],\n                [17, 17588638],\n                [18, 17588639],\n                [19, 17588640],\n                [20, 17588641],\n                [21, 17588642],\n                [22, 17588643],\n                [23, 17588644],\n                [24, 17588645],\n                [25, 17588646],\n                [26, 17588647],\n                [27, 17588648],\n                [28, 17588649],\n                [29, 17588650],\n                [30, 17588651],\n                [31, 17588652],\n                [32, 17588653],\n                [33, 17588654],\n                [34, 17588655],\n                [35, 17588656],\n                [36, 17588657],\n                [37, 17589196],\n                [38, 17589197],\n                [39, 17589198],\n                [40, 17589199],\n                [41, 17589200],\n                [42, 17589201],\n                [43, 17589202],\n                [44, 17589203],\n                [45, 17589204],\n                [46, 17589205],\n                [47, 17589206],\n                [48, 17589207],\n                [49, 17589208]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [1, 17591770],\n                [2, 17591771],\n                [3, 17591772],\n                [4, 17591773],\n                [5, 17591774],\n                [6, 17591775],\n                [7, 17591776],\n                [8, 17591777],\n                [9, 17591778],\n                [10, 17591779],\n                [11, 17591780],\n                [12, 17591781],\n                [13, 17591782],\n                [14, 17591783],\n                [15, 17591784],\n                [16, 17591785],\n                [17, 17591786],\n                [18, 17591787],\n                [19, 17591788],\n                [20, 17591789],\n                [21, 17591790],\n                [22, 17591791],\n                [23, 17591792],\n                [24, 17591793],\n                [25, 17591794],\n                [26, 17591796],\n                [27, 17591797],\n                [28, 17591798],\n                [29, 17591799],\n                [30, 17591800],\n                [31, 17591801],\n                [32, 17591802],\n                [33, 17591803],\n                [34, 17591804],\n                [35, 17591805],\n                [36, 17591806],\n                [37, 17591807],\n                [38, 17591808],\n                [39, 17591809],\n                [40, 17591810],\n                [41, 17591811],\n                [42, 17591812],\n                [43, 17591813],\n                [44, 17591814],\n                [45, 17591815],\n                [46, 17591816],\n                [47, 17591817],\n                [48, 17591818],\n                [49, 17591819],\n                [50, 17591820]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 17593855],\n                [1, 17593856],\n                [2, 17593857],\n                [3, 17593858],\n                [4, 17593859],\n                [5, 17593860],\n                [6, 17593861],\n                [7, 17593862],\n                [8, 17593863],\n                [9, 17593864],\n                [10, 17593865],\n                [11, 17593866],\n                [12, 17593867],\n                [13, 17593868],\n                [14, 17593869],\n                [15, 17593870],\n                [16, 17593871],\n                [17, 17593872],\n                [18, 17593873],\n                [19, 17593874],\n                [20, 17593875],\n                [21, 17593876],\n                [22, 17593877],\n                [23, 17593878],\n                [24, 17593880],\n                [25, 17593881],\n                [26, 17593882],\n                [27, 17593883],\n                [28, 17593884],\n                [29, 17593885],\n                [30, 17593886],\n                [31, 17593887],\n                [32, 17593888],\n                [33, 17593889],\n                [34, 17593890],\n                [35, 17593891],\n                [36, 17593892],\n                [37, 17593893],\n                [38, 17593894],\n                [39, 17593895],\n                [40, 17593896],\n                [41, 17593897],\n                [42, 17593898],\n                [43, 17593899],\n                [44, 17593900],\n                [45, 17593901],\n                [46, 17593902],\n                [47, 17593903]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 17593863],\n                [1, 17593864],\n                [2, 17593865],\n                [3, 17593866],\n                [4, 17593867],\n                [5, 17593868],\n                [6, 17593869],\n                [7, 17593870],\n                [8, 17593871],\n                [9, 17593872],\n                [10, 17593873],\n                [11, 17593874],\n                [12, 17593875],\n                [13, 17593876],\n                [14, 17593877],\n                [15, 17593878],\n                [16, 17593880],\n                [17, 17593881],\n                [18, 17593882],\n                [19, 17593883],\n                [20, 17593884],\n                [21, 17593885],\n                [22, 17593886],\n                [23, 17593887],\n                [24, 17593888],\n                [25, 17593889],\n                [26, 17593890],\n                [27, 17593891],\n                [28, 17593892],\n                [29, 17593893],\n                [30, 17593894],\n                [31, 17593895],\n                [32, 17593896],\n                [33, 17593897],\n                [34, 17593898],\n                [35, 17593899],\n                [36, 17593900],\n                [37, 17593901],\n                [38, 17593902],\n                [39, 17593903],\n                [40, 17593904],\n                [41, 17593905],\n                [42, 17593906],\n                [43, 17593907]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [11, 17596476],\n                [12, 17596477],\n                [13, 17596478],\n                [14, 17596479],\n                [15, 17596480],\n                [16, 17596481],\n                [17, 17596482],\n                [19, 17596483],\n                [20, 17596484],\n                [21, 17596485],\n                [22, 17596486],\n                [23, 17596487],\n                [24, 17596488],\n                [25, 17596489],\n                [26, 17596490],\n                [27, 17596491],\n                [28, 17596492],\n                [29, 17596493],\n                [30, 17596494],\n                [31, 17596495],\n                [32, 17596496],\n                [33, 17596497],\n                [34, 17596498],\n                [35, 17596499],\n                [36, 17596500],\n                [37, 17596501],\n                [38, 17596502],\n                [39, 17596503],\n                [40, 17596504],\n                [41, 17596505],\n                [42, 17596506],\n                [43, 17596507],\n                [44, 17596508],\n                [45, 17596509],\n                [46, 17596510],\n                [47, 17596511],\n                [48, 17596512],\n                [49, 17596513],\n                [50, 17596514]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [5, 17624012],\n                [6, 17624013],\n                [7, 17624014],\n                [8, 17624015],\n                [9, 17624016],\n                [10, 17624017],\n                [11, 17624018],\n                [12, 17624019],\n                [13, 17624020],\n                [14, 17625913],\n                [15, 17625914],\n                [16, 17625915],\n                [17, 17625916],\n                [18, 17625917],\n                [19, 17625918],\n                [20, 17625919],\n                [21, 17625920],\n                [22, 17625921],\n                [23, 17625922],\n                [24, 17625923],\n                [25, 17625924],\n                [26, 17625925],\n                [27, 17625926],\n                [28, 17625927],\n                [29, 17625928],\n                [30, 17625929],\n                [31, 17625930],\n                [32, 17625931],\n                [33, 17625932],\n                [34, 17625933],\n                [35, 17625934],\n                [36, 17625935],\n                [37, 17625936],\n                [38, 17625937],\n                [39, 17625938],\n                [40, 17625939],\n                [41, 17625940],\n                [42, 17625941],\n                [43, 17625942],\n                [44, 17625943],\n                [45, 17625944],\n                [46, 17625945],\n                [47, 17625946],\n                [48, 17625947],\n                [49, 17625948],\n                [50, 17625949]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [2, 17624012],\n                [3, 17624013],\n                [4, 17624014],\n                [5, 17624015],\n                [6, 17624016],\n                [7, 17624017],\n                [8, 17624018],\n                [9, 17624019],\n                [10, 17624020],\n                [11, 17625913],\n                [12, 17625914],\n                [13, 17625915],\n                [14, 17625916],\n                [15, 17625917],\n                [16, 17625918],\n                [17, 17625919],\n                [18, 17625920],\n                [19, 17625921],\n                [20, 17625922],\n                [21, 17625923],\n                [22, 17625924],\n                [23, 17625925],\n                [24, 17625926],\n                [25, 17625927],\n                [26, 17625928],\n                [27, 17625929],\n                [28, 17625930],\n                [29, 17625931],\n                [30, 17625932],\n                [31, 17625933],\n                [32, 17625934],\n                [33, 17625935],\n                [34, 17625936],\n                [35, 17625937],\n                [36, 17625938],\n                [37, 17625939],\n                [38, 17625940],\n                [39, 17625941],\n                [40, 17625942],\n                [41, 17625943],\n                [42, 17625944],\n                [43, 17625945],\n                [44, 17625946],\n                [45, 17625947],\n                [46, 17625948],\n                [47, 17625949],\n                [48, 17625950],\n                [49, 17625951],\n                [50, 17625952]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [1, 31796700],\n                [2, 31796701],\n                [3, 31796702],\n                [4, 31796703],\n                [5, 31796704],\n                [6, 31796705],\n                [7, 31796706],\n                [8, 31796710],\n                [9, 31796711],\n                [10, 31796712],\n                [11, 31796713],\n                [12, 31796714],\n                [13, 31796715],\n                [14, 31796716],\n                [15, 31796717],\n                [16, 31796718],\n                [17, 31796719],\n                [18, 31796720],\n                [19, 31796721],\n                [20, 31796722],\n                [21, 31796723],\n                [22, 31796724],\n                [23, 31796725],\n                [24, 31796726],\n                [25, 31796727],\n                [26, 31796728],\n                [27, 31799014],\n                [28, 31799015],\n                [29, 31799016],\n                [30, 31799017],\n                [31, 31799018],\n                [32, 31799019],\n                [33, 31799020],\n                [34, 31799021],\n                [35, 31799022],\n                [36, 31799023],\n                [37, 31799024],\n                [38, 31799025],\n                [39, 31799026],\n                [40, 31799027],\n                [41, 31799028],\n                [42, 31799029],\n                [43, 31799030],\n                [44, 31799031],\n                [45, 31799032],\n                [46, 31799033],\n                [47, 31799034],\n                [48, 31799035],\n                [49, 31799036],\n                [50, 31799037]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [0, 36722692],\n                [1, 36722693],\n                [2, 36722694],\n                [3, 36722695],\n                [4, 36722696],\n                [5, 36722697],\n                [6, 36722698],\n                [7, 36722699],\n                [8, 36722700],\n                [9, 36722701],\n                [10, 36722702],\n                [11, 36722703],\n                [12, 36722704],\n                [13, 36722705],\n                [14, 36723505],\n                [15, 36723506],\n                [16, 36723507],\n                [17, 36723508],\n                [18, 36723509],\n                [19, 36723510],\n                [20, 36723511],\n                [21, 36723512],\n                [22, 36723513],\n                [23, 36723514],\n                [24, 36723515],\n                [25, 36723516],\n                [26, 36723517],\n                [27, 36723518],\n                [28, 36723519],\n                [29, 36723520],\n                [30, 36723521],\n                [31, 36723522],\n                [32, 36723523],\n                [33, 36723524],\n                [34, 36723525],\n                [35, 36723526],\n                [36, 36723527],\n                [37, 36723528],\n                [38, 36723529],\n                [39, 36723530],\n                [40, 36723531],\n                [41, 36723532],\n                [42, 36737414],\n                [43, 36737415],\n                [44, 36737416],\n                [45, 36737417],\n                [46, 36737418],\n                [47, 36737419],\n                [48, 36737420]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [4, 44587963],\n                [5, 44587964],\n                [6, 44587965],\n                [7, 44587966],\n                [8, 44587967],\n                [9, 44587968],\n                [10, 44587969],\n                [11, 44587970],\n                [12, 44587971],\n                [13, 44587972],\n                [14, 44587973],\n                [15, 44587974],\n                [16, 44587975],\n                [17, 44587976],\n                [18, 44587977],\n                [19, 44587978],\n                [20, 44587979],\n                [21, 44587980],\n                [22, 44587981],\n                [23, 44587982],\n                [24, 44587983],\n                [25, 44589680],\n                [26, 44589681],\n                [27, 44589682],\n                [28, 44589683],\n                [29, 44589684],\n                [30, 44589685],\n                [31, 44589686],\n                [32, 44589687],\n                [33, 44589688],\n                [34, 44589689],\n                [35, 44589690],\n                [36, 44589691],\n                [37, 44589692],\n                [38, 44589693],\n                [39, 44589694],\n                [40, 44589695],\n                [41, 44589696],\n                [42, 44589697],\n                [43, 44589698],\n                [44, 44589699],\n                [45, 44589700],\n                [46, 44589701],\n                [47, 44589702],\n                [48, 44592034],\n                [49, 44592035],\n                [50, 44592036]\n            ]\n        );\n    }\n\n    #[test]\n    fn test_aligned_pairs_full() {\n        let mut bam = bam::Reader::from_path(\"./test/test_spliced_reads.bam\").unwrap();\n        let mut it = bam.records();\n\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [Some(0), None],\n                [Some(1), None],\n                [Some(2), None],\n                [Some(3), None],\n                [Some(4), None],\n                [Some(5), None],\n                [Some(6), Some(16050676)],\n                [Some(7), Some(16050677)],\n                [Some(8), Some(16050678)],\n                [Some(9), Some(16050679)],\n                [Some(10), Some(16050680)],\n                [Some(11), Some(16050681)],\n                [Some(12), Some(16050682)],\n                [Some(13), Some(16050683)],\n                [Some(14), Some(16050684)],\n                [Some(15), Some(16050685)],\n                [Some(16), Some(16050686)],\n                [Some(17), Some(16050687)],\n                [Some(18), Some(16050688)],\n                [Some(19), Some(16050689)],\n                [Some(20), Some(16050690)],\n                [Some(21), Some(16050691)],\n                [Some(22), Some(16050692)],\n                [Some(23), Some(16050693)],\n                [Some(24), Some(16050694)],\n                [Some(25), Some(16050695)],\n                [Some(26), Some(16050696)],\n                [Some(27), Some(16050697)],\n                [Some(28), Some(16050698)],\n                [Some(29), Some(16050699)],\n                [Some(30), Some(16050700)],\n                [Some(31), Some(16050701)],\n                [Some(32), Some(16050702)],\n                [Some(33), Some(16050703)],\n                [Some(34), Some(16050704)],\n                [Some(35), Some(16050705)],\n                [Some(36), Some(16050706)],\n                [Some(37), Some(16050707)],\n                [Some(38), Some(16050708)],\n                [Some(39), Some(16050709)],\n                [Some(40), Some(16050710)],\n                [Some(41), Some(16050711)],\n                [Some(42), Some(16050712)],\n                [Some(43), Some(16050713)],\n                [Some(44), Some(16050714)],\n                [Some(45), Some(16050715)],\n                [Some(46), Some(16050716)],\n                [Some(47), Some(16050717)],\n                [Some(48), Some(16050718)],\n                [Some(49), Some(16050719)],\n                [Some(50), Some(16050720)]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [Some(0), Some(16096878)],\n                [Some(1), Some(16096879)],\n                [Some(2), Some(16096880)],\n                [Some(3), Some(16096881)],\n                [Some(4), Some(16096882)],\n                [Some(5), Some(16096883)],\n                [Some(6), Some(16096884)],\n                [None, Some(16096885)],\n                [None, Some(16096886)],\n                [Some(7), Some(16096887)],\n                [Some(8), Some(16096888)],\n                [Some(9), Some(16096889)],\n                [Some(10), Some(16096890)],\n                [Some(11), Some(16096891)],\n                [Some(12), Some(16096892)],\n                [Some(13), Some(16096893)],\n                [Some(14), Some(16096894)],\n                [Some(15), Some(16096895)],\n                [Some(16), Some(16096896)],\n                [Some(17), Some(16096897)],\n                [Some(18), Some(16096898)],\n                [Some(19), Some(16096899)],\n                [Some(20), Some(16096900)],\n                [Some(21), Some(16096901)],\n                [Some(22), Some(16096902)],\n                [Some(23), Some(16096903)],\n                [Some(24), Some(16096904)],\n                [Some(25), Some(16096905)],\n                [Some(26), Some(16096906)],\n                [Some(27), Some(16096907)],\n                [Some(28), Some(16096908)],\n                [Some(29), Some(16096909)],\n                [Some(30), Some(16096910)],\n                [Some(31), Some(16096911)],\n                [Some(32), Some(16096912)],\n                [Some(33), Some(16096913)],\n                [Some(34), Some(16096914)],\n                [Some(35), Some(16096915)],\n                [Some(36), Some(16096916)],\n                [Some(37), Some(16096917)],\n                [Some(38), Some(16096918)],\n                [Some(39), Some(16096919)],\n                [Some(40), Some(16096920)],\n                [Some(41), Some(16096921)],\n                [Some(42), Some(16096922)],\n                [Some(43), Some(16096923)],\n                [Some(44), Some(16096924)],\n                [Some(45), Some(16096925)],\n                [Some(46), Some(16096926)],\n                [Some(47), Some(16096927)],\n                [Some(48), Some(16096928)],\n                [Some(49), Some(16096929)],\n                [Some(50), Some(16096930)]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [Some(0), Some(16097145)],\n                [Some(1), Some(16097146)],\n                [Some(2), Some(16097147)],\n                [Some(3), Some(16097148)],\n                [Some(4), Some(16097149)],\n                [Some(5), Some(16097150)],\n                [Some(6), Some(16097151)],\n                [Some(7), Some(16097152)],\n                [Some(8), Some(16097153)],\n                [Some(9), Some(16097154)],\n                [Some(10), Some(16097155)],\n                [Some(11), Some(16097156)],\n                [Some(12), Some(16097157)],\n                [Some(13), Some(16097158)],\n                [Some(14), Some(16097159)],\n                [Some(15), Some(16097160)],\n                [Some(16), Some(16097161)],\n                [Some(17), Some(16097162)],\n                [Some(18), Some(16097163)],\n                [Some(19), Some(16097164)],\n                [Some(20), Some(16097165)],\n                [Some(21), Some(16097166)],\n                [Some(22), Some(16097167)],\n                [Some(23), Some(16097168)],\n                [Some(24), Some(16097169)],\n                [Some(25), Some(16097170)],\n                [Some(26), Some(16097171)],\n                [Some(27), Some(16097172)],\n                [Some(28), Some(16097173)],\n                [None, Some(16097174)],\n                [None, Some(16097175)],\n                [Some(29), Some(16097176)],\n                [Some(30), Some(16097177)],\n                [Some(31), Some(16097178)],\n                [Some(32), Some(16097179)],\n                [Some(33), Some(16097180)],\n                [Some(34), Some(16097181)],\n                [Some(35), Some(16097182)],\n                [Some(36), Some(16097183)],\n                [Some(37), Some(16097184)],\n                [Some(38), Some(16097185)],\n                [Some(39), Some(16097186)],\n                [Some(40), Some(16097187)],\n                [Some(41), Some(16097188)],\n                [Some(42), Some(16097189)],\n                [Some(43), Some(16097190)],\n                [Some(44), Some(16097191)],\n                [Some(45), Some(16097192)],\n                [Some(46), Some(16097193)],\n                [Some(47), Some(16097194)],\n                [Some(48), Some(16097195)],\n                [Some(49), Some(16097196)],\n                [Some(50), Some(16097197)]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [Some(0), Some(16117350)],\n                [Some(1), Some(16117351)],\n                [Some(2), Some(16117352)],\n                [Some(3), Some(16117353)],\n                [Some(4), Some(16117354)],\n                [Some(5), Some(16117355)],\n                [Some(6), Some(16117356)],\n                [Some(7), Some(16117357)],\n                [Some(8), Some(16117358)],\n                [Some(9), Some(16117359)],\n                [Some(10), Some(16117360)],\n                [Some(11), Some(16117361)],\n                [Some(12), Some(16117362)],\n                [Some(13), Some(16117363)],\n                [Some(14), Some(16117364)],\n                [Some(15), Some(16117365)],\n                [Some(16), Some(16117366)],\n                [Some(17), Some(16117367)],\n                [Some(18), Some(16117368)],\n                [Some(19), Some(16117369)],\n                [Some(20), Some(16117370)],\n                [Some(21), Some(16117371)],\n                [Some(22), Some(16117372)],\n                [Some(23), Some(16117373)],\n                [Some(24), Some(16117374)],\n                [Some(25), Some(16117375)],\n                [Some(26), Some(16117376)],\n                [Some(27), Some(16117377)],\n                [Some(28), Some(16117378)],\n                [Some(29), Some(16117379)],\n                [Some(30), Some(16117380)],\n                [Some(31), Some(16117381)],\n                [Some(32), Some(16117382)],\n                [Some(33), Some(16117383)],\n                [Some(34), Some(16117384)],\n                [Some(35), Some(16117385)],\n                [Some(36), Some(16117386)],\n                [Some(37), Some(16117387)],\n                [Some(38), Some(16117388)],\n                [Some(39), Some(16117389)],\n                [Some(40), Some(16117390)],\n                [Some(41), Some(16117391)],\n                [Some(42), Some(16117392)],\n                [Some(43), Some(16117393)],\n                [Some(44), Some(16117394)],\n                [Some(45), Some(16117395)],\n                [Some(46), Some(16117396)],\n                [Some(47), Some(16117397)],\n                [Some(48), Some(16117398)],\n                [Some(49), Some(16117399)],\n                [Some(50), Some(16117400)]\n            ]\n        );\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(\n            pairs,\n            vec![\n                [Some(0), Some(16118483)],\n                [Some(1), Some(16118484)],\n                [Some(2), Some(16118485)],\n                [Some(3), Some(16118486)],\n                [Some(4), Some(16118487)],\n                [Some(5), Some(16118488)],\n                [Some(6), Some(16118489)],\n                [Some(7), Some(16118490)],\n                [Some(8), Some(16118491)],\n                [Some(9), Some(16118492)],\n                [Some(10), Some(16118493)],\n                [Some(11), Some(16118494)],\n                [Some(12), Some(16118495)],\n                [Some(13), Some(16118496)],\n                [Some(14), Some(16118497)],\n                [Some(15), Some(16118498)],\n                [Some(16), Some(16118499)],\n                [Some(17), Some(16118500)],\n                [Some(18), Some(16118501)],\n                [Some(19), Some(16118502)],\n                [Some(20), Some(16118503)],\n                [Some(21), Some(16118504)],\n                [Some(22), Some(16118505)],\n                [Some(23), Some(16118506)],\n                [Some(24), Some(16118507)],\n                [Some(25), Some(16118508)],\n                [Some(26), Some(16118509)],\n                [Some(27), Some(16118510)],\n                [Some(28), Some(16118511)],\n                [Some(29), Some(16118512)],\n                [Some(30), Some(16118513)],\n                [Some(31), Some(16118514)],\n                [Some(32), Some(16118515)],\n                [Some(33), Some(16118516)],\n                [Some(34), Some(16118517)],\n                [Some(35), Some(16118518)],\n                [Some(36), Some(16118519)],\n                [Some(37), Some(16118520)],\n                [Some(38), Some(16118521)],\n                [Some(39), Some(16118522)],\n                [Some(40), Some(16118523)],\n                [Some(41), Some(16118524)],\n                [Some(42), Some(16118525)],\n                [Some(43), Some(16118526)],\n                [Some(44), Some(16118527)],\n                [Some(45), Some(16118528)],\n                [Some(46), Some(16118529)],\n                [Some(47), Some(16118530)],\n                [Some(48), Some(16118531)],\n                [Some(49), Some(16118532)],\n                [Some(50), Some(16118533)]\n            ]\n        );\n\n        //\n        //for the rest, we just verify that they have the expected amount of None in each position\n        fn some_count(pairs: &[[Option<i64>; 2]], pos: usize) -> i64 {\n            pairs.iter().filter(|x| x[pos].is_some()).count() as i64\n        }\n        fn none_count(pairs: &[[Option<i64>; 2]], pos: usize) -> i64 {\n            pairs.iter().filter(|x| x[pos].is_none()).count() as i64\n        }\n\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 0);\n        assert_eq!(some_count(&pairs, 1), 51);\n        assert_eq!(none_count(&pairs, 1), 0);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 0);\n        assert_eq!(some_count(&pairs, 1), 51);\n        assert_eq!(none_count(&pairs, 1), 0);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 0);\n        assert_eq!(some_count(&pairs, 1), 51);\n        assert_eq!(none_count(&pairs, 1), 0);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 0);\n        assert_eq!(some_count(&pairs, 1), 51);\n        assert_eq!(none_count(&pairs, 1), 0);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 0);\n        assert_eq!(some_count(&pairs, 1), 45);\n        assert_eq!(none_count(&pairs, 1), 6);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 0);\n        assert_eq!(some_count(&pairs, 1), 41);\n        assert_eq!(none_count(&pairs, 1), 10);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 0);\n        assert_eq!(some_count(&pairs, 1), 51);\n        assert_eq!(none_count(&pairs, 1), 0);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 0);\n        assert_eq!(some_count(&pairs, 1), 51);\n        assert_eq!(none_count(&pairs, 1), 0);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 0);\n        assert_eq!(some_count(&pairs, 1), 51);\n        assert_eq!(none_count(&pairs, 1), 0);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 0);\n        assert_eq!(some_count(&pairs, 1), 51);\n        assert_eq!(none_count(&pairs, 1), 0);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 0);\n        assert_eq!(some_count(&pairs, 1), 42);\n        assert_eq!(none_count(&pairs, 1), 9);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 0);\n        assert_eq!(some_count(&pairs, 1), 51);\n        assert_eq!(none_count(&pairs, 1), 0);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 0);\n        assert_eq!(some_count(&pairs, 1), 50);\n        assert_eq!(none_count(&pairs, 1), 1);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 0);\n        assert_eq!(some_count(&pairs, 1), 45);\n        assert_eq!(none_count(&pairs, 1), 6);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 0);\n        assert_eq!(some_count(&pairs, 1), 48);\n        assert_eq!(none_count(&pairs, 1), 3);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 0);\n        assert_eq!(some_count(&pairs, 1), 42);\n        assert_eq!(none_count(&pairs, 1), 9);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 0);\n        assert_eq!(some_count(&pairs, 1), 38);\n        assert_eq!(none_count(&pairs, 1), 13);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 0);\n        assert_eq!(some_count(&pairs, 1), 44);\n        assert_eq!(none_count(&pairs, 1), 7);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 0);\n        assert_eq!(some_count(&pairs, 1), 46);\n        assert_eq!(none_count(&pairs, 1), 5);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 0);\n        assert_eq!(some_count(&pairs, 1), 47);\n        assert_eq!(none_count(&pairs, 1), 4);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 0);\n        assert_eq!(some_count(&pairs, 1), 50);\n        assert_eq!(none_count(&pairs, 1), 1);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 2183);\n        assert_eq!(some_count(&pairs, 1), 2234);\n        assert_eq!(none_count(&pairs, 1), 0);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 2183);\n        assert_eq!(some_count(&pairs, 1), 2234);\n        assert_eq!(none_count(&pairs, 1), 0);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 2183);\n        assert_eq!(some_count(&pairs, 1), 2234);\n        assert_eq!(none_count(&pairs, 1), 0);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 0);\n        assert_eq!(some_count(&pairs, 1), 33);\n        assert_eq!(none_count(&pairs, 1), 18);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 0);\n        assert_eq!(some_count(&pairs, 1), 48);\n        assert_eq!(none_count(&pairs, 1), 3);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 0);\n        assert_eq!(some_count(&pairs, 1), 45);\n        assert_eq!(none_count(&pairs, 1), 6);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 11832);\n        assert_eq!(some_count(&pairs, 1), 11883);\n        assert_eq!(none_count(&pairs, 1), 0);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 12542);\n        assert_eq!(some_count(&pairs, 1), 12593);\n        assert_eq!(none_count(&pairs, 1), 0);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 12542);\n        assert_eq!(some_count(&pairs, 1), 12593);\n        assert_eq!(none_count(&pairs, 1), 0);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 12542);\n        assert_eq!(some_count(&pairs, 1), 12593);\n        assert_eq!(none_count(&pairs, 1), 0);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 12542);\n        assert_eq!(some_count(&pairs, 1), 12593);\n        assert_eq!(none_count(&pairs, 1), 0);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 12542);\n        assert_eq!(some_count(&pairs, 1), 12593);\n        assert_eq!(none_count(&pairs, 1), 0);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 12542);\n        assert_eq!(some_count(&pairs, 1), 12593);\n        assert_eq!(none_count(&pairs, 1), 0);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 12542);\n        assert_eq!(some_count(&pairs, 1), 12593);\n        assert_eq!(none_count(&pairs, 1), 0);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 12542);\n        assert_eq!(some_count(&pairs, 1), 12593);\n        assert_eq!(none_count(&pairs, 1), 0);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 1467);\n        assert_eq!(some_count(&pairs, 1), 1517);\n        assert_eq!(none_count(&pairs, 1), 1);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 1609);\n        assert_eq!(some_count(&pairs, 1), 1660);\n        assert_eq!(none_count(&pairs, 1), 0);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 1609);\n        assert_eq!(some_count(&pairs, 1), 1660);\n        assert_eq!(none_count(&pairs, 1), 0);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 1609);\n        assert_eq!(some_count(&pairs, 1), 1660);\n        assert_eq!(none_count(&pairs, 1), 0);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 95);\n        assert_eq!(some_count(&pairs, 1), 145);\n        assert_eq!(none_count(&pairs, 1), 1);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 538);\n        assert_eq!(some_count(&pairs, 1), 588);\n        assert_eq!(none_count(&pairs, 1), 1);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 538);\n        assert_eq!(some_count(&pairs, 1), 588);\n        assert_eq!(none_count(&pairs, 1), 1);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 538);\n        assert_eq!(some_count(&pairs, 1), 588);\n        assert_eq!(none_count(&pairs, 1), 1);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 1);\n        assert_eq!(some_count(&pairs, 1), 51);\n        assert_eq!(none_count(&pairs, 1), 1);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 1);\n        assert_eq!(some_count(&pairs, 1), 49);\n        assert_eq!(none_count(&pairs, 1), 3);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 1);\n        assert_eq!(some_count(&pairs, 1), 45);\n        assert_eq!(none_count(&pairs, 1), 7);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 0);\n        assert_eq!(some_count(&pairs, 1), 39);\n        assert_eq!(none_count(&pairs, 1), 12);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 1892);\n        assert_eq!(some_count(&pairs, 1), 1938);\n        assert_eq!(none_count(&pairs, 1), 5);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 1892);\n        assert_eq!(some_count(&pairs, 1), 1941);\n        assert_eq!(none_count(&pairs, 1), 2);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 2288);\n        assert_eq!(some_count(&pairs, 1), 2338);\n        assert_eq!(none_count(&pairs, 1), 1);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 14680);\n        assert_eq!(some_count(&pairs, 1), 14729);\n        assert_eq!(none_count(&pairs, 1), 2);\n        let pairs: Vec<_> = it.next().unwrap().unwrap().aligned_pairs_full().collect();\n        assert_eq!(some_count(&pairs, 0), 51);\n        assert_eq!(none_count(&pairs, 0), 4027);\n        assert_eq!(some_count(&pairs, 1), 4074);\n        assert_eq!(none_count(&pairs, 1), 4);\n    }\n\n    #[test]\n    fn test_aligned_block_pairs() {\n        let mut bam = bam::Reader::from_path(\"./test/test_spliced_reads.bam\").unwrap();\n        let mut it = bam.records();\n\n        let read = it.next().unwrap().unwrap();\n        let pairs: Vec<_> = read.aligned_pairs().collect();\n        let block_pairs: Vec<_> = read.aligned_block_pairs().collect();\n\n        //first coordinates identical\n        assert_eq!(pairs[0][0], block_pairs[0].0[0]); //read\n        assert_eq!(pairs[0][1], block_pairs[0].1[0]); // genomic\n\n        //end coordinates are + 1, so the ranges are the same...\n        assert_eq!(\n            pairs[pairs.len() - 1][0],\n            block_pairs[block_pairs.len() - 1].0[1] - 1\n        );\n        assert_eq!(\n            pairs[pairs.len() - 1][1],\n            block_pairs[block_pairs.len() - 1].1[1] - 1\n        );\n\n        //let's see if they're really identical\n        for read in it {\n            let read = read.unwrap();\n            let pairs: Vec<_> = read.aligned_pairs().collect();\n            let block_pairs: Vec<_> = read.aligned_block_pairs().collect();\n            let mut ii = 0;\n            for ([read_start, read_stop], [genome_start, genome_stop]) in block_pairs {\n                assert_eq!(read_stop - read_start, genome_stop - genome_start);\n                for (read_pos, genome_pos) in (read_start..read_stop).zip(genome_start..genome_stop)\n                {\n                    assert_eq!(pairs[ii][0], read_pos);\n                    assert_eq!(pairs[ii][1], genome_pos);\n                    ii += 1;\n                }\n            }\n        }\n    }\n\n    #[test]\n    fn test_get_cigar_stats() {\n        let mut bam = bam::Reader::from_path(\"./test/test_spliced_reads.bam\").unwrap();\n        let mut it = bam.records();\n\n        fn to_arr(hm: HashMap<Cigar, i32>) -> [i32; 9] {\n            [\n                *hm.get(&Cigar::Match(0)).unwrap(),\n                *hm.get(&Cigar::Ins(0)).unwrap(),\n                *hm.get(&Cigar::Del(0)).unwrap(),\n                *hm.get(&Cigar::RefSkip(0)).unwrap(),\n                *hm.get(&Cigar::SoftClip(0)).unwrap(),\n                *hm.get(&Cigar::HardClip(0)).unwrap(),\n                *hm.get(&Cigar::Pad(0)).unwrap(),\n                *hm.get(&Cigar::Equal(0)).unwrap(),\n                *hm.get(&Cigar::Diff(0)).unwrap(),\n            ]\n        }\n\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [45, 0, 0, 0, 6, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 1, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 2, 0, 0, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [2, 0, 1, 0, 0, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 2, 0, 0, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [2, 0, 1, 0, 0, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 0, 0, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 0, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 0, 0, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 0, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 0, 0, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 0, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 0, 0, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 0, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 0, 0, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 0, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 0, 0, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 0, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [45, 0, 0, 0, 6, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 1, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [41, 0, 0, 0, 10, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 1, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 0, 0, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 0, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 0, 0, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 0, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 0, 0, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 0, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 0, 0, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 0, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [42, 0, 0, 0, 9, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 1, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 0, 0, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 0, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [50, 0, 0, 0, 1, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 1, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [45, 0, 0, 0, 6, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 1, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [48, 0, 0, 0, 3, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 1, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [42, 0, 0, 0, 9, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 1, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [38, 0, 0, 0, 13, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 1, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [44, 0, 0, 0, 7, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 1, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [46, 0, 0, 0, 5, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 1, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [47, 4, 0, 0, 0, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [2, 1, 0, 0, 0, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [50, 1, 0, 0, 0, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [2, 1, 0, 0, 0, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 2183, 0, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [2, 0, 0, 1, 0, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 2183, 0, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [2, 0, 0, 1, 0, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 2183, 0, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [2, 0, 0, 1, 0, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [33, 0, 0, 0, 18, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 2, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [48, 0, 0, 0, 3, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 2, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [45, 0, 0, 0, 6, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [1, 0, 0, 0, 2, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 11832, 0, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [2, 0, 0, 1, 0, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 12542, 0, 0, 0, 0, 0],);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [3, 0, 0, 2, 0, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 12542, 0, 0, 0, 0, 0],);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [3, 0, 0, 2, 0, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 12542, 0, 0, 0, 0, 0],);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [3, 0, 0, 2, 0, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 12542, 0, 0, 0, 0, 0],);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [3, 0, 0, 2, 0, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 12542, 0, 0, 0, 0, 0],);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [3, 0, 0, 2, 0, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 12542, 0, 0, 0, 0, 0],);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [3, 0, 0, 2, 0, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 12542, 0, 0, 0, 0, 0],);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [3, 0, 0, 2, 0, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 12542, 0, 0, 0, 0, 0],);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [3, 0, 0, 2, 0, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [50, 0, 0, 1467, 1, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [2, 0, 0, 1, 1, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 1609, 0, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [3, 0, 0, 2, 0, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 1609, 0, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [3, 0, 0, 2, 0, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [51, 0, 0, 1609, 0, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [3, 0, 0, 2, 0, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [50, 0, 0, 95, 1, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [2, 0, 0, 1, 1, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [50, 0, 0, 538, 1, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [2, 0, 0, 1, 1, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [50, 0, 0, 538, 1, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [2, 0, 0, 1, 1, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [50, 0, 0, 538, 1, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [2, 0, 0, 1, 1, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [50, 0, 1, 0, 1, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [2, 0, 1, 0, 1, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [48, 0, 1, 0, 3, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [2, 0, 1, 0, 1, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [44, 0, 1, 0, 7, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [2, 0, 1, 0, 1, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [39, 1, 0, 0, 11, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [2, 1, 0, 0, 1, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [46, 0, 0, 1892, 5, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [2, 0, 0, 1, 1, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [49, 0, 0, 1892, 2, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [2, 0, 0, 1, 1, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [50, 0, 3, 2285, 1, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [3, 0, 1, 1, 1, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [49, 0, 0, 14680, 2, 0, 0, 0, 0],);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [3, 0, 0, 2, 1, 0, 0, 0, 0]);\n        let read = it.next().unwrap().unwrap();\n        let cigar_nucleotides = read.cigar_stats_nucleotides();\n        assert_eq!(to_arr(cigar_nucleotides), [47, 0, 0, 4027, 4, 0, 0, 0, 0]);\n        let cigar_blocks = read.cigar_stats_blocks();\n        assert_eq!(to_arr(cigar_blocks), [3, 0, 0, 2, 1, 0, 0, 0, 0]);\n    }\n\n    #[test]\n    fn test_reference_positions() {\n        let mut bam = bam::Reader::from_path(\"./test/test_spliced_reads.bam\").unwrap();\n        let mut it = bam.records();\n\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                16050676, 16050677, 16050678, 16050679, 16050680, 16050681, 16050682, 16050683,\n                16050684, 16050685, 16050686, 16050687, 16050688, 16050689, 16050690, 16050691,\n                16050692, 16050693, 16050694, 16050695, 16050696, 16050697, 16050698, 16050699,\n                16050700, 16050701, 16050702, 16050703, 16050704, 16050705, 16050706, 16050707,\n                16050708, 16050709, 16050710, 16050711, 16050712, 16050713, 16050714, 16050715,\n                16050716, 16050717, 16050718, 16050719, 16050720\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                16096878, 16096879, 16096880, 16096881, 16096882, 16096883, 16096884, 16096887,\n                16096888, 16096889, 16096890, 16096891, 16096892, 16096893, 16096894, 16096895,\n                16096896, 16096897, 16096898, 16096899, 16096900, 16096901, 16096902, 16096903,\n                16096904, 16096905, 16096906, 16096907, 16096908, 16096909, 16096910, 16096911,\n                16096912, 16096913, 16096914, 16096915, 16096916, 16096917, 16096918, 16096919,\n                16096920, 16096921, 16096922, 16096923, 16096924, 16096925, 16096926, 16096927,\n                16096928, 16096929, 16096930\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                16097145, 16097146, 16097147, 16097148, 16097149, 16097150, 16097151, 16097152,\n                16097153, 16097154, 16097155, 16097156, 16097157, 16097158, 16097159, 16097160,\n                16097161, 16097162, 16097163, 16097164, 16097165, 16097166, 16097167, 16097168,\n                16097169, 16097170, 16097171, 16097172, 16097173, 16097176, 16097177, 16097178,\n                16097179, 16097180, 16097181, 16097182, 16097183, 16097184, 16097185, 16097186,\n                16097187, 16097188, 16097189, 16097190, 16097191, 16097192, 16097193, 16097194,\n                16097195, 16097196, 16097197\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                16117350, 16117351, 16117352, 16117353, 16117354, 16117355, 16117356, 16117357,\n                16117358, 16117359, 16117360, 16117361, 16117362, 16117363, 16117364, 16117365,\n                16117366, 16117367, 16117368, 16117369, 16117370, 16117371, 16117372, 16117373,\n                16117374, 16117375, 16117376, 16117377, 16117378, 16117379, 16117380, 16117381,\n                16117382, 16117383, 16117384, 16117385, 16117386, 16117387, 16117388, 16117389,\n                16117390, 16117391, 16117392, 16117393, 16117394, 16117395, 16117396, 16117397,\n                16117398, 16117399, 16117400\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                16118483, 16118484, 16118485, 16118486, 16118487, 16118488, 16118489, 16118490,\n                16118491, 16118492, 16118493, 16118494, 16118495, 16118496, 16118497, 16118498,\n                16118499, 16118500, 16118501, 16118502, 16118503, 16118504, 16118505, 16118506,\n                16118507, 16118508, 16118509, 16118510, 16118511, 16118512, 16118513, 16118514,\n                16118515, 16118516, 16118517, 16118518, 16118519, 16118520, 16118521, 16118522,\n                16118523, 16118524, 16118525, 16118526, 16118527, 16118528, 16118529, 16118530,\n                16118531, 16118532, 16118533\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                16118499, 16118500, 16118501, 16118502, 16118503, 16118504, 16118505, 16118506,\n                16118507, 16118508, 16118509, 16118510, 16118511, 16118512, 16118513, 16118514,\n                16118515, 16118516, 16118517, 16118518, 16118519, 16118520, 16118521, 16118522,\n                16118523, 16118524, 16118525, 16118526, 16118527, 16118528, 16118529, 16118530,\n                16118531, 16118532, 16118533, 16118534, 16118535, 16118536, 16118537, 16118538,\n                16118539, 16118540, 16118541, 16118542, 16118543, 16118544, 16118545, 16118546,\n                16118547, 16118548, 16118549\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                16118499, 16118500, 16118501, 16118502, 16118503, 16118504, 16118505, 16118506,\n                16118507, 16118508, 16118509, 16118510, 16118511, 16118512, 16118513, 16118514,\n                16118515, 16118516, 16118517, 16118518, 16118519, 16118520, 16118521, 16118522,\n                16118523, 16118524, 16118525, 16118526, 16118527, 16118528, 16118529, 16118530,\n                16118531, 16118532, 16118533, 16118534, 16118535, 16118536, 16118537, 16118538,\n                16118539, 16118540, 16118541, 16118542, 16118543, 16118544, 16118545, 16118546,\n                16118547, 16118548, 16118549\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                16118499, 16118500, 16118501, 16118502, 16118503, 16118504, 16118505, 16118506,\n                16118507, 16118508, 16118509, 16118510, 16118511, 16118512, 16118513, 16118514,\n                16118515, 16118516, 16118517, 16118518, 16118519, 16118520, 16118521, 16118522,\n                16118523, 16118524, 16118525, 16118526, 16118527, 16118528, 16118529, 16118530,\n                16118531, 16118532, 16118533, 16118534, 16118535, 16118536, 16118537, 16118538,\n                16118539, 16118540, 16118541, 16118542, 16118543, 16118544, 16118545, 16118546,\n                16118547, 16118548, 16118549\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                16123411, 16123412, 16123413, 16123414, 16123415, 16123416, 16123417, 16123418,\n                16123419, 16123420, 16123421, 16123422, 16123423, 16123424, 16123425, 16123426,\n                16123427, 16123428, 16123429, 16123430, 16123431, 16123432, 16123433, 16123434,\n                16123435, 16123436, 16123437, 16123438, 16123439, 16123440, 16123441, 16123442,\n                16123443, 16123444, 16123445, 16123446, 16123447, 16123448, 16123449, 16123450,\n                16123451, 16123452, 16123453, 16123454, 16123455, 16123456, 16123457, 16123458,\n                16123459, 16123460, 16123461\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                16123417, 16123418, 16123419, 16123420, 16123421, 16123422, 16123423, 16123424,\n                16123425, 16123426, 16123427, 16123428, 16123429, 16123430, 16123431, 16123432,\n                16123433, 16123434, 16123435, 16123436, 16123437, 16123438, 16123439, 16123440,\n                16123441, 16123442, 16123443, 16123444, 16123445, 16123446, 16123447, 16123448,\n                16123449, 16123450, 16123451, 16123452, 16123453, 16123454, 16123455, 16123456,\n                16123457, 16123458, 16123459, 16123460, 16123461\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                16165860, 16165861, 16165862, 16165863, 16165864, 16165865, 16165866, 16165867,\n                16165868, 16165869, 16165870, 16165871, 16165872, 16165873, 16165874, 16165875,\n                16165876, 16165877, 16165878, 16165879, 16165880, 16165881, 16165882, 16165883,\n                16165884, 16165885, 16165886, 16165887, 16165888, 16165889, 16165890, 16165891,\n                16165892, 16165893, 16165894, 16165895, 16165896, 16165897, 16165898, 16165899,\n                16165900\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                16180871, 16180872, 16180873, 16180874, 16180875, 16180876, 16180877, 16180878,\n                16180879, 16180880, 16180881, 16180882, 16180883, 16180884, 16180885, 16180886,\n                16180887, 16180888, 16180889, 16180890, 16180891, 16180892, 16180893, 16180894,\n                16180895, 16180896, 16180897, 16180898, 16180899, 16180900, 16180901, 16180902,\n                16180903, 16180904, 16180905, 16180906, 16180907, 16180908, 16180909, 16180910,\n                16180911, 16180912, 16180913, 16180914, 16180915, 16180916, 16180917, 16180918,\n                16180919, 16180920, 16180921\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                16189705, 16189706, 16189707, 16189708, 16189709, 16189710, 16189711, 16189712,\n                16189713, 16189714, 16189715, 16189716, 16189717, 16189718, 16189719, 16189720,\n                16189721, 16189722, 16189723, 16189724, 16189725, 16189726, 16189727, 16189728,\n                16189729, 16189730, 16189731, 16189732, 16189733, 16189734, 16189735, 16189736,\n                16189737, 16189738, 16189739, 16189740, 16189741, 16189742, 16189743, 16189744,\n                16189745, 16189746, 16189747, 16189748, 16189749, 16189750, 16189751, 16189752,\n                16189753, 16189754, 16189755\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                16231271, 16231272, 16231273, 16231274, 16231275, 16231276, 16231277, 16231278,\n                16231279, 16231280, 16231281, 16231282, 16231283, 16231284, 16231285, 16231286,\n                16231287, 16231288, 16231289, 16231290, 16231291, 16231292, 16231293, 16231294,\n                16231295, 16231296, 16231297, 16231298, 16231299, 16231300, 16231301, 16231302,\n                16231303, 16231304, 16231305, 16231306, 16231307, 16231308, 16231309, 16231310,\n                16231311, 16231312, 16231313, 16231314, 16231315, 16231316, 16231317, 16231318,\n                16231319, 16231320, 16231321\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                16237657, 16237658, 16237659, 16237660, 16237661, 16237662, 16237663, 16237664,\n                16237665, 16237666, 16237667, 16237668, 16237669, 16237670, 16237671, 16237672,\n                16237673, 16237674, 16237675, 16237676, 16237677, 16237678, 16237679, 16237680,\n                16237681, 16237682, 16237683, 16237684, 16237685, 16237686, 16237687, 16237688,\n                16237689, 16237690, 16237691, 16237692, 16237693, 16237694, 16237695, 16237696,\n                16237697, 16237698, 16237699, 16237700, 16237701, 16237702, 16237703, 16237704,\n                16237705, 16237706, 16237707\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                16255012, 16255013, 16255014, 16255015, 16255016, 16255017, 16255018, 16255019,\n                16255020, 16255021, 16255022, 16255023, 16255024, 16255025, 16255026, 16255027,\n                16255028, 16255029, 16255030, 16255031, 16255032, 16255033, 16255034, 16255035,\n                16255036, 16255037, 16255038, 16255039, 16255040, 16255041, 16255042, 16255043,\n                16255044, 16255045, 16255046, 16255047, 16255048, 16255049, 16255050, 16255051,\n                16255052, 16255053\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                16255391, 16255392, 16255393, 16255394, 16255395, 16255396, 16255397, 16255398,\n                16255399, 16255400, 16255401, 16255402, 16255403, 16255404, 16255405, 16255406,\n                16255407, 16255408, 16255409, 16255410, 16255411, 16255412, 16255413, 16255414,\n                16255415, 16255416, 16255417, 16255418, 16255419, 16255420, 16255421, 16255422,\n                16255423, 16255424, 16255425, 16255426, 16255427, 16255428, 16255429, 16255430,\n                16255431, 16255432, 16255433, 16255434, 16255435, 16255436, 16255437, 16255438,\n                16255439, 16255440, 16255441\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                16255392, 16255393, 16255394, 16255395, 16255396, 16255397, 16255398, 16255399,\n                16255400, 16255401, 16255402, 16255403, 16255404, 16255405, 16255406, 16255407,\n                16255408, 16255409, 16255410, 16255411, 16255412, 16255413, 16255414, 16255415,\n                16255416, 16255417, 16255418, 16255419, 16255420, 16255421, 16255422, 16255423,\n                16255424, 16255425, 16255426, 16255427, 16255428, 16255429, 16255430, 16255431,\n                16255432, 16255433, 16255434, 16255435, 16255436, 16255437, 16255438, 16255439,\n                16255440, 16255441\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                16256084, 16256085, 16256086, 16256087, 16256088, 16256089, 16256090, 16256091,\n                16256092, 16256093, 16256094, 16256095, 16256096, 16256097, 16256098, 16256099,\n                16256100, 16256101, 16256102, 16256103, 16256104, 16256105, 16256106, 16256107,\n                16256108, 16256109, 16256110, 16256111, 16256112, 16256113, 16256114, 16256115,\n                16256116, 16256117, 16256118, 16256119, 16256120, 16256121, 16256122, 16256123,\n                16256124, 16256125, 16256126, 16256127, 16256128\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                16256224, 16256225, 16256226, 16256227, 16256228, 16256229, 16256230, 16256231,\n                16256232, 16256233, 16256234, 16256235, 16256236, 16256237, 16256238, 16256239,\n                16256240, 16256241, 16256242, 16256243, 16256244, 16256245, 16256246, 16256247,\n                16256248, 16256249, 16256250, 16256251, 16256252, 16256253, 16256254, 16256255,\n                16256256, 16256257, 16256258, 16256259, 16256260, 16256261, 16256262, 16256263,\n                16256264, 16256265, 16256266, 16256267, 16256268, 16256269, 16256270, 16256271\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                16325199, 16325200, 16325201, 16325202, 16325203, 16325204, 16325205, 16325206,\n                16325207, 16325208, 16325209, 16325210, 16325211, 16325212, 16325213, 16325214,\n                16325215, 16325216, 16325217, 16325218, 16325219, 16325220, 16325221, 16325222,\n                16325223, 16325224, 16325225, 16325226, 16325227, 16325228, 16325229, 16325230,\n                16325231, 16325232, 16325233, 16325234, 16325235, 16325236, 16325237, 16325238,\n                16325239, 16325240\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                16352865, 16352866, 16352867, 16352868, 16352869, 16352870, 16352871, 16352872,\n                16352873, 16352874, 16352875, 16352876, 16352877, 16352878, 16352879, 16352880,\n                16352881, 16352882, 16352883, 16352884, 16352885, 16352886, 16352887, 16352888,\n                16352889, 16352890, 16352891, 16352892, 16352893, 16352894, 16352895, 16352896,\n                16352897, 16352898, 16352899, 16352900, 16352901, 16352902\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                16352968, 16352969, 16352970, 16352971, 16352972, 16352973, 16352974, 16352975,\n                16352976, 16352977, 16352978, 16352979, 16352980, 16352981, 16352982, 16352983,\n                16352984, 16352985, 16352986, 16352987, 16352988, 16352989, 16352990, 16352991,\n                16352992, 16352993, 16352994, 16352995, 16352996, 16352997, 16352998, 16352999,\n                16353000, 16353001, 16353002, 16353003, 16353004, 16353005, 16353006, 16353007,\n                16353008, 16353009, 16353010, 16353011\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                16414998, 16414999, 16415000, 16415001, 16415002, 16415003, 16415004, 16415005,\n                16415006, 16415007, 16415008, 16415009, 16415010, 16415011, 16415012, 16415013,\n                16415014, 16415015, 16415016, 16415017, 16415018, 16415019, 16415020, 16415021,\n                16415022, 16415023, 16415024, 16415025, 16415026, 16415027, 16415028, 16415029,\n                16415030, 16415031, 16415032, 16415033, 16415034, 16415035, 16415036, 16415037,\n                16415038, 16415039, 16415040, 16415041, 16415042, 16415043\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                17031591, 17031592, 17031593, 17031594, 17031595, 17031596, 17031597, 17031598,\n                17031599, 17031600, 17031601, 17031602, 17031603, 17031604, 17031605, 17031606,\n                17031607, 17031608, 17031609, 17031610, 17031611, 17031612, 17031613, 17031614,\n                17031615, 17031616, 17031617, 17031618, 17031619, 17031620, 17031621, 17031622,\n                17031623, 17031624, 17031625, 17031626, 17031627, 17031628, 17031629, 17031630,\n                17031631, 17031632, 17031633, 17031634, 17031635, 17031636, 17031637\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                17057382, 17057383, 17057384, 17057385, 17057386, 17057387, 17057388, 17057389,\n                17057390, 17057391, 17057392, 17057393, 17057394, 17057395, 17057396, 17057397,\n                17057398, 17057399, 17057400, 17057401, 17057402, 17057403, 17057404, 17057405,\n                17057406, 17057407, 17057408, 17057409, 17057410, 17057411, 17057412, 17057413,\n                17057414, 17057415, 17057416, 17057417, 17057418, 17057419, 17057420, 17057421,\n                17057422, 17057423, 17057424, 17057425, 17057426, 17057427, 17057428, 17057429,\n                17057430, 17057431\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                17092766, 17092767, 17092768, 17092769, 17092770, 17092771, 17092772, 17092773,\n                17092774, 17092775, 17092776, 17092777, 17092778, 17092779, 17092780, 17092781,\n                17092782, 17094966, 17094967, 17094968, 17094969, 17094970, 17094971, 17094972,\n                17094973, 17094974, 17094975, 17094976, 17094977, 17094978, 17094979, 17094980,\n                17094981, 17094982, 17094983, 17094984, 17094985, 17094986, 17094987, 17094988,\n                17094989, 17094990, 17094991, 17094992, 17094993, 17094994, 17094995, 17094996,\n                17094997, 17094998, 17094999\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                17092782, 17094966, 17094967, 17094968, 17094969, 17094970, 17094971, 17094972,\n                17094973, 17094974, 17094975, 17094976, 17094977, 17094978, 17094979, 17094980,\n                17094981, 17094982, 17094983, 17094984, 17094985, 17094986, 17094987, 17094988,\n                17094989, 17094990, 17094991, 17094992, 17094993, 17094994, 17094995, 17094996,\n                17094997, 17094998, 17094999, 17095000, 17095001, 17095002, 17095003, 17095004,\n                17095005, 17095006, 17095007, 17095008, 17095009, 17095010, 17095011, 17095012,\n                17095013, 17095014, 17095015\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                17092782, 17094966, 17094967, 17094968, 17094969, 17094970, 17094971, 17094972,\n                17094973, 17094974, 17094975, 17094976, 17094977, 17094978, 17094979, 17094980,\n                17094981, 17094982, 17094983, 17094984, 17094985, 17094986, 17094987, 17094988,\n                17094989, 17094990, 17094991, 17094992, 17094993, 17094994, 17094995, 17094996,\n                17094997, 17094998, 17094999, 17095000, 17095001, 17095002, 17095003, 17095004,\n                17095005, 17095006, 17095007, 17095008, 17095009, 17095010, 17095011, 17095012,\n                17095013, 17095014, 17095015\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                17137287, 17137288, 17137289, 17137290, 17137291, 17137292, 17137293, 17137294,\n                17137295, 17137296, 17137297, 17137298, 17137299, 17137300, 17137301, 17137302,\n                17137303, 17137304, 17137305, 17137306, 17137307, 17137308, 17137309, 17137310,\n                17137311, 17137312, 17137313, 17137314, 17137315, 17137316, 17137317, 17137318,\n                17137319\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                17306238, 17306239, 17306240, 17306241, 17306242, 17306243, 17306244, 17306245,\n                17306246, 17306247, 17306248, 17306249, 17306250, 17306251, 17306252, 17306253,\n                17306254, 17306255, 17306256, 17306257, 17306258, 17306259, 17306260, 17306261,\n                17306262, 17306263, 17306264, 17306265, 17306266, 17306267, 17306268, 17306269,\n                17306270, 17306271, 17306272, 17306273, 17306274, 17306275, 17306276, 17306277,\n                17306278, 17306279, 17306280, 17306281, 17306282, 17306283, 17306284, 17306285\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                17561868, 17561869, 17561870, 17561871, 17561872, 17561873, 17561874, 17561875,\n                17561876, 17561877, 17561878, 17561879, 17561880, 17561881, 17561882, 17561883,\n                17561884, 17561885, 17561886, 17561887, 17561888, 17561889, 17561890, 17561891,\n                17561892, 17561893, 17561894, 17561895, 17561896, 17561897, 17561898, 17561899,\n                17561900, 17561901, 17561902, 17561903, 17561904, 17561905, 17561906, 17561907,\n                17561908, 17561909, 17561910, 17561911, 17561912\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                17566078, 17566079, 17566080, 17566081, 17566082, 17566083, 17566084, 17566085,\n                17566086, 17566087, 17566088, 17566089, 17566090, 17566091, 17566092, 17566093,\n                17566094, 17566095, 17566096, 17566097, 17566098, 17566099, 17566100, 17566101,\n                17566102, 17566103, 17566104, 17566105, 17566106, 17566107, 17566108, 17566109,\n                17566110, 17566111, 17566112, 17566113, 17566114, 17566115, 17566116, 17566117,\n                17566118, 17577951, 17577952, 17577953, 17577954, 17577955, 17577956, 17577957,\n                17577958, 17577959, 17577960\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                17566108, 17566109, 17566110, 17566111, 17566112, 17566113, 17566114, 17566115,\n                17566116, 17566117, 17566118, 17577951, 17577952, 17577953, 17577954, 17577955,\n                17577956, 17577957, 17577958, 17577959, 17577960, 17577961, 17577962, 17577963,\n                17577964, 17577965, 17577966, 17577967, 17577968, 17577969, 17577970, 17577971,\n                17577972, 17577973, 17577974, 17577975, 17578686, 17578687, 17578688, 17578689,\n                17578690, 17578691, 17578692, 17578693, 17578694, 17578695, 17578696, 17578697,\n                17578698, 17578699, 17578700\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                17566111, 17566112, 17566113, 17566114, 17566115, 17566116, 17566117, 17566118,\n                17577951, 17577952, 17577953, 17577954, 17577955, 17577956, 17577957, 17577958,\n                17577959, 17577960, 17577961, 17577962, 17577963, 17577964, 17577965, 17577966,\n                17577967, 17577968, 17577969, 17577970, 17577971, 17577972, 17577973, 17577974,\n                17577975, 17578686, 17578687, 17578688, 17578689, 17578690, 17578691, 17578692,\n                17578693, 17578694, 17578695, 17578696, 17578697, 17578698, 17578699, 17578700,\n                17578701, 17578702, 17578703\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                17566111, 17566112, 17566113, 17566114, 17566115, 17566116, 17566117, 17566118,\n                17577951, 17577952, 17577953, 17577954, 17577955, 17577956, 17577957, 17577958,\n                17577959, 17577960, 17577961, 17577962, 17577963, 17577964, 17577965, 17577966,\n                17577967, 17577968, 17577969, 17577970, 17577971, 17577972, 17577973, 17577974,\n                17577975, 17578686, 17578687, 17578688, 17578689, 17578690, 17578691, 17578692,\n                17578693, 17578694, 17578695, 17578696, 17578697, 17578698, 17578699, 17578700,\n                17578701, 17578702, 17578703\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                17566111, 17566112, 17566113, 17566114, 17566115, 17566116, 17566117, 17566118,\n                17577951, 17577952, 17577953, 17577954, 17577955, 17577956, 17577957, 17577958,\n                17577959, 17577960, 17577961, 17577962, 17577963, 17577964, 17577965, 17577966,\n                17577967, 17577968, 17577969, 17577970, 17577971, 17577972, 17577973, 17577974,\n                17577975, 17578686, 17578687, 17578688, 17578689, 17578690, 17578691, 17578692,\n                17578693, 17578694, 17578695, 17578696, 17578697, 17578698, 17578699, 17578700,\n                17578701, 17578702, 17578703\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                17566111, 17566112, 17566113, 17566114, 17566115, 17566116, 17566117, 17566118,\n                17577951, 17577952, 17577953, 17577954, 17577955, 17577956, 17577957, 17577958,\n                17577959, 17577960, 17577961, 17577962, 17577963, 17577964, 17577965, 17577966,\n                17577967, 17577968, 17577969, 17577970, 17577971, 17577972, 17577973, 17577974,\n                17577975, 17578686, 17578687, 17578688, 17578689, 17578690, 17578691, 17578692,\n                17578693, 17578694, 17578695, 17578696, 17578697, 17578698, 17578699, 17578700,\n                17578701, 17578702, 17578703\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                17566112, 17566113, 17566114, 17566115, 17566116, 17566117, 17566118, 17577951,\n                17577952, 17577953, 17577954, 17577955, 17577956, 17577957, 17577958, 17577959,\n                17577960, 17577961, 17577962, 17577963, 17577964, 17577965, 17577966, 17577967,\n                17577968, 17577969, 17577970, 17577971, 17577972, 17577973, 17577974, 17577975,\n                17578686, 17578687, 17578688, 17578689, 17578690, 17578691, 17578692, 17578693,\n                17578694, 17578695, 17578696, 17578697, 17578698, 17578699, 17578700, 17578701,\n                17578702, 17578703, 17578704\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                17566113, 17566114, 17566115, 17566116, 17566117, 17566118, 17577951, 17577952,\n                17577953, 17577954, 17577955, 17577956, 17577957, 17577958, 17577959, 17577960,\n                17577961, 17577962, 17577963, 17577964, 17577965, 17577966, 17577967, 17577968,\n                17577969, 17577970, 17577971, 17577972, 17577973, 17577974, 17577975, 17578686,\n                17578687, 17578688, 17578689, 17578690, 17578691, 17578692, 17578693, 17578694,\n                17578695, 17578696, 17578697, 17578698, 17578699, 17578700, 17578701, 17578702,\n                17578703, 17578704, 17578705\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                17566113, 17566114, 17566115, 17566116, 17566117, 17566118, 17577951, 17577952,\n                17577953, 17577954, 17577955, 17577956, 17577957, 17577958, 17577959, 17577960,\n                17577961, 17577962, 17577963, 17577964, 17577965, 17577966, 17577967, 17577968,\n                17577969, 17577970, 17577971, 17577972, 17577973, 17577974, 17577975, 17578686,\n                17578687, 17578688, 17578689, 17578690, 17578691, 17578692, 17578693, 17578694,\n                17578695, 17578696, 17578697, 17578698, 17578699, 17578700, 17578701, 17578702,\n                17578703, 17578704, 17578705\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                17579733, 17579734, 17579735, 17579736, 17579737, 17579738, 17579739, 17579740,\n                17579741, 17579742, 17579743, 17579744, 17579745, 17579746, 17579747, 17579748,\n                17579749, 17579750, 17579751, 17579752, 17579753, 17579754, 17579755, 17579756,\n                17579757, 17579758, 17579759, 17579760, 17579761, 17579762, 17579763, 17579764,\n                17579765, 17579766, 17579767, 17579768, 17579769, 17579770, 17579771, 17579772,\n                17579773, 17579774, 17579775, 17579776, 17581244, 17581245, 17581246, 17581247,\n                17581248, 17581249\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                17581369, 17581370, 17582885, 17582886, 17582887, 17582888, 17582889, 17582890,\n                17582891, 17582892, 17582893, 17582894, 17582895, 17582896, 17582897, 17582898,\n                17582899, 17582900, 17582901, 17582902, 17582903, 17582904, 17582905, 17582906,\n                17582907, 17582908, 17582909, 17582910, 17582911, 17582912, 17582913, 17582914,\n                17582915, 17582916, 17582917, 17582918, 17582919, 17582920, 17582921, 17582922,\n                17582923, 17582924, 17582925, 17582926, 17582927, 17582928, 17582929, 17582930,\n                17582931, 17582932, 17583028\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                17581370, 17582885, 17582886, 17582887, 17582888, 17582889, 17582890, 17582891,\n                17582892, 17582893, 17582894, 17582895, 17582896, 17582897, 17582898, 17582899,\n                17582900, 17582901, 17582902, 17582903, 17582904, 17582905, 17582906, 17582907,\n                17582908, 17582909, 17582910, 17582911, 17582912, 17582913, 17582914, 17582915,\n                17582916, 17582917, 17582918, 17582919, 17582920, 17582921, 17582922, 17582923,\n                17582924, 17582925, 17582926, 17582927, 17582928, 17582929, 17582930, 17582931,\n                17582932, 17583028, 17583029\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                17581370, 17582885, 17582886, 17582887, 17582888, 17582889, 17582890, 17582891,\n                17582892, 17582893, 17582894, 17582895, 17582896, 17582897, 17582898, 17582899,\n                17582900, 17582901, 17582902, 17582903, 17582904, 17582905, 17582906, 17582907,\n                17582908, 17582909, 17582910, 17582911, 17582912, 17582913, 17582914, 17582915,\n                17582916, 17582917, 17582918, 17582919, 17582920, 17582921, 17582922, 17582923,\n                17582924, 17582925, 17582926, 17582927, 17582928, 17582929, 17582930, 17582931,\n                17582932, 17583028, 17583029\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                17582911, 17582912, 17582913, 17582914, 17582915, 17582916, 17582917, 17582918,\n                17582919, 17582920, 17582921, 17582922, 17582923, 17582924, 17582925, 17582926,\n                17582927, 17582928, 17582929, 17582930, 17582931, 17582932, 17583028, 17583029,\n                17583030, 17583031, 17583032, 17583033, 17583034, 17583035, 17583036, 17583037,\n                17583038, 17583039, 17583040, 17583041, 17583042, 17583043, 17583044, 17583045,\n                17583046, 17583047, 17583048, 17583049, 17583050, 17583051, 17583052, 17583053,\n                17583054, 17583055\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                17588621, 17588622, 17588623, 17588624, 17588625, 17588626, 17588627, 17588628,\n                17588629, 17588630, 17588631, 17588632, 17588633, 17588634, 17588635, 17588636,\n                17588637, 17588638, 17588639, 17588640, 17588641, 17588642, 17588643, 17588644,\n                17588645, 17588646, 17588647, 17588648, 17588649, 17588650, 17588651, 17588652,\n                17588653, 17588654, 17588655, 17588656, 17588657, 17589196, 17589197, 17589198,\n                17589199, 17589200, 17589201, 17589202, 17589203, 17589204, 17589205, 17589206,\n                17589207, 17589208\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                17588621, 17588622, 17588623, 17588624, 17588625, 17588626, 17588627, 17588628,\n                17588629, 17588630, 17588631, 17588632, 17588633, 17588634, 17588635, 17588636,\n                17588637, 17588638, 17588639, 17588640, 17588641, 17588642, 17588643, 17588644,\n                17588645, 17588646, 17588647, 17588648, 17588649, 17588650, 17588651, 17588652,\n                17588653, 17588654, 17588655, 17588656, 17588657, 17589196, 17589197, 17589198,\n                17589199, 17589200, 17589201, 17589202, 17589203, 17589204, 17589205, 17589206,\n                17589207, 17589208\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                17588621, 17588622, 17588623, 17588624, 17588625, 17588626, 17588627, 17588628,\n                17588629, 17588630, 17588631, 17588632, 17588633, 17588634, 17588635, 17588636,\n                17588637, 17588638, 17588639, 17588640, 17588641, 17588642, 17588643, 17588644,\n                17588645, 17588646, 17588647, 17588648, 17588649, 17588650, 17588651, 17588652,\n                17588653, 17588654, 17588655, 17588656, 17588657, 17589196, 17589197, 17589198,\n                17589199, 17589200, 17589201, 17589202, 17589203, 17589204, 17589205, 17589206,\n                17589207, 17589208\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                17591770, 17591771, 17591772, 17591773, 17591774, 17591775, 17591776, 17591777,\n                17591778, 17591779, 17591780, 17591781, 17591782, 17591783, 17591784, 17591785,\n                17591786, 17591787, 17591788, 17591789, 17591790, 17591791, 17591792, 17591793,\n                17591794, 17591796, 17591797, 17591798, 17591799, 17591800, 17591801, 17591802,\n                17591803, 17591804, 17591805, 17591806, 17591807, 17591808, 17591809, 17591810,\n                17591811, 17591812, 17591813, 17591814, 17591815, 17591816, 17591817, 17591818,\n                17591819, 17591820\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                17593855, 17593856, 17593857, 17593858, 17593859, 17593860, 17593861, 17593862,\n                17593863, 17593864, 17593865, 17593866, 17593867, 17593868, 17593869, 17593870,\n                17593871, 17593872, 17593873, 17593874, 17593875, 17593876, 17593877, 17593878,\n                17593880, 17593881, 17593882, 17593883, 17593884, 17593885, 17593886, 17593887,\n                17593888, 17593889, 17593890, 17593891, 17593892, 17593893, 17593894, 17593895,\n                17593896, 17593897, 17593898, 17593899, 17593900, 17593901, 17593902, 17593903\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                17593863, 17593864, 17593865, 17593866, 17593867, 17593868, 17593869, 17593870,\n                17593871, 17593872, 17593873, 17593874, 17593875, 17593876, 17593877, 17593878,\n                17593880, 17593881, 17593882, 17593883, 17593884, 17593885, 17593886, 17593887,\n                17593888, 17593889, 17593890, 17593891, 17593892, 17593893, 17593894, 17593895,\n                17593896, 17593897, 17593898, 17593899, 17593900, 17593901, 17593902, 17593903,\n                17593904, 17593905, 17593906, 17593907\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                17596476, 17596477, 17596478, 17596479, 17596480, 17596481, 17596482, 17596483,\n                17596484, 17596485, 17596486, 17596487, 17596488, 17596489, 17596490, 17596491,\n                17596492, 17596493, 17596494, 17596495, 17596496, 17596497, 17596498, 17596499,\n                17596500, 17596501, 17596502, 17596503, 17596504, 17596505, 17596506, 17596507,\n                17596508, 17596509, 17596510, 17596511, 17596512, 17596513, 17596514\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                17624012, 17624013, 17624014, 17624015, 17624016, 17624017, 17624018, 17624019,\n                17624020, 17625913, 17625914, 17625915, 17625916, 17625917, 17625918, 17625919,\n                17625920, 17625921, 17625922, 17625923, 17625924, 17625925, 17625926, 17625927,\n                17625928, 17625929, 17625930, 17625931, 17625932, 17625933, 17625934, 17625935,\n                17625936, 17625937, 17625938, 17625939, 17625940, 17625941, 17625942, 17625943,\n                17625944, 17625945, 17625946, 17625947, 17625948, 17625949\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                17624012, 17624013, 17624014, 17624015, 17624016, 17624017, 17624018, 17624019,\n                17624020, 17625913, 17625914, 17625915, 17625916, 17625917, 17625918, 17625919,\n                17625920, 17625921, 17625922, 17625923, 17625924, 17625925, 17625926, 17625927,\n                17625928, 17625929, 17625930, 17625931, 17625932, 17625933, 17625934, 17625935,\n                17625936, 17625937, 17625938, 17625939, 17625940, 17625941, 17625942, 17625943,\n                17625944, 17625945, 17625946, 17625947, 17625948, 17625949, 17625950, 17625951,\n                17625952\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                31796700, 31796701, 31796702, 31796703, 31796704, 31796705, 31796706, 31796710,\n                31796711, 31796712, 31796713, 31796714, 31796715, 31796716, 31796717, 31796718,\n                31796719, 31796720, 31796721, 31796722, 31796723, 31796724, 31796725, 31796726,\n                31796727, 31796728, 31799014, 31799015, 31799016, 31799017, 31799018, 31799019,\n                31799020, 31799021, 31799022, 31799023, 31799024, 31799025, 31799026, 31799027,\n                31799028, 31799029, 31799030, 31799031, 31799032, 31799033, 31799034, 31799035,\n                31799036, 31799037\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                36722692, 36722693, 36722694, 36722695, 36722696, 36722697, 36722698, 36722699,\n                36722700, 36722701, 36722702, 36722703, 36722704, 36722705, 36723505, 36723506,\n                36723507, 36723508, 36723509, 36723510, 36723511, 36723512, 36723513, 36723514,\n                36723515, 36723516, 36723517, 36723518, 36723519, 36723520, 36723521, 36723522,\n                36723523, 36723524, 36723525, 36723526, 36723527, 36723528, 36723529, 36723530,\n                36723531, 36723532, 36737414, 36737415, 36737416, 36737417, 36737418, 36737419,\n                36737420\n            ]\n        );\n        let rp: Vec<i64> = it.next().unwrap().unwrap().reference_positions().collect();\n        assert_eq!(\n            rp,\n            vec![\n                44587963, 44587964, 44587965, 44587966, 44587967, 44587968, 44587969, 44587970,\n                44587971, 44587972, 44587973, 44587974, 44587975, 44587976, 44587977, 44587978,\n                44587979, 44587980, 44587981, 44587982, 44587983, 44589680, 44589681, 44589682,\n                44589683, 44589684, 44589685, 44589686, 44589687, 44589688, 44589689, 44589690,\n                44589691, 44589692, 44589693, 44589694, 44589695, 44589696, 44589697, 44589698,\n                44589699, 44589700, 44589701, 44589702, 44592034, 44592035, 44592036\n            ]\n        );\n    }\n\n    #[test]\n    fn test_reference_positions_full() {\n        let mut bam = bam::Reader::from_path(\"./test/test_spliced_reads.bam\").unwrap();\n        let mut it = bam.records();\n\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                Some(16050676),\n                Some(16050677),\n                Some(16050678),\n                Some(16050679),\n                Some(16050680),\n                Some(16050681),\n                Some(16050682),\n                Some(16050683),\n                Some(16050684),\n                Some(16050685),\n                Some(16050686),\n                Some(16050687),\n                Some(16050688),\n                Some(16050689),\n                Some(16050690),\n                Some(16050691),\n                Some(16050692),\n                Some(16050693),\n                Some(16050694),\n                Some(16050695),\n                Some(16050696),\n                Some(16050697),\n                Some(16050698),\n                Some(16050699),\n                Some(16050700),\n                Some(16050701),\n                Some(16050702),\n                Some(16050703),\n                Some(16050704),\n                Some(16050705),\n                Some(16050706),\n                Some(16050707),\n                Some(16050708),\n                Some(16050709),\n                Some(16050710),\n                Some(16050711),\n                Some(16050712),\n                Some(16050713),\n                Some(16050714),\n                Some(16050715),\n                Some(16050716),\n                Some(16050717),\n                Some(16050718),\n                Some(16050719),\n                Some(16050720)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(16096878),\n                Some(16096879),\n                Some(16096880),\n                Some(16096881),\n                Some(16096882),\n                Some(16096883),\n                Some(16096884),\n                Some(16096887),\n                Some(16096888),\n                Some(16096889),\n                Some(16096890),\n                Some(16096891),\n                Some(16096892),\n                Some(16096893),\n                Some(16096894),\n                Some(16096895),\n                Some(16096896),\n                Some(16096897),\n                Some(16096898),\n                Some(16096899),\n                Some(16096900),\n                Some(16096901),\n                Some(16096902),\n                Some(16096903),\n                Some(16096904),\n                Some(16096905),\n                Some(16096906),\n                Some(16096907),\n                Some(16096908),\n                Some(16096909),\n                Some(16096910),\n                Some(16096911),\n                Some(16096912),\n                Some(16096913),\n                Some(16096914),\n                Some(16096915),\n                Some(16096916),\n                Some(16096917),\n                Some(16096918),\n                Some(16096919),\n                Some(16096920),\n                Some(16096921),\n                Some(16096922),\n                Some(16096923),\n                Some(16096924),\n                Some(16096925),\n                Some(16096926),\n                Some(16096927),\n                Some(16096928),\n                Some(16096929),\n                Some(16096930)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(16097145),\n                Some(16097146),\n                Some(16097147),\n                Some(16097148),\n                Some(16097149),\n                Some(16097150),\n                Some(16097151),\n                Some(16097152),\n                Some(16097153),\n                Some(16097154),\n                Some(16097155),\n                Some(16097156),\n                Some(16097157),\n                Some(16097158),\n                Some(16097159),\n                Some(16097160),\n                Some(16097161),\n                Some(16097162),\n                Some(16097163),\n                Some(16097164),\n                Some(16097165),\n                Some(16097166),\n                Some(16097167),\n                Some(16097168),\n                Some(16097169),\n                Some(16097170),\n                Some(16097171),\n                Some(16097172),\n                Some(16097173),\n                Some(16097176),\n                Some(16097177),\n                Some(16097178),\n                Some(16097179),\n                Some(16097180),\n                Some(16097181),\n                Some(16097182),\n                Some(16097183),\n                Some(16097184),\n                Some(16097185),\n                Some(16097186),\n                Some(16097187),\n                Some(16097188),\n                Some(16097189),\n                Some(16097190),\n                Some(16097191),\n                Some(16097192),\n                Some(16097193),\n                Some(16097194),\n                Some(16097195),\n                Some(16097196),\n                Some(16097197)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(16117350),\n                Some(16117351),\n                Some(16117352),\n                Some(16117353),\n                Some(16117354),\n                Some(16117355),\n                Some(16117356),\n                Some(16117357),\n                Some(16117358),\n                Some(16117359),\n                Some(16117360),\n                Some(16117361),\n                Some(16117362),\n                Some(16117363),\n                Some(16117364),\n                Some(16117365),\n                Some(16117366),\n                Some(16117367),\n                Some(16117368),\n                Some(16117369),\n                Some(16117370),\n                Some(16117371),\n                Some(16117372),\n                Some(16117373),\n                Some(16117374),\n                Some(16117375),\n                Some(16117376),\n                Some(16117377),\n                Some(16117378),\n                Some(16117379),\n                Some(16117380),\n                Some(16117381),\n                Some(16117382),\n                Some(16117383),\n                Some(16117384),\n                Some(16117385),\n                Some(16117386),\n                Some(16117387),\n                Some(16117388),\n                Some(16117389),\n                Some(16117390),\n                Some(16117391),\n                Some(16117392),\n                Some(16117393),\n                Some(16117394),\n                Some(16117395),\n                Some(16117396),\n                Some(16117397),\n                Some(16117398),\n                Some(16117399),\n                Some(16117400)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(16118483),\n                Some(16118484),\n                Some(16118485),\n                Some(16118486),\n                Some(16118487),\n                Some(16118488),\n                Some(16118489),\n                Some(16118490),\n                Some(16118491),\n                Some(16118492),\n                Some(16118493),\n                Some(16118494),\n                Some(16118495),\n                Some(16118496),\n                Some(16118497),\n                Some(16118498),\n                Some(16118499),\n                Some(16118500),\n                Some(16118501),\n                Some(16118502),\n                Some(16118503),\n                Some(16118504),\n                Some(16118505),\n                Some(16118506),\n                Some(16118507),\n                Some(16118508),\n                Some(16118509),\n                Some(16118510),\n                Some(16118511),\n                Some(16118512),\n                Some(16118513),\n                Some(16118514),\n                Some(16118515),\n                Some(16118516),\n                Some(16118517),\n                Some(16118518),\n                Some(16118519),\n                Some(16118520),\n                Some(16118521),\n                Some(16118522),\n                Some(16118523),\n                Some(16118524),\n                Some(16118525),\n                Some(16118526),\n                Some(16118527),\n                Some(16118528),\n                Some(16118529),\n                Some(16118530),\n                Some(16118531),\n                Some(16118532),\n                Some(16118533)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(16118499),\n                Some(16118500),\n                Some(16118501),\n                Some(16118502),\n                Some(16118503),\n                Some(16118504),\n                Some(16118505),\n                Some(16118506),\n                Some(16118507),\n                Some(16118508),\n                Some(16118509),\n                Some(16118510),\n                Some(16118511),\n                Some(16118512),\n                Some(16118513),\n                Some(16118514),\n                Some(16118515),\n                Some(16118516),\n                Some(16118517),\n                Some(16118518),\n                Some(16118519),\n                Some(16118520),\n                Some(16118521),\n                Some(16118522),\n                Some(16118523),\n                Some(16118524),\n                Some(16118525),\n                Some(16118526),\n                Some(16118527),\n                Some(16118528),\n                Some(16118529),\n                Some(16118530),\n                Some(16118531),\n                Some(16118532),\n                Some(16118533),\n                Some(16118534),\n                Some(16118535),\n                Some(16118536),\n                Some(16118537),\n                Some(16118538),\n                Some(16118539),\n                Some(16118540),\n                Some(16118541),\n                Some(16118542),\n                Some(16118543),\n                Some(16118544),\n                Some(16118545),\n                Some(16118546),\n                Some(16118547),\n                Some(16118548),\n                Some(16118549)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(16118499),\n                Some(16118500),\n                Some(16118501),\n                Some(16118502),\n                Some(16118503),\n                Some(16118504),\n                Some(16118505),\n                Some(16118506),\n                Some(16118507),\n                Some(16118508),\n                Some(16118509),\n                Some(16118510),\n                Some(16118511),\n                Some(16118512),\n                Some(16118513),\n                Some(16118514),\n                Some(16118515),\n                Some(16118516),\n                Some(16118517),\n                Some(16118518),\n                Some(16118519),\n                Some(16118520),\n                Some(16118521),\n                Some(16118522),\n                Some(16118523),\n                Some(16118524),\n                Some(16118525),\n                Some(16118526),\n                Some(16118527),\n                Some(16118528),\n                Some(16118529),\n                Some(16118530),\n                Some(16118531),\n                Some(16118532),\n                Some(16118533),\n                Some(16118534),\n                Some(16118535),\n                Some(16118536),\n                Some(16118537),\n                Some(16118538),\n                Some(16118539),\n                Some(16118540),\n                Some(16118541),\n                Some(16118542),\n                Some(16118543),\n                Some(16118544),\n                Some(16118545),\n                Some(16118546),\n                Some(16118547),\n                Some(16118548),\n                Some(16118549)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(16118499),\n                Some(16118500),\n                Some(16118501),\n                Some(16118502),\n                Some(16118503),\n                Some(16118504),\n                Some(16118505),\n                Some(16118506),\n                Some(16118507),\n                Some(16118508),\n                Some(16118509),\n                Some(16118510),\n                Some(16118511),\n                Some(16118512),\n                Some(16118513),\n                Some(16118514),\n                Some(16118515),\n                Some(16118516),\n                Some(16118517),\n                Some(16118518),\n                Some(16118519),\n                Some(16118520),\n                Some(16118521),\n                Some(16118522),\n                Some(16118523),\n                Some(16118524),\n                Some(16118525),\n                Some(16118526),\n                Some(16118527),\n                Some(16118528),\n                Some(16118529),\n                Some(16118530),\n                Some(16118531),\n                Some(16118532),\n                Some(16118533),\n                Some(16118534),\n                Some(16118535),\n                Some(16118536),\n                Some(16118537),\n                Some(16118538),\n                Some(16118539),\n                Some(16118540),\n                Some(16118541),\n                Some(16118542),\n                Some(16118543),\n                Some(16118544),\n                Some(16118545),\n                Some(16118546),\n                Some(16118547),\n                Some(16118548),\n                Some(16118549)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(16123411),\n                Some(16123412),\n                Some(16123413),\n                Some(16123414),\n                Some(16123415),\n                Some(16123416),\n                Some(16123417),\n                Some(16123418),\n                Some(16123419),\n                Some(16123420),\n                Some(16123421),\n                Some(16123422),\n                Some(16123423),\n                Some(16123424),\n                Some(16123425),\n                Some(16123426),\n                Some(16123427),\n                Some(16123428),\n                Some(16123429),\n                Some(16123430),\n                Some(16123431),\n                Some(16123432),\n                Some(16123433),\n                Some(16123434),\n                Some(16123435),\n                Some(16123436),\n                Some(16123437),\n                Some(16123438),\n                Some(16123439),\n                Some(16123440),\n                Some(16123441),\n                Some(16123442),\n                Some(16123443),\n                Some(16123444),\n                Some(16123445),\n                Some(16123446),\n                Some(16123447),\n                Some(16123448),\n                Some(16123449),\n                Some(16123450),\n                Some(16123451),\n                Some(16123452),\n                Some(16123453),\n                Some(16123454),\n                Some(16123455),\n                Some(16123456),\n                Some(16123457),\n                Some(16123458),\n                Some(16123459),\n                Some(16123460),\n                Some(16123461)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                Some(16123417),\n                Some(16123418),\n                Some(16123419),\n                Some(16123420),\n                Some(16123421),\n                Some(16123422),\n                Some(16123423),\n                Some(16123424),\n                Some(16123425),\n                Some(16123426),\n                Some(16123427),\n                Some(16123428),\n                Some(16123429),\n                Some(16123430),\n                Some(16123431),\n                Some(16123432),\n                Some(16123433),\n                Some(16123434),\n                Some(16123435),\n                Some(16123436),\n                Some(16123437),\n                Some(16123438),\n                Some(16123439),\n                Some(16123440),\n                Some(16123441),\n                Some(16123442),\n                Some(16123443),\n                Some(16123444),\n                Some(16123445),\n                Some(16123446),\n                Some(16123447),\n                Some(16123448),\n                Some(16123449),\n                Some(16123450),\n                Some(16123451),\n                Some(16123452),\n                Some(16123453),\n                Some(16123454),\n                Some(16123455),\n                Some(16123456),\n                Some(16123457),\n                Some(16123458),\n                Some(16123459),\n                Some(16123460),\n                Some(16123461)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(16165860),\n                Some(16165861),\n                Some(16165862),\n                Some(16165863),\n                Some(16165864),\n                Some(16165865),\n                Some(16165866),\n                Some(16165867),\n                Some(16165868),\n                Some(16165869),\n                Some(16165870),\n                Some(16165871),\n                Some(16165872),\n                Some(16165873),\n                Some(16165874),\n                Some(16165875),\n                Some(16165876),\n                Some(16165877),\n                Some(16165878),\n                Some(16165879),\n                Some(16165880),\n                Some(16165881),\n                Some(16165882),\n                Some(16165883),\n                Some(16165884),\n                Some(16165885),\n                Some(16165886),\n                Some(16165887),\n                Some(16165888),\n                Some(16165889),\n                Some(16165890),\n                Some(16165891),\n                Some(16165892),\n                Some(16165893),\n                Some(16165894),\n                Some(16165895),\n                Some(16165896),\n                Some(16165897),\n                Some(16165898),\n                Some(16165899),\n                Some(16165900),\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                None\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(16180871),\n                Some(16180872),\n                Some(16180873),\n                Some(16180874),\n                Some(16180875),\n                Some(16180876),\n                Some(16180877),\n                Some(16180878),\n                Some(16180879),\n                Some(16180880),\n                Some(16180881),\n                Some(16180882),\n                Some(16180883),\n                Some(16180884),\n                Some(16180885),\n                Some(16180886),\n                Some(16180887),\n                Some(16180888),\n                Some(16180889),\n                Some(16180890),\n                Some(16180891),\n                Some(16180892),\n                Some(16180893),\n                Some(16180894),\n                Some(16180895),\n                Some(16180896),\n                Some(16180897),\n                Some(16180898),\n                Some(16180899),\n                Some(16180900),\n                Some(16180901),\n                Some(16180902),\n                Some(16180903),\n                Some(16180904),\n                Some(16180905),\n                Some(16180906),\n                Some(16180907),\n                Some(16180908),\n                Some(16180909),\n                Some(16180910),\n                Some(16180911),\n                Some(16180912),\n                Some(16180913),\n                Some(16180914),\n                Some(16180915),\n                Some(16180916),\n                Some(16180917),\n                Some(16180918),\n                Some(16180919),\n                Some(16180920),\n                Some(16180921)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(16189705),\n                Some(16189706),\n                Some(16189707),\n                Some(16189708),\n                Some(16189709),\n                Some(16189710),\n                Some(16189711),\n                Some(16189712),\n                Some(16189713),\n                Some(16189714),\n                Some(16189715),\n                Some(16189716),\n                Some(16189717),\n                Some(16189718),\n                Some(16189719),\n                Some(16189720),\n                Some(16189721),\n                Some(16189722),\n                Some(16189723),\n                Some(16189724),\n                Some(16189725),\n                Some(16189726),\n                Some(16189727),\n                Some(16189728),\n                Some(16189729),\n                Some(16189730),\n                Some(16189731),\n                Some(16189732),\n                Some(16189733),\n                Some(16189734),\n                Some(16189735),\n                Some(16189736),\n                Some(16189737),\n                Some(16189738),\n                Some(16189739),\n                Some(16189740),\n                Some(16189741),\n                Some(16189742),\n                Some(16189743),\n                Some(16189744),\n                Some(16189745),\n                Some(16189746),\n                Some(16189747),\n                Some(16189748),\n                Some(16189749),\n                Some(16189750),\n                Some(16189751),\n                Some(16189752),\n                Some(16189753),\n                Some(16189754),\n                Some(16189755)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(16231271),\n                Some(16231272),\n                Some(16231273),\n                Some(16231274),\n                Some(16231275),\n                Some(16231276),\n                Some(16231277),\n                Some(16231278),\n                Some(16231279),\n                Some(16231280),\n                Some(16231281),\n                Some(16231282),\n                Some(16231283),\n                Some(16231284),\n                Some(16231285),\n                Some(16231286),\n                Some(16231287),\n                Some(16231288),\n                Some(16231289),\n                Some(16231290),\n                Some(16231291),\n                Some(16231292),\n                Some(16231293),\n                Some(16231294),\n                Some(16231295),\n                Some(16231296),\n                Some(16231297),\n                Some(16231298),\n                Some(16231299),\n                Some(16231300),\n                Some(16231301),\n                Some(16231302),\n                Some(16231303),\n                Some(16231304),\n                Some(16231305),\n                Some(16231306),\n                Some(16231307),\n                Some(16231308),\n                Some(16231309),\n                Some(16231310),\n                Some(16231311),\n                Some(16231312),\n                Some(16231313),\n                Some(16231314),\n                Some(16231315),\n                Some(16231316),\n                Some(16231317),\n                Some(16231318),\n                Some(16231319),\n                Some(16231320),\n                Some(16231321)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(16237657),\n                Some(16237658),\n                Some(16237659),\n                Some(16237660),\n                Some(16237661),\n                Some(16237662),\n                Some(16237663),\n                Some(16237664),\n                Some(16237665),\n                Some(16237666),\n                Some(16237667),\n                Some(16237668),\n                Some(16237669),\n                Some(16237670),\n                Some(16237671),\n                Some(16237672),\n                Some(16237673),\n                Some(16237674),\n                Some(16237675),\n                Some(16237676),\n                Some(16237677),\n                Some(16237678),\n                Some(16237679),\n                Some(16237680),\n                Some(16237681),\n                Some(16237682),\n                Some(16237683),\n                Some(16237684),\n                Some(16237685),\n                Some(16237686),\n                Some(16237687),\n                Some(16237688),\n                Some(16237689),\n                Some(16237690),\n                Some(16237691),\n                Some(16237692),\n                Some(16237693),\n                Some(16237694),\n                Some(16237695),\n                Some(16237696),\n                Some(16237697),\n                Some(16237698),\n                Some(16237699),\n                Some(16237700),\n                Some(16237701),\n                Some(16237702),\n                Some(16237703),\n                Some(16237704),\n                Some(16237705),\n                Some(16237706),\n                Some(16237707)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                Some(16255012),\n                Some(16255013),\n                Some(16255014),\n                Some(16255015),\n                Some(16255016),\n                Some(16255017),\n                Some(16255018),\n                Some(16255019),\n                Some(16255020),\n                Some(16255021),\n                Some(16255022),\n                Some(16255023),\n                Some(16255024),\n                Some(16255025),\n                Some(16255026),\n                Some(16255027),\n                Some(16255028),\n                Some(16255029),\n                Some(16255030),\n                Some(16255031),\n                Some(16255032),\n                Some(16255033),\n                Some(16255034),\n                Some(16255035),\n                Some(16255036),\n                Some(16255037),\n                Some(16255038),\n                Some(16255039),\n                Some(16255040),\n                Some(16255041),\n                Some(16255042),\n                Some(16255043),\n                Some(16255044),\n                Some(16255045),\n                Some(16255046),\n                Some(16255047),\n                Some(16255048),\n                Some(16255049),\n                Some(16255050),\n                Some(16255051),\n                Some(16255052),\n                Some(16255053)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(16255391),\n                Some(16255392),\n                Some(16255393),\n                Some(16255394),\n                Some(16255395),\n                Some(16255396),\n                Some(16255397),\n                Some(16255398),\n                Some(16255399),\n                Some(16255400),\n                Some(16255401),\n                Some(16255402),\n                Some(16255403),\n                Some(16255404),\n                Some(16255405),\n                Some(16255406),\n                Some(16255407),\n                Some(16255408),\n                Some(16255409),\n                Some(16255410),\n                Some(16255411),\n                Some(16255412),\n                Some(16255413),\n                Some(16255414),\n                Some(16255415),\n                Some(16255416),\n                Some(16255417),\n                Some(16255418),\n                Some(16255419),\n                Some(16255420),\n                Some(16255421),\n                Some(16255422),\n                Some(16255423),\n                Some(16255424),\n                Some(16255425),\n                Some(16255426),\n                Some(16255427),\n                Some(16255428),\n                Some(16255429),\n                Some(16255430),\n                Some(16255431),\n                Some(16255432),\n                Some(16255433),\n                Some(16255434),\n                Some(16255435),\n                Some(16255436),\n                Some(16255437),\n                Some(16255438),\n                Some(16255439),\n                Some(16255440),\n                Some(16255441)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(16255392),\n                Some(16255393),\n                Some(16255394),\n                Some(16255395),\n                Some(16255396),\n                Some(16255397),\n                Some(16255398),\n                Some(16255399),\n                Some(16255400),\n                Some(16255401),\n                Some(16255402),\n                Some(16255403),\n                Some(16255404),\n                Some(16255405),\n                Some(16255406),\n                Some(16255407),\n                Some(16255408),\n                Some(16255409),\n                Some(16255410),\n                Some(16255411),\n                Some(16255412),\n                Some(16255413),\n                Some(16255414),\n                Some(16255415),\n                Some(16255416),\n                Some(16255417),\n                Some(16255418),\n                Some(16255419),\n                Some(16255420),\n                Some(16255421),\n                Some(16255422),\n                Some(16255423),\n                Some(16255424),\n                Some(16255425),\n                Some(16255426),\n                Some(16255427),\n                Some(16255428),\n                Some(16255429),\n                Some(16255430),\n                Some(16255431),\n                Some(16255432),\n                Some(16255433),\n                Some(16255434),\n                Some(16255435),\n                Some(16255436),\n                Some(16255437),\n                Some(16255438),\n                Some(16255439),\n                Some(16255440),\n                Some(16255441),\n                None\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(16256084),\n                Some(16256085),\n                Some(16256086),\n                Some(16256087),\n                Some(16256088),\n                Some(16256089),\n                Some(16256090),\n                Some(16256091),\n                Some(16256092),\n                Some(16256093),\n                Some(16256094),\n                Some(16256095),\n                Some(16256096),\n                Some(16256097),\n                Some(16256098),\n                Some(16256099),\n                Some(16256100),\n                Some(16256101),\n                Some(16256102),\n                Some(16256103),\n                Some(16256104),\n                Some(16256105),\n                Some(16256106),\n                Some(16256107),\n                Some(16256108),\n                Some(16256109),\n                Some(16256110),\n                Some(16256111),\n                Some(16256112),\n                Some(16256113),\n                Some(16256114),\n                Some(16256115),\n                Some(16256116),\n                Some(16256117),\n                Some(16256118),\n                Some(16256119),\n                Some(16256120),\n                Some(16256121),\n                Some(16256122),\n                Some(16256123),\n                Some(16256124),\n                Some(16256125),\n                Some(16256126),\n                Some(16256127),\n                Some(16256128),\n                None,\n                None,\n                None,\n                None,\n                None,\n                None\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                None,\n                None,\n                None,\n                Some(16256224),\n                Some(16256225),\n                Some(16256226),\n                Some(16256227),\n                Some(16256228),\n                Some(16256229),\n                Some(16256230),\n                Some(16256231),\n                Some(16256232),\n                Some(16256233),\n                Some(16256234),\n                Some(16256235),\n                Some(16256236),\n                Some(16256237),\n                Some(16256238),\n                Some(16256239),\n                Some(16256240),\n                Some(16256241),\n                Some(16256242),\n                Some(16256243),\n                Some(16256244),\n                Some(16256245),\n                Some(16256246),\n                Some(16256247),\n                Some(16256248),\n                Some(16256249),\n                Some(16256250),\n                Some(16256251),\n                Some(16256252),\n                Some(16256253),\n                Some(16256254),\n                Some(16256255),\n                Some(16256256),\n                Some(16256257),\n                Some(16256258),\n                Some(16256259),\n                Some(16256260),\n                Some(16256261),\n                Some(16256262),\n                Some(16256263),\n                Some(16256264),\n                Some(16256265),\n                Some(16256266),\n                Some(16256267),\n                Some(16256268),\n                Some(16256269),\n                Some(16256270),\n                Some(16256271)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(16325199),\n                Some(16325200),\n                Some(16325201),\n                Some(16325202),\n                Some(16325203),\n                Some(16325204),\n                Some(16325205),\n                Some(16325206),\n                Some(16325207),\n                Some(16325208),\n                Some(16325209),\n                Some(16325210),\n                Some(16325211),\n                Some(16325212),\n                Some(16325213),\n                Some(16325214),\n                Some(16325215),\n                Some(16325216),\n                Some(16325217),\n                Some(16325218),\n                Some(16325219),\n                Some(16325220),\n                Some(16325221),\n                Some(16325222),\n                Some(16325223),\n                Some(16325224),\n                Some(16325225),\n                Some(16325226),\n                Some(16325227),\n                Some(16325228),\n                Some(16325229),\n                Some(16325230),\n                Some(16325231),\n                Some(16325232),\n                Some(16325233),\n                Some(16325234),\n                Some(16325235),\n                Some(16325236),\n                Some(16325237),\n                Some(16325238),\n                Some(16325239),\n                Some(16325240),\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                None\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                Some(16352865),\n                Some(16352866),\n                Some(16352867),\n                Some(16352868),\n                Some(16352869),\n                Some(16352870),\n                Some(16352871),\n                Some(16352872),\n                Some(16352873),\n                Some(16352874),\n                Some(16352875),\n                Some(16352876),\n                Some(16352877),\n                Some(16352878),\n                Some(16352879),\n                Some(16352880),\n                Some(16352881),\n                Some(16352882),\n                Some(16352883),\n                Some(16352884),\n                Some(16352885),\n                Some(16352886),\n                Some(16352887),\n                Some(16352888),\n                Some(16352889),\n                Some(16352890),\n                Some(16352891),\n                Some(16352892),\n                Some(16352893),\n                Some(16352894),\n                Some(16352895),\n                Some(16352896),\n                Some(16352897),\n                Some(16352898),\n                Some(16352899),\n                Some(16352900),\n                Some(16352901),\n                Some(16352902)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(16352968),\n                Some(16352969),\n                Some(16352970),\n                Some(16352971),\n                Some(16352972),\n                Some(16352973),\n                Some(16352974),\n                Some(16352975),\n                Some(16352976),\n                Some(16352977),\n                Some(16352978),\n                Some(16352979),\n                Some(16352980),\n                Some(16352981),\n                Some(16352982),\n                Some(16352983),\n                Some(16352984),\n                Some(16352985),\n                Some(16352986),\n                Some(16352987),\n                Some(16352988),\n                Some(16352989),\n                Some(16352990),\n                Some(16352991),\n                Some(16352992),\n                Some(16352993),\n                Some(16352994),\n                Some(16352995),\n                Some(16352996),\n                Some(16352997),\n                Some(16352998),\n                Some(16352999),\n                Some(16353000),\n                Some(16353001),\n                Some(16353002),\n                Some(16353003),\n                Some(16353004),\n                Some(16353005),\n                Some(16353006),\n                Some(16353007),\n                Some(16353008),\n                Some(16353009),\n                Some(16353010),\n                Some(16353011),\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                None\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                None,\n                None,\n                None,\n                None,\n                None,\n                Some(16414998),\n                Some(16414999),\n                Some(16415000),\n                Some(16415001),\n                Some(16415002),\n                Some(16415003),\n                Some(16415004),\n                Some(16415005),\n                Some(16415006),\n                Some(16415007),\n                Some(16415008),\n                Some(16415009),\n                Some(16415010),\n                Some(16415011),\n                Some(16415012),\n                Some(16415013),\n                Some(16415014),\n                Some(16415015),\n                Some(16415016),\n                Some(16415017),\n                Some(16415018),\n                Some(16415019),\n                Some(16415020),\n                Some(16415021),\n                Some(16415022),\n                Some(16415023),\n                Some(16415024),\n                Some(16415025),\n                Some(16415026),\n                Some(16415027),\n                Some(16415028),\n                Some(16415029),\n                Some(16415030),\n                Some(16415031),\n                Some(16415032),\n                Some(16415033),\n                Some(16415034),\n                Some(16415035),\n                Some(16415036),\n                Some(16415037),\n                Some(16415038),\n                Some(16415039),\n                Some(16415040),\n                Some(16415041),\n                Some(16415042),\n                Some(16415043)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(17031591),\n                Some(17031592),\n                Some(17031593),\n                Some(17031594),\n                Some(17031595),\n                Some(17031596),\n                Some(17031597),\n                Some(17031598),\n                Some(17031599),\n                Some(17031600),\n                Some(17031601),\n                Some(17031602),\n                Some(17031603),\n                Some(17031604),\n                Some(17031605),\n                Some(17031606),\n                Some(17031607),\n                Some(17031608),\n                Some(17031609),\n                Some(17031610),\n                Some(17031611),\n                Some(17031612),\n                Some(17031613),\n                None,\n                None,\n                None,\n                None,\n                Some(17031614),\n                Some(17031615),\n                Some(17031616),\n                Some(17031617),\n                Some(17031618),\n                Some(17031619),\n                Some(17031620),\n                Some(17031621),\n                Some(17031622),\n                Some(17031623),\n                Some(17031624),\n                Some(17031625),\n                Some(17031626),\n                Some(17031627),\n                Some(17031628),\n                Some(17031629),\n                Some(17031630),\n                Some(17031631),\n                Some(17031632),\n                Some(17031633),\n                Some(17031634),\n                Some(17031635),\n                Some(17031636),\n                Some(17031637)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(17057382),\n                Some(17057383),\n                Some(17057384),\n                Some(17057385),\n                Some(17057386),\n                Some(17057387),\n                Some(17057388),\n                Some(17057389),\n                Some(17057390),\n                Some(17057391),\n                Some(17057392),\n                Some(17057393),\n                Some(17057394),\n                Some(17057395),\n                Some(17057396),\n                Some(17057397),\n                Some(17057398),\n                Some(17057399),\n                None,\n                Some(17057400),\n                Some(17057401),\n                Some(17057402),\n                Some(17057403),\n                Some(17057404),\n                Some(17057405),\n                Some(17057406),\n                Some(17057407),\n                Some(17057408),\n                Some(17057409),\n                Some(17057410),\n                Some(17057411),\n                Some(17057412),\n                Some(17057413),\n                Some(17057414),\n                Some(17057415),\n                Some(17057416),\n                Some(17057417),\n                Some(17057418),\n                Some(17057419),\n                Some(17057420),\n                Some(17057421),\n                Some(17057422),\n                Some(17057423),\n                Some(17057424),\n                Some(17057425),\n                Some(17057426),\n                Some(17057427),\n                Some(17057428),\n                Some(17057429),\n                Some(17057430),\n                Some(17057431)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(17092766),\n                Some(17092767),\n                Some(17092768),\n                Some(17092769),\n                Some(17092770),\n                Some(17092771),\n                Some(17092772),\n                Some(17092773),\n                Some(17092774),\n                Some(17092775),\n                Some(17092776),\n                Some(17092777),\n                Some(17092778),\n                Some(17092779),\n                Some(17092780),\n                Some(17092781),\n                Some(17092782),\n                Some(17094966),\n                Some(17094967),\n                Some(17094968),\n                Some(17094969),\n                Some(17094970),\n                Some(17094971),\n                Some(17094972),\n                Some(17094973),\n                Some(17094974),\n                Some(17094975),\n                Some(17094976),\n                Some(17094977),\n                Some(17094978),\n                Some(17094979),\n                Some(17094980),\n                Some(17094981),\n                Some(17094982),\n                Some(17094983),\n                Some(17094984),\n                Some(17094985),\n                Some(17094986),\n                Some(17094987),\n                Some(17094988),\n                Some(17094989),\n                Some(17094990),\n                Some(17094991),\n                Some(17094992),\n                Some(17094993),\n                Some(17094994),\n                Some(17094995),\n                Some(17094996),\n                Some(17094997),\n                Some(17094998),\n                Some(17094999)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(17092782),\n                Some(17094966),\n                Some(17094967),\n                Some(17094968),\n                Some(17094969),\n                Some(17094970),\n                Some(17094971),\n                Some(17094972),\n                Some(17094973),\n                Some(17094974),\n                Some(17094975),\n                Some(17094976),\n                Some(17094977),\n                Some(17094978),\n                Some(17094979),\n                Some(17094980),\n                Some(17094981),\n                Some(17094982),\n                Some(17094983),\n                Some(17094984),\n                Some(17094985),\n                Some(17094986),\n                Some(17094987),\n                Some(17094988),\n                Some(17094989),\n                Some(17094990),\n                Some(17094991),\n                Some(17094992),\n                Some(17094993),\n                Some(17094994),\n                Some(17094995),\n                Some(17094996),\n                Some(17094997),\n                Some(17094998),\n                Some(17094999),\n                Some(17095000),\n                Some(17095001),\n                Some(17095002),\n                Some(17095003),\n                Some(17095004),\n                Some(17095005),\n                Some(17095006),\n                Some(17095007),\n                Some(17095008),\n                Some(17095009),\n                Some(17095010),\n                Some(17095011),\n                Some(17095012),\n                Some(17095013),\n                Some(17095014),\n                Some(17095015)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(17092782),\n                Some(17094966),\n                Some(17094967),\n                Some(17094968),\n                Some(17094969),\n                Some(17094970),\n                Some(17094971),\n                Some(17094972),\n                Some(17094973),\n                Some(17094974),\n                Some(17094975),\n                Some(17094976),\n                Some(17094977),\n                Some(17094978),\n                Some(17094979),\n                Some(17094980),\n                Some(17094981),\n                Some(17094982),\n                Some(17094983),\n                Some(17094984),\n                Some(17094985),\n                Some(17094986),\n                Some(17094987),\n                Some(17094988),\n                Some(17094989),\n                Some(17094990),\n                Some(17094991),\n                Some(17094992),\n                Some(17094993),\n                Some(17094994),\n                Some(17094995),\n                Some(17094996),\n                Some(17094997),\n                Some(17094998),\n                Some(17094999),\n                Some(17095000),\n                Some(17095001),\n                Some(17095002),\n                Some(17095003),\n                Some(17095004),\n                Some(17095005),\n                Some(17095006),\n                Some(17095007),\n                Some(17095008),\n                Some(17095009),\n                Some(17095010),\n                Some(17095011),\n                Some(17095012),\n                Some(17095013),\n                Some(17095014),\n                Some(17095015)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                Some(17137287),\n                Some(17137288),\n                Some(17137289),\n                Some(17137290),\n                Some(17137291),\n                Some(17137292),\n                Some(17137293),\n                Some(17137294),\n                Some(17137295),\n                Some(17137296),\n                Some(17137297),\n                Some(17137298),\n                Some(17137299),\n                Some(17137300),\n                Some(17137301),\n                Some(17137302),\n                Some(17137303),\n                Some(17137304),\n                Some(17137305),\n                Some(17137306),\n                Some(17137307),\n                Some(17137308),\n                Some(17137309),\n                Some(17137310),\n                Some(17137311),\n                Some(17137312),\n                Some(17137313),\n                Some(17137314),\n                Some(17137315),\n                Some(17137316),\n                Some(17137317),\n                Some(17137318),\n                Some(17137319),\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                None\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                None,\n                None,\n                Some(17306238),\n                Some(17306239),\n                Some(17306240),\n                Some(17306241),\n                Some(17306242),\n                Some(17306243),\n                Some(17306244),\n                Some(17306245),\n                Some(17306246),\n                Some(17306247),\n                Some(17306248),\n                Some(17306249),\n                Some(17306250),\n                Some(17306251),\n                Some(17306252),\n                Some(17306253),\n                Some(17306254),\n                Some(17306255),\n                Some(17306256),\n                Some(17306257),\n                Some(17306258),\n                Some(17306259),\n                Some(17306260),\n                Some(17306261),\n                Some(17306262),\n                Some(17306263),\n                Some(17306264),\n                Some(17306265),\n                Some(17306266),\n                Some(17306267),\n                Some(17306268),\n                Some(17306269),\n                Some(17306270),\n                Some(17306271),\n                Some(17306272),\n                Some(17306273),\n                Some(17306274),\n                Some(17306275),\n                Some(17306276),\n                Some(17306277),\n                Some(17306278),\n                Some(17306279),\n                Some(17306280),\n                Some(17306281),\n                Some(17306282),\n                Some(17306283),\n                Some(17306284),\n                Some(17306285),\n                None\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                None,\n                None,\n                None,\n                None,\n                Some(17561868),\n                Some(17561869),\n                Some(17561870),\n                Some(17561871),\n                Some(17561872),\n                Some(17561873),\n                Some(17561874),\n                Some(17561875),\n                Some(17561876),\n                Some(17561877),\n                Some(17561878),\n                Some(17561879),\n                Some(17561880),\n                Some(17561881),\n                Some(17561882),\n                Some(17561883),\n                Some(17561884),\n                Some(17561885),\n                Some(17561886),\n                Some(17561887),\n                Some(17561888),\n                Some(17561889),\n                Some(17561890),\n                Some(17561891),\n                Some(17561892),\n                Some(17561893),\n                Some(17561894),\n                Some(17561895),\n                Some(17561896),\n                Some(17561897),\n                Some(17561898),\n                Some(17561899),\n                Some(17561900),\n                Some(17561901),\n                Some(17561902),\n                Some(17561903),\n                Some(17561904),\n                Some(17561905),\n                Some(17561906),\n                Some(17561907),\n                Some(17561908),\n                Some(17561909),\n                Some(17561910),\n                Some(17561911),\n                Some(17561912),\n                None,\n                None\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(17566078),\n                Some(17566079),\n                Some(17566080),\n                Some(17566081),\n                Some(17566082),\n                Some(17566083),\n                Some(17566084),\n                Some(17566085),\n                Some(17566086),\n                Some(17566087),\n                Some(17566088),\n                Some(17566089),\n                Some(17566090),\n                Some(17566091),\n                Some(17566092),\n                Some(17566093),\n                Some(17566094),\n                Some(17566095),\n                Some(17566096),\n                Some(17566097),\n                Some(17566098),\n                Some(17566099),\n                Some(17566100),\n                Some(17566101),\n                Some(17566102),\n                Some(17566103),\n                Some(17566104),\n                Some(17566105),\n                Some(17566106),\n                Some(17566107),\n                Some(17566108),\n                Some(17566109),\n                Some(17566110),\n                Some(17566111),\n                Some(17566112),\n                Some(17566113),\n                Some(17566114),\n                Some(17566115),\n                Some(17566116),\n                Some(17566117),\n                Some(17566118),\n                Some(17577951),\n                Some(17577952),\n                Some(17577953),\n                Some(17577954),\n                Some(17577955),\n                Some(17577956),\n                Some(17577957),\n                Some(17577958),\n                Some(17577959),\n                Some(17577960)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(17566108),\n                Some(17566109),\n                Some(17566110),\n                Some(17566111),\n                Some(17566112),\n                Some(17566113),\n                Some(17566114),\n                Some(17566115),\n                Some(17566116),\n                Some(17566117),\n                Some(17566118),\n                Some(17577951),\n                Some(17577952),\n                Some(17577953),\n                Some(17577954),\n                Some(17577955),\n                Some(17577956),\n                Some(17577957),\n                Some(17577958),\n                Some(17577959),\n                Some(17577960),\n                Some(17577961),\n                Some(17577962),\n                Some(17577963),\n                Some(17577964),\n                Some(17577965),\n                Some(17577966),\n                Some(17577967),\n                Some(17577968),\n                Some(17577969),\n                Some(17577970),\n                Some(17577971),\n                Some(17577972),\n                Some(17577973),\n                Some(17577974),\n                Some(17577975),\n                Some(17578686),\n                Some(17578687),\n                Some(17578688),\n                Some(17578689),\n                Some(17578690),\n                Some(17578691),\n                Some(17578692),\n                Some(17578693),\n                Some(17578694),\n                Some(17578695),\n                Some(17578696),\n                Some(17578697),\n                Some(17578698),\n                Some(17578699),\n                Some(17578700)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(17566111),\n                Some(17566112),\n                Some(17566113),\n                Some(17566114),\n                Some(17566115),\n                Some(17566116),\n                Some(17566117),\n                Some(17566118),\n                Some(17577951),\n                Some(17577952),\n                Some(17577953),\n                Some(17577954),\n                Some(17577955),\n                Some(17577956),\n                Some(17577957),\n                Some(17577958),\n                Some(17577959),\n                Some(17577960),\n                Some(17577961),\n                Some(17577962),\n                Some(17577963),\n                Some(17577964),\n                Some(17577965),\n                Some(17577966),\n                Some(17577967),\n                Some(17577968),\n                Some(17577969),\n                Some(17577970),\n                Some(17577971),\n                Some(17577972),\n                Some(17577973),\n                Some(17577974),\n                Some(17577975),\n                Some(17578686),\n                Some(17578687),\n                Some(17578688),\n                Some(17578689),\n                Some(17578690),\n                Some(17578691),\n                Some(17578692),\n                Some(17578693),\n                Some(17578694),\n                Some(17578695),\n                Some(17578696),\n                Some(17578697),\n                Some(17578698),\n                Some(17578699),\n                Some(17578700),\n                Some(17578701),\n                Some(17578702),\n                Some(17578703)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(17566111),\n                Some(17566112),\n                Some(17566113),\n                Some(17566114),\n                Some(17566115),\n                Some(17566116),\n                Some(17566117),\n                Some(17566118),\n                Some(17577951),\n                Some(17577952),\n                Some(17577953),\n                Some(17577954),\n                Some(17577955),\n                Some(17577956),\n                Some(17577957),\n                Some(17577958),\n                Some(17577959),\n                Some(17577960),\n                Some(17577961),\n                Some(17577962),\n                Some(17577963),\n                Some(17577964),\n                Some(17577965),\n                Some(17577966),\n                Some(17577967),\n                Some(17577968),\n                Some(17577969),\n                Some(17577970),\n                Some(17577971),\n                Some(17577972),\n                Some(17577973),\n                Some(17577974),\n                Some(17577975),\n                Some(17578686),\n                Some(17578687),\n                Some(17578688),\n                Some(17578689),\n                Some(17578690),\n                Some(17578691),\n                Some(17578692),\n                Some(17578693),\n                Some(17578694),\n                Some(17578695),\n                Some(17578696),\n                Some(17578697),\n                Some(17578698),\n                Some(17578699),\n                Some(17578700),\n                Some(17578701),\n                Some(17578702),\n                Some(17578703)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(17566111),\n                Some(17566112),\n                Some(17566113),\n                Some(17566114),\n                Some(17566115),\n                Some(17566116),\n                Some(17566117),\n                Some(17566118),\n                Some(17577951),\n                Some(17577952),\n                Some(17577953),\n                Some(17577954),\n                Some(17577955),\n                Some(17577956),\n                Some(17577957),\n                Some(17577958),\n                Some(17577959),\n                Some(17577960),\n                Some(17577961),\n                Some(17577962),\n                Some(17577963),\n                Some(17577964),\n                Some(17577965),\n                Some(17577966),\n                Some(17577967),\n                Some(17577968),\n                Some(17577969),\n                Some(17577970),\n                Some(17577971),\n                Some(17577972),\n                Some(17577973),\n                Some(17577974),\n                Some(17577975),\n                Some(17578686),\n                Some(17578687),\n                Some(17578688),\n                Some(17578689),\n                Some(17578690),\n                Some(17578691),\n                Some(17578692),\n                Some(17578693),\n                Some(17578694),\n                Some(17578695),\n                Some(17578696),\n                Some(17578697),\n                Some(17578698),\n                Some(17578699),\n                Some(17578700),\n                Some(17578701),\n                Some(17578702),\n                Some(17578703)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(17566111),\n                Some(17566112),\n                Some(17566113),\n                Some(17566114),\n                Some(17566115),\n                Some(17566116),\n                Some(17566117),\n                Some(17566118),\n                Some(17577951),\n                Some(17577952),\n                Some(17577953),\n                Some(17577954),\n                Some(17577955),\n                Some(17577956),\n                Some(17577957),\n                Some(17577958),\n                Some(17577959),\n                Some(17577960),\n                Some(17577961),\n                Some(17577962),\n                Some(17577963),\n                Some(17577964),\n                Some(17577965),\n                Some(17577966),\n                Some(17577967),\n                Some(17577968),\n                Some(17577969),\n                Some(17577970),\n                Some(17577971),\n                Some(17577972),\n                Some(17577973),\n                Some(17577974),\n                Some(17577975),\n                Some(17578686),\n                Some(17578687),\n                Some(17578688),\n                Some(17578689),\n                Some(17578690),\n                Some(17578691),\n                Some(17578692),\n                Some(17578693),\n                Some(17578694),\n                Some(17578695),\n                Some(17578696),\n                Some(17578697),\n                Some(17578698),\n                Some(17578699),\n                Some(17578700),\n                Some(17578701),\n                Some(17578702),\n                Some(17578703)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(17566112),\n                Some(17566113),\n                Some(17566114),\n                Some(17566115),\n                Some(17566116),\n                Some(17566117),\n                Some(17566118),\n                Some(17577951),\n                Some(17577952),\n                Some(17577953),\n                Some(17577954),\n                Some(17577955),\n                Some(17577956),\n                Some(17577957),\n                Some(17577958),\n                Some(17577959),\n                Some(17577960),\n                Some(17577961),\n                Some(17577962),\n                Some(17577963),\n                Some(17577964),\n                Some(17577965),\n                Some(17577966),\n                Some(17577967),\n                Some(17577968),\n                Some(17577969),\n                Some(17577970),\n                Some(17577971),\n                Some(17577972),\n                Some(17577973),\n                Some(17577974),\n                Some(17577975),\n                Some(17578686),\n                Some(17578687),\n                Some(17578688),\n                Some(17578689),\n                Some(17578690),\n                Some(17578691),\n                Some(17578692),\n                Some(17578693),\n                Some(17578694),\n                Some(17578695),\n                Some(17578696),\n                Some(17578697),\n                Some(17578698),\n                Some(17578699),\n                Some(17578700),\n                Some(17578701),\n                Some(17578702),\n                Some(17578703),\n                Some(17578704)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(17566113),\n                Some(17566114),\n                Some(17566115),\n                Some(17566116),\n                Some(17566117),\n                Some(17566118),\n                Some(17577951),\n                Some(17577952),\n                Some(17577953),\n                Some(17577954),\n                Some(17577955),\n                Some(17577956),\n                Some(17577957),\n                Some(17577958),\n                Some(17577959),\n                Some(17577960),\n                Some(17577961),\n                Some(17577962),\n                Some(17577963),\n                Some(17577964),\n                Some(17577965),\n                Some(17577966),\n                Some(17577967),\n                Some(17577968),\n                Some(17577969),\n                Some(17577970),\n                Some(17577971),\n                Some(17577972),\n                Some(17577973),\n                Some(17577974),\n                Some(17577975),\n                Some(17578686),\n                Some(17578687),\n                Some(17578688),\n                Some(17578689),\n                Some(17578690),\n                Some(17578691),\n                Some(17578692),\n                Some(17578693),\n                Some(17578694),\n                Some(17578695),\n                Some(17578696),\n                Some(17578697),\n                Some(17578698),\n                Some(17578699),\n                Some(17578700),\n                Some(17578701),\n                Some(17578702),\n                Some(17578703),\n                Some(17578704),\n                Some(17578705)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(17566113),\n                Some(17566114),\n                Some(17566115),\n                Some(17566116),\n                Some(17566117),\n                Some(17566118),\n                Some(17577951),\n                Some(17577952),\n                Some(17577953),\n                Some(17577954),\n                Some(17577955),\n                Some(17577956),\n                Some(17577957),\n                Some(17577958),\n                Some(17577959),\n                Some(17577960),\n                Some(17577961),\n                Some(17577962),\n                Some(17577963),\n                Some(17577964),\n                Some(17577965),\n                Some(17577966),\n                Some(17577967),\n                Some(17577968),\n                Some(17577969),\n                Some(17577970),\n                Some(17577971),\n                Some(17577972),\n                Some(17577973),\n                Some(17577974),\n                Some(17577975),\n                Some(17578686),\n                Some(17578687),\n                Some(17578688),\n                Some(17578689),\n                Some(17578690),\n                Some(17578691),\n                Some(17578692),\n                Some(17578693),\n                Some(17578694),\n                Some(17578695),\n                Some(17578696),\n                Some(17578697),\n                Some(17578698),\n                Some(17578699),\n                Some(17578700),\n                Some(17578701),\n                Some(17578702),\n                Some(17578703),\n                Some(17578704),\n                Some(17578705)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                None,\n                Some(17579733),\n                Some(17579734),\n                Some(17579735),\n                Some(17579736),\n                Some(17579737),\n                Some(17579738),\n                Some(17579739),\n                Some(17579740),\n                Some(17579741),\n                Some(17579742),\n                Some(17579743),\n                Some(17579744),\n                Some(17579745),\n                Some(17579746),\n                Some(17579747),\n                Some(17579748),\n                Some(17579749),\n                Some(17579750),\n                Some(17579751),\n                Some(17579752),\n                Some(17579753),\n                Some(17579754),\n                Some(17579755),\n                Some(17579756),\n                Some(17579757),\n                Some(17579758),\n                Some(17579759),\n                Some(17579760),\n                Some(17579761),\n                Some(17579762),\n                Some(17579763),\n                Some(17579764),\n                Some(17579765),\n                Some(17579766),\n                Some(17579767),\n                Some(17579768),\n                Some(17579769),\n                Some(17579770),\n                Some(17579771),\n                Some(17579772),\n                Some(17579773),\n                Some(17579774),\n                Some(17579775),\n                Some(17579776),\n                Some(17581244),\n                Some(17581245),\n                Some(17581246),\n                Some(17581247),\n                Some(17581248),\n                Some(17581249)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(17581369),\n                Some(17581370),\n                Some(17582885),\n                Some(17582886),\n                Some(17582887),\n                Some(17582888),\n                Some(17582889),\n                Some(17582890),\n                Some(17582891),\n                Some(17582892),\n                Some(17582893),\n                Some(17582894),\n                Some(17582895),\n                Some(17582896),\n                Some(17582897),\n                Some(17582898),\n                Some(17582899),\n                Some(17582900),\n                Some(17582901),\n                Some(17582902),\n                Some(17582903),\n                Some(17582904),\n                Some(17582905),\n                Some(17582906),\n                Some(17582907),\n                Some(17582908),\n                Some(17582909),\n                Some(17582910),\n                Some(17582911),\n                Some(17582912),\n                Some(17582913),\n                Some(17582914),\n                Some(17582915),\n                Some(17582916),\n                Some(17582917),\n                Some(17582918),\n                Some(17582919),\n                Some(17582920),\n                Some(17582921),\n                Some(17582922),\n                Some(17582923),\n                Some(17582924),\n                Some(17582925),\n                Some(17582926),\n                Some(17582927),\n                Some(17582928),\n                Some(17582929),\n                Some(17582930),\n                Some(17582931),\n                Some(17582932),\n                Some(17583028)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(17581370),\n                Some(17582885),\n                Some(17582886),\n                Some(17582887),\n                Some(17582888),\n                Some(17582889),\n                Some(17582890),\n                Some(17582891),\n                Some(17582892),\n                Some(17582893),\n                Some(17582894),\n                Some(17582895),\n                Some(17582896),\n                Some(17582897),\n                Some(17582898),\n                Some(17582899),\n                Some(17582900),\n                Some(17582901),\n                Some(17582902),\n                Some(17582903),\n                Some(17582904),\n                Some(17582905),\n                Some(17582906),\n                Some(17582907),\n                Some(17582908),\n                Some(17582909),\n                Some(17582910),\n                Some(17582911),\n                Some(17582912),\n                Some(17582913),\n                Some(17582914),\n                Some(17582915),\n                Some(17582916),\n                Some(17582917),\n                Some(17582918),\n                Some(17582919),\n                Some(17582920),\n                Some(17582921),\n                Some(17582922),\n                Some(17582923),\n                Some(17582924),\n                Some(17582925),\n                Some(17582926),\n                Some(17582927),\n                Some(17582928),\n                Some(17582929),\n                Some(17582930),\n                Some(17582931),\n                Some(17582932),\n                Some(17583028),\n                Some(17583029)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(17581370),\n                Some(17582885),\n                Some(17582886),\n                Some(17582887),\n                Some(17582888),\n                Some(17582889),\n                Some(17582890),\n                Some(17582891),\n                Some(17582892),\n                Some(17582893),\n                Some(17582894),\n                Some(17582895),\n                Some(17582896),\n                Some(17582897),\n                Some(17582898),\n                Some(17582899),\n                Some(17582900),\n                Some(17582901),\n                Some(17582902),\n                Some(17582903),\n                Some(17582904),\n                Some(17582905),\n                Some(17582906),\n                Some(17582907),\n                Some(17582908),\n                Some(17582909),\n                Some(17582910),\n                Some(17582911),\n                Some(17582912),\n                Some(17582913),\n                Some(17582914),\n                Some(17582915),\n                Some(17582916),\n                Some(17582917),\n                Some(17582918),\n                Some(17582919),\n                Some(17582920),\n                Some(17582921),\n                Some(17582922),\n                Some(17582923),\n                Some(17582924),\n                Some(17582925),\n                Some(17582926),\n                Some(17582927),\n                Some(17582928),\n                Some(17582929),\n                Some(17582930),\n                Some(17582931),\n                Some(17582932),\n                Some(17583028),\n                Some(17583029)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                None,\n                Some(17582911),\n                Some(17582912),\n                Some(17582913),\n                Some(17582914),\n                Some(17582915),\n                Some(17582916),\n                Some(17582917),\n                Some(17582918),\n                Some(17582919),\n                Some(17582920),\n                Some(17582921),\n                Some(17582922),\n                Some(17582923),\n                Some(17582924),\n                Some(17582925),\n                Some(17582926),\n                Some(17582927),\n                Some(17582928),\n                Some(17582929),\n                Some(17582930),\n                Some(17582931),\n                Some(17582932),\n                Some(17583028),\n                Some(17583029),\n                Some(17583030),\n                Some(17583031),\n                Some(17583032),\n                Some(17583033),\n                Some(17583034),\n                Some(17583035),\n                Some(17583036),\n                Some(17583037),\n                Some(17583038),\n                Some(17583039),\n                Some(17583040),\n                Some(17583041),\n                Some(17583042),\n                Some(17583043),\n                Some(17583044),\n                Some(17583045),\n                Some(17583046),\n                Some(17583047),\n                Some(17583048),\n                Some(17583049),\n                Some(17583050),\n                Some(17583051),\n                Some(17583052),\n                Some(17583053),\n                Some(17583054),\n                Some(17583055)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(17588621),\n                Some(17588622),\n                Some(17588623),\n                Some(17588624),\n                Some(17588625),\n                Some(17588626),\n                Some(17588627),\n                Some(17588628),\n                Some(17588629),\n                Some(17588630),\n                Some(17588631),\n                Some(17588632),\n                Some(17588633),\n                Some(17588634),\n                Some(17588635),\n                Some(17588636),\n                Some(17588637),\n                Some(17588638),\n                Some(17588639),\n                Some(17588640),\n                Some(17588641),\n                Some(17588642),\n                Some(17588643),\n                Some(17588644),\n                Some(17588645),\n                Some(17588646),\n                Some(17588647),\n                Some(17588648),\n                Some(17588649),\n                Some(17588650),\n                Some(17588651),\n                Some(17588652),\n                Some(17588653),\n                Some(17588654),\n                Some(17588655),\n                Some(17588656),\n                Some(17588657),\n                Some(17589196),\n                Some(17589197),\n                Some(17589198),\n                Some(17589199),\n                Some(17589200),\n                Some(17589201),\n                Some(17589202),\n                Some(17589203),\n                Some(17589204),\n                Some(17589205),\n                Some(17589206),\n                Some(17589207),\n                Some(17589208),\n                None\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(17588621),\n                Some(17588622),\n                Some(17588623),\n                Some(17588624),\n                Some(17588625),\n                Some(17588626),\n                Some(17588627),\n                Some(17588628),\n                Some(17588629),\n                Some(17588630),\n                Some(17588631),\n                Some(17588632),\n                Some(17588633),\n                Some(17588634),\n                Some(17588635),\n                Some(17588636),\n                Some(17588637),\n                Some(17588638),\n                Some(17588639),\n                Some(17588640),\n                Some(17588641),\n                Some(17588642),\n                Some(17588643),\n                Some(17588644),\n                Some(17588645),\n                Some(17588646),\n                Some(17588647),\n                Some(17588648),\n                Some(17588649),\n                Some(17588650),\n                Some(17588651),\n                Some(17588652),\n                Some(17588653),\n                Some(17588654),\n                Some(17588655),\n                Some(17588656),\n                Some(17588657),\n                Some(17589196),\n                Some(17589197),\n                Some(17589198),\n                Some(17589199),\n                Some(17589200),\n                Some(17589201),\n                Some(17589202),\n                Some(17589203),\n                Some(17589204),\n                Some(17589205),\n                Some(17589206),\n                Some(17589207),\n                Some(17589208),\n                None\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(17588621),\n                Some(17588622),\n                Some(17588623),\n                Some(17588624),\n                Some(17588625),\n                Some(17588626),\n                Some(17588627),\n                Some(17588628),\n                Some(17588629),\n                Some(17588630),\n                Some(17588631),\n                Some(17588632),\n                Some(17588633),\n                Some(17588634),\n                Some(17588635),\n                Some(17588636),\n                Some(17588637),\n                Some(17588638),\n                Some(17588639),\n                Some(17588640),\n                Some(17588641),\n                Some(17588642),\n                Some(17588643),\n                Some(17588644),\n                Some(17588645),\n                Some(17588646),\n                Some(17588647),\n                Some(17588648),\n                Some(17588649),\n                Some(17588650),\n                Some(17588651),\n                Some(17588652),\n                Some(17588653),\n                Some(17588654),\n                Some(17588655),\n                Some(17588656),\n                Some(17588657),\n                Some(17589196),\n                Some(17589197),\n                Some(17589198),\n                Some(17589199),\n                Some(17589200),\n                Some(17589201),\n                Some(17589202),\n                Some(17589203),\n                Some(17589204),\n                Some(17589205),\n                Some(17589206),\n                Some(17589207),\n                Some(17589208),\n                None\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                None,\n                Some(17591770),\n                Some(17591771),\n                Some(17591772),\n                Some(17591773),\n                Some(17591774),\n                Some(17591775),\n                Some(17591776),\n                Some(17591777),\n                Some(17591778),\n                Some(17591779),\n                Some(17591780),\n                Some(17591781),\n                Some(17591782),\n                Some(17591783),\n                Some(17591784),\n                Some(17591785),\n                Some(17591786),\n                Some(17591787),\n                Some(17591788),\n                Some(17591789),\n                Some(17591790),\n                Some(17591791),\n                Some(17591792),\n                Some(17591793),\n                Some(17591794),\n                Some(17591796),\n                Some(17591797),\n                Some(17591798),\n                Some(17591799),\n                Some(17591800),\n                Some(17591801),\n                Some(17591802),\n                Some(17591803),\n                Some(17591804),\n                Some(17591805),\n                Some(17591806),\n                Some(17591807),\n                Some(17591808),\n                Some(17591809),\n                Some(17591810),\n                Some(17591811),\n                Some(17591812),\n                Some(17591813),\n                Some(17591814),\n                Some(17591815),\n                Some(17591816),\n                Some(17591817),\n                Some(17591818),\n                Some(17591819),\n                Some(17591820)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(17593855),\n                Some(17593856),\n                Some(17593857),\n                Some(17593858),\n                Some(17593859),\n                Some(17593860),\n                Some(17593861),\n                Some(17593862),\n                Some(17593863),\n                Some(17593864),\n                Some(17593865),\n                Some(17593866),\n                Some(17593867),\n                Some(17593868),\n                Some(17593869),\n                Some(17593870),\n                Some(17593871),\n                Some(17593872),\n                Some(17593873),\n                Some(17593874),\n                Some(17593875),\n                Some(17593876),\n                Some(17593877),\n                Some(17593878),\n                Some(17593880),\n                Some(17593881),\n                Some(17593882),\n                Some(17593883),\n                Some(17593884),\n                Some(17593885),\n                Some(17593886),\n                Some(17593887),\n                Some(17593888),\n                Some(17593889),\n                Some(17593890),\n                Some(17593891),\n                Some(17593892),\n                Some(17593893),\n                Some(17593894),\n                Some(17593895),\n                Some(17593896),\n                Some(17593897),\n                Some(17593898),\n                Some(17593899),\n                Some(17593900),\n                Some(17593901),\n                Some(17593902),\n                Some(17593903),\n                None,\n                None,\n                None\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(17593863),\n                Some(17593864),\n                Some(17593865),\n                Some(17593866),\n                Some(17593867),\n                Some(17593868),\n                Some(17593869),\n                Some(17593870),\n                Some(17593871),\n                Some(17593872),\n                Some(17593873),\n                Some(17593874),\n                Some(17593875),\n                Some(17593876),\n                Some(17593877),\n                Some(17593878),\n                Some(17593880),\n                Some(17593881),\n                Some(17593882),\n                Some(17593883),\n                Some(17593884),\n                Some(17593885),\n                Some(17593886),\n                Some(17593887),\n                Some(17593888),\n                Some(17593889),\n                Some(17593890),\n                Some(17593891),\n                Some(17593892),\n                Some(17593893),\n                Some(17593894),\n                Some(17593895),\n                Some(17593896),\n                Some(17593897),\n                Some(17593898),\n                Some(17593899),\n                Some(17593900),\n                Some(17593901),\n                Some(17593902),\n                Some(17593903),\n                Some(17593904),\n                Some(17593905),\n                Some(17593906),\n                Some(17593907),\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                None\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                None,\n                Some(17596476),\n                Some(17596477),\n                Some(17596478),\n                Some(17596479),\n                Some(17596480),\n                Some(17596481),\n                Some(17596482),\n                None,\n                Some(17596483),\n                Some(17596484),\n                Some(17596485),\n                Some(17596486),\n                Some(17596487),\n                Some(17596488),\n                Some(17596489),\n                Some(17596490),\n                Some(17596491),\n                Some(17596492),\n                Some(17596493),\n                Some(17596494),\n                Some(17596495),\n                Some(17596496),\n                Some(17596497),\n                Some(17596498),\n                Some(17596499),\n                Some(17596500),\n                Some(17596501),\n                Some(17596502),\n                Some(17596503),\n                Some(17596504),\n                Some(17596505),\n                Some(17596506),\n                Some(17596507),\n                Some(17596508),\n                Some(17596509),\n                Some(17596510),\n                Some(17596511),\n                Some(17596512),\n                Some(17596513),\n                Some(17596514)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                None,\n                None,\n                None,\n                None,\n                None,\n                Some(17624012),\n                Some(17624013),\n                Some(17624014),\n                Some(17624015),\n                Some(17624016),\n                Some(17624017),\n                Some(17624018),\n                Some(17624019),\n                Some(17624020),\n                Some(17625913),\n                Some(17625914),\n                Some(17625915),\n                Some(17625916),\n                Some(17625917),\n                Some(17625918),\n                Some(17625919),\n                Some(17625920),\n                Some(17625921),\n                Some(17625922),\n                Some(17625923),\n                Some(17625924),\n                Some(17625925),\n                Some(17625926),\n                Some(17625927),\n                Some(17625928),\n                Some(17625929),\n                Some(17625930),\n                Some(17625931),\n                Some(17625932),\n                Some(17625933),\n                Some(17625934),\n                Some(17625935),\n                Some(17625936),\n                Some(17625937),\n                Some(17625938),\n                Some(17625939),\n                Some(17625940),\n                Some(17625941),\n                Some(17625942),\n                Some(17625943),\n                Some(17625944),\n                Some(17625945),\n                Some(17625946),\n                Some(17625947),\n                Some(17625948),\n                Some(17625949)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                None,\n                None,\n                Some(17624012),\n                Some(17624013),\n                Some(17624014),\n                Some(17624015),\n                Some(17624016),\n                Some(17624017),\n                Some(17624018),\n                Some(17624019),\n                Some(17624020),\n                Some(17625913),\n                Some(17625914),\n                Some(17625915),\n                Some(17625916),\n                Some(17625917),\n                Some(17625918),\n                Some(17625919),\n                Some(17625920),\n                Some(17625921),\n                Some(17625922),\n                Some(17625923),\n                Some(17625924),\n                Some(17625925),\n                Some(17625926),\n                Some(17625927),\n                Some(17625928),\n                Some(17625929),\n                Some(17625930),\n                Some(17625931),\n                Some(17625932),\n                Some(17625933),\n                Some(17625934),\n                Some(17625935),\n                Some(17625936),\n                Some(17625937),\n                Some(17625938),\n                Some(17625939),\n                Some(17625940),\n                Some(17625941),\n                Some(17625942),\n                Some(17625943),\n                Some(17625944),\n                Some(17625945),\n                Some(17625946),\n                Some(17625947),\n                Some(17625948),\n                Some(17625949),\n                Some(17625950),\n                Some(17625951),\n                Some(17625952)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                None,\n                Some(31796700),\n                Some(31796701),\n                Some(31796702),\n                Some(31796703),\n                Some(31796704),\n                Some(31796705),\n                Some(31796706),\n                Some(31796710),\n                Some(31796711),\n                Some(31796712),\n                Some(31796713),\n                Some(31796714),\n                Some(31796715),\n                Some(31796716),\n                Some(31796717),\n                Some(31796718),\n                Some(31796719),\n                Some(31796720),\n                Some(31796721),\n                Some(31796722),\n                Some(31796723),\n                Some(31796724),\n                Some(31796725),\n                Some(31796726),\n                Some(31796727),\n                Some(31796728),\n                Some(31799014),\n                Some(31799015),\n                Some(31799016),\n                Some(31799017),\n                Some(31799018),\n                Some(31799019),\n                Some(31799020),\n                Some(31799021),\n                Some(31799022),\n                Some(31799023),\n                Some(31799024),\n                Some(31799025),\n                Some(31799026),\n                Some(31799027),\n                Some(31799028),\n                Some(31799029),\n                Some(31799030),\n                Some(31799031),\n                Some(31799032),\n                Some(31799033),\n                Some(31799034),\n                Some(31799035),\n                Some(31799036),\n                Some(31799037)\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                Some(36722692),\n                Some(36722693),\n                Some(36722694),\n                Some(36722695),\n                Some(36722696),\n                Some(36722697),\n                Some(36722698),\n                Some(36722699),\n                Some(36722700),\n                Some(36722701),\n                Some(36722702),\n                Some(36722703),\n                Some(36722704),\n                Some(36722705),\n                Some(36723505),\n                Some(36723506),\n                Some(36723507),\n                Some(36723508),\n                Some(36723509),\n                Some(36723510),\n                Some(36723511),\n                Some(36723512),\n                Some(36723513),\n                Some(36723514),\n                Some(36723515),\n                Some(36723516),\n                Some(36723517),\n                Some(36723518),\n                Some(36723519),\n                Some(36723520),\n                Some(36723521),\n                Some(36723522),\n                Some(36723523),\n                Some(36723524),\n                Some(36723525),\n                Some(36723526),\n                Some(36723527),\n                Some(36723528),\n                Some(36723529),\n                Some(36723530),\n                Some(36723531),\n                Some(36723532),\n                Some(36737414),\n                Some(36737415),\n                Some(36737416),\n                Some(36737417),\n                Some(36737418),\n                Some(36737419),\n                Some(36737420),\n                None,\n                None\n            ]\n        );\n        let rp: Vec<_> = it\n            .next()\n            .unwrap()\n            .unwrap()\n            .reference_positions_full()\n            .collect();\n        assert_eq!(\n            rp,\n            vec![\n                None,\n                None,\n                None,\n                None,\n                Some(44587963),\n                Some(44587964),\n                Some(44587965),\n                Some(44587966),\n                Some(44587967),\n                Some(44587968),\n                Some(44587969),\n                Some(44587970),\n                Some(44587971),\n                Some(44587972),\n                Some(44587973),\n                Some(44587974),\n                Some(44587975),\n                Some(44587976),\n                Some(44587977),\n                Some(44587978),\n                Some(44587979),\n                Some(44587980),\n                Some(44587981),\n                Some(44587982),\n                Some(44587983),\n                Some(44589680),\n                Some(44589681),\n                Some(44589682),\n                Some(44589683),\n                Some(44589684),\n                Some(44589685),\n                Some(44589686),\n                Some(44589687),\n                Some(44589688),\n                Some(44589689),\n                Some(44589690),\n                Some(44589691),\n                Some(44589692),\n                Some(44589693),\n                Some(44589694),\n                Some(44589695),\n                Some(44589696),\n                Some(44589697),\n                Some(44589698),\n                Some(44589699),\n                Some(44589700),\n                Some(44589701),\n                Some(44589702),\n                Some(44592034),\n                Some(44592035),\n                Some(44592036)\n            ]\n        );\n    }\n\n    #[test]\n    fn test_reference_start_end() {\n        let mut bam = bam::Reader::from_path(\"./test/test_spliced_reads.bam\").unwrap();\n        let mut it = bam.records();\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 16050676);\n        assert_eq!(read.reference_end(), 16050721);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 16096878);\n        assert_eq!(read.reference_end(), 16096931);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 16097145);\n        assert_eq!(read.reference_end(), 16097198);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 16117350);\n        assert_eq!(read.reference_end(), 16117401);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 16118483);\n        assert_eq!(read.reference_end(), 16118534);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 16118499);\n        assert_eq!(read.reference_end(), 16118550);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 16118499);\n        assert_eq!(read.reference_end(), 16118550);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 16118499);\n        assert_eq!(read.reference_end(), 16118550);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 16123411);\n        assert_eq!(read.reference_end(), 16123462);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 16123417);\n        assert_eq!(read.reference_end(), 16123462);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 16165860);\n        assert_eq!(read.reference_end(), 16165901);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 16180871);\n        assert_eq!(read.reference_end(), 16180922);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 16189705);\n        assert_eq!(read.reference_end(), 16189756);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 16231271);\n        assert_eq!(read.reference_end(), 16231322);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 16237657);\n        assert_eq!(read.reference_end(), 16237708);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 16255012);\n        assert_eq!(read.reference_end(), 16255054);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 16255391);\n        assert_eq!(read.reference_end(), 16255442);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 16255392);\n        assert_eq!(read.reference_end(), 16255442);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 16256084);\n        assert_eq!(read.reference_end(), 16256129);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 16256224);\n        assert_eq!(read.reference_end(), 16256272);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 16325199);\n        assert_eq!(read.reference_end(), 16325241);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 16352865);\n        assert_eq!(read.reference_end(), 16352903);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 16352968);\n        assert_eq!(read.reference_end(), 16353012);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 16414998);\n        assert_eq!(read.reference_end(), 16415044);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 17031591);\n        assert_eq!(read.reference_end(), 17031638);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 17057382);\n        assert_eq!(read.reference_end(), 17057432);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 17092766);\n        assert_eq!(read.reference_end(), 17095000);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 17092782);\n        assert_eq!(read.reference_end(), 17095016);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 17092782);\n        assert_eq!(read.reference_end(), 17095016);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 17137287);\n        assert_eq!(read.reference_end(), 17137320);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 17306238);\n        assert_eq!(read.reference_end(), 17306286);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 17561868);\n        assert_eq!(read.reference_end(), 17561913);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 17566078);\n        assert_eq!(read.reference_end(), 17577961);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 17566108);\n        assert_eq!(read.reference_end(), 17578701);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 17566111);\n        assert_eq!(read.reference_end(), 17578704);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 17566111);\n        assert_eq!(read.reference_end(), 17578704);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 17566111);\n        assert_eq!(read.reference_end(), 17578704);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 17566111);\n        assert_eq!(read.reference_end(), 17578704);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 17566112);\n        assert_eq!(read.reference_end(), 17578705);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 17566113);\n        assert_eq!(read.reference_end(), 17578706);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 17566113);\n        assert_eq!(read.reference_end(), 17578706);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 17579733);\n        assert_eq!(read.reference_end(), 17581250);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 17581369);\n        assert_eq!(read.reference_end(), 17583029);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 17581370);\n        assert_eq!(read.reference_end(), 17583030);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 17581370);\n        assert_eq!(read.reference_end(), 17583030);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 17582911);\n        assert_eq!(read.reference_end(), 17583056);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 17588621);\n        assert_eq!(read.reference_end(), 17589209);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 17588621);\n        assert_eq!(read.reference_end(), 17589209);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 17588621);\n        assert_eq!(read.reference_end(), 17589209);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 17591770);\n        assert_eq!(read.reference_end(), 17591821);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 17593855);\n        assert_eq!(read.reference_end(), 17593904);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 17593863);\n        assert_eq!(read.reference_end(), 17593908);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 17596476);\n        assert_eq!(read.reference_end(), 17596515);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 17624012);\n        assert_eq!(read.reference_end(), 17625950);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 17624012);\n        assert_eq!(read.reference_end(), 17625953);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 31796700);\n        assert_eq!(read.reference_end(), 31799038);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 36722692);\n        assert_eq!(read.reference_end(), 36737421);\n        let read = it.next().unwrap().unwrap();\n        assert_eq!(read.reference_start(), 44587963);\n        assert_eq!(read.reference_end(), 44592037);\n    }\n\n    #[test]\n    fn test_infer_seq_len() {\n        use std::convert::TryFrom;\n        let mut bam = bam::Reader::from_path(\"./test/test_spliced_reads.bam\").unwrap();\n        for read in bam.records() {\n            let read = read.unwrap();\n            assert_eq!(read.seq_len_from_cigar(false), 51);\n            assert_eq!(read.seq_len_from_cigar(true), 51);\n        }\n\n        let mut read = bam::Record::new();\n        for (input_cigar, supposed_length_wo_hard_clip, supposed_length_with_hard_clip) in &[\n            (\"40M\", 40, 40),\n            (\"40=\", 40, 40),\n            (\"40X\", 40, 40),\n            (\"20M5I20M\", 45, 45),\n            (\"20M5D20M\", 40, 40),\n            (\"5H35M\", 35, 40),\n            (\"5S35M\", 40, 40),\n            (\"35M5H\", 35, 40),\n            (\"35M5S\", 40, 40),\n            (\"\", 0, 0),\n        ] {\n            read.set(\n                b\"test\",\n                Some(&CigarString::try_from(*input_cigar).unwrap()),\n                b\"agtc\",\n                b\"BBBB\",\n            );\n            assert_eq!(\n                &read.seq_len_from_cigar(false),\n                supposed_length_wo_hard_clip\n            );\n            assert_eq!(\n                &read.seq_len_from_cigar(true),\n                supposed_length_with_hard_clip\n            );\n        }\n    }\n}\n"
  },
  {
    "path": "src/bam/header.rs",
    "content": "// Copyright 2014 Johannes Köster.\n// Licensed under the MIT license (http://opensource.org/licenses/MIT)\n// This file may not be copied, modified, or distributed\n// except according to those terms.\n\nuse crate::bam::HeaderView;\nuse lazy_static::lazy_static;\nuse linear_map::LinearMap;\nuse regex::Regex;\nuse std::borrow::Cow;\nuse std::collections::HashMap;\n\n/// A BAM header.\n#[derive(Debug, Clone)]\npub struct Header {\n    records: Vec<Vec<u8>>,\n}\n\nimpl Default for Header {\n    fn default() -> Self {\n        Self::new()\n    }\n}\n\nimpl Header {\n    /// Create a new header.\n    pub fn new() -> Self {\n        Header {\n            records: Vec::new(),\n        }\n    }\n\n    pub fn from_template(header: &HeaderView) -> Self {\n        let mut record = header.as_bytes().to_owned();\n        // Strip off any trailing newline character.\n        // Otherwise there could be a blank line in the\n        // header which samtools (<=1.6) will complain\n        // about\n        while let Some(&last_char) = record.last() {\n            if last_char == b'\\n' {\n                record.pop();\n            } else {\n                break;\n            }\n        }\n        Header {\n            records: vec![record],\n        }\n    }\n\n    /// Add a record to the header.\n    pub fn push_record(&mut self, record: &HeaderRecord<'_>) -> &mut Self {\n        self.records.push(record.to_bytes());\n        self\n    }\n\n    /// Add a comment to the header.\n    pub fn push_comment(&mut self, comment: &[u8]) -> &mut Self {\n        self.records.push([&b\"@CO\"[..], comment].join(&b'\\t'));\n        self\n    }\n\n    pub fn to_bytes(&self) -> Vec<u8> {\n        self.records.join(&b'\\n')\n    }\n\n    /// This returns a header as a HashMap.\n    /// Comment lines starting with \"@CO\" will NOT be included in the HashMap.\n    /// Comment lines can be obtained by the `comments` function.\n    pub fn to_hashmap(&self) -> HashMap<String, Vec<LinearMap<String, String>>> {\n        let mut header_map = HashMap::default();\n\n        lazy_static! {\n            static ref REC_TYPE_RE: Regex = Regex::new(r\"@([A-Z][A-Z])\").unwrap();\n            static ref TAG_RE: Regex = Regex::new(r\"([A-Za-z][A-Za-z0-9]):([ -~]*)\").unwrap();\n        }\n\n        let header_string = String::from_utf8(self.to_bytes()).unwrap();\n\n        for line in header_string.split('\\n').filter(|x| !x.is_empty()) {\n            let parts: Vec<_> = line.split('\\t').filter(|x| !x.is_empty()).collect();\n            // assert!(rec_type_re.is_match(parts[0]));\n            let record_type = REC_TYPE_RE\n                .captures(parts[0])\n                .unwrap()\n                .get(1)\n                .unwrap()\n                .as_str()\n                .to_owned();\n            if record_type.eq(\"CO\") {\n                continue;\n            }\n            let mut field = LinearMap::default();\n            for part in parts.iter().skip(1) {\n                let cap = TAG_RE.captures(part).unwrap();\n                let tag = cap.get(1).unwrap().as_str().to_owned();\n                let value = cap.get(2).unwrap().as_str().to_owned();\n                field.insert(tag, value);\n            }\n            header_map\n                .entry(record_type)\n                .or_insert_with(Vec::new)\n                .push(field);\n        }\n        header_map\n    }\n\n    /// Returns an iterator of comment lines.\n    pub fn comments(&'_ self) -> impl Iterator<Item = Cow<'_, str>> {\n        self.records.iter().flat_map(|r| {\n            r.split(|x| x == &b'\\n')\n                .filter(|x| x.starts_with(b\"@CO\\t\"))\n                .map(|x| String::from_utf8_lossy(&x[4..]))\n        })\n    }\n}\n\n/// Header record.\n#[derive(Debug, Clone)]\npub struct HeaderRecord<'a> {\n    rec_type: Vec<u8>,\n    tags: Vec<(&'a [u8], Vec<u8>)>,\n}\n\nimpl<'a> HeaderRecord<'a> {\n    /// Create a new header record.\n    /// See SAM format specification for possible record types.\n    pub fn new(rec_type: &'a [u8]) -> Self {\n        HeaderRecord {\n            rec_type: [&b\"@\"[..], rec_type].concat(),\n            tags: Vec::new(),\n        }\n    }\n\n    /// Add a new tag to the record.\n    ///\n    /// # Arguments\n    ///\n    /// * `tag` - the tag identifier\n    /// * `value` - the value. Can be any type convertible into a string. Preferably numbers or\n    ///   strings.\n    pub fn push_tag<V: ToString>(&mut self, tag: &'a [u8], value: V) -> &mut Self {\n        self.tags.push((tag, value.to_string().into_bytes()));\n        self\n    }\n\n    fn to_bytes(&self) -> Vec<u8> {\n        let mut out = Vec::new();\n        out.extend(self.rec_type.iter());\n        for &(tag, ref value) in self.tags.iter() {\n            out.push(b'\\t');\n            out.extend(tag.iter());\n            out.push(b':');\n            out.extend(value.iter());\n        }\n        out\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::HeaderRecord;\n\n    #[test]\n    fn test_push_tag() {\n        let mut record = HeaderRecord::new(b\"HD\");\n        record.push_tag(b\"X1\", 0);\n        record.push_tag(b\"X2\", 0);\n\n        let x = \"x\".to_string();\n        record.push_tag(b\"X3\", x.as_str());\n        record.push_tag(b\"X4\", &x);\n        record.push_tag(b\"X5\", x);\n\n        assert_eq!(record.to_bytes(), b\"@HD\\tX1:0\\tX2:0\\tX3:x\\tX4:x\\tX5:x\");\n    }\n}\n"
  },
  {
    "path": "src/bam/index.rs",
    "content": "// Copyright 2019 Johannes Köster.\n// Licensed under the MIT license (http://opensource.org/licenses/MIT)\n// This file may not be copied, modified, or distributed\n// except according to those terms.\n\n//! Module for working with BAM or CRAM indices.\n\nuse std::path::Path;\nuse std::ptr;\n\nuse crate::errors::{Error, Result};\nuse crate::htslib;\nuse crate::utils;\n\n/// Index type to build.\npub enum Type {\n    /// BAI index\n    Bai,\n    /// CSI index, with given minimum shift\n    Csi(u32),\n}\n\n/// Build a BAM index.\npub fn build<P: AsRef<Path>>(\n    bam_path: P,\n    idx_path: Option<P>,\n    idx_type: Type,\n    n_threads: u32,\n) -> Result<()> {\n    let min_shift = match idx_type {\n        Type::Bai => 0,\n        Type::Csi(min_shift) => min_shift as i32,\n    };\n    let idx_path_cstr;\n    let idx_path_ptr = if let Some(p) = idx_path {\n        idx_path_cstr =\n            utils::path_to_cstring(&p).expect(\"path_to_cstring unexpectedly returned with Err\");\n        idx_path_cstr.as_ptr()\n    } else {\n        ptr::null()\n    };\n    let ret = unsafe {\n        htslib::sam_index_build3(\n            utils::path_to_cstring(&bam_path).unwrap().as_ptr(),\n            idx_path_ptr,\n            min_shift,\n            n_threads as i32,\n        )\n    };\n    match ret {\n        0 => Ok(()),\n        -1 => Err(Error::BamBuildIndex),\n        -2 => Err(Error::BamOpen {\n            target: bam_path.as_ref().to_str().unwrap().to_owned(),\n        }),\n        -3 => Err(Error::BamNotIndexable),\n        -4 => Err(Error::BamWriteIndex),\n        e => panic!(\"unexpected error code from sam_index_build3: {}\", e),\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    #[test]\n    fn test_index_build() {\n        let test_bam = \"test/test_index_build.bam\";\n\n        // test BAI index creation with 1 thread\n        let idx1 = \"test/results/test1.bam.bai\";\n        build(test_bam, Some(idx1), Type::Bai, 1).unwrap();\n        assert!(Path::new(idx1).exists());\n\n        // test BAI index creation with 2 threads\n        let idx2 = \"test/results/test2.bam.bai\";\n        build(test_bam, Some(idx2), Type::Bai, 2).unwrap();\n        assert!(Path::new(idx2).exists());\n\n        // test CSI index creation with 2 threads\n        let idx3 = \"test/results/test3.bam.csi\";\n        build(test_bam, Some(idx3), Type::Csi(2), 2).unwrap();\n        assert!(Path::new(idx3).exists());\n\n        // test CSI index creation with 2 threads and default file name\n        build(test_bam, None, Type::Csi(5), 2).unwrap();\n        assert!(Path::new(\"test/test_index_build.bam.csi\").exists());\n    }\n}\n"
  },
  {
    "path": "src/bam/mod.rs",
    "content": "// Copyright 2014 Christopher Schröder, Johannes Köster.\n// Licensed under the MIT license (http://opensource.org/licenses/MIT)\n// This file may not be copied, modified, or distributed\n// except according to those terms.\n\n//! Module for working with SAM, BAM, and CRAM files.\n\npub mod buffer;\npub mod ext;\npub mod header;\npub mod index;\npub mod pileup;\npub mod record;\n\n#[cfg(feature = \"serde_feature\")]\npub mod record_serde;\n\nuse std::ffi;\nuse std::os::raw::c_char;\nuse std::path::Path;\nuse std::rc::Rc;\nuse std::slice;\nuse std::str;\nuse std::sync::Arc;\n\nuse url::Url;\n\nuse crate::errors::{Error, Result};\nuse crate::htslib;\nuse crate::tpool::ThreadPool;\nuse crate::utils::path_as_bytes;\n\npub use crate::bam::buffer::RecordBuffer;\npub use crate::bam::header::Header;\npub use crate::bam::record::Record;\nuse hts_sys::{hts_fmt_option, sam_fields};\nuse std::convert::{TryFrom, TryInto};\nuse std::mem::MaybeUninit;\n\n/// # Safety\n///\n/// Implementation for `Read::set_threads` and `Writer::set_threads`.\nunsafe fn set_threads(htsfile: *mut htslib::htsFile, n_threads: usize) -> Result<()> {\n    assert!(n_threads != 0, \"n_threads must be > 0\");\n\n    if htslib::hts_set_threads(htsfile, n_threads as i32) != 0 {\n        Err(Error::SetThreads)\n    } else {\n        Ok(())\n    }\n}\n\nunsafe fn set_thread_pool(htsfile: *mut htslib::htsFile, tpool: &ThreadPool) -> Result<()> {\n    let mut b = tpool.handle.borrow_mut();\n\n    if htslib::hts_set_thread_pool(htsfile, &mut b.inner as *mut _) != 0 {\n        Err(Error::ThreadPool)\n    } else {\n        Ok(())\n    }\n}\n\n/// # Safety\n///\n/// Set the reference FAI index path in a `htslib::htsFile` struct for reading CRAM format.\npub unsafe fn set_fai_filename<P: AsRef<Path>>(\n    htsfile: *mut htslib::htsFile,\n    fasta_path: P,\n) -> Result<()> {\n    let path = if let Some(ext) = fasta_path.as_ref().extension() {\n        fasta_path\n            .as_ref()\n            .with_extension(format!(\"{}.fai\", ext.to_str().unwrap()))\n    } else {\n        fasta_path.as_ref().with_extension(\".fai\")\n    };\n    let p: &Path = path.as_ref();\n    let c_str = ffi::CString::new(p.to_str().unwrap().as_bytes()).unwrap();\n    if htslib::hts_set_fai_filename(htsfile, c_str.as_ptr()) == 0 {\n        Ok(())\n    } else {\n        Err(Error::BamInvalidReferencePath { path: p.to_owned() })\n    }\n}\n\n/// A trait for a BAM reader with a read method.\npub trait Read: Sized {\n    /// Read next BAM record into given record.\n    /// Use this method in combination with a single allocated record to avoid the reallocations\n    /// occurring with the iterator.\n    ///\n    /// # Arguments\n    ///\n    /// * `record` - the record to be filled\n    ///\n    /// # Returns\n    ///\n    /// Some(Ok(())) if the record was read and None if no more records to read\n    ///\n    /// Example:\n    /// ```\n    /// use rust_htslib::errors::Error;\n    /// use rust_htslib::bam::{Read, IndexedReader, Record};\n    ///\n    /// let mut bam = IndexedReader::from_path(\"test/test.bam\").unwrap();\n    /// bam.fetch((0, 1000, 2000)); // reads on tid 0, from 1000bp to 2000bp\n    /// let mut record = Record::new();\n    /// while let Some(result) = bam.read(&mut record) {\n    ///     match result {\n    ///         Ok(_) => {\n    ///             println!(\"Read sequence: {:?}\", record.seq().as_bytes());\n    ///         }\n    ///         Err(_) => panic!(\"BAM parsing failed...\")\n    ///     }\n    /// }\n    /// ```\n    ///\n    /// Consider using [`rc_records`](#tymethod.rc_records) instead.\n    fn read(&mut self, record: &mut record::Record) -> Option<Result<()>>;\n\n    /// Iterator over the records of the seeked region.\n    /// Note that, while being convenient, this is less efficient than pre-allocating a\n    /// `Record` and reading into it with the `read` method, since every iteration involves\n    /// the allocation of a new `Record`.\n    ///\n    /// This is about 10% slower than record in micro benchmarks.\n    ///\n    /// Consider using [`rc_records`](#tymethod.rc_records) instead.\n    fn records(&mut self) -> Records<'_, Self>;\n\n    /// Records iterator using an Rc to avoid allocating a Record each turn.\n    /// This is about 1% slower than the [`read`](#tymethod.read) based API in micro benchmarks,\n    /// but has nicer ergonomics (and might not actually be slower in your applications).\n    ///\n    /// Example:\n    /// ```\n    /// use rust_htslib::errors::Error;\n    /// use rust_htslib::bam::{Read, Reader, Record};\n    /// use rust_htslib::htslib; // for BAM_F*\n    /// let mut bam = Reader::from_path(\"test/test.bam\").unwrap();\n    ///\n    /// for read in\n    ///     bam.rc_records()\n    ///     .map(|x| x.expect(\"Failure parsing Bam file\"))\n    ///     .filter(|read|\n    ///         read.flags()\n    ///          & (htslib::BAM_FUNMAP\n    ///              | htslib::BAM_FSECONDARY\n    ///              | htslib::BAM_FQCFAIL\n    ///              | htslib::BAM_FDUP) as u16\n    ///          == 0\n    ///     )\n    ///     .filter(|read| !read.is_reverse()) {\n    ///     println!(\"Found a forward read: {:?}\", read.qname());\n    /// }\n    ///\n    /// //or to add the read qnames into a Vec\n    /// let collected: Vec<_> = bam.rc_records().map(|read| read.unwrap().qname().to_vec()).collect();\n    ///\n    ///\n    /// ```\n    fn rc_records(&mut self) -> RcRecords<'_, Self>;\n\n    /// Iterator over pileups.\n    fn pileup(&mut self) -> pileup::Pileups<'_, Self>;\n\n    /// Return the htsFile struct\n    fn htsfile(&self) -> *mut htslib::htsFile;\n\n    /// Return the header.\n    fn header(&self) -> &HeaderView;\n\n    /// Seek to the given virtual offset in the file\n    fn seek(&mut self, offset: i64) -> Result<()> {\n        let htsfile = unsafe { self.htsfile().as_ref() }.expect(\"bug: null pointer to htsFile\");\n        let ret = match htsfile.format.format {\n            htslib::htsExactFormat_cram => unsafe {\n                i64::from(htslib::cram_seek(\n                    htsfile.fp.cram,\n                    offset as libc::off_t,\n                    libc::SEEK_SET,\n                ))\n            },\n            _ => unsafe { htslib::bgzf_seek(htsfile.fp.bgzf, offset, libc::SEEK_SET) },\n        };\n\n        if ret == 0 {\n            Ok(())\n        } else {\n            Err(Error::FileSeek)\n        }\n    }\n\n    /// Report the current virtual offset\n    fn tell(&self) -> i64 {\n        // this reimplements the bgzf_tell macro\n        let htsfile = unsafe { self.htsfile().as_ref() }.expect(\"bug: null pointer to htsFile\");\n        let bgzf = unsafe { *htsfile.fp.bgzf };\n        (bgzf.block_address << 16) | (i64::from(bgzf.block_offset) & 0xFFFF)\n    }\n\n    /// Activate multi-threaded BAM read support in htslib. This should permit faster\n    /// reading of large BAM files.\n    ///\n    /// Setting `nthreads` to `0` does not change the current state.  Note that it is not\n    /// possible to set the number of background threads below `1` once it has been set.\n    ///\n    /// # Arguments\n    ///\n    /// * `n_threads` - number of extra background writer threads to use, must be `> 0`.\n    fn set_threads(&mut self, n_threads: usize) -> Result<()> {\n        unsafe { set_threads(self.htsfile(), n_threads) }\n    }\n\n    /// Use a shared thread-pool for writing. This permits controlling the total\n    /// thread count when multiple readers and writers are working simultaneously.\n    /// A thread pool can be created with `crate::tpool::ThreadPool::new(n_threads)`\n    ///\n    /// # Arguments\n    ///\n    /// * `tpool` - thread pool to use for compression work.\n    fn set_thread_pool(&mut self, tpool: &ThreadPool) -> Result<()>;\n\n    /// If the underlying file is in CRAM format, allows modifying CRAM options.\n    /// Note that this method does *not* check that the underlying file actually is in CRAM format.\n    ///\n    /// # Examples\n    ///\n    /// Set the required fields to RNAME and FLAG,\n    /// potentially allowing htslib to skip over the rest,\n    /// resulting in faster iteration:\n    /// ```\n    /// use rust_htslib::bam::{Read, Reader};\n    /// use hts_sys;\n    /// let mut cram = Reader::from_path(\"test/test_cram.cram\").unwrap();\n    /// cram.set_cram_options(hts_sys::hts_fmt_option_CRAM_OPT_REQUIRED_FIELDS,\n    ///             hts_sys::sam_fields_SAM_RNAME | hts_sys::sam_fields_SAM_FLAG).unwrap();\n    /// ```\n    fn set_cram_options(&mut self, fmt_opt: hts_fmt_option, fields: sam_fields) -> Result<()> {\n        unsafe {\n            if hts_sys::hts_set_opt(self.htsfile(), fmt_opt, fields) != 0 {\n                Err(Error::HtsSetOpt)\n            } else {\n                Ok(())\n            }\n        }\n    }\n}\n\n/// A BAM reader.\n#[derive(Debug)]\npub struct Reader {\n    htsfile: *mut htslib::htsFile,\n    header: Arc<HeaderView>,\n    tpool: Option<ThreadPool>,\n}\n\nunsafe impl Send for Reader {}\n\nimpl Reader {\n    /// Create a new Reader from path.\n    ///\n    /// # Arguments\n    ///\n    /// * `path` - the path to open.\n    pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self> {\n        Self::new(&path_as_bytes(path, true)?)\n    }\n\n    /// Create a new Reader from STDIN.\n    pub fn from_stdin() -> Result<Self> {\n        Self::new(b\"-\")\n    }\n\n    /// Create a new Reader from URL.\n    pub fn from_url(url: &Url) -> Result<Self> {\n        Self::new(url.as_str().as_bytes())\n    }\n\n    /// Create a new Reader.\n    ///\n    /// # Arguments\n    ///\n    /// * `path` - the path to open. Use \"-\" for stdin.\n    fn new(path: &[u8]) -> Result<Self> {\n        let htsfile = hts_open(path, b\"r\")?;\n\n        let header = unsafe { htslib::sam_hdr_read(htsfile) };\n        if header.is_null() {\n            return Err(Error::BamOpen {\n                target: String::from_utf8_lossy(path).to_string(),\n            });\n        }\n\n        // Invalidate the `text` representation of the header\n        unsafe {\n            let _ = htslib::sam_hdr_line_name(header, b\"SQ\".as_ptr().cast::<c_char>(), 0);\n        }\n\n        Ok(Reader {\n            htsfile,\n            header: Arc::new(HeaderView::new(header)),\n            tpool: None,\n        })\n    }\n\n    extern \"C\" fn pileup_read(\n        data: *mut ::std::os::raw::c_void,\n        record: *mut htslib::bam1_t,\n    ) -> i32 {\n        let mut _self = unsafe { (data as *mut Self).as_mut().unwrap() };\n        unsafe {\n            htslib::sam_read1(\n                _self.htsfile(),\n                _self.header().inner_ptr() as *mut hts_sys::sam_hdr_t,\n                record,\n            )\n        }\n    }\n\n    /// Iterator over the records between the (optional) virtual offsets `start` and `end`\n    ///\n    /// # Arguments\n    ///\n    /// * `start` - Optional starting virtual offset to seek to. Throws an error if it is not\n    ///   a valid virtual offset.\n    ///\n    /// * `end` - Read until the virtual offset is less than `end`\n    pub fn iter_chunk(&mut self, start: Option<i64>, end: Option<i64>) -> ChunkIterator<'_, Self> {\n        if let Some(pos) = start {\n            self.seek(pos)\n                .expect(\"Failed to seek to the starting position\");\n        };\n\n        ChunkIterator { reader: self, end }\n    }\n\n    /// Set the reference path for reading CRAM files.\n    ///\n    /// # Arguments\n    ///\n    /// * `path` - path to the FASTA reference\n    pub fn set_reference<P: AsRef<Path>>(&mut self, path: P) -> Result<()> {\n        unsafe { set_fai_filename(self.htsfile, path) }\n    }\n}\n\nimpl Read for Reader {\n    /// Read the next BAM record into the given `Record`.\n    /// Returns `None` if there are no more records.\n    ///\n    /// This method is useful if you want to read records as fast as possible as the\n    /// `Record` can be reused. A more ergonomic approach is to use the [records](Reader::records)\n    /// iterator.\n    ///\n    /// # Errors\n    /// If there are any issues with reading the next record an error will be returned.\n    ///\n    /// # Examples\n    ///\n    /// ```\n    /// use rust_htslib::errors::Error;\n    /// use rust_htslib::bam::{Read, Reader, Record};\n    ///\n    /// let mut bam = Reader::from_path(\"test/test.bam\")?;\n    /// let mut record = Record::new();\n    ///\n    /// // Print the TID of each record\n    /// while let Some(r) = bam.read(&mut record) {\n    ///    r.expect(\"Failed to parse record\");\n    ///    println!(\"TID: {}\", record.tid())\n    /// }\n    /// # Ok::<(), Error>(())\n    /// ```\n    fn read(&mut self, record: &mut record::Record) -> Option<Result<()>> {\n        match unsafe {\n            htslib::sam_read1(\n                self.htsfile,\n                self.header().inner_ptr() as *mut hts_sys::sam_hdr_t,\n                record.inner_ptr_mut(),\n            )\n        } {\n            -1 => None,\n            -2 => Some(Err(Error::BamTruncatedRecord)),\n            -4 => Some(Err(Error::BamInvalidRecord)),\n            _ => {\n                record.set_header(Arc::clone(&self.header));\n\n                Some(Ok(()))\n            }\n        }\n    }\n\n    /// Iterator over the records of the fetched region.\n    /// Note that, while being convenient, this is less efficient than pre-allocating a\n    /// `Record` and reading into it with the `read` method, since every iteration involves\n    /// the allocation of a new `Record`.\n    fn records(&mut self) -> Records<'_, Self> {\n        Records { reader: self }\n    }\n\n    fn rc_records(&mut self) -> RcRecords<'_, Self> {\n        RcRecords {\n            reader: self,\n            record: Rc::new(record::Record::new()),\n        }\n    }\n\n    fn pileup(&mut self) -> pileup::Pileups<'_, Self> {\n        let _self = self as *const Self;\n        let itr = unsafe {\n            htslib::bam_plp_init(\n                Some(Reader::pileup_read),\n                _self as *mut ::std::os::raw::c_void,\n            )\n        };\n        pileup::Pileups::new(self, itr)\n    }\n\n    fn htsfile(&self) -> *mut htslib::htsFile {\n        self.htsfile\n    }\n\n    fn header(&self) -> &HeaderView {\n        &self.header\n    }\n\n    fn set_thread_pool(&mut self, tpool: &ThreadPool) -> Result<()> {\n        unsafe { set_thread_pool(self.htsfile(), tpool)? }\n        self.tpool = Some(tpool.clone());\n        Ok(())\n    }\n}\n\nimpl Drop for Reader {\n    fn drop(&mut self) {\n        unsafe {\n            htslib::hts_close(self.htsfile);\n        }\n    }\n}\n\n/// Conversion type for start/stop coordinates\n/// only public because it's leaked by the conversions\n#[doc(hidden)]\npub struct FetchCoordinate(i64);\n\n//the old sam spec\nimpl From<i32> for FetchCoordinate {\n    fn from(coord: i32) -> FetchCoordinate {\n        FetchCoordinate(coord as i64)\n    }\n}\n\n// to support un-annotated literals (type interference fails on those)\nimpl From<u32> for FetchCoordinate {\n    fn from(coord: u32) -> FetchCoordinate {\n        FetchCoordinate(coord as i64)\n    }\n}\n\n//the new sam spec\nimpl From<i64> for FetchCoordinate {\n    fn from(coord: i64) -> FetchCoordinate {\n        FetchCoordinate(coord)\n    }\n}\n\n//what some of our header methods return\nimpl From<u64> for FetchCoordinate {\n    fn from(coord: u64) -> FetchCoordinate {\n        FetchCoordinate(coord.try_into().expect(\"Coordinate exceeded 2^^63-1\"))\n    }\n}\n\n/// Enum for [IndexdReader.fetch()](struct.IndexedReader.html#method.fetch) arguments.\n///\n/// tids may be converted From<>:\n/// * i32 (correct as per spec)\n/// * u32 (because of header.tid. Will panic if above 2^31-1).\n///\n///Coordinates may be (via FetchCoordinate)\n/// * i32 (as of the sam v1 spec)\n/// * i64 (as of the htslib 'large coordinate' extension (even though they are not supported in BAM)\n/// * u32 (because that's what rust literals will default to)\n/// * u64 (because of header.target_len(). Will panic if above 2^^63-1).\n#[derive(Debug)]\npub enum FetchDefinition<'a> {\n    /// tid, start, stop,\n    Region(i32, i64, i64),\n    /// 'named-reference', start, stop tuple.\n    RegionString(&'a [u8], i64, i64),\n    ///complete reference. May be i32 or u32 (which panics if above 2^31-')\n    CompleteTid(i32),\n    ///complete reference by name (&[u8] or &str)\n    String(&'a [u8]),\n    /// Every read\n    All,\n    /// Only reads with the BAM flag BAM_FUNMAP (which might not be all reads with reference = -1)\n    Unmapped,\n}\n\nimpl<'a, X: Into<FetchCoordinate>, Y: Into<FetchCoordinate>> From<(i32, X, Y)>\n    for FetchDefinition<'a>\n{\n    fn from(tup: (i32, X, Y)) -> FetchDefinition<'a> {\n        let start: FetchCoordinate = tup.1.into();\n        let stop: FetchCoordinate = tup.2.into();\n        FetchDefinition::Region(tup.0, start.0, stop.0)\n    }\n}\n\nimpl<'a, X: Into<FetchCoordinate>, Y: Into<FetchCoordinate>> From<(u32, X, Y)>\n    for FetchDefinition<'a>\n{\n    fn from(tup: (u32, X, Y)) -> FetchDefinition<'a> {\n        let start: FetchCoordinate = tup.1.into();\n        let stop: FetchCoordinate = tup.2.into();\n        FetchDefinition::Region(\n            tup.0.try_into().expect(\"Tid exceeded 2^31-1\"),\n            start.0,\n            stop.0,\n        )\n    }\n}\n\n//non tuple impls\nimpl<'a> From<i32> for FetchDefinition<'a> {\n    fn from(tid: i32) -> FetchDefinition<'a> {\n        FetchDefinition::CompleteTid(tid)\n    }\n}\n\nimpl<'a> From<u32> for FetchDefinition<'a> {\n    fn from(tid: u32) -> FetchDefinition<'a> {\n        let tid: i32 = tid.try_into().expect(\"tid exceeded 2^31-1\");\n        FetchDefinition::CompleteTid(tid)\n    }\n}\n\nimpl<'a> From<&'a str> for FetchDefinition<'a> {\n    fn from(s: &'a str) -> FetchDefinition<'a> {\n        FetchDefinition::String(s.as_bytes())\n    }\n}\n\n//also accept &[u8;n] literals\nimpl<'a> From<&'a [u8]> for FetchDefinition<'a> {\n    fn from(s: &'a [u8]) -> FetchDefinition<'a> {\n        FetchDefinition::String(s)\n    }\n}\n\n//also accept &[u8;n] literals\nimpl<'a, T: AsRef<[u8]>> From<&'a T> for FetchDefinition<'a> {\n    fn from(s: &'a T) -> FetchDefinition<'a> {\n        FetchDefinition::String(s.as_ref())\n    }\n}\n\nimpl<'a, X: Into<FetchCoordinate>, Y: Into<FetchCoordinate>> From<(&'a str, X, Y)>\n    for FetchDefinition<'a>\n{\n    fn from(tup: (&'a str, X, Y)) -> FetchDefinition<'a> {\n        let start: FetchCoordinate = tup.1.into();\n        let stop: FetchCoordinate = tup.2.into();\n        FetchDefinition::RegionString(tup.0.as_bytes(), start.0, stop.0)\n    }\n}\n\nimpl<'a, X: Into<FetchCoordinate>, Y: Into<FetchCoordinate>> From<(&'a [u8], X, Y)>\n    for FetchDefinition<'a>\n{\n    fn from(tup: (&'a [u8], X, Y)) -> FetchDefinition<'a> {\n        let start: FetchCoordinate = tup.1.into();\n        let stop: FetchCoordinate = tup.2.into();\n        FetchDefinition::RegionString(tup.0, start.0, stop.0)\n    }\n}\n\n//also accept &[u8;n] literals\nimpl<'a, T: AsRef<[u8]>, X: Into<FetchCoordinate>, Y: Into<FetchCoordinate>> From<(&'a T, X, Y)>\n    for FetchDefinition<'a>\n{\n    fn from(tup: (&'a T, X, Y)) -> FetchDefinition<'a> {\n        let start: FetchCoordinate = tup.1.into();\n        let stop: FetchCoordinate = tup.2.into();\n        FetchDefinition::RegionString(tup.0.as_ref(), start.0, stop.0)\n    }\n}\n\n#[derive(Debug)]\npub struct IndexedReader {\n    htsfile: *mut htslib::htsFile,\n    header: Arc<HeaderView>,\n    idx: Arc<IndexView>,\n    itr: Option<*mut htslib::hts_itr_t>,\n    tpool: Option<ThreadPool>,\n}\n\nunsafe impl Send for IndexedReader {}\n\nimpl IndexedReader {\n    /// Create a new Reader from path.\n    ///\n    /// # Arguments\n    ///\n    /// * `path` - the path to open.\n    pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self> {\n        Self::new(&path_as_bytes(path, true)?)\n    }\n\n    pub fn from_path_and_index<P: AsRef<Path>>(path: P, index_path: P) -> Result<Self> {\n        Self::new_with_index_path(\n            &path_as_bytes(path, true)?,\n            &path_as_bytes(index_path, true)?,\n        )\n    }\n\n    pub fn from_url(url: &Url) -> Result<Self> {\n        Self::new(url.as_str().as_bytes())\n    }\n\n    /// Create a new Reader.\n    ///\n    /// # Arguments\n    ///\n    /// * `path` - the path. Use \"-\" for stdin.\n    fn new(path: &[u8]) -> Result<Self> {\n        let htsfile = hts_open(path, b\"r\")?;\n        let header = unsafe { htslib::sam_hdr_read(htsfile) };\n        let c_str = ffi::CString::new(path).unwrap();\n        let idx = unsafe { htslib::sam_index_load(htsfile, c_str.as_ptr()) };\n        if idx.is_null() {\n            Err(Error::BamInvalidIndex {\n                target: str::from_utf8(path).unwrap().to_owned(),\n            })\n        } else {\n            Ok(IndexedReader {\n                htsfile,\n                header: Arc::new(HeaderView::new(header)),\n                idx: Arc::new(IndexView::new(idx)),\n                itr: None,\n                tpool: None,\n            })\n        }\n    }\n    /// Create a new Reader.\n    ///\n    /// # Arguments\n    ///\n    /// * `path` - the path. Use \"-\" for stdin.\n    /// * `index_path` - the index path to use\n    fn new_with_index_path(path: &[u8], index_path: &[u8]) -> Result<Self> {\n        let htsfile = hts_open(path, b\"r\")?;\n        let header = unsafe { htslib::sam_hdr_read(htsfile) };\n        let c_str_path = ffi::CString::new(path).unwrap();\n        let c_str_index_path = ffi::CString::new(index_path).unwrap();\n        let idx = unsafe {\n            htslib::sam_index_load2(htsfile, c_str_path.as_ptr(), c_str_index_path.as_ptr())\n        };\n        if idx.is_null() {\n            Err(Error::BamInvalidIndex {\n                target: str::from_utf8(path).unwrap().to_owned(),\n            })\n        } else {\n            Ok(IndexedReader {\n                htsfile,\n                header: Arc::new(HeaderView::new(header)),\n                idx: Arc::new(IndexView::new(idx)),\n                itr: None,\n                tpool: None,\n            })\n        }\n    }\n\n    /// Define the region from which .read() or .records will retrieve reads.\n    ///\n    /// Both iterating (with [.records()](trait.Read.html#tymethod.records)) and looping without allocation (with [.read()](trait.Read.html#tymethod.read) are a two stage process:\n    /// 1. 'fetch' the region of interest\n    /// 2. iter/loop through the reads.\n    ///\n    /// Example:\n    /// ```\n    /// use rust_htslib::bam::{IndexedReader, Read};\n    /// let mut bam = IndexedReader::from_path(\"test/test.bam\").unwrap();\n    /// bam.fetch((\"chrX\", 10000, 20000)); // coordinates 10000..20000 on reference named \"chrX\"\n    /// for read in bam.records() {\n    ///     println!(\"read name: {:?}\", read.unwrap().qname());\n    /// }\n    /// ```\n    ///\n    /// The arguments may be anything that can be converted into a FetchDefinition\n    /// such as\n    ///\n    /// * fetch(tid: u32) -> fetch everything on this reference\n    /// * fetch(reference_name: &[u8] | &str) -> fetch everything on this reference\n    /// * fetch((tid: i32, start: i64, stop: i64)): -> fetch in this region on this tid\n    /// * fetch((reference_name: &[u8] | &str, start: i64, stop: i64) -> fetch in this region on this tid\n    /// * fetch(FetchDefinition::All) or fetch(\".\") -> Fetch overything\n    /// * fetch(FetchDefinition::Unmapped) or fetch(\"*\") -> Fetch unmapped (as signified by the 'unmapped' flag in the BAM - might be unreliable with some aligners.\n    ///\n    /// The start / stop coordinates will take i64 (the correct type as of htslib's 'large\n    /// coordinates' expansion), i32, u32, and u64 (with a possible panic! if the coordinate\n    /// won't fit an i64).\n    ///\n    /// `start` and `stop` are zero-based. `start` is inclusive, `stop` is exclusive.\n    ///\n    /// This replaces the old fetch and fetch_str implementations.\n    pub fn fetch<'a, T: Into<FetchDefinition<'a>>>(&mut self, fetch_definition: T) -> Result<()> {\n        //this 'compile time redirect' safes us\n        //from monomorphing the 'meat' of the fetch function\n        self._inner_fetch(fetch_definition.into())\n    }\n\n    fn _inner_fetch(&mut self, fetch_definition: FetchDefinition) -> Result<()> {\n        match fetch_definition {\n            FetchDefinition::Region(tid, start, stop) => {\n                self._fetch_by_coord_tuple(tid, start, stop)\n            }\n            FetchDefinition::RegionString(s, start, stop) => {\n                let tid = self.header().tid(s);\n                match tid {\n                    Some(tid) => self._fetch_by_coord_tuple(tid as i32, start, stop),\n                    None => Err(Error::Fetch),\n                }\n            }\n            FetchDefinition::CompleteTid(tid) => {\n                let len = self.header().target_len(tid as u32);\n                match len {\n                    Some(len) => self._fetch_by_coord_tuple(tid, 0, len as i64),\n                    None => Err(Error::Fetch),\n                }\n            }\n            FetchDefinition::String(s) => {\n                // either a target-name or a samtools style definition\n                let tid = self.header().tid(s);\n                match tid {\n                    Some(tid) => {\n                        //'large position' spec says target len must will fit into an i64.\n                        let len: i64 = self.header.target_len(tid).unwrap().try_into().unwrap();\n                        self._fetch_by_coord_tuple(tid as i32, 0, len)\n                    }\n                    None => self._fetch_by_str(s),\n                }\n            }\n            FetchDefinition::All => self._fetch_by_str(b\".\"),\n            FetchDefinition::Unmapped => self._fetch_by_str(b\"*\"),\n        }\n    }\n\n    fn _fetch_by_coord_tuple(&mut self, tid: i32, beg: i64, end: i64) -> Result<()> {\n        if let Some(itr) = self.itr {\n            unsafe { htslib::hts_itr_destroy(itr) }\n        }\n        let itr = unsafe { htslib::sam_itr_queryi(self.index().inner_ptr(), tid, beg, end) };\n        if itr.is_null() {\n            self.itr = None;\n            Err(Error::Fetch)\n        } else {\n            self.itr = Some(itr);\n            Ok(())\n        }\n    }\n\n    fn _fetch_by_str(&mut self, region: &[u8]) -> Result<()> {\n        if let Some(itr) = self.itr {\n            unsafe { htslib::hts_itr_destroy(itr) }\n        }\n        let rstr = ffi::CString::new(region).unwrap();\n        let rptr = rstr.as_ptr();\n        let itr = unsafe {\n            htslib::sam_itr_querys(\n                self.index().inner_ptr(),\n                self.header().inner_ptr() as *mut hts_sys::sam_hdr_t,\n                rptr,\n            )\n        };\n        if itr.is_null() {\n            self.itr = None;\n            Err(Error::Fetch)\n        } else {\n            self.itr = Some(itr);\n            Ok(())\n        }\n    }\n\n    extern \"C\" fn pileup_read(\n        data: *mut ::std::os::raw::c_void,\n        record: *mut htslib::bam1_t,\n    ) -> i32 {\n        let _self = unsafe { (data as *mut Self).as_mut().unwrap() };\n        match _self.itr {\n            Some(itr) => itr_next(_self.htsfile, itr, record), // read fetched region\n            None => unsafe {\n                htslib::sam_read1(\n                    _self.htsfile,\n                    _self.header().inner_ptr() as *mut hts_sys::sam_hdr_t,\n                    record,\n                )\n            }, // ordinary reading\n        }\n    }\n\n    /// Set the reference path for reading CRAM files.\n    ///\n    /// # Arguments\n    ///\n    /// * `path` - path to the FASTA reference\n    pub fn set_reference<P: AsRef<Path>>(&mut self, path: P) -> Result<()> {\n        unsafe { set_fai_filename(self.htsfile, path) }\n    }\n\n    pub fn index(&self) -> &IndexView {\n        &self.idx\n    }\n\n    // Analogous to slow_idxstats in samtools, see\n    // https://github.com/samtools/samtools/blob/556c60fdff977c0e6cadc4c2581661f187098b4d/bam_index.c#L140-L199\n    unsafe fn slow_idxstats(&mut self) -> Result<Vec<(i64, u64, u64, u64)>> {\n        self.set_cram_options(\n            hts_sys::hts_fmt_option_CRAM_OPT_REQUIRED_FIELDS,\n            hts_sys::sam_fields_SAM_RNAME | hts_sys::sam_fields_SAM_FLAG,\n        )?;\n        let header = self.header();\n        let h = header.inner;\n        let mut ret;\n        let mut last_tid = -2;\n        let fp = self.htsfile();\n\n        let nref =\n            usize::try_from(hts_sys::sam_hdr_nref(h)).map_err(|_| Error::NoSequencesInReference)?;\n        if nref == 0 {\n            return Ok(vec![]);\n        }\n        let mut counts = vec![vec![0; 2]; nref + 1];\n        let mut bb: hts_sys::bam1_t = MaybeUninit::zeroed().assume_init();\n        let b = &mut bb as *mut hts_sys::bam1_t;\n        loop {\n            ret = hts_sys::sam_read1(fp, h, b);\n            if ret < 0 {\n                break;\n            }\n            let tid = (*b).core.tid;\n            if tid >= nref as i32 || tid < -1 {\n                return Err(Error::InvalidTid { tid });\n            }\n\n            if tid != last_tid {\n                if (last_tid >= -1) && (counts[tid as usize][0] + counts[tid as usize][1]) > 0 {\n                    return Err(Error::BamUnsorted);\n                }\n                last_tid = tid;\n            }\n\n            let idx = if ((*b).core.flag as u32 & hts_sys::BAM_FUNMAP) > 0 {\n                1\n            } else {\n                0\n            };\n            counts[(*b).core.tid as usize][idx] += 1;\n        }\n\n        if ret == -1 {\n            let res = (0..nref)\n                .map(|i| {\n                    (\n                        i as i64,\n                        header.target_len(i as u32).unwrap(),\n                        counts[i][0],\n                        counts[i][1],\n                    )\n                })\n                .chain([(-1, 0, counts[nref][0], counts[nref][1])])\n                .collect();\n            Ok(res)\n        } else {\n            Err(Error::SlowIdxStats)\n        }\n    }\n\n    /// Similar to samtools idxstats, this returns a vector of tuples\n    /// containing the target id, length, number of mapped reads, and number of unmapped reads.\n    /// The last entry in the vector corresponds to the unmapped reads for the entire file, with\n    /// the tid set to -1.\n    pub fn index_stats(&mut self) -> Result<Vec<(i64, u64, u64, u64)>> {\n        let header = self.header();\n        let index = self.index();\n        if index.inner_ptr().is_null() {\n            panic!(\"Index is null\");\n        }\n        // the quick index stats method only works for BAM files, not SAM or CRAM\n        unsafe {\n            if (*self.htsfile()).format.format != htslib::htsExactFormat_bam {\n                return self.slow_idxstats();\n            }\n        }\n        Ok((0..header.target_count())\n            .map(|tid| {\n                let (mapped, unmapped) = index.number_mapped_unmapped(tid);\n                let tlen = header.target_len(tid).unwrap();\n                (tid as i64, tlen, mapped, unmapped)\n            })\n            .chain([(-1, 0, 0, index.number_unmapped())])\n            .collect::<_>())\n    }\n}\n\n#[derive(Debug)]\npub struct IndexView {\n    inner: *mut hts_sys::hts_idx_t,\n}\n\nunsafe impl Send for IndexView {}\nunsafe impl Sync for IndexView {}\n\nimpl IndexView {\n    fn new(hts_idx: *mut hts_sys::hts_idx_t) -> Self {\n        Self { inner: hts_idx }\n    }\n\n    #[inline]\n    pub fn inner(&self) -> &hts_sys::hts_idx_t {\n        unsafe { self.inner.as_ref().unwrap() }\n    }\n\n    #[inline]\n    // Pointer to inner hts_idx_t struct\n    pub fn inner_ptr(&self) -> *const hts_sys::hts_idx_t {\n        self.inner\n    }\n\n    #[inline]\n    pub fn inner_mut(&mut self) -> &mut hts_sys::hts_idx_t {\n        unsafe { self.inner.as_mut().unwrap() }\n    }\n\n    #[inline]\n    // Mutable pointer to hts_idx_t struct\n    pub fn inner_ptr_mut(&mut self) -> *mut hts_sys::hts_idx_t {\n        self.inner\n    }\n\n    /// Get the number of mapped and unmapped reads for a given target id\n    /// FIXME only valid for BAM, not SAM/CRAM\n    fn number_mapped_unmapped(&self, tid: u32) -> (u64, u64) {\n        let (mut mapped, mut unmapped) = (0, 0);\n        unsafe {\n            hts_sys::hts_idx_get_stat(self.inner, tid as i32, &mut mapped, &mut unmapped);\n        }\n        (mapped, unmapped)\n    }\n\n    /// Get the total number of unmapped reads in the file\n    /// FIXME only valid for BAM, not SAM/CRAM\n    fn number_unmapped(&self) -> u64 {\n        unsafe { hts_sys::hts_idx_get_n_no_coor(self.inner) }\n    }\n}\n\nimpl Drop for IndexView {\n    fn drop(&mut self) {\n        unsafe {\n            htslib::hts_idx_destroy(self.inner);\n        }\n    }\n}\n\nimpl Read for IndexedReader {\n    fn read(&mut self, record: &mut record::Record) -> Option<Result<()>> {\n        match self.itr {\n            Some(itr) => {\n                match itr_next(self.htsfile, itr, &mut record.inner as *mut htslib::bam1_t) {\n                    -1 => None,\n                    -2 => Some(Err(Error::BamTruncatedRecord)),\n                    -4 => Some(Err(Error::BamInvalidRecord)),\n                    _ => {\n                        record.set_header(Arc::clone(&self.header));\n\n                        Some(Ok(()))\n                    }\n                }\n            }\n            None => None,\n        }\n    }\n\n    /// Iterator over the records of the fetched region.\n    /// Note that, while being convenient, this is less efficient than pre-allocating a\n    /// `Record` and reading into it with the `read` method, since every iteration involves\n    /// the allocation of a new `Record`.\n    fn records(&mut self) -> Records<'_, Self> {\n        Records { reader: self }\n    }\n\n    fn rc_records(&mut self) -> RcRecords<'_, Self> {\n        RcRecords {\n            reader: self,\n            record: Rc::new(record::Record::new()),\n        }\n    }\n\n    fn pileup(&mut self) -> pileup::Pileups<'_, Self> {\n        let _self = self as *const Self;\n        let itr = unsafe {\n            htslib::bam_plp_init(\n                Some(IndexedReader::pileup_read),\n                _self as *mut ::std::os::raw::c_void,\n            )\n        };\n        pileup::Pileups::new(self, itr)\n    }\n\n    fn htsfile(&self) -> *mut htslib::htsFile {\n        self.htsfile\n    }\n\n    fn header(&self) -> &HeaderView {\n        &self.header\n    }\n\n    fn set_thread_pool(&mut self, tpool: &ThreadPool) -> Result<()> {\n        unsafe { set_thread_pool(self.htsfile(), tpool)? }\n        self.tpool = Some(tpool.clone());\n        Ok(())\n    }\n}\n\nimpl Drop for IndexedReader {\n    fn drop(&mut self) {\n        unsafe {\n            if self.itr.is_some() {\n                htslib::hts_itr_destroy(self.itr.unwrap());\n            }\n            htslib::hts_close(self.htsfile);\n        }\n    }\n}\n\n#[derive(Debug, Clone, Copy, PartialEq, Eq)]\npub enum Format {\n    Sam,\n    Bam,\n    Cram,\n}\n\nimpl Format {\n    fn write_mode(self) -> &'static [u8] {\n        match self {\n            Format::Sam => b\"w\",\n            Format::Bam => b\"wb\",\n            Format::Cram => b\"wc\",\n        }\n    }\n}\n\n/// A BAM writer.\n#[derive(Debug)]\npub struct Writer {\n    f: *mut htslib::htsFile,\n    header: Arc<HeaderView>,\n    tpool: Option<ThreadPool>,\n}\n\nunsafe impl Send for Writer {}\n\nimpl Writer {\n    /// Create a new SAM/BAM/CRAM file.\n    ///\n    /// # Arguments\n    ///\n    /// * `path` - the path.\n    /// * `header` - header definition to use\n    /// * `format` - the format to use (SAM/BAM/CRAM)\n    pub fn from_path<P: AsRef<Path>>(\n        path: P,\n        header: &header::Header,\n        format: Format,\n    ) -> Result<Self> {\n        Self::new(&path_as_bytes(path, false)?, format.write_mode(), header)\n    }\n\n    /// Create a new SAM/BAM/CRAM file at STDOUT.\n    ///\n    /// # Arguments\n    ///\n    /// * `header` - header definition to use\n    /// * `format` - the format to use (SAM/BAM/CRAM)\n    pub fn from_stdout(header: &header::Header, format: Format) -> Result<Self> {\n        Self::new(b\"-\", format.write_mode(), header)\n    }\n\n    /// Create a new SAM/BAM/CRAM file.\n    ///\n    /// # Arguments\n    ///\n    /// * `path` - the path. Use \"-\" for stdout.\n    /// * `mode` - write mode, refer to htslib::hts_open()\n    /// * `header` - header definition to use\n    fn new(path: &[u8], mode: &[u8], header: &header::Header) -> Result<Self> {\n        let f = hts_open(path, mode)?;\n\n        // sam_hdr_parse does not populate the text and l_text fields of the header_record.\n        // This causes non-SQ headers to be dropped in the output BAM file.\n        // To avoid this, we copy the All header to a new C-string that is allocated with malloc,\n        // and set this into header_record manually.\n        let header_record = unsafe {\n            let mut header_string = header.to_bytes();\n            if !header_string.is_empty() && header_string[header_string.len() - 1] != b'\\n' {\n                header_string.push(b'\\n');\n            }\n            let l_text = header_string.len();\n            let text = ::libc::malloc(l_text + 1);\n            libc::memset(text, 0, l_text + 1);\n            libc::memcpy(\n                text,\n                header_string.as_ptr() as *const ::libc::c_void,\n                header_string.len(),\n            );\n\n            //println!(\"{}\", str::from_utf8(&header_string).unwrap());\n            let rec = htslib::sam_hdr_parse(l_text + 1, text as *const c_char);\n\n            (*rec).text = text as *mut c_char;\n            (*rec).l_text = l_text;\n            rec\n        };\n\n        unsafe {\n            htslib::sam_hdr_write(f, header_record);\n        }\n\n        Ok(Writer {\n            f,\n            header: Arc::new(HeaderView::new(header_record)),\n            tpool: None,\n        })\n    }\n\n    /// Activate multi-threaded BAM write support in htslib. This should permit faster\n    /// writing of large BAM files.\n    ///\n    /// # Arguments\n    ///\n    /// * `n_threads` - number of extra background writer threads to use, must be `> 0`.\n    pub fn set_threads(&mut self, n_threads: usize) -> Result<()> {\n        unsafe { set_threads(self.f, n_threads) }\n    }\n\n    /// Use a shared thread-pool for writing. This permits controlling the total\n    /// thread count when multiple readers and writers are working simultaneously.\n    /// A thread pool can be created with `crate::tpool::ThreadPool::new(n_threads)`\n    ///\n    /// # Arguments\n    ///\n    /// * `tpool` - thread pool to use for compression work.\n    pub fn set_thread_pool(&mut self, tpool: &ThreadPool) -> Result<()> {\n        unsafe { set_thread_pool(self.f, tpool)? }\n        self.tpool = Some(tpool.clone());\n        Ok(())\n    }\n\n    /// Write record to BAM.\n    ///\n    /// # Arguments\n    ///\n    /// * `record` - the record to write\n    pub fn write(&mut self, record: &record::Record) -> Result<()> {\n        if unsafe { htslib::sam_write1(self.f, self.header.inner(), record.inner_ptr()) } == -1 {\n            Err(Error::WriteRecord)\n        } else {\n            Ok(())\n        }\n    }\n\n    /// Return the header.\n    pub fn header(&self) -> &HeaderView {\n        &self.header\n    }\n\n    /// Set the reference path for reading CRAM files.\n    ///\n    /// # Arguments\n    ///\n    /// * `path` - path to the FASTA reference\n    pub fn set_reference<P: AsRef<Path>>(&mut self, path: P) -> Result<()> {\n        unsafe { set_fai_filename(self.f, path) }\n    }\n\n    /// Set the compression level for writing BAM/CRAM files.\n    ///\n    /// # Arguments\n    ///\n    /// * `compression_level` - `CompressionLevel` enum variant\n    pub fn set_compression_level(&mut self, compression_level: CompressionLevel) -> Result<()> {\n        let level = compression_level.convert()?;\n        match unsafe {\n            htslib::hts_set_opt(\n                self.f,\n                htslib::hts_fmt_option_HTS_OPT_COMPRESSION_LEVEL,\n                level,\n            )\n        } {\n            0 => Ok(()),\n            _ => Err(Error::BamInvalidCompressionLevel { level }),\n        }\n    }\n}\n\n/// Compression levels in BAM/CRAM files\n///\n/// * Uncompressed: No compression, zlib level 0\n/// * Fastest: Lowest compression level, zlib level 1\n/// * Maximum: Highest compression level, zlib level 9\n/// * Level(i): Custom compression level in the range [0, 9]\n#[derive(Debug, Clone, Copy)]\npub enum CompressionLevel {\n    Uncompressed,\n    Fastest,\n    Maximum,\n    Level(u32),\n}\n\nimpl CompressionLevel {\n    // Convert and check the variants of the `CompressionLevel` enum to a numeric level\n    fn convert(self) -> Result<u32> {\n        match self {\n            CompressionLevel::Uncompressed => Ok(0),\n            CompressionLevel::Fastest => Ok(1),\n            CompressionLevel::Maximum => Ok(9),\n            CompressionLevel::Level(i @ 0..=9) => Ok(i),\n            CompressionLevel::Level(i) => Err(Error::BamInvalidCompressionLevel { level: i }),\n        }\n    }\n}\n\nimpl Drop for Writer {\n    fn drop(&mut self) {\n        unsafe {\n            htslib::hts_close(self.f);\n        }\n    }\n}\n\n/// Iterator over the records of a BAM.\n#[derive(Debug)]\npub struct Records<'a, R: Read> {\n    reader: &'a mut R,\n}\n\nimpl<R: Read> Iterator for Records<'_, R> {\n    type Item = Result<record::Record>;\n\n    fn next(&mut self) -> Option<Result<record::Record>> {\n        let mut record = record::Record::new();\n        match self.reader.read(&mut record) {\n            None => None,\n            Some(Ok(_)) => Some(Ok(record)),\n            Some(Err(err)) => Some(Err(err)),\n        }\n    }\n}\n\n/// Iterator over the records of a BAM, using an Rc.\n///\n/// See [rc_records](trait.Read.html#tymethod.rc_records).\n#[derive(Debug)]\npub struct RcRecords<'a, R: Read> {\n    reader: &'a mut R,\n    record: Rc<record::Record>,\n}\n\nimpl<R: Read> Iterator for RcRecords<'_, R> {\n    type Item = Result<Rc<record::Record>>;\n\n    fn next(&mut self) -> Option<Self::Item> {\n        let record = match Rc::get_mut(&mut self.record) {\n            //not make_mut, we don't need a clone\n            Some(x) => x,\n            None => {\n                self.record = Rc::new(record::Record::new());\n                Rc::get_mut(&mut self.record).unwrap()\n            }\n        };\n\n        match self.reader.read(record) {\n            None => None,\n            Some(Ok(_)) => Some(Ok(Rc::clone(&self.record))),\n            Some(Err(err)) => Some(Err(err)),\n        }\n    }\n}\n\n/// Iterator over the records of a BAM until the virtual offset is less than `end`\npub struct ChunkIterator<'a, R: Read> {\n    reader: &'a mut R,\n    end: Option<i64>,\n}\n\nimpl<R: Read> Iterator for ChunkIterator<'_, R> {\n    type Item = Result<record::Record>;\n    fn next(&mut self) -> Option<Result<record::Record>> {\n        if let Some(pos) = self.end {\n            if self.reader.tell() >= pos {\n                return None;\n            }\n        }\n        let mut record = record::Record::new();\n        match self.reader.read(&mut record) {\n            None => None,\n            Some(Ok(_)) => Some(Ok(record)),\n            Some(Err(err)) => Some(Err(err)),\n        }\n    }\n}\n\n/// Wrapper for opening a BAM file.\nfn hts_open(path: &[u8], mode: &[u8]) -> Result<*mut htslib::htsFile> {\n    let cpath = ffi::CString::new(path).unwrap();\n    let path = str::from_utf8(path).unwrap();\n    let c_str = ffi::CString::new(mode).unwrap();\n    let ret = unsafe { htslib::hts_open(cpath.as_ptr(), c_str.as_ptr()) };\n    if ret.is_null() {\n        Err(Error::BamOpen {\n            target: path.to_owned(),\n        })\n    } else {\n        if !mode.contains(&b'w') {\n            unsafe {\n                // Comparison against 'htsFormatCategory_sequence_data' doesn't handle text files correctly\n                // hence the explicit checks against all supported exact formats\n                if (*ret).format.format != htslib::htsExactFormat_sam\n                    && (*ret).format.format != htslib::htsExactFormat_bam\n                    && (*ret).format.format != htslib::htsExactFormat_cram\n                {\n                    return Err(Error::BamOpen {\n                        target: path.to_owned(),\n                    });\n                }\n            }\n        }\n        Ok(ret)\n    }\n}\n\n/// Wrapper for iterating an indexed BAM file.\nfn itr_next(\n    htsfile: *mut htslib::htsFile,\n    itr: *mut htslib::hts_itr_t,\n    record: *mut htslib::bam1_t,\n) -> i32 {\n    unsafe {\n        htslib::hts_itr_next(\n            (*htsfile).fp.bgzf,\n            itr,\n            record as *mut ::std::os::raw::c_void,\n            htsfile as *mut ::std::os::raw::c_void,\n        )\n    }\n}\n\n#[derive(Debug)]\npub struct HeaderView {\n    inner: *mut htslib::bam_hdr_t,\n}\n\nunsafe impl Send for HeaderView {}\nunsafe impl Sync for HeaderView {}\n\nimpl HeaderView {\n    /// Create a new HeaderView from a pre-populated Header object\n    pub fn from_header(header: &Header) -> Self {\n        let mut header_string = header.to_bytes();\n        if !header_string.is_empty() && header_string[header_string.len() - 1] != b'\\n' {\n            header_string.push(b'\\n');\n        }\n        Self::from_bytes(&header_string)\n    }\n\n    /// Create a new HeaderView from bytes\n    pub fn from_bytes(header_string: &[u8]) -> Self {\n        let header_record = unsafe {\n            let l_text = header_string.len();\n            let text = ::libc::malloc(l_text + 1);\n            ::libc::memset(text, 0, l_text + 1);\n            ::libc::memcpy(\n                text,\n                header_string.as_ptr() as *const ::libc::c_void,\n                header_string.len(),\n            );\n\n            let rec = htslib::sam_hdr_parse(l_text + 1, text as *const c_char);\n            (*rec).text = text as *mut c_char;\n            (*rec).l_text = l_text;\n            rec\n        };\n\n        HeaderView::new(header_record)\n    }\n\n    /// Create a new HeaderView from the underlying Htslib type, and own it.\n    fn new(inner: *mut htslib::bam_hdr_t) -> Self {\n        HeaderView { inner }\n    }\n\n    #[inline]\n    pub fn inner(&self) -> &htslib::bam_hdr_t {\n        unsafe { self.inner.as_ref().unwrap() }\n    }\n\n    #[inline]\n    // Pointer to inner bam_hdr_t struct\n    pub fn inner_ptr(&self) -> *const htslib::bam_hdr_t {\n        self.inner\n    }\n\n    #[inline]\n    pub fn inner_mut(&mut self) -> &mut htslib::bam_hdr_t {\n        unsafe { self.inner.as_mut().unwrap() }\n    }\n\n    #[inline]\n    // Mutable pointer to bam_hdr_t struct\n    pub fn inner_ptr_mut(&mut self) -> *mut htslib::bam_hdr_t {\n        self.inner\n    }\n\n    pub fn tid(&self, name: &[u8]) -> Option<u32> {\n        let c_str = ffi::CString::new(name).expect(\"Expected valid name.\");\n        let tid = unsafe { htslib::sam_hdr_name2tid(self.inner, c_str.as_ptr()) };\n        if tid < 0 {\n            None\n        } else {\n            Some(tid as u32)\n        }\n    }\n\n    pub fn tid2name(&self, tid: u32) -> &[u8] {\n        unsafe { ffi::CStr::from_ptr(htslib::sam_hdr_tid2name(self.inner, tid as i32)).to_bytes() }\n    }\n\n    pub fn target_count(&self) -> u32 {\n        self.inner().n_targets as u32\n    }\n\n    pub fn target_names(&self) -> Vec<&[u8]> {\n        let names = unsafe {\n            slice::from_raw_parts(self.inner().target_name, self.target_count() as usize)\n        };\n        names\n            .iter()\n            .map(|name| unsafe { ffi::CStr::from_ptr(*name).to_bytes() })\n            .collect()\n    }\n\n    pub fn target_len(&self, tid: u32) -> Option<u64> {\n        let inner = unsafe { *self.inner };\n        if (tid as i32) < inner.n_targets {\n            let l: &[u32] =\n                unsafe { slice::from_raw_parts(inner.target_len, inner.n_targets as usize) };\n            Some(l[tid as usize] as u64)\n        } else {\n            None\n        }\n    }\n\n    /// Retrieve the textual SAM header as bytes\n    pub fn as_bytes(&self) -> &[u8] {\n        unsafe {\n            let rebuilt_hdr = htslib::sam_hdr_str(self.inner);\n            if rebuilt_hdr.is_null() {\n                return b\"\";\n            }\n            ffi::CStr::from_ptr(rebuilt_hdr).to_bytes()\n        }\n    }\n}\n\nimpl Clone for HeaderView {\n    fn clone(&self) -> Self {\n        HeaderView {\n            inner: unsafe { htslib::sam_hdr_dup(self.inner) },\n        }\n    }\n}\n\nimpl Drop for HeaderView {\n    fn drop(&mut self) {\n        unsafe {\n            htslib::sam_hdr_destroy(self.inner);\n        }\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::header::HeaderRecord;\n    use super::record::{Aux, Cigar, CigarString};\n    use super::*;\n    use std::collections::HashMap;\n    use std::fs;\n    use std::path::Path;\n    use std::str;\n\n    type GoldType = (\n        [&'static [u8]; 6],\n        [u16; 6],\n        [&'static [u8]; 6],\n        [&'static [u8]; 6],\n        [CigarString; 6],\n    );\n    fn gold() -> GoldType {\n        let names = [\n            &b\"I\"[..],\n            &b\"II.14978392\"[..],\n            &b\"III\"[..],\n            &b\"IV\"[..],\n            &b\"V\"[..],\n            &b\"VI\"[..],\n        ];\n        let flags = [16u16, 16u16, 16u16, 16u16, 16u16, 2048u16];\n        let seqs = [\n            &b\"CCTAGCCCTAACCCTAACCCTAACCCTAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCC\\\nTAAGCCTAAGCCTAAGCCTAA\"[..],\n            &b\"CCTAGCCCTAACCCTAACCCTAACCCTAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCC\\\nTAAGCCTAAGCCTAAGCCTAA\"[..],\n            &b\"CCTAGCCCTAACCCTAACCCTAACCCTAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCC\\\nTAAGCCTAAGCCTAAGCCTAA\"[..],\n            &b\"CCTAGCCCTAACCCTAACCCTAACCCTAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCC\\\nTAAGCCTAAGCCTAAGCCTAA\"[..],\n            &b\"CCTAGCCCTAACCCTAACCCTAACCCTAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCC\\\nTAAGCCTAAGCCTAAGCCTAA\"[..],\n            &b\"ACTAAGCCTAAGCCTAAGCCTAAGCCAATTATCGATTTCTGAAAAAATTATCGAATTTTCTAGAAATTTTGCAAATTTT\\\nTTCATAAAATTATCGATTTTA\"[..],\n        ];\n        let quals = [\n            &b\"#############################@B?8B?BA@@DDBCDDCBC@CDCDCCCCCCCCCCCCCCCCCCCCCCCCCCCC\\\nCCCCCCCCCCCCCCCCCCC\"[..],\n            &b\"#############################@B?8B?BA@@DDBCDDCBC@CDCDCCCCCCCCCCCCCCCCCCCCCCCCCCCC\\\nCCCCCCCCCCCCCCCCCCC\"[..],\n            &b\"#############################@B?8B?BA@@DDBCDDCBC@CDCDCCCCCCCCCCCCCCCCCCCCCCCCCCCC\\\nCCCCCCCCCCCCCCCCCCC\"[..],\n            &b\"#############################@B?8B?BA@@DDBCDDCBC@CDCDCCCCCCCCCCCCCCCCCCCCCCCCCCCC\\\nCCCCCCCCCCCCCCCCCCC\"[..],\n            &b\"#############################@B?8B?BA@@DDBCDDCBC@CDCDCCCCCCCCCCCCCCCCCCCCCCCCCCCC\\\nCCCCCCCCCCCCCCCCCCC\"[..],\n            &b\"#############################@B?8B?BA@@DDBCDDCBC@CDCDCCCCCCCCCCCCCCCCCCCCCCCCCCCC\\\nCCCCCCCCCCCCCCCCCCC\"[..],\n        ];\n        let cigars = [\n            CigarString(vec![Cigar::Match(27), Cigar::Del(1), Cigar::Match(73)]),\n            CigarString(vec![Cigar::Match(27), Cigar::Del(1), Cigar::Match(73)]),\n            CigarString(vec![Cigar::Match(27), Cigar::Del(1), Cigar::Match(73)]),\n            CigarString(vec![Cigar::Match(27), Cigar::Del(1), Cigar::Match(73)]),\n            CigarString(vec![Cigar::Match(27), Cigar::Del(1), Cigar::Match(73)]),\n            CigarString(vec![Cigar::Match(27), Cigar::Del(100000), Cigar::Match(73)]),\n        ];\n        (names, flags, seqs, quals, cigars)\n    }\n\n    fn compare_inner_bam_cram_records(cram_records: &[Record], bam_records: &[Record]) {\n        // Selectively compares bam1_t struct fields from BAM and CRAM\n        for (c1, b1) in cram_records.iter().zip(bam_records.iter()) {\n            // CRAM vs BAM l_data is off by 3, see: https://github.com/rust-bio/rust-htslib/pull/184#issuecomment-590133544\n            // The rest of the fields should be identical:\n            assert_eq!(c1.cigar(), b1.cigar());\n            assert_eq!(c1.inner().core.pos, b1.inner().core.pos);\n            assert_eq!(c1.inner().core.mpos, b1.inner().core.mpos);\n            assert_eq!(c1.inner().core.mtid, b1.inner().core.mtid);\n            assert_eq!(c1.inner().core.tid, b1.inner().core.tid);\n            assert_eq!(c1.inner().core.bin, b1.inner().core.bin);\n            assert_eq!(c1.inner().core.qual, b1.inner().core.qual);\n            assert_eq!(c1.inner().core.l_extranul, b1.inner().core.l_extranul);\n            assert_eq!(c1.inner().core.flag, b1.inner().core.flag);\n            assert_eq!(c1.inner().core.l_qname, b1.inner().core.l_qname);\n            assert_eq!(c1.inner().core.n_cigar, b1.inner().core.n_cigar);\n            assert_eq!(c1.inner().core.l_qseq, b1.inner().core.l_qseq);\n            assert_eq!(c1.inner().core.isize_, b1.inner().core.isize_);\n            //... except m_data\n        }\n    }\n\n    #[test]\n    fn test_read() {\n        let (names, flags, seqs, quals, cigars) = gold();\n        let mut bam = Reader::from_path(Path::new(\"test/test.bam\")).expect(\"Error opening file.\");\n        let del_len = [1, 1, 1, 1, 1, 100000];\n\n        for (i, record) in bam.records().enumerate() {\n            let rec = record.expect(\"Expected valid record\");\n            assert_eq!(rec.qname(), names[i]);\n            assert_eq!(rec.flags(), flags[i]);\n            assert_eq!(rec.seq().as_bytes(), seqs[i]);\n\n            let cigar = rec.cigar();\n            assert_eq!(*cigar, cigars[i]);\n\n            let end_pos = cigar.end_pos();\n            assert_eq!(end_pos, rec.pos() + 100 + del_len[i]);\n            assert_eq!(\n                cigar\n                    .read_pos(end_pos as u32 - 10, false, false)\n                    .unwrap()\n                    .unwrap(),\n                90\n            );\n            assert_eq!(\n                cigar\n                    .read_pos(rec.pos() as u32 + 20, false, false)\n                    .unwrap()\n                    .unwrap(),\n                20\n            );\n            assert_eq!(cigar.read_pos(4000000, false, false).unwrap(), None);\n            // fix qual offset\n            let qual: Vec<u8> = quals[i].iter().map(|&q| q - 33).collect();\n            assert_eq!(rec.qual(), &qual[..]);\n        }\n    }\n\n    #[test]\n    fn test_seek() {\n        let mut bam = Reader::from_path(Path::new(\"test/test.bam\")).expect(\"Error opening file.\");\n\n        let mut names_by_voffset = HashMap::new();\n\n        let mut offset = bam.tell();\n        let mut rec = Record::new();\n        while let Some(r) = bam.read(&mut rec) {\n            r.expect(\"error reading bam\");\n            let qname = str::from_utf8(rec.qname()).unwrap().to_string();\n            println!(\"{} {}\", offset, qname);\n            names_by_voffset.insert(offset, qname);\n            offset = bam.tell();\n        }\n\n        for (offset, qname) in names_by_voffset.iter() {\n            println!(\"{} {}\", offset, qname);\n            bam.seek(*offset).unwrap();\n            if let Some(r) = bam.read(&mut rec) {\n                r.unwrap();\n            };\n            let rec_qname = str::from_utf8(rec.qname()).unwrap().to_string();\n            assert_eq!(qname, &rec_qname);\n        }\n    }\n\n    #[test]\n    fn test_read_sam_header() {\n        let bam = Reader::from_path(\"test/test.bam\").expect(\"Error opening file.\");\n\n        let true_header = \"@SQ\\tSN:CHROMOSOME_I\\tLN:15072423\\n@SQ\\tSN:CHROMOSOME_II\\tLN:15279345\\\n             \\n@SQ\\tSN:CHROMOSOME_III\\tLN:13783700\\n@SQ\\tSN:CHROMOSOME_IV\\tLN:17493793\\n@SQ\\t\\\n             SN:CHROMOSOME_V\\tLN:20924149\\n\"\n            .to_string();\n        let header_text = String::from_utf8(bam.header.as_bytes().to_owned()).unwrap();\n        assert_eq!(header_text, true_header);\n    }\n\n    #[test]\n    fn test_read_against_sam() {\n        let mut bam = Reader::from_path(\"./test/bam2sam_out.sam\").unwrap();\n        for read in bam.records() {\n            let _read = read.unwrap();\n        }\n    }\n\n    fn _test_read_indexed_common(mut bam: IndexedReader) {\n        let (names, flags, seqs, quals, cigars) = gold();\n        let sq_1 = b\"CHROMOSOME_I\";\n        let sq_2 = b\"CHROMOSOME_II\";\n        let tid_1 = bam.header.tid(sq_1).expect(\"Expected tid.\");\n        let tid_2 = bam.header.tid(sq_2).expect(\"Expected tid.\");\n        assert!(bam.header.target_len(tid_1).expect(\"Expected target len.\") == 15072423);\n\n        // fetch to position containing reads\n        bam.fetch((tid_1, 0, 2))\n            .expect(\"Expected successful fetch.\");\n        assert!(bam.records().count() == 6);\n\n        // compare reads\n        bam.fetch((tid_1, 0, 2))\n            .expect(\"Expected successful fetch.\");\n        for (i, record) in bam.records().enumerate() {\n            let rec = record.expect(\"Expected valid record\");\n\n            println!(\"{}\", str::from_utf8(rec.qname()).unwrap());\n            assert_eq!(rec.qname(), names[i]);\n            assert_eq!(rec.flags(), flags[i]);\n            assert_eq!(rec.seq().as_bytes(), seqs[i]);\n            assert_eq!(*rec.cigar(), cigars[i]);\n            // fix qual offset\n            let qual: Vec<u8> = quals[i].iter().map(|&q| q - 33).collect();\n            assert_eq!(rec.qual(), &qual[..]);\n            assert_eq!(rec.aux(b\"X\"), Err(Error::BamAuxStringError));\n            assert_eq!(rec.aux(b\"NotAvailableAux\"), Err(Error::BamAuxTagNotFound));\n        }\n\n        // fetch to empty position\n        bam.fetch((tid_2, 1, 1))\n            .expect(\"Expected successful fetch.\");\n        assert!(bam.records().count() == 0);\n\n        // repeat with byte-string based fetch\n\n        // fetch to position containing reads\n        // using coordinate-string chr:start-stop\n        bam.fetch(format!(\"{}:{}-{}\", str::from_utf8(sq_1).unwrap(), 0, 2).as_bytes())\n            .expect(\"Expected successful fetch.\");\n        assert!(bam.records().count() == 6);\n        // using &str and exercising some of the coordinate conversion funcs\n        bam.fetch((str::from_utf8(sq_1).unwrap(), 0_u32, 2_u64))\n            .expect(\"Expected successful fetch.\");\n        assert!(bam.records().count() == 6);\n        // using a slice\n        bam.fetch((&sq_1[..], 0, 2))\n            .expect(\"Expected successful fetch.\");\n        assert!(bam.records().count() == 6);\n        // using a literal\n        bam.fetch((sq_1, 0, 2)).expect(\"Expected successful fetch.\");\n        assert!(bam.records().count() == 6);\n\n        // using a tid\n        bam.fetch((0i32, 0u32, 2i64))\n            .expect(\"Expected successful fetch.\");\n        assert!(bam.records().count() == 6);\n        // using a tid:u32\n        bam.fetch((0u32, 0u32, 2i64))\n            .expect(\"Expected successful fetch.\");\n        assert!(bam.records().count() == 6);\n\n        // compare reads\n        bam.fetch(format!(\"{}:{}-{}\", str::from_utf8(sq_1).unwrap(), 0, 2).as_bytes())\n            .expect(\"Expected successful fetch.\");\n        for (i, record) in bam.records().enumerate() {\n            let rec = record.expect(\"Expected valid record\");\n\n            println!(\"{}\", str::from_utf8(rec.qname()).unwrap());\n            assert_eq!(rec.qname(), names[i]);\n            assert_eq!(rec.flags(), flags[i]);\n            assert_eq!(rec.seq().as_bytes(), seqs[i]);\n            assert_eq!(*rec.cigar(), cigars[i]);\n            // fix qual offset\n            let qual: Vec<u8> = quals[i].iter().map(|&q| q - 33).collect();\n            assert_eq!(rec.qual(), &qual[..]);\n            assert_eq!(rec.aux(b\"NotAvailableAux\"), Err(Error::BamAuxTagNotFound));\n        }\n\n        // fetch to empty position\n        bam.fetch(format!(\"{}:{}-{}\", str::from_utf8(sq_2).unwrap(), 1, 1).as_bytes())\n            .expect(\"Expected successful fetch.\");\n        assert!(bam.records().count() == 0);\n\n        //all on a tid\n        bam.fetch(0).expect(\"Expected successful fetch.\");\n        assert!(bam.records().count() == 6);\n        //all on a tid:u32\n        bam.fetch(0u32).expect(\"Expected successful fetch.\");\n        assert!(bam.records().count() == 6);\n\n        //all on a tid - by &[u8]\n        bam.fetch(sq_1).expect(\"Expected successful fetch.\");\n        assert!(bam.records().count() == 6);\n        //all on a tid - by str\n        bam.fetch(str::from_utf8(sq_1).unwrap())\n            .expect(\"Expected successful fetch.\");\n        assert!(bam.records().count() == 6);\n\n        //all reads\n        bam.fetch(FetchDefinition::All)\n            .expect(\"Expected successful fetch.\");\n        assert!(bam.records().count() == 6);\n\n        //all reads\n        bam.fetch(\".\").expect(\"Expected successful fetch.\");\n        assert!(bam.records().count() == 6);\n\n        //all unmapped\n        bam.fetch(FetchDefinition::Unmapped)\n            .expect(\"Expected successful fetch.\");\n        assert_eq!(bam.records().count(), 1); // expect one 'truncade record' Record.\n\n        bam.fetch(\"*\").expect(\"Expected successful fetch.\");\n        assert_eq!(bam.records().count(), 1); // expect one 'truncade record' Record.\n    }\n\n    #[test]\n    fn test_read_indexed() {\n        let bam = IndexedReader::from_path(\"test/test.bam\").expect(\"Expected valid index.\");\n        _test_read_indexed_common(bam);\n    }\n\n    #[test]\n    fn test_read_indexed_different_index_name() {\n        let bam = IndexedReader::from_path_and_index(\n            &\"test/test_different_index_name.bam\",\n            &\"test/test.bam.bai\",\n        )\n        .expect(\"Expected valid index.\");\n        _test_read_indexed_common(bam);\n    }\n\n    #[test]\n    fn test_set_record() {\n        let (names, _, seqs, quals, cigars) = gold();\n\n        let mut rec = record::Record::new();\n        rec.set_reverse();\n        rec.set(names[0], Some(&cigars[0]), seqs[0], quals[0]);\n        // note: this segfaults if you push_aux() before set()\n        //       because set() obliterates aux\n        rec.push_aux(b\"NM\", Aux::I32(15)).unwrap();\n\n        assert_eq!(rec.qname(), names[0]);\n        assert_eq!(*rec.cigar(), cigars[0]);\n        assert_eq!(rec.seq().as_bytes(), seqs[0]);\n        assert_eq!(rec.qual(), quals[0]);\n        assert!(rec.is_reverse());\n        assert_eq!(rec.aux(b\"NM\").unwrap(), Aux::I32(15));\n    }\n\n    #[test]\n    fn test_set_repeated() {\n        let mut rec = Record::new();\n        rec.set(\n            b\"123\",\n            Some(&CigarString(vec![Cigar::Match(3)])),\n            b\"AAA\",\n            b\"III\",\n        );\n        rec.push_aux(b\"AS\", Aux::I32(12345)).unwrap();\n        assert_eq!(rec.qname(), b\"123\");\n        assert_eq!(rec.seq().as_bytes(), b\"AAA\");\n        assert_eq!(rec.qual(), b\"III\");\n        assert_eq!(rec.aux(b\"AS\").unwrap(), Aux::I32(12345));\n\n        rec.set(\n            b\"1234\",\n            Some(&CigarString(vec![Cigar::SoftClip(1), Cigar::Match(3)])),\n            b\"AAAA\",\n            b\"IIII\",\n        );\n        assert_eq!(rec.qname(), b\"1234\");\n        assert_eq!(rec.seq().as_bytes(), b\"AAAA\");\n        assert_eq!(rec.qual(), b\"IIII\");\n        assert_eq!(rec.aux(b\"AS\").unwrap(), Aux::I32(12345));\n\n        rec.set(\n            b\"12\",\n            Some(&CigarString(vec![Cigar::Match(2)])),\n            b\"AA\",\n            b\"II\",\n        );\n        assert_eq!(rec.qname(), b\"12\");\n        assert_eq!(rec.seq().as_bytes(), b\"AA\");\n        assert_eq!(rec.qual(), b\"II\");\n        assert_eq!(rec.aux(b\"AS\").unwrap(), Aux::I32(12345));\n    }\n\n    #[test]\n    fn test_set_qname() {\n        let (names, _, seqs, quals, cigars) = gold();\n\n        assert!(names[0] != names[1]);\n\n        for i in 0..names.len() {\n            let mut rec = record::Record::new();\n            rec.set(names[i], Some(&cigars[i]), seqs[i], quals[i]);\n            rec.push_aux(b\"NM\", Aux::I32(15)).unwrap();\n\n            assert_eq!(rec.qname(), names[i]);\n            assert_eq!(*rec.cigar(), cigars[i]);\n            assert_eq!(rec.seq().as_bytes(), seqs[i]);\n            assert_eq!(rec.qual(), quals[i]);\n            assert_eq!(rec.aux(b\"NM\").unwrap(), Aux::I32(15));\n\n            // Equal length qname\n            assert!(rec.qname()[0] != b'X');\n            rec.set_qname(b\"X\");\n            assert_eq!(rec.qname(), b\"X\");\n\n            // Longer qname\n            let mut longer_name = names[i].to_owned().clone();\n            let extension = b\"BuffaloBUffaloBUFFaloBUFFAloBUFFALoBUFFALO\";\n            longer_name.extend(extension.iter());\n            rec.set_qname(&longer_name);\n\n            assert_eq!(rec.qname(), longer_name.as_slice());\n            assert_eq!(*rec.cigar(), cigars[i]);\n            assert_eq!(rec.seq().as_bytes(), seqs[i]);\n            assert_eq!(rec.qual(), quals[i]);\n            assert_eq!(rec.aux(b\"NM\").unwrap(), Aux::I32(15));\n\n            // Shorter qname\n            let shorter_name = b\"42\";\n            rec.set_qname(shorter_name);\n\n            assert_eq!(rec.qname(), shorter_name);\n            assert_eq!(*rec.cigar(), cigars[i]);\n            assert_eq!(rec.seq().as_bytes(), seqs[i]);\n            assert_eq!(rec.qual(), quals[i]);\n            assert_eq!(rec.aux(b\"NM\").unwrap(), Aux::I32(15));\n\n            // Zero-length qname\n            rec.set_qname(b\"\");\n\n            assert_eq!(rec.qname(), b\"\");\n            assert_eq!(*rec.cigar(), cigars[i]);\n            assert_eq!(rec.seq().as_bytes(), seqs[i]);\n            assert_eq!(rec.qual(), quals[i]);\n            assert_eq!(rec.aux(b\"NM\").unwrap(), Aux::I32(15));\n        }\n    }\n\n    #[test]\n    fn test_set_qname2() {\n        let mut _header = Header::new();\n        _header.push_record(\n            HeaderRecord::new(b\"SQ\")\n                .push_tag(b\"SN\", \"1\")\n                .push_tag(b\"LN\", 10000000),\n        );\n        let header = HeaderView::from_header(&_header);\n\n        let line =\n            b\"blah1\t0\t1\t1\t255\t1M\t*\t0\t0\tA\tF\tCB:Z:AAAA-1\tUR:Z:AAAA\tUB:Z:AAAA\tGX:Z:G1\txf:i:1\tfx:Z:G1\\tli:i:0\\ttf:Z:cC\";\n\n        let mut rec = Record::from_sam(&header, line).unwrap();\n        assert_eq!(rec.qname(), b\"blah1\");\n        rec.set_qname(b\"r0\");\n        assert_eq!(rec.qname(), b\"r0\");\n    }\n\n    #[test]\n    fn test_set_cigar() {\n        let (names, _, seqs, quals, cigars) = gold();\n\n        assert!(names[0] != names[1]);\n\n        for i in 0..names.len() {\n            let mut rec = record::Record::new();\n            rec.set(names[i], Some(&cigars[i]), seqs[i], quals[i]);\n            rec.push_aux(b\"NM\", Aux::I32(15)).unwrap();\n\n            assert_eq!(rec.qname(), names[i]);\n            assert_eq!(*rec.cigar(), cigars[i]);\n            assert_eq!(rec.seq().as_bytes(), seqs[i]);\n            assert_eq!(rec.qual(), quals[i]);\n            assert_eq!(rec.aux(b\"NM\").unwrap(), Aux::I32(15));\n\n            // boring cigar\n            let new_cigar = CigarString(vec![Cigar::Match(rec.seq_len() as u32)]);\n            assert_ne!(*rec.cigar(), new_cigar);\n            rec.set_cigar(Some(&new_cigar));\n            assert_eq!(*rec.cigar(), new_cigar);\n\n            assert_eq!(rec.qname(), names[i]);\n            assert_eq!(rec.seq().as_bytes(), seqs[i]);\n            assert_eq!(rec.qual(), quals[i]);\n            assert_eq!(rec.aux(b\"NM\").unwrap(), Aux::I32(15));\n\n            // bizarre cigar\n            let new_cigar = (0..rec.seq_len())\n                .map(|i| {\n                    if i % 2 == 0 {\n                        Cigar::Match(1)\n                    } else {\n                        Cigar::Ins(1)\n                    }\n                })\n                .collect::<Vec<_>>();\n            let new_cigar = CigarString(new_cigar);\n            assert_ne!(*rec.cigar(), new_cigar);\n            rec.set_cigar(Some(&new_cigar));\n            assert_eq!(*rec.cigar(), new_cigar);\n\n            assert_eq!(rec.qname(), names[i]);\n            assert_eq!(rec.seq().as_bytes(), seqs[i]);\n            assert_eq!(rec.qual(), quals[i]);\n            assert_eq!(rec.aux(b\"NM\").unwrap(), Aux::I32(15));\n\n            // empty cigar\n            let new_cigar = CigarString(Vec::new());\n            assert_ne!(*rec.cigar(), new_cigar);\n            rec.set_cigar(None);\n            assert_eq!(*rec.cigar(), new_cigar);\n\n            assert_eq!(rec.qname(), names[i]);\n            assert_eq!(rec.seq().as_bytes(), seqs[i]);\n            assert_eq!(rec.qual(), quals[i]);\n            assert_eq!(rec.aux(b\"NM\").unwrap(), Aux::I32(15));\n        }\n    }\n\n    #[test]\n    fn test_remove_aux() {\n        let mut bam = Reader::from_path(Path::new(\"test/test.bam\")).expect(\"Error opening file.\");\n\n        for record in bam.records() {\n            let mut rec = record.expect(\"Expected valid record\");\n\n            if rec.aux(b\"XS\").is_ok() {\n                rec.remove_aux(b\"XS\").unwrap();\n            }\n\n            if rec.aux(b\"YT\").is_ok() {\n                rec.remove_aux(b\"YT\").unwrap();\n            }\n\n            assert_eq!(rec.remove_aux(b\"X\"), Err(Error::BamAuxStringError));\n            assert_eq!(rec.remove_aux(b\"ab\"), Err(Error::BamAuxTagNotFound));\n\n            assert_eq!(rec.aux(b\"XS\"), Err(Error::BamAuxTagNotFound));\n            assert_eq!(rec.aux(b\"YT\"), Err(Error::BamAuxTagNotFound));\n        }\n    }\n\n    #[test]\n    fn test_write() {\n        let (names, _, seqs, quals, cigars) = gold();\n\n        let tmp = tempfile::Builder::new()\n            .prefix(\"rust-htslib\")\n            .tempdir()\n            .expect(\"Cannot create temp dir\");\n        let bampath = tmp.path().join(\"test.bam\");\n        println!(\"{:?}\", bampath);\n        {\n            let mut bam = Writer::from_path(\n                &bampath,\n                Header::new().push_record(\n                    HeaderRecord::new(b\"SQ\")\n                        .push_tag(b\"SN\", \"chr1\")\n                        .push_tag(b\"LN\", 15072423),\n                ),\n                Format::Bam,\n            )\n            .expect(\"Error opening file.\");\n\n            for i in 0..names.len() {\n                let mut rec = record::Record::new();\n                rec.set(names[i], Some(&cigars[i]), seqs[i], quals[i]);\n                rec.push_aux(b\"NM\", Aux::I32(15)).unwrap();\n\n                bam.write(&rec).expect(\"Failed to write record.\");\n            }\n        }\n\n        {\n            let mut bam = Reader::from_path(bampath).expect(\"Error opening file.\");\n\n            for i in 0..names.len() {\n                let mut rec = record::Record::new();\n                if let Some(r) = bam.read(&mut rec) {\n                    r.expect(\"Failed to read record.\");\n                };\n\n                assert_eq!(rec.qname(), names[i]);\n                assert_eq!(*rec.cigar(), cigars[i]);\n                assert_eq!(rec.seq().as_bytes(), seqs[i]);\n                assert_eq!(rec.qual(), quals[i]);\n                assert_eq!(rec.aux(b\"NM\").unwrap(), Aux::I32(15));\n            }\n        }\n\n        tmp.close().expect(\"Failed to delete temp dir\");\n    }\n\n    #[test]\n    fn test_write_threaded() {\n        let (names, _, seqs, quals, cigars) = gold();\n\n        let tmp = tempfile::Builder::new()\n            .prefix(\"rust-htslib\")\n            .tempdir()\n            .expect(\"Cannot create temp dir\");\n        let bampath = tmp.path().join(\"test.bam\");\n        println!(\"{:?}\", bampath);\n        {\n            let mut bam = Writer::from_path(\n                &bampath,\n                Header::new().push_record(\n                    HeaderRecord::new(b\"SQ\")\n                        .push_tag(b\"SN\", \"chr1\")\n                        .push_tag(b\"LN\", 15072423),\n                ),\n                Format::Bam,\n            )\n            .expect(\"Error opening file.\");\n            bam.set_threads(4).unwrap();\n\n            for i in 0..10000 {\n                let mut rec = record::Record::new();\n                let idx = i % names.len();\n                rec.set(names[idx], Some(&cigars[idx]), seqs[idx], quals[idx]);\n                rec.push_aux(b\"NM\", Aux::I32(15)).unwrap();\n                rec.set_pos(i as i64);\n\n                bam.write(&rec).expect(\"Failed to write record.\");\n            }\n        }\n\n        {\n            let mut bam = Reader::from_path(bampath).expect(\"Error opening file.\");\n\n            for (i, _rec) in bam.records().enumerate() {\n                let idx = i % names.len();\n\n                let rec = _rec.expect(\"Failed to read record.\");\n\n                assert_eq!(rec.pos(), i as i64);\n                assert_eq!(rec.qname(), names[idx]);\n                assert_eq!(*rec.cigar(), cigars[idx]);\n                assert_eq!(rec.seq().as_bytes(), seqs[idx]);\n                assert_eq!(rec.qual(), quals[idx]);\n                assert_eq!(rec.aux(b\"NM\").unwrap(), Aux::I32(15));\n            }\n        }\n\n        tmp.close().expect(\"Failed to delete temp dir\");\n    }\n\n    #[test]\n    fn test_write_shared_tpool() {\n        let (names, _, seqs, quals, cigars) = gold();\n\n        let tmp = tempfile::Builder::new()\n            .prefix(\"rust-htslib\")\n            .tempdir()\n            .expect(\"Cannot create temp dir\");\n        let bampath1 = tmp.path().join(\"test1.bam\");\n        let bampath2 = tmp.path().join(\"test2.bam\");\n\n        {\n            let (mut bam1, mut bam2) = {\n                let pool = crate::tpool::ThreadPool::new(4).unwrap();\n\n                let mut bam1 = Writer::from_path(\n                    &bampath1,\n                    Header::new().push_record(\n                        HeaderRecord::new(b\"SQ\")\n                            .push_tag(b\"SN\", \"chr1\")\n                            .push_tag(b\"LN\", 15072423),\n                    ),\n                    Format::Bam,\n                )\n                .expect(\"Error opening file.\");\n\n                let mut bam2 = Writer::from_path(\n                    &bampath2,\n                    Header::new().push_record(\n                        HeaderRecord::new(b\"SQ\")\n                            .push_tag(b\"SN\", \"chr1\")\n                            .push_tag(b\"LN\", 15072423),\n                    ),\n                    Format::Bam,\n                )\n                .expect(\"Error opening file.\");\n\n                bam1.set_thread_pool(&pool).unwrap();\n                bam2.set_thread_pool(&pool).unwrap();\n                (bam1, bam2)\n            };\n\n            for i in 0..10000 {\n                let mut rec = record::Record::new();\n                let idx = i % names.len();\n                rec.set(names[idx], Some(&cigars[idx]), seqs[idx], quals[idx]);\n                rec.push_aux(b\"NM\", Aux::I32(15)).unwrap();\n                rec.set_pos(i as i64);\n\n                bam1.write(&rec).expect(\"Failed to write record.\");\n                bam2.write(&rec).expect(\"Failed to write record.\");\n            }\n        }\n\n        {\n            let pool = crate::tpool::ThreadPool::new(2).unwrap();\n\n            for p in [bampath1, bampath2] {\n                let mut bam = Reader::from_path(p).expect(\"Error opening file.\");\n                bam.set_thread_pool(&pool).unwrap();\n\n                for (i, _rec) in bam.iter_chunk(None, None).enumerate() {\n                    let idx = i % names.len();\n\n                    let rec = _rec.expect(\"Failed to read record.\");\n\n                    assert_eq!(rec.pos(), i as i64);\n                    assert_eq!(rec.qname(), names[idx]);\n                    assert_eq!(*rec.cigar(), cigars[idx]);\n                    assert_eq!(rec.seq().as_bytes(), seqs[idx]);\n                    assert_eq!(rec.qual(), quals[idx]);\n                    assert_eq!(rec.aux(b\"NM\").unwrap(), Aux::I32(15));\n                }\n            }\n        }\n\n        tmp.close().expect(\"Failed to delete temp dir\");\n    }\n\n    #[test]\n    fn test_copy_template() {\n        // Verify that BAM headers are transmitted correctly when using an existing BAM as a\n        // template for headers.\n\n        let tmp = tempfile::Builder::new()\n            .prefix(\"rust-htslib\")\n            .tempdir()\n            .expect(\"Cannot create temp dir\");\n        let bampath = tmp.path().join(\"test.bam\");\n        println!(\"{:?}\", bampath);\n\n        let mut input_bam = Reader::from_path(\"test/test.bam\").expect(\"Error opening file.\");\n\n        {\n            let mut bam = Writer::from_path(\n                &bampath,\n                &Header::from_template(input_bam.header()),\n                Format::Bam,\n            )\n            .expect(\"Error opening file.\");\n\n            for rec in input_bam.records() {\n                bam.write(&rec.unwrap()).expect(\"Failed to write record.\");\n            }\n        }\n\n        {\n            let copy_bam = Reader::from_path(bampath).expect(\"Error opening file.\");\n\n            // Verify that the header came across correctly\n            assert_eq!(input_bam.header().as_bytes(), copy_bam.header().as_bytes());\n        }\n\n        tmp.close().expect(\"Failed to delete temp dir\");\n    }\n\n    #[test]\n    fn test_pileup() {\n        let (_, _, seqs, quals, _) = gold();\n\n        let mut bam = Reader::from_path(\"test/test.bam\").expect(\"Error opening file.\");\n        let pileups = bam.pileup();\n        for pileup in pileups.take(26) {\n            let _pileup = pileup.expect(\"Expected successful pileup.\");\n            let pos = _pileup.pos() as usize;\n            assert_eq!(_pileup.depth(), 6);\n            assert!(_pileup.tid() == 0);\n            for (i, a) in _pileup.alignments().enumerate() {\n                assert_eq!(a.indel(), pileup::Indel::None);\n                let qpos = a.qpos().unwrap();\n                assert_eq!(qpos, pos - 1);\n                assert_eq!(a.record().seq()[qpos], seqs[i][qpos]);\n                assert_eq!(a.record().qual()[qpos], quals[i][qpos] - 33);\n            }\n        }\n    }\n\n    #[test]\n    fn test_idx_pileup() {\n        let mut bam = IndexedReader::from_path(\"test/test.bam\").expect(\"Error opening file.\");\n        // read without fetch\n        for pileup in bam.pileup() {\n            pileup.unwrap();\n        }\n        // go back again\n        let tid = bam.header().tid(b\"CHROMOSOME_I\").unwrap();\n        bam.fetch((tid, 0, 5)).unwrap();\n        for p in bam.pileup() {\n            println!(\"{}\", p.unwrap().pos())\n        }\n    }\n\n    #[test]\n    fn parse_from_sam() {\n        use std::fs::File;\n        use std::io::Read;\n\n        let bamfile = \"./test/bam2sam_test.bam\";\n        let samfile = \"./test/bam2sam_expected.sam\";\n\n        // Load BAM file:\n        let mut rdr = Reader::from_path(bamfile).unwrap();\n        let bam_recs: Vec<Record> = rdr.records().map(|v| v.unwrap()).collect();\n\n        let mut sam = Vec::new();\n        assert!(File::open(samfile).unwrap().read_to_end(&mut sam).is_ok());\n\n        let sam_recs: Vec<Record> = sam\n            .split(|x| *x == b'\\n')\n            .filter(|x| !x.is_empty() && x[0] != b'@')\n            .map(|line| Record::from_sam(rdr.header(), line).unwrap())\n            .collect();\n\n        for (b1, s1) in bam_recs.iter().zip(sam_recs.iter()) {\n            assert!(b1 == s1);\n        }\n    }\n\n    #[test]\n    fn test_cigar_modes() {\n        // test the cached and uncached ways of getting the cigar string.\n\n        let (_, _, _, _, cigars) = gold();\n        let mut bam = Reader::from_path(Path::new(\"test/test.bam\")).expect(\"Error opening file.\");\n\n        for (i, record) in bam.records().enumerate() {\n            let rec = record.expect(\"Expected valid record\");\n\n            let cigar = rec.cigar();\n            assert_eq!(*cigar, cigars[i]);\n        }\n\n        for (i, record) in bam.records().enumerate() {\n            let mut rec = record.expect(\"Expected valid record\");\n            rec.cache_cigar();\n\n            let cigar = rec.cigar_cached().unwrap();\n            assert_eq!(**cigar, cigars[i]);\n\n            let cigar = rec.cigar();\n            assert_eq!(*cigar, cigars[i]);\n        }\n    }\n\n    #[test]\n    fn test_read_cram() {\n        let cram_path = \"./test/test_cram.cram\";\n        let bam_path = \"./test/test_cram.bam\";\n        let ref_path = \"./test/test_cram.fa\";\n\n        // Load CRAM file, records\n        let mut cram_reader = Reader::from_path(cram_path).unwrap();\n        cram_reader.set_reference(ref_path).unwrap();\n        let cram_records: Vec<Record> = cram_reader.records().map(|v| v.unwrap()).collect();\n\n        // Load BAM file, records\n        let mut bam_reader = Reader::from_path(bam_path).unwrap();\n        let bam_records: Vec<Record> = bam_reader.records().map(|v| v.unwrap()).collect();\n\n        compare_inner_bam_cram_records(&cram_records, &bam_records);\n    }\n\n    #[test]\n    fn test_write_cram() {\n        // BAM file, records\n        let bam_path = \"./test/test_cram.bam\";\n        let ref_path = \"./test/test_cram.fa\";\n        let mut bam_reader = Reader::from_path(bam_path).unwrap();\n        let bam_records: Vec<Record> = bam_reader.records().map(|v| v.unwrap()).collect();\n\n        // New CRAM file\n        let tmp = tempfile::Builder::new()\n            .prefix(\"rust-htslib\")\n            .tempdir()\n            .expect(\"Cannot create temp dir\");\n        let cram_path = tmp.path().join(\"test.cram\");\n\n        // Write BAM records to new CRAM file\n        {\n            let mut header = Header::new();\n            header.push_record(\n                HeaderRecord::new(b\"HD\")\n                    .push_tag(b\"VN\", \"1.5\")\n                    .push_tag(b\"SO\", \"coordinate\"),\n            );\n            header.push_record(\n                HeaderRecord::new(b\"SQ\")\n                    .push_tag(b\"SN\", \"chr1\")\n                    .push_tag(b\"LN\", 120)\n                    .push_tag(b\"M5\", \"20a9a0fb770814e6c5e49946750f9724\")\n                    .push_tag(b\"UR\", \"test/test_cram.fa\"),\n            );\n            header.push_record(\n                HeaderRecord::new(b\"SQ\")\n                    .push_tag(b\"SN\", \"chr2\")\n                    .push_tag(b\"LN\", 120)\n                    .push_tag(b\"M5\", \"7a2006ccca94ea92b6dae5997e1b0d70\")\n                    .push_tag(b\"UR\", \"test/test_cram.fa\"),\n            );\n            header.push_record(\n                HeaderRecord::new(b\"SQ\")\n                    .push_tag(b\"SN\", \"chr3\")\n                    .push_tag(b\"LN\", 120)\n                    .push_tag(b\"M5\", \"a66b336bfe3ee8801c744c9545c87e24\")\n                    .push_tag(b\"UR\", \"test/test_cram.fa\"),\n            );\n\n            let mut cram_writer = Writer::from_path(&cram_path, &header, Format::Cram)\n                .expect(\"Error opening CRAM file.\");\n            cram_writer.set_reference(ref_path).unwrap();\n\n            // Write BAM records to CRAM file\n            for rec in bam_records.iter() {\n                cram_writer\n                    .write(rec)\n                    .expect(\"Faied to write record to CRAM.\");\n            }\n        }\n\n        // Compare written CRAM records with BAM records\n        {\n            // Load written CRAM file\n            let mut cram_reader = Reader::from_path(cram_path).unwrap();\n            cram_reader.set_reference(ref_path).unwrap();\n            let cram_records: Vec<Record> = cram_reader.records().map(|v| v.unwrap()).collect();\n\n            // Compare CRAM records to BAM records\n            compare_inner_bam_cram_records(&cram_records, &bam_records);\n        }\n\n        tmp.close().expect(\"Failed to delete temp dir\");\n    }\n\n    #[test]\n    fn test_compression_level_conversion() {\n        // predefined compression levels\n        assert_eq!(CompressionLevel::Uncompressed.convert().unwrap(), 0);\n        assert_eq!(CompressionLevel::Fastest.convert().unwrap(), 1);\n        assert_eq!(CompressionLevel::Maximum.convert().unwrap(), 9);\n\n        // numeric compression levels\n        for level in 0..=9 {\n            assert_eq!(CompressionLevel::Level(level).convert().unwrap(), level);\n        }\n        // invalid levels\n        assert!(CompressionLevel::Level(10).convert().is_err());\n    }\n\n    #[test]\n    fn test_write_compression() {\n        let tmp = tempfile::Builder::new()\n            .prefix(\"rust-htslib\")\n            .tempdir()\n            .expect(\"Cannot create temp dir\");\n        let input_bam_path = \"test/test.bam\";\n\n        // test levels with decreasing compression factor\n        let levels_to_test = vec![\n            CompressionLevel::Maximum,\n            CompressionLevel::Level(6),\n            CompressionLevel::Fastest,\n            CompressionLevel::Uncompressed,\n        ];\n        let file_sizes: Vec<_> = levels_to_test\n            .iter()\n            .map(|level| {\n                let output_bam_path = tmp.path().join(\"test.bam\");\n                {\n                    let mut reader = Reader::from_path(input_bam_path).unwrap();\n                    let header = Header::from_template(reader.header());\n                    let mut writer =\n                        Writer::from_path(&output_bam_path, &header, Format::Bam).unwrap();\n                    writer.set_compression_level(*level).unwrap();\n                    for record in reader.records() {\n                        let r = record.unwrap();\n                        writer.write(&r).unwrap();\n                    }\n                }\n                fs::metadata(output_bam_path).unwrap().len()\n            })\n            .collect();\n\n        // check that out BAM file sizes are in decreasing order, in line with the expected compression factor\n        println!(\"testing compression leves: {:?}\", levels_to_test);\n        println!(\"got compressed sizes: {:?}\", file_sizes);\n\n        // libdeflate comes out with a slightly bigger file on Max compression\n        // than on Level(6), so skip that check\n        #[cfg(feature = \"libdeflate\")]\n        assert!(file_sizes[1..].windows(2).all(|size| size[0] <= size[1]));\n\n        #[cfg(not(feature = \"libdeflate\"))]\n        assert!(file_sizes.windows(2).all(|size| size[0] <= size[1]));\n\n        tmp.close().expect(\"Failed to delete temp dir\");\n    }\n\n    #[test]\n    fn test_bam_fails_on_vcf() {\n        let bam_path = \"./test/test_left.vcf\";\n        let bam_reader = Reader::from_path(bam_path);\n        assert!(bam_reader.is_err());\n    }\n\n    #[test]\n    fn test_indexde_bam_fails_on_vcf() {\n        let bam_path = \"./test/test_left.vcf\";\n        let bam_reader = IndexedReader::from_path(bam_path);\n        assert!(bam_reader.is_err());\n    }\n\n    #[test]\n    fn test_bam_fails_on_toml() {\n        let bam_path = \"./Cargo.toml\";\n        let bam_reader = Reader::from_path(bam_path);\n        assert!(bam_reader.is_err());\n    }\n\n    #[test]\n    fn test_sam_writer_example() {\n        fn from_bam_with_filter<F>(bamfile: &str, samfile: &str, f: F) -> bool\n        where\n            F: Fn(&record::Record) -> Option<bool>,\n        {\n            let mut bam_reader = Reader::from_path(bamfile).unwrap(); // internal functions, just unwrap\n            let header = header::Header::from_template(bam_reader.header());\n            let mut sam_writer = Writer::from_path(samfile, &header, Format::Sam).unwrap();\n            for record in bam_reader.records() {\n                if record.is_err() {\n                    return false;\n                }\n                let parsed = record.unwrap();\n                match f(&parsed) {\n                    None => return true,\n                    Some(false) => {}\n                    Some(true) => {\n                        if sam_writer.write(&parsed).is_err() {\n                            return false;\n                        }\n                    }\n                }\n            }\n            true\n        }\n        use std::fs::File;\n        use std::io::Read;\n        let bamfile = \"./test/bam2sam_test.bam\";\n        let samfile = \"./test/bam2sam_out.sam\";\n        let expectedfile = \"./test/bam2sam_expected.sam\";\n        let result = from_bam_with_filter(bamfile, samfile, |_| Some(true));\n        assert!(result);\n        let mut expected = Vec::new();\n        let mut written = Vec::new();\n        assert!(File::open(expectedfile)\n            .unwrap()\n            .read_to_end(&mut expected)\n            .is_ok());\n        assert!(File::open(samfile)\n            .unwrap()\n            .read_to_end(&mut written)\n            .is_ok());\n        assert_eq!(expected, written);\n    }\n\n    // #[cfg(feature = \"curl\")]\n    // #[test]\n    // fn test_http_connect() {\n    //     let url: Url = Url::parse(\n    //         \"https://raw.githubusercontent.com/brainstorm/tiny-test-data/master/wgs/mt.bam\",\n    //     )\n    //     .unwrap();\n    //     let r = Reader::from_url(&url);\n    //     println!(\"{:#?}\", r);\n    //     let r = r.unwrap();\n\n    //     assert_eq!(r.header().target_names()[0], b\"chr1\");\n    // }\n\n    #[test]\n    fn test_rc_records() {\n        let (names, flags, seqs, quals, cigars) = gold();\n        let mut bam = Reader::from_path(Path::new(\"test/test.bam\")).expect(\"Error opening file.\");\n        let del_len = [1, 1, 1, 1, 1, 100000];\n\n        for (i, record) in bam.rc_records().enumerate() {\n            //let rec = record.expect(\"Expected valid record\");\n            let rec = record.unwrap();\n            println!(\"{}\", str::from_utf8(rec.qname()).ok().unwrap());\n            assert_eq!(rec.qname(), names[i]);\n            assert_eq!(rec.flags(), flags[i]);\n            assert_eq!(rec.seq().as_bytes(), seqs[i]);\n\n            let cigar = rec.cigar();\n            assert_eq!(*cigar, cigars[i]);\n\n            let end_pos = cigar.end_pos();\n            assert_eq!(end_pos, rec.pos() + 100 + del_len[i]);\n            assert_eq!(\n                cigar\n                    .read_pos(end_pos as u32 - 10, false, false)\n                    .unwrap()\n                    .unwrap(),\n                90\n            );\n            assert_eq!(\n                cigar\n                    .read_pos(rec.pos() as u32 + 20, false, false)\n                    .unwrap()\n                    .unwrap(),\n                20\n            );\n            assert_eq!(cigar.read_pos(4000000, false, false).unwrap(), None);\n            // fix qual offset\n            let qual: Vec<u8> = quals[i].iter().map(|&q| q - 33).collect();\n            assert_eq!(rec.qual(), &qual[..]);\n        }\n    }\n\n    #[test]\n    fn test_aux_arrays() {\n        let bam_header = Header::new();\n        let mut test_record = Record::from_sam(\n            &HeaderView::from_header(&bam_header),\n            \"ali1\\t4\\t*\\t0\\t0\\t*\\t*\\t0\\t0\\tACGT\\tFFFF\".as_bytes(),\n        )\n        .unwrap();\n\n        let array_i8: Vec<i8> = vec![i8::MIN, -1, 0, 1, i8::MAX];\n        let array_u8: Vec<u8> = vec![u8::MIN, 0, 1, u8::MAX];\n        let array_i16: Vec<i16> = vec![i16::MIN, -1, 0, 1, i16::MAX];\n        let array_u16: Vec<u16> = vec![u16::MIN, 0, 1, u16::MAX];\n        let array_i32: Vec<i32> = vec![i32::MIN, -1, 0, 1, i32::MAX];\n        let array_u32: Vec<u32> = vec![u32::MIN, 0, 1, u32::MAX];\n        let array_f32: Vec<f32> = vec![f32::MIN, 0.0, -0.0, 0.1, 0.99, f32::MAX];\n\n        test_record\n            .push_aux(b\"XA\", Aux::ArrayI8((&array_i8).into()))\n            .unwrap();\n        test_record\n            .push_aux(b\"XB\", Aux::ArrayU8((&array_u8).into()))\n            .unwrap();\n        test_record\n            .push_aux(b\"XC\", Aux::ArrayI16((&array_i16).into()))\n            .unwrap();\n        test_record\n            .push_aux(b\"XD\", Aux::ArrayU16((&array_u16).into()))\n            .unwrap();\n        test_record\n            .push_aux(b\"XE\", Aux::ArrayI32((&array_i32).into()))\n            .unwrap();\n        test_record\n            .push_aux(b\"XF\", Aux::ArrayU32((&array_u32).into()))\n            .unwrap();\n        test_record\n            .push_aux(b\"XG\", Aux::ArrayFloat((&array_f32).into()))\n            .unwrap();\n\n        {\n            let tag = b\"XA\";\n            if let Ok(Aux::ArrayI8(array)) = test_record.aux(tag) {\n                // Retrieve aux array\n                let aux_array_content = array.iter().collect::<Vec<_>>();\n                assert_eq!(aux_array_content, array_i8);\n\n                // Copy the stored aux array to another record\n                {\n                    let mut copy_test_record = test_record.clone();\n\n                    // Pushing a field with an existing tag should fail\n                    assert!(copy_test_record.push_aux(tag, Aux::I8(3)).is_err());\n\n                    // Remove aux array from target record\n                    copy_test_record.remove_aux(tag).unwrap();\n                    assert!(copy_test_record.aux(tag).is_err());\n\n                    // Copy array to target record\n                    let src_aux = test_record.aux(tag).unwrap();\n                    assert!(copy_test_record.push_aux(tag, src_aux).is_ok());\n                    if let Ok(Aux::ArrayI8(array)) = copy_test_record.aux(tag) {\n                        let aux_array_content_copied = array.iter().collect::<Vec<_>>();\n                        assert_eq!(aux_array_content_copied, array_i8);\n                    } else {\n                        panic!(\"Aux tag not found\");\n                    }\n                }\n            } else {\n                panic!(\"Aux tag not found\");\n            }\n        }\n\n        {\n            let tag = b\"XB\";\n            if let Ok(Aux::ArrayU8(array)) = test_record.aux(tag) {\n                // Retrieve aux array\n                let aux_array_content = array.iter().collect::<Vec<_>>();\n                assert_eq!(aux_array_content, array_u8);\n\n                // Copy the stored aux array to another record\n                {\n                    let mut copy_test_record = test_record.clone();\n\n                    // Pushing a field with an existing tag should fail\n                    assert!(copy_test_record.push_aux(tag, Aux::U8(3)).is_err());\n\n                    // Remove aux array from target record\n                    copy_test_record.remove_aux(tag).unwrap();\n                    assert!(copy_test_record.aux(tag).is_err());\n\n                    // Copy array to target record\n                    let src_aux = test_record.aux(tag).unwrap();\n                    assert!(copy_test_record.push_aux(tag, src_aux).is_ok());\n                    if let Ok(Aux::ArrayU8(array)) = copy_test_record.aux(tag) {\n                        let aux_array_content_copied = array.iter().collect::<Vec<_>>();\n                        assert_eq!(aux_array_content_copied, array_u8);\n                    } else {\n                        panic!(\"Aux tag not found\");\n                    }\n                }\n            } else {\n                panic!(\"Aux tag not found\");\n            }\n        }\n\n        {\n            let tag = b\"XC\";\n            if let Ok(Aux::ArrayI16(array)) = test_record.aux(tag) {\n                // Retrieve aux array\n                let aux_array_content = array.iter().collect::<Vec<_>>();\n                assert_eq!(aux_array_content, array_i16);\n\n                // Copy the stored aux array to another record\n                {\n                    let mut copy_test_record = test_record.clone();\n\n                    // Pushing a field with an existing tag should fail\n                    assert!(copy_test_record.push_aux(tag, Aux::I16(3)).is_err());\n\n                    // Remove aux array from target record\n                    copy_test_record.remove_aux(tag).unwrap();\n                    assert!(copy_test_record.aux(tag).is_err());\n\n                    // Copy array to target record\n                    let src_aux = test_record.aux(tag).unwrap();\n                    assert!(copy_test_record.push_aux(tag, src_aux).is_ok());\n                    if let Ok(Aux::ArrayI16(array)) = copy_test_record.aux(tag) {\n                        let aux_array_content_copied = array.iter().collect::<Vec<_>>();\n                        assert_eq!(aux_array_content_copied, array_i16);\n                    } else {\n                        panic!(\"Aux tag not found\");\n                    }\n                }\n            } else {\n                panic!(\"Aux tag not found\");\n            }\n        }\n\n        {\n            let tag = b\"XD\";\n            if let Ok(Aux::ArrayU16(array)) = test_record.aux(tag) {\n                // Retrieve aux array\n                let aux_array_content = array.iter().collect::<Vec<_>>();\n                assert_eq!(aux_array_content, array_u16);\n\n                // Copy the stored aux array to another record\n                {\n                    let mut copy_test_record = test_record.clone();\n\n                    // Pushing a field with an existing tag should fail\n                    assert!(copy_test_record.push_aux(tag, Aux::U16(3)).is_err());\n\n                    // Remove aux array from target record\n                    copy_test_record.remove_aux(tag).unwrap();\n                    assert!(copy_test_record.aux(tag).is_err());\n\n                    // Copy array to target record\n                    let src_aux = test_record.aux(tag).unwrap();\n                    assert!(copy_test_record.push_aux(tag, src_aux).is_ok());\n                    if let Ok(Aux::ArrayU16(array)) = copy_test_record.aux(tag) {\n                        let aux_array_content_copied = array.iter().collect::<Vec<_>>();\n                        assert_eq!(aux_array_content_copied, array_u16);\n                    } else {\n                        panic!(\"Aux tag not found\");\n                    }\n                }\n            } else {\n                panic!(\"Aux tag not found\");\n            }\n        }\n\n        {\n            let tag = b\"XE\";\n            if let Ok(Aux::ArrayI32(array)) = test_record.aux(tag) {\n                // Retrieve aux array\n                let aux_array_content = array.iter().collect::<Vec<_>>();\n                assert_eq!(aux_array_content, array_i32);\n\n                // Copy the stored aux array to another record\n                {\n                    let mut copy_test_record = test_record.clone();\n\n                    // Pushing a field with an existing tag should fail\n                    assert!(copy_test_record.push_aux(tag, Aux::I32(3)).is_err());\n\n                    // Remove aux array from target record\n                    copy_test_record.remove_aux(tag).unwrap();\n                    assert!(copy_test_record.aux(tag).is_err());\n\n                    // Copy array to target record\n                    let src_aux = test_record.aux(tag).unwrap();\n                    assert!(copy_test_record.push_aux(tag, src_aux).is_ok());\n                    if let Ok(Aux::ArrayI32(array)) = copy_test_record.aux(tag) {\n                        let aux_array_content_copied = array.iter().collect::<Vec<_>>();\n                        assert_eq!(aux_array_content_copied, array_i32);\n                    } else {\n                        panic!(\"Aux tag not found\");\n                    }\n                }\n            } else {\n                panic!(\"Aux tag not found\");\n            }\n        }\n\n        {\n            let tag = b\"XF\";\n            if let Ok(Aux::ArrayU32(array)) = test_record.aux(tag) {\n                // Retrieve aux array\n                let aux_array_content = array.iter().collect::<Vec<_>>();\n                assert_eq!(aux_array_content, array_u32);\n\n                // Copy the stored aux array to another record\n                {\n                    let mut copy_test_record = test_record.clone();\n\n                    // Pushing a field with an existing tag should fail\n                    assert!(copy_test_record.push_aux(tag, Aux::U32(3)).is_err());\n\n                    // Remove aux array from target record\n                    copy_test_record.remove_aux(tag).unwrap();\n                    assert!(copy_test_record.aux(tag).is_err());\n\n                    // Copy array to target record\n                    let src_aux = test_record.aux(tag).unwrap();\n                    assert!(copy_test_record.push_aux(tag, src_aux).is_ok());\n                    if let Ok(Aux::ArrayU32(array)) = copy_test_record.aux(tag) {\n                        let aux_array_content_copied = array.iter().collect::<Vec<_>>();\n                        assert_eq!(aux_array_content_copied, array_u32);\n                    } else {\n                        panic!(\"Aux tag not found\");\n                    }\n                }\n            } else {\n                panic!(\"Aux tag not found\");\n            }\n        }\n\n        {\n            let tag = b\"XG\";\n            if let Ok(Aux::ArrayFloat(array)) = test_record.aux(tag) {\n                // Retrieve aux array\n                let aux_array_content = array.iter().collect::<Vec<_>>();\n                assert_eq!(aux_array_content, array_f32);\n\n                // Copy the stored aux array to another record\n                {\n                    let mut copy_test_record = test_record.clone();\n\n                    // Pushing a field with an existing tag should fail\n                    assert!(copy_test_record.push_aux(tag, Aux::Float(3.0)).is_err());\n\n                    // Remove aux array from target record\n                    copy_test_record.remove_aux(tag).unwrap();\n                    assert!(copy_test_record.aux(tag).is_err());\n\n                    // Copy array to target record\n                    let src_aux = test_record.aux(tag).unwrap();\n                    assert!(copy_test_record.push_aux(tag, src_aux).is_ok());\n                    if let Ok(Aux::ArrayFloat(array)) = copy_test_record.aux(tag) {\n                        let aux_array_content_copied = array.iter().collect::<Vec<_>>();\n                        assert_eq!(aux_array_content_copied, array_f32);\n                    } else {\n                        panic!(\"Aux tag not found\");\n                    }\n                }\n            } else {\n                panic!(\"Aux tag not found\");\n            }\n        }\n\n        // Test via `Iterator` impl\n        for item in test_record.aux_iter() {\n            match item.unwrap() {\n                (b\"XA\", Aux::ArrayI8(array)) => {\n                    assert_eq!(&array.iter().collect::<Vec<_>>(), &array_i8);\n                }\n                (b\"XB\", Aux::ArrayU8(array)) => {\n                    assert_eq!(&array.iter().collect::<Vec<_>>(), &array_u8);\n                }\n                (b\"XC\", Aux::ArrayI16(array)) => {\n                    assert_eq!(&array.iter().collect::<Vec<_>>(), &array_i16);\n                }\n                (b\"XD\", Aux::ArrayU16(array)) => {\n                    assert_eq!(&array.iter().collect::<Vec<_>>(), &array_u16);\n                }\n                (b\"XE\", Aux::ArrayI32(array)) => {\n                    assert_eq!(&array.iter().collect::<Vec<_>>(), &array_i32);\n                }\n                (b\"XF\", Aux::ArrayU32(array)) => {\n                    assert_eq!(&array.iter().collect::<Vec<_>>(), &array_u32);\n                }\n                (b\"XG\", Aux::ArrayFloat(array)) => {\n                    assert_eq!(&array.iter().collect::<Vec<_>>(), &array_f32);\n                }\n                _ => {\n                    panic!();\n                }\n            }\n        }\n\n        // Test via `PartialEq` impl\n        assert_eq!(\n            test_record.aux(b\"XA\").unwrap(),\n            Aux::ArrayI8((&array_i8).into())\n        );\n        assert_eq!(\n            test_record.aux(b\"XB\").unwrap(),\n            Aux::ArrayU8((&array_u8).into())\n        );\n        assert_eq!(\n            test_record.aux(b\"XC\").unwrap(),\n            Aux::ArrayI16((&array_i16).into())\n        );\n        assert_eq!(\n            test_record.aux(b\"XD\").unwrap(),\n            Aux::ArrayU16((&array_u16).into())\n        );\n        assert_eq!(\n            test_record.aux(b\"XE\").unwrap(),\n            Aux::ArrayI32((&array_i32).into())\n        );\n        assert_eq!(\n            test_record.aux(b\"XF\").unwrap(),\n            Aux::ArrayU32((&array_u32).into())\n        );\n        assert_eq!(\n            test_record.aux(b\"XG\").unwrap(),\n            Aux::ArrayFloat((&array_f32).into())\n        );\n    }\n\n    #[test]\n    fn test_aux_scalars() {\n        let bam_header = Header::new();\n        let mut test_record = Record::from_sam(\n            &HeaderView::from_header(&bam_header),\n            \"ali1\\t4\\t*\\t0\\t0\\t*\\t*\\t0\\t0\\tACGT\\tFFFF\".as_bytes(),\n        )\n        .unwrap();\n\n        test_record.push_aux(b\"XA\", Aux::I8(i8::MIN)).unwrap();\n        test_record.push_aux(b\"XB\", Aux::I8(i8::MAX)).unwrap();\n        test_record.push_aux(b\"XC\", Aux::U8(u8::MIN)).unwrap();\n        test_record.push_aux(b\"XD\", Aux::U8(u8::MAX)).unwrap();\n        test_record.push_aux(b\"XE\", Aux::I16(i16::MIN)).unwrap();\n        test_record.push_aux(b\"XF\", Aux::I16(i16::MAX)).unwrap();\n        test_record.push_aux(b\"XG\", Aux::U16(u16::MIN)).unwrap();\n        test_record.push_aux(b\"XH\", Aux::U16(u16::MAX)).unwrap();\n        test_record.push_aux(b\"XI\", Aux::I32(i32::MIN)).unwrap();\n        test_record.push_aux(b\"XJ\", Aux::I32(i32::MAX)).unwrap();\n        test_record.push_aux(b\"XK\", Aux::U32(u32::MIN)).unwrap();\n        test_record.push_aux(b\"XL\", Aux::U32(u32::MAX)).unwrap();\n        test_record\n            .push_aux(b\"XM\", Aux::Float(std::f32::consts::PI))\n            .unwrap();\n        test_record\n            .push_aux(b\"XN\", Aux::Double(std::f64::consts::PI))\n            .unwrap();\n        test_record\n            .push_aux(b\"XO\", Aux::String(\"Test str\"))\n            .unwrap();\n        test_record.push_aux(b\"XP\", Aux::I8(0)).unwrap();\n\n        let collected_aux_fields = test_record.aux_iter().collect::<Result<Vec<_>>>().unwrap();\n        assert_eq!(\n            collected_aux_fields,\n            vec![\n                (&b\"XA\"[..], Aux::I8(i8::MIN)),\n                (&b\"XB\"[..], Aux::I8(i8::MAX)),\n                (&b\"XC\"[..], Aux::U8(u8::MIN)),\n                (&b\"XD\"[..], Aux::U8(u8::MAX)),\n                (&b\"XE\"[..], Aux::I16(i16::MIN)),\n                (&b\"XF\"[..], Aux::I16(i16::MAX)),\n                (&b\"XG\"[..], Aux::U16(u16::MIN)),\n                (&b\"XH\"[..], Aux::U16(u16::MAX)),\n                (&b\"XI\"[..], Aux::I32(i32::MIN)),\n                (&b\"XJ\"[..], Aux::I32(i32::MAX)),\n                (&b\"XK\"[..], Aux::U32(u32::MIN)),\n                (&b\"XL\"[..], Aux::U32(u32::MAX)),\n                (&b\"XM\"[..], Aux::Float(std::f32::consts::PI)),\n                (&b\"XN\"[..], Aux::Double(std::f64::consts::PI)),\n                (&b\"XO\"[..], Aux::String(\"Test str\")),\n                (&b\"XP\"[..], Aux::I8(0)),\n            ]\n        );\n    }\n\n    #[test]\n    fn test_aux_array_partial_eq() {\n        use record::AuxArray;\n\n        // Target types\n        let one_data: Vec<i8> = vec![0, 1, 2, 3, 4, 5, 6];\n        let one_aux_array = AuxArray::from(&one_data);\n\n        let two_data: Vec<i8> = vec![0, 1, 2, 3, 4, 5];\n        let two_aux_array = AuxArray::from(&two_data);\n\n        assert_ne!(&one_data, &two_data);\n        assert_ne!(&one_aux_array, &two_aux_array);\n\n        let one_aux = Aux::ArrayI8(one_aux_array);\n        let two_aux = Aux::ArrayI8(two_aux_array);\n        assert_ne!(&one_aux, &two_aux);\n\n        // Raw bytes\n        let bam_header = Header::new();\n        let mut test_record = Record::from_sam(\n            &HeaderView::from_header(&bam_header),\n            \"ali1\\t4\\t*\\t0\\t0\\t*\\t*\\t0\\t0\\tACGT\\tFFFF\".as_bytes(),\n        )\n        .unwrap();\n\n        test_record.push_aux(b\"XA\", one_aux).unwrap();\n        test_record.push_aux(b\"XB\", two_aux).unwrap();\n\n        // RawLeBytes == RawLeBytes\n        assert_eq!(\n            test_record.aux(b\"XA\").unwrap(),\n            test_record.aux(b\"XA\").unwrap()\n        );\n        // RawLeBytes != RawLeBytes\n        assert_ne!(\n            test_record.aux(b\"XA\").unwrap(),\n            test_record.aux(b\"XB\").unwrap()\n        );\n\n        // RawLeBytes == TargetType\n        assert_eq!(\n            test_record.aux(b\"XA\").unwrap(),\n            Aux::ArrayI8((&one_data).into())\n        );\n        assert_eq!(\n            test_record.aux(b\"XB\").unwrap(),\n            Aux::ArrayI8((&two_data).into())\n        );\n        // RawLeBytes != TargetType\n        assert_ne!(\n            test_record.aux(b\"XA\").unwrap(),\n            Aux::ArrayI8((&two_data).into())\n        );\n        assert_ne!(\n            test_record.aux(b\"XB\").unwrap(),\n            Aux::ArrayI8((&one_data).into())\n        );\n    }\n\n    /// Test if both text and binary representations of a BAM header are in sync (#156)\n    #[test]\n    fn test_bam_header_sync() {\n        let reader = Reader::from_path(\"test/test_issue_156_no_text.bam\").unwrap();\n        let header_hashmap = Header::from_template(reader.header()).to_hashmap();\n        let header_refseqs = header_hashmap.get(\"SQ\").unwrap();\n        assert_eq!(header_refseqs[0].get(\"SN\").unwrap(), \"ref_1\",);\n        assert_eq!(header_refseqs[0].get(\"LN\").unwrap(), \"10000000\",);\n    }\n\n    #[test]\n    fn test_bam_new() {\n        // Create the path to write the tmp test BAM\n        let tmp = tempfile::Builder::new()\n            .prefix(\"rust-htslib\")\n            .tempdir()\n            .expect(\"Cannot create temp dir\");\n        let bampath = tmp.path().join(\"test.bam\");\n\n        // write an unmapped BAM record (uBAM)\n        {\n            // Build the header\n            let mut header = Header::new();\n\n            // Add the version\n            header.push_record(\n                HeaderRecord::new(b\"HD\")\n                    .push_tag(b\"VN\", \"1.6\")\n                    .push_tag(b\"SO\", \"unsorted\"),\n            );\n\n            // Build the writer\n            let mut writer = Writer::from_path(&bampath, &header, Format::Bam).unwrap();\n\n            // Build an empty record\n            let record = Record::new();\n\n            // Write the record (this previously seg-faulted)\n            assert!(writer.write(&record).is_ok());\n        }\n\n        // Read the record\n        {\n            // Build th reader\n            let mut reader = Reader::from_path(bampath).expect(\"Error opening file.\");\n\n            // Read the record\n            let mut rec = Record::new();\n            match reader.read(&mut rec) {\n                Some(r) => r.expect(\"Failed to read record.\"),\n                None => panic!(\"No record read.\"),\n            };\n\n            // Check a few things\n            assert!(rec.is_unmapped());\n            assert_eq!(rec.tid(), -1);\n            assert_eq!(rec.pos(), -1);\n            assert_eq!(rec.mtid(), -1);\n            assert_eq!(rec.mpos(), -1);\n        }\n    }\n\n    #[test]\n    fn test_idxstats_bam() {\n        let mut reader = IndexedReader::from_path(\"test/test.bam\").unwrap();\n        let expected = vec![\n            (0, 15072423, 6, 0),\n            (1, 15279345, 0, 0),\n            (2, 13783700, 0, 0),\n            (3, 17493793, 0, 0),\n            (4, 20924149, 0, 0),\n            (-1, 0, 0, 0),\n        ];\n        let actual = reader.index_stats().unwrap();\n        assert_eq!(expected, actual);\n    }\n\n    #[test]\n    fn test_number_mapped_and_unmapped_bam() {\n        let reader = IndexedReader::from_path(\"test/test.bam\").unwrap();\n        let expected = (6, 0);\n        let actual = reader.index().number_mapped_unmapped(0);\n        assert_eq!(expected, actual);\n    }\n\n    #[test]\n    fn test_number_unmapped_global_bam() {\n        let reader = IndexedReader::from_path(\"test/test_unmapped.bam\").unwrap();\n        let expected = 8;\n        let actual = reader.index().number_unmapped();\n        assert_eq!(expected, actual);\n    }\n\n    #[test]\n    fn test_idxstats_cram() {\n        let mut reader = IndexedReader::from_path(\"test/test_cram.cram\").unwrap();\n        reader.set_reference(\"test/test_cram.fa\").unwrap();\n        let expected = vec![\n            (0, 120, 2, 0),\n            (1, 120, 2, 0),\n            (2, 120, 2, 0),\n            (-1, 0, 0, 0),\n        ];\n        let actual = reader.index_stats().unwrap();\n        assert_eq!(expected, actual);\n    }\n\n    #[test]\n    fn test_slow_idxstats_cram() {\n        let mut reader = IndexedReader::from_path(\"test/test_cram.cram\").unwrap();\n        reader.set_reference(\"test/test_cram.fa\").unwrap();\n        let expected = vec![\n            (0, 120, 2, 0),\n            (1, 120, 2, 0),\n            (2, 120, 2, 0),\n            (-1, 0, 0, 0),\n        ];\n        let actual = reader.index_stats().unwrap();\n        assert_eq!(expected, actual);\n    }\n\n    // #[test]\n    // fn test_number_mapped_and_unmapped_cram() {\n    //     let mut reader = IndexedReader::from_path(\"test/test_cram.cram\").unwrap();\n    //     reader.set_reference(\"test/test_cram.fa\").unwrap();\n    //     let expected = (2, 0);\n    //     let actual = reader.index().number_mapped_unmapped(0);\n    //     assert_eq!(expected, actual);\n    // }\n    //\n    // #[test]\n    // fn test_number_unmapped_global_cram() {\n    //     let mut reader = IndexedReader::from_path(\"test/test_unmapped.cram\").unwrap();\n    //     let expected = 8;\n    //     let actual = reader.index().number_unmapped();\n    //     assert_eq!(expected, actual);\n    // }\n}\n"
  },
  {
    "path": "src/bam/pileup.rs",
    "content": "// Copyright 2014 Johannes Köster.\n// Licensed under the MIT license (http://opensource.org/licenses/MIT)\n// This file may not be copied, modified, or distributed\n// except according to those terms.\n\nuse std::fmt;\nuse std::iter;\nuse std::slice;\n\nuse crate::htslib;\n\nuse crate::bam;\nuse crate::bam::record;\nuse crate::errors::{Error, Result};\n\n/// Iterator over alignments of a pileup.\npub type Alignments<'a> = iter::Map<\n    slice::Iter<'a, htslib::bam_pileup1_t>,\n    fn(&'a htslib::bam_pileup1_t) -> Alignment<'a>,\n>;\n\n/// A pileup over one genomic position.\n#[derive(Debug)]\npub struct Pileup {\n    inner: *const htslib::bam_pileup1_t,\n    depth: u32,\n    tid: u32,\n    pos: u32,\n}\n\nimpl Pileup {\n    pub fn tid(&self) -> u32 {\n        self.tid\n    }\n\n    pub fn pos(&self) -> u32 {\n        self.pos\n    }\n\n    pub fn depth(&self) -> u32 {\n        self.depth\n    }\n\n    pub fn alignments(&self) -> Alignments<'_> {\n        self.inner().iter().map(Alignment::new)\n    }\n\n    fn inner(&self) -> &[htslib::bam_pileup1_t] {\n        unsafe {\n            slice::from_raw_parts(\n                self.inner as *mut htslib::bam_pileup1_t,\n                self.depth as usize,\n            )\n        }\n    }\n}\n\n/// An aligned read in a pileup.\npub struct Alignment<'a> {\n    inner: &'a htslib::bam_pileup1_t,\n}\n\nimpl fmt::Debug for Alignment<'_> {\n    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {\n        write!(f, \"Alignment\")\n    }\n}\n\nimpl<'a> Alignment<'a> {\n    pub fn new(inner: &'a htslib::bam_pileup1_t) -> Self {\n        Alignment { inner }\n    }\n\n    /// Position within the read. None if either `is_del` or `is_refskip`.\n    pub fn qpos(&self) -> Option<usize> {\n        if self.is_del() || self.is_refskip() {\n            // there is no alignment position in such a case\n            None\n        } else {\n            Some(self.inner.qpos as usize)\n        }\n    }\n\n    /// Insertion, deletion (with length) if indel starts at next base or None otherwise.\n    pub fn indel(&self) -> Indel {\n        match self.inner.indel {\n            len if len < 0 => Indel::Del(-len as u32),\n            len if len > 0 => Indel::Ins(len as u32),\n            _ => Indel::None,\n        }\n    }\n\n    /// Whether there is a deletion in the alignment at this position.\n    pub fn is_del(&self) -> bool {\n        self.inner.is_del() != 0\n    }\n\n    /// Whether the alignment starts at this position.\n    pub fn is_head(&self) -> bool {\n        self.inner.is_head() != 0\n    }\n\n    /// Whether the alignment ends at this position.\n    pub fn is_tail(&self) -> bool {\n        self.inner.is_tail() != 0\n    }\n\n    /// Whether this position is marked as refskip in the CIGAR string.\n    pub fn is_refskip(&self) -> bool {\n        self.inner.is_refskip() != 0\n    }\n\n    /// The corresponding record.\n    pub fn record(&self) -> record::Record {\n        record::Record::from_inner(self.inner.b)\n    }\n}\n\n#[derive(PartialEq, Eq, Debug, Copy, Clone, Hash)]\npub enum Indel {\n    Ins(u32),\n    Del(u32),\n    None,\n}\n\n/// Iterator over pileups.\n#[derive(Debug)]\npub struct Pileups<'a, R: bam::Read> {\n    #[allow(dead_code)]\n    reader: &'a mut R,\n    itr: htslib::bam_plp_t,\n}\n\nimpl<'a, R: bam::Read> Pileups<'a, R> {\n    pub fn new(reader: &'a mut R, itr: htslib::bam_plp_t) -> Self {\n        Pileups { reader, itr }\n    }\n\n    /// Warning: because htslib internally uses signed integer for depth this method\n    /// will panic if `depth` exceeds `i32::MAX`.\n    pub fn set_max_depth(&mut self, depth: u32) {\n        if depth > i32::MAX as u32 {\n            panic!(\n                \"Maximum value for pileup depth is {} but {} was provided\",\n                i32::MAX,\n                depth\n            )\n        }\n        let intdepth = depth as i32;\n        unsafe {\n            htslib::bam_plp_set_maxcnt(self.itr, intdepth);\n        }\n    }\n}\n\nimpl<R: bam::Read> Iterator for Pileups<'_, R> {\n    type Item = Result<Pileup>;\n\n    #[allow(clippy::match_bool)]\n    fn next(&mut self) -> Option<Result<Pileup>> {\n        let (mut tid, mut pos, mut depth) = (0i32, 0i32, 0i32);\n        let inner = unsafe { htslib::bam_plp_auto(self.itr, &mut tid, &mut pos, &mut depth) };\n\n        match inner.is_null() {\n            true if depth == -1 => Some(Err(Error::BamPileup)),\n            true => None,\n            false => Some(Ok(Pileup {\n                inner,\n                depth: depth as u32,\n                tid: tid as u32,\n                pos: pos as u32,\n            })),\n        }\n    }\n}\n\nimpl<R: bam::Read> Drop for Pileups<'_, R> {\n    fn drop(&mut self) {\n        unsafe {\n            htslib::bam_plp_reset(self.itr);\n            htslib::bam_plp_destroy(self.itr);\n        }\n    }\n}\n\n#[cfg(test)]\nmod tests {\n\n    use crate::bam;\n    use crate::bam::Read;\n\n    #[test]\n    fn test_max_pileup() {\n        let mut bam = bam::Reader::from_path(\"test/test.bam\").unwrap();\n        let mut p = bam.pileup();\n        p.set_max_depth(0u32);\n        p.set_max_depth(800u32);\n    }\n\n    #[test]\n    #[should_panic]\n    fn test_max_pileup_to_high() {\n        let mut bam = bam::Reader::from_path(\"test/test.bam\").unwrap();\n        let mut p = bam.pileup();\n        p.set_max_depth((i32::MAX as u32) + 1);\n    }\n}\n"
  },
  {
    "path": "src/bam/record.rs",
    "content": "// Copyright 2014 Christopher Schröder, Johannes Köster.\n// Licensed under the MIT license (http://opensource.org/licenses/MIT)\n// This file may not be copied, modified, or distributed\n// except according to those terms.\n\nuse std::convert::TryFrom;\nuse std::convert::TryInto;\nuse std::ffi;\nuse std::fmt;\nuse std::marker::PhantomData;\nuse std::mem::{size_of, MaybeUninit};\nuse std::ops;\nuse std::os::raw::c_char;\nuse std::slice;\nuse std::str;\nuse std::sync::Arc;\n\nuse byteorder::{LittleEndian, ReadBytesExt};\n\nuse crate::bam::Error;\nuse crate::bam::HeaderView;\nuse crate::errors::Result;\nuse crate::htslib;\nuse crate::utils;\n#[cfg(feature = \"serde_feature\")]\nuse serde::{self, Deserialize, Serialize};\n\nuse bio_types::alignment::{Alignment, AlignmentMode, AlignmentOperation};\nuse bio_types::genome;\nuse bio_types::sequence::SequenceRead;\nuse bio_types::sequence::SequenceReadPairOrientation;\nuse bio_types::strand::ReqStrand;\n\n/// A macro creating methods for flag access.\nmacro_rules! flag {\n    ($get:ident, $set:ident, $unset:ident, $bit:expr) => {\n        pub fn $get(&self) -> bool {\n            self.inner().core.flag & $bit != 0\n        }\n\n        pub fn $set(&mut self) {\n            self.inner_mut().core.flag |= $bit;\n        }\n\n        pub fn $unset(&mut self) {\n            self.inner_mut().core.flag &= !$bit;\n        }\n    };\n}\n\n/// A BAM record.\npub struct Record {\n    pub inner: htslib::bam1_t,\n    own: bool,\n    cigar: Option<CigarStringView>,\n    header: Option<Arc<HeaderView>>,\n}\n\nunsafe impl Send for Record {}\nunsafe impl Sync for Record {}\n\nimpl Clone for Record {\n    fn clone(&self) -> Self {\n        let mut copy = Record::new();\n        unsafe { htslib::bam_copy1(copy.inner_ptr_mut(), self.inner_ptr()) };\n        copy\n    }\n}\n\nimpl PartialEq for Record {\n    fn eq(&self, other: &Record) -> bool {\n        self.tid() == other.tid()\n            && self.pos() == other.pos()\n            && self.bin() == other.bin()\n            && self.mapq() == other.mapq()\n            && self.flags() == other.flags()\n            && self.mtid() == other.mtid()\n            && self.mpos() == other.mpos()\n            && self.insert_size() == other.insert_size()\n            && self.data() == other.data()\n            && self.inner().core.l_extranul == other.inner().core.l_extranul\n    }\n}\n\nimpl Eq for Record {}\n\nimpl fmt::Debug for Record {\n    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {\n        fmt.write_fmt(format_args!(\n            \"Record(tid: {}, pos: {})\",\n            self.tid(),\n            self.pos()\n        ))\n    }\n}\n\nimpl Default for Record {\n    fn default() -> Self {\n        Self::new()\n    }\n}\n\n#[inline]\nfn extranul_from_qname(qname: &[u8]) -> usize {\n    let qlen = qname.len() + 1;\n    if !qlen.is_multiple_of(4) {\n        4 - qlen % 4\n    } else {\n        0\n    }\n}\n\nimpl Record {\n    /// Create an empty BAM record.\n    pub fn new() -> Self {\n        let mut record = Record {\n            inner: unsafe { MaybeUninit::zeroed().assume_init() },\n            own: true,\n            cigar: None,\n            header: None,\n        };\n        // The read/query name needs to be set as empty to properly initialize\n        // the record\n        record.set_qname(b\"\");\n        // Developer note: these are needed so the returned record is properly\n        // initialized as unmapped.\n        record.set_unmapped();\n        record.set_tid(-1);\n        record.set_pos(-1);\n        record.set_mpos(-1);\n        record.set_mtid(-1);\n        record\n    }\n\n    pub fn from_inner(from: *mut htslib::bam1_t) -> Self {\n        Record {\n            inner: {\n                #[allow(clippy::uninit_assumed_init, invalid_value)]\n                let mut inner = unsafe { MaybeUninit::uninit().assume_init() };\n                unsafe {\n                    ::libc::memcpy(\n                        &mut inner as *mut htslib::bam1_t as *mut ::libc::c_void,\n                        from as *const ::libc::c_void,\n                        size_of::<htslib::bam1_t>(),\n                    );\n                }\n                inner\n            },\n            own: false,\n            cigar: None,\n            header: None,\n        }\n    }\n\n    // Create a BAM record from a line SAM text. SAM slice need not be 0-terminated.\n    pub fn from_sam(header_view: &HeaderView, sam: &[u8]) -> Result<Record> {\n        let mut record = Self::new();\n\n        let mut sam_copy = Vec::with_capacity(sam.len() + 1);\n        sam_copy.extend(sam);\n        sam_copy.push(0);\n\n        let mut sam_string = htslib::kstring_t {\n            s: sam_copy.as_ptr() as *mut c_char,\n            l: sam_copy.len(),\n            m: sam_copy.len(),\n        };\n\n        let succ = unsafe {\n            htslib::sam_parse1(\n                &mut sam_string,\n                header_view.inner_ptr() as *mut htslib::bam_hdr_t,\n                record.inner_ptr_mut(),\n            )\n        };\n\n        if succ == 0 {\n            Ok(record)\n        } else {\n            Err(Error::BamParseSAM {\n                rec: str::from_utf8(&sam_copy).unwrap().to_owned(),\n            })\n        }\n    }\n\n    pub fn set_header(&mut self, header: Arc<HeaderView>) {\n        self.header = Some(header);\n    }\n\n    pub(super) fn data(&self) -> &[u8] {\n        unsafe { slice::from_raw_parts(self.inner().data, self.inner().l_data as usize) }\n    }\n\n    #[inline]\n    pub fn inner_mut(&mut self) -> &mut htslib::bam1_t {\n        &mut self.inner\n    }\n\n    #[inline]\n    pub(super) fn inner_ptr_mut(&mut self) -> *mut htslib::bam1_t {\n        &mut self.inner as *mut htslib::bam1_t\n    }\n\n    #[inline]\n    pub fn inner(&self) -> &htslib::bam1_t {\n        &self.inner\n    }\n\n    #[inline]\n    pub(super) fn inner_ptr(&self) -> *const htslib::bam1_t {\n        &self.inner as *const htslib::bam1_t\n    }\n\n    /// Get target id.\n    pub fn tid(&self) -> i32 {\n        self.inner().core.tid\n    }\n\n    /// Set target id.\n    pub fn set_tid(&mut self, tid: i32) {\n        self.inner_mut().core.tid = tid;\n    }\n\n    /// Get position (0-based).\n    pub fn pos(&self) -> i64 {\n        self.inner().core.pos\n    }\n\n    /// Set position (0-based).\n    pub fn set_pos(&mut self, pos: i64) {\n        self.inner_mut().core.pos = pos;\n    }\n\n    pub fn bin(&self) -> u16 {\n        self.inner().core.bin\n    }\n\n    pub fn set_bin(&mut self, bin: u16) {\n        self.inner_mut().core.bin = bin;\n    }\n\n    /// Get MAPQ.\n    pub fn mapq(&self) -> u8 {\n        self.inner().core.qual\n    }\n\n    /// Set MAPQ.\n    pub fn set_mapq(&mut self, mapq: u8) {\n        self.inner_mut().core.qual = mapq;\n    }\n\n    /// Get strand information from record flags.\n    pub fn strand(&self) -> ReqStrand {\n        let reverse = self.flags() & 0x10 != 0;\n        if reverse {\n            ReqStrand::Reverse\n        } else {\n            ReqStrand::Forward\n        }\n    }\n\n    /// Get raw flags.\n    pub fn flags(&self) -> u16 {\n        self.inner().core.flag\n    }\n\n    /// Set raw flags.\n    pub fn set_flags(&mut self, flags: u16) {\n        self.inner_mut().core.flag = flags;\n    }\n\n    /// Unset all flags.\n    pub fn unset_flags(&mut self) {\n        self.inner_mut().core.flag = 0;\n    }\n\n    /// Get target id of mate.\n    pub fn mtid(&self) -> i32 {\n        self.inner().core.mtid\n    }\n\n    /// Set target id of mate.\n    pub fn set_mtid(&mut self, mtid: i32) {\n        self.inner_mut().core.mtid = mtid;\n    }\n\n    /// Get mate position.\n    pub fn mpos(&self) -> i64 {\n        self.inner().core.mpos\n    }\n\n    /// Set mate position.\n    pub fn set_mpos(&mut self, mpos: i64) {\n        self.inner_mut().core.mpos = mpos;\n    }\n\n    /// Get insert size.\n    pub fn insert_size(&self) -> i64 {\n        self.inner().core.isize_\n    }\n\n    /// Set insert size.\n    pub fn set_insert_size(&mut self, insert_size: i64) {\n        self.inner_mut().core.isize_ = insert_size;\n    }\n\n    fn qname_capacity(&self) -> usize {\n        self.inner().core.l_qname as usize\n    }\n\n    fn qname_len(&self) -> usize {\n        // discount all trailing zeros (the default one and extra nulls)\n        self.qname_capacity() - 1 - self.inner().core.l_extranul as usize\n    }\n\n    /// Get qname (read name). Complexity: O(1).\n    pub fn qname(&self) -> &[u8] {\n        &self.data()[..self.qname_len()]\n    }\n\n    /// Set the variable length data buffer\n    pub fn set_data(&mut self, new_data: &[u8]) {\n        self.cigar = None;\n\n        self.inner_mut().l_data = new_data.len() as i32;\n        if (self.inner().m_data as i32) < self.inner().l_data {\n            // Verbosity due to lexical borrowing\n            let l_data = self.inner().l_data;\n            self.realloc_var_data(l_data as usize);\n        }\n\n        // Copy new data into buffer\n        let data =\n            unsafe { slice::from_raw_parts_mut(self.inner.data, self.inner().l_data as usize) };\n        utils::copy_memory(new_data, data);\n    }\n\n    /// Set variable length data (qname, cigar, seq, qual).\n    /// The aux data is left unchanged.\n    /// `qual` is Phred-scaled quality values, without any offset.\n    /// NOTE: seq.len() must equal qual.len() or this method\n    /// will panic. If you don't have quality values use\n    /// `let quals = vec![ 255 as u8; seq.len()];` as a placeholder that will\n    /// be recognized as missing QVs by `samtools`.\n    pub fn set(&mut self, qname: &[u8], cigar: Option<&CigarString>, seq: &[u8], qual: &[u8]) {\n        assert!(qname.len() < 255);\n        assert_eq!(seq.len(), qual.len(), \"seq.len() must equal qual.len()\");\n\n        self.cigar = None;\n\n        let cigar_width = if let Some(cigar_string) = cigar {\n            cigar_string.len()\n        } else {\n            0\n        } * 4;\n        let q_len = qname.len() + 1;\n        let extranul = extranul_from_qname(qname);\n\n        let orig_aux_offset = self.qname_capacity()\n            + 4 * self.cigar_len()\n            + self.seq_len().div_ceil(2)\n            + self.seq_len();\n        let new_aux_offset = q_len + extranul + cigar_width + seq.len().div_ceil(2) + qual.len();\n        assert!(orig_aux_offset <= self.inner.l_data as usize);\n        let aux_len = self.inner.l_data as usize - orig_aux_offset;\n        self.inner_mut().l_data = (new_aux_offset + aux_len) as i32;\n        if (self.inner().m_data as i32) < self.inner().l_data {\n            // Verbosity due to lexical borrowing\n            let l_data = self.inner().l_data;\n            self.realloc_var_data(l_data as usize);\n        }\n\n        // Copy the aux data.\n        if aux_len > 0 && orig_aux_offset != new_aux_offset {\n            let data =\n                unsafe { slice::from_raw_parts_mut(self.inner.data, self.inner().m_data as usize) };\n            data.copy_within(orig_aux_offset..orig_aux_offset + aux_len, new_aux_offset);\n        }\n\n        let data =\n            unsafe { slice::from_raw_parts_mut(self.inner.data, self.inner().l_data as usize) };\n\n        // qname\n        utils::copy_memory(qname, data);\n        for i in 0..=extranul {\n            data[qname.len() + i] = b'\\0';\n        }\n        let mut i = q_len + extranul;\n        self.inner_mut().core.l_qname = i as u16;\n        self.inner_mut().core.l_extranul = extranul as u8;\n\n        // cigar\n        if let Some(cigar_string) = cigar {\n            let cigar_data = unsafe {\n                //cigar is always aligned to 4 bytes (see extranul above) - so this is safe\n                #[allow(clippy::cast_ptr_alignment)]\n                slice::from_raw_parts_mut(data[i..].as_ptr() as *mut u32, cigar_string.len())\n            };\n            for (i, c) in cigar_string.iter().enumerate() {\n                cigar_data[i] = c.encode();\n            }\n            self.inner_mut().core.n_cigar = cigar_string.len() as u32;\n            i += cigar_string.len() * 4;\n        } else {\n            self.inner_mut().core.n_cigar = 0;\n        };\n\n        // seq\n        {\n            for j in (0..seq.len()).step_by(2) {\n                data[i + j / 2] = (ENCODE_BASE[seq[j] as usize] << 4)\n                    | (if j + 1 < seq.len() {\n                        ENCODE_BASE[seq[j + 1] as usize]\n                    } else {\n                        0\n                    });\n            }\n            self.inner_mut().core.l_qseq = seq.len() as i32;\n            i += seq.len().div_ceil(2);\n        }\n\n        // qual\n        utils::copy_memory(qual, &mut data[i..]);\n    }\n\n    /// Replace current qname with a new one.\n    pub fn set_qname(&mut self, new_qname: &[u8]) {\n        // 251 + 1NUL is the max 32-bit aligned value that fits in u8\n        assert!(new_qname.len() < 252);\n\n        let old_q_len = self.qname_capacity();\n        // We're going to add a terminal NUL\n        let extranul = extranul_from_qname(new_qname);\n        let new_q_len = new_qname.len() + 1 + extranul;\n\n        // Length of data after qname\n        let other_len = self.inner_mut().l_data - old_q_len as i32;\n\n        if new_q_len < old_q_len && self.inner().l_data > (old_q_len as i32) {\n            self.inner_mut().l_data -= (old_q_len - new_q_len) as i32;\n        } else if new_q_len > old_q_len {\n            self.inner_mut().l_data += (new_q_len - old_q_len) as i32;\n\n            // Reallocate if necessary\n            if (self.inner().m_data as i32) < self.inner().l_data {\n                // Verbosity due to lexical borrowing\n                let l_data = self.inner().l_data;\n                self.realloc_var_data(l_data as usize);\n            }\n        }\n\n        if new_q_len != old_q_len {\n            // Move other data to new location\n            unsafe {\n                let data = slice::from_raw_parts_mut(self.inner.data, self.inner().l_data as usize);\n\n                ::libc::memmove(\n                    data.as_mut_ptr().add(new_q_len) as *mut ::libc::c_void,\n                    data.as_mut_ptr().add(old_q_len) as *mut ::libc::c_void,\n                    other_len as usize,\n                );\n            }\n        }\n\n        // Copy qname data\n        let data =\n            unsafe { slice::from_raw_parts_mut(self.inner.data, self.inner().l_data as usize) };\n        utils::copy_memory(new_qname, data);\n        for i in 0..=extranul {\n            data[new_q_len - i - 1] = b'\\0';\n        }\n        self.inner_mut().core.l_qname = new_q_len as u16;\n        self.inner_mut().core.l_extranul = extranul as u8;\n    }\n\n    /// Replace current cigar with a new one.\n    pub fn set_cigar(&mut self, new_cigar: Option<&CigarString>) {\n        self.cigar = None;\n\n        let qname_data_len = self.qname_capacity();\n        let old_cigar_data_len = self.cigar_len() * 4;\n\n        // Length of data after cigar\n        let other_data_len = self.inner_mut().l_data - (qname_data_len + old_cigar_data_len) as i32;\n\n        let new_cigar_len = match new_cigar {\n            Some(x) => x.len(),\n            None => 0,\n        };\n        let new_cigar_data_len = new_cigar_len * 4;\n\n        if new_cigar_data_len < old_cigar_data_len {\n            self.inner_mut().l_data -= (old_cigar_data_len - new_cigar_data_len) as i32;\n        } else if new_cigar_data_len > old_cigar_data_len {\n            self.inner_mut().l_data += (new_cigar_data_len - old_cigar_data_len) as i32;\n\n            // Reallocate if necessary\n            if (self.inner().m_data as i32) < self.inner().l_data {\n                // Verbosity due to lexical borrowing\n                let l_data = self.inner().l_data;\n                self.realloc_var_data(l_data as usize);\n            }\n        }\n\n        if new_cigar_data_len != old_cigar_data_len {\n            // Move other data to new location\n            unsafe {\n                ::libc::memmove(\n                    self.inner.data.add(qname_data_len + new_cigar_data_len) as *mut ::libc::c_void,\n                    self.inner.data.add(qname_data_len + old_cigar_data_len) as *mut ::libc::c_void,\n                    other_data_len as usize,\n                );\n            }\n        }\n\n        // Copy cigar data\n        if let Some(cigar_string) = new_cigar {\n            let cigar_data = unsafe {\n                #[allow(clippy::cast_ptr_alignment)]\n                slice::from_raw_parts_mut(\n                    self.inner.data.add(qname_data_len) as *mut u32,\n                    cigar_string.len(),\n                )\n            };\n            for (i, c) in cigar_string.iter().enumerate() {\n                cigar_data[i] = c.encode();\n            }\n        }\n        self.inner_mut().core.n_cigar = new_cigar_len as u32;\n    }\n\n    fn realloc_var_data(&mut self, new_len: usize) {\n        // pad request\n        let new_len = new_len as u32;\n        let new_request = new_len + 32 - (new_len % 32);\n\n        let ptr = unsafe {\n            ::libc::realloc(\n                self.inner().data as *mut ::libc::c_void,\n                new_request as usize,\n            ) as *mut u8\n        };\n\n        if ptr.is_null() {\n            panic!(\"ran out of memory in rust_htslib trying to realloc\");\n        }\n\n        // don't update m_data until we know we have\n        // a successful allocation.\n        self.inner_mut().m_data = new_request;\n        self.inner_mut().data = ptr;\n\n        // we now own inner.data\n        self.own = true;\n    }\n\n    pub fn cigar_len(&self) -> usize {\n        self.inner().core.n_cigar as usize\n    }\n\n    /// Get reference to raw cigar string representation (as stored in BAM file).\n    /// Usually, the method `Record::cigar` should be used instead.\n    pub fn raw_cigar(&self) -> &[u32] {\n        //cigar is always aligned to 4 bytes - so this is safe\n        #[allow(clippy::cast_ptr_alignment)]\n        unsafe {\n            slice::from_raw_parts(\n                self.data()[self.qname_capacity()..].as_ptr() as *const u32,\n                self.cigar_len(),\n            )\n        }\n    }\n\n    /// Return unpacked cigar string. This will create a fresh copy the Cigar data.\n    pub fn cigar(&self) -> CigarStringView {\n        match self.cigar {\n            Some(ref c) => c.clone(),\n            None => self.unpack_cigar(),\n        }\n    }\n\n    // Return unpacked cigar string. This returns None unless you have first called `bam::Record::cache_cigar`.\n    pub fn cigar_cached(&self) -> Option<&CigarStringView> {\n        self.cigar.as_ref()\n    }\n\n    /// Decode the cigar string and cache it inside the `Record`\n    pub fn cache_cigar(&mut self) {\n        self.cigar = Some(self.unpack_cigar())\n    }\n\n    /// Unpack cigar string. Complexity: O(k) with k being the length of the cigar string.\n    fn unpack_cigar(&self) -> CigarStringView {\n        CigarString(\n            self.raw_cigar()\n                .iter()\n                .map(|&c| {\n                    let len = c >> 4;\n                    match c & 0b1111 {\n                        0 => Cigar::Match(len),\n                        1 => Cigar::Ins(len),\n                        2 => Cigar::Del(len),\n                        3 => Cigar::RefSkip(len),\n                        4 => Cigar::SoftClip(len),\n                        5 => Cigar::HardClip(len),\n                        6 => Cigar::Pad(len),\n                        7 => Cigar::Equal(len),\n                        8 => Cigar::Diff(len),\n                        _ => panic!(\"Unexpected cigar operation\"),\n                    }\n                })\n                .collect(),\n        )\n        .into_view(self.pos())\n    }\n\n    pub fn seq_len(&self) -> usize {\n        self.inner().core.l_qseq as usize\n    }\n\n    fn seq_data(&self) -> &[u8] {\n        let offset = self.qname_capacity() + self.cigar_len() * 4;\n        &self.data()[offset..][..self.seq_len().div_ceil(2)]\n    }\n\n    /// Get read sequence. Complexity: O(1).\n    pub fn seq(&self) -> Seq<'_> {\n        Seq {\n            encoded: self.seq_data(),\n            len: self.seq_len(),\n        }\n    }\n\n    /// Get base qualities (PHRED-scaled probability that base is wrong).\n    /// This does not entail any offsets, hence the qualities can be used directly without\n    /// e.g. subtracting 33. Complexity: O(1).\n    pub fn qual(&self) -> &[u8] {\n        &self.data()[self.qname_capacity() + self.cigar_len() * 4 + self.seq_len().div_ceil(2)..]\n            [..self.seq_len()]\n    }\n\n    /// Look up an auxiliary field by its tag.\n    ///\n    /// Only the first two bytes of a given tag are used for the look-up of a field.\n    /// See [`Aux`] for more details.\n    pub fn aux(&self, tag: &[u8]) -> Result<Aux<'_>> {\n        if tag.len() < 2 {\n            return Err(Error::BamAuxStringError);\n        }\n        let aux = unsafe {\n            htslib::bam_aux_get(\n                &self.inner as *const htslib::bam1_t,\n                tag.as_ptr() as *const c_char,\n            )\n        };\n        unsafe { Self::read_aux_field(aux).map(|(aux_field, _length)| aux_field) }\n    }\n\n    unsafe fn read_aux_field<'a>(aux: *const u8) -> Result<(Aux<'a>, usize)> {\n        const TAG_LEN: isize = 2;\n        // Used for skipping type identifier\n        const TYPE_ID_LEN: isize = 1;\n\n        if aux.is_null() {\n            return Err(Error::BamAuxTagNotFound);\n        }\n\n        let (data, type_size) = match *aux {\n            b'A' => {\n                let type_size = size_of::<u8>();\n                (Aux::Char(*aux.offset(TYPE_ID_LEN)), type_size)\n            }\n            b'c' => {\n                let type_size = size_of::<i8>();\n                (Aux::I8(*aux.offset(TYPE_ID_LEN).cast::<i8>()), type_size)\n            }\n            b'C' => {\n                let type_size = size_of::<u8>();\n                (Aux::U8(*aux.offset(TYPE_ID_LEN)), type_size)\n            }\n            b's' => {\n                let type_size = size_of::<i16>();\n                (\n                    Aux::I16(\n                        slice::from_raw_parts(aux.offset(TYPE_ID_LEN), type_size)\n                            .read_i16::<LittleEndian>()\n                            .map_err(|_| Error::BamAuxParsingError)?,\n                    ),\n                    type_size,\n                )\n            }\n            b'S' => {\n                let type_size = size_of::<u16>();\n                (\n                    Aux::U16(\n                        slice::from_raw_parts(aux.offset(TYPE_ID_LEN), type_size)\n                            .read_u16::<LittleEndian>()\n                            .map_err(|_| Error::BamAuxParsingError)?,\n                    ),\n                    type_size,\n                )\n            }\n            b'i' => {\n                let type_size = size_of::<i32>();\n                (\n                    Aux::I32(\n                        slice::from_raw_parts(aux.offset(TYPE_ID_LEN), type_size)\n                            .read_i32::<LittleEndian>()\n                            .map_err(|_| Error::BamAuxParsingError)?,\n                    ),\n                    type_size,\n                )\n            }\n            b'I' => {\n                let type_size = size_of::<u32>();\n                (\n                    Aux::U32(\n                        slice::from_raw_parts(aux.offset(TYPE_ID_LEN), type_size)\n                            .read_u32::<LittleEndian>()\n                            .map_err(|_| Error::BamAuxParsingError)?,\n                    ),\n                    type_size,\n                )\n            }\n            b'f' => {\n                let type_size = size_of::<f32>();\n                (\n                    Aux::Float(\n                        slice::from_raw_parts(aux.offset(TYPE_ID_LEN), type_size)\n                            .read_f32::<LittleEndian>()\n                            .map_err(|_| Error::BamAuxParsingError)?,\n                    ),\n                    type_size,\n                )\n            }\n            b'd' => {\n                let type_size = size_of::<f64>();\n                (\n                    Aux::Double(\n                        slice::from_raw_parts(aux.offset(TYPE_ID_LEN), type_size)\n                            .read_f64::<LittleEndian>()\n                            .map_err(|_| Error::BamAuxParsingError)?,\n                    ),\n                    type_size,\n                )\n            }\n            b'Z' | b'H' => {\n                let c_str = ffi::CStr::from_ptr(aux.offset(TYPE_ID_LEN).cast::<c_char>());\n                let rust_str = c_str.to_str().map_err(|_| Error::BamAuxParsingError)?;\n                (Aux::String(rust_str), c_str.to_bytes_with_nul().len())\n            }\n            b'B' => {\n                const ARRAY_INNER_TYPE_LEN: isize = 1;\n                const ARRAY_COUNT_LEN: isize = 4;\n\n                // Used for skipping metadata\n                let array_data_offset = TYPE_ID_LEN + ARRAY_INNER_TYPE_LEN + ARRAY_COUNT_LEN;\n\n                let length =\n                    slice::from_raw_parts(aux.offset(TYPE_ID_LEN + ARRAY_INNER_TYPE_LEN), 4)\n                        .read_u32::<LittleEndian>()\n                        .map_err(|_| Error::BamAuxParsingError)? as usize;\n\n                // Return tuples of an `Aux` enum and the length of data + metadata in bytes\n                let (array_data, array_size) = match *aux.offset(TYPE_ID_LEN) {\n                    b'c' => (\n                        Aux::ArrayI8(AuxArray::<'a, i8>::from_bytes(slice::from_raw_parts(\n                            aux.offset(array_data_offset),\n                            length,\n                        ))),\n                        length,\n                    ),\n                    b'C' => (\n                        Aux::ArrayU8(AuxArray::<'a, u8>::from_bytes(slice::from_raw_parts(\n                            aux.offset(array_data_offset),\n                            length,\n                        ))),\n                        length,\n                    ),\n                    b's' => (\n                        Aux::ArrayI16(AuxArray::<'a, i16>::from_bytes(slice::from_raw_parts(\n                            aux.offset(array_data_offset),\n                            length * size_of::<i16>(),\n                        ))),\n                        length * std::mem::size_of::<i16>(),\n                    ),\n                    b'S' => (\n                        Aux::ArrayU16(AuxArray::<'a, u16>::from_bytes(slice::from_raw_parts(\n                            aux.offset(array_data_offset),\n                            length * size_of::<u16>(),\n                        ))),\n                        length * std::mem::size_of::<u16>(),\n                    ),\n                    b'i' => (\n                        Aux::ArrayI32(AuxArray::<'a, i32>::from_bytes(slice::from_raw_parts(\n                            aux.offset(array_data_offset),\n                            length * size_of::<i32>(),\n                        ))),\n                        length * std::mem::size_of::<i32>(),\n                    ),\n                    b'I' => (\n                        Aux::ArrayU32(AuxArray::<'a, u32>::from_bytes(slice::from_raw_parts(\n                            aux.offset(array_data_offset),\n                            length * size_of::<u32>(),\n                        ))),\n                        length * std::mem::size_of::<u32>(),\n                    ),\n                    b'f' => (\n                        Aux::ArrayFloat(AuxArray::<f32>::from_bytes(slice::from_raw_parts(\n                            aux.offset(array_data_offset),\n                            length * size_of::<f32>(),\n                        ))),\n                        length * std::mem::size_of::<f32>(),\n                    ),\n                    _ => {\n                        return Err(Error::BamAuxUnknownType);\n                    }\n                };\n                (\n                    array_data,\n                    // Offset: array-specific metadata + array size\n                    ARRAY_INNER_TYPE_LEN as usize + ARRAY_COUNT_LEN as usize + array_size,\n                )\n            }\n            _ => {\n                return Err(Error::BamAuxUnknownType);\n            }\n        };\n\n        // Offset: metadata + type size\n        Ok((data, TAG_LEN as usize + TYPE_ID_LEN as usize + type_size))\n    }\n\n    /// Returns an iterator over the auxiliary fields of the record.\n    ///\n    /// When an error occurs, the `Err` variant will be returned\n    /// and the iterator will not be able to advance anymore.\n    pub fn aux_iter(&'_ self) -> AuxIter<'_> {\n        AuxIter {\n            // In order to get to the aux data section of a `bam::Record`\n            // we need to skip fields in front of it\n            aux: &self.data()[\n                // NUL terminated read name:\n                self.qname_capacity()\n                // CIGAR (uint32_t):\n                + self.cigar_len() * std::mem::size_of::<u32>()\n                // Read sequence (4-bit encoded):\n                + self.seq_len().div_ceil(2)\n                // Base qualities (char):\n                + self.seq_len()..],\n        }\n    }\n\n    /// Add auxiliary data.\n    pub fn push_aux(&mut self, tag: &[u8], value: Aux<'_>) -> Result<()> {\n        // Don't allow pushing aux data when the given tag is already present in the record.\n        // `htslib` seems to allow this (for non-array values), which can lead to problems\n        // since retrieving aux fields consumes &[u8; 2] and yields one field only.\n        if self.aux(tag).is_ok() {\n            return Err(Error::BamAuxTagAlreadyPresent);\n        }\n        self.push_aux_unchecked(tag, value)\n    }\n\n    /// Add auxiliary data, without checking if the tag is present.\n    ///\n    /// The caller should ensure that the same tag is not pushed more than once.\n    /// This is provided as a performance optimization.\n    pub fn push_aux_unchecked(&mut self, tag: &[u8], value: Aux<'_>) -> Result<()> {\n        let ctag = tag.as_ptr() as *mut c_char;\n        let ret = unsafe {\n            match value {\n                Aux::Char(v) => htslib::bam_aux_append(\n                    self.inner_ptr_mut(),\n                    ctag,\n                    b'A' as c_char,\n                    size_of::<u8>() as i32,\n                    [v].as_mut_ptr(),\n                ),\n                Aux::I8(v) => htslib::bam_aux_append(\n                    self.inner_ptr_mut(),\n                    ctag,\n                    b'c' as c_char,\n                    size_of::<i8>() as i32,\n                    [v].as_mut_ptr() as *mut u8,\n                ),\n                Aux::U8(v) => htslib::bam_aux_append(\n                    self.inner_ptr_mut(),\n                    ctag,\n                    b'C' as c_char,\n                    size_of::<u8>() as i32,\n                    [v].as_mut_ptr(),\n                ),\n                Aux::I16(v) => htslib::bam_aux_append(\n                    self.inner_ptr_mut(),\n                    ctag,\n                    b's' as c_char,\n                    size_of::<i16>() as i32,\n                    [v].as_mut_ptr() as *mut u8,\n                ),\n                Aux::U16(v) => htslib::bam_aux_append(\n                    self.inner_ptr_mut(),\n                    ctag,\n                    b'S' as c_char,\n                    size_of::<u16>() as i32,\n                    [v].as_mut_ptr() as *mut u8,\n                ),\n                Aux::I32(v) => htslib::bam_aux_append(\n                    self.inner_ptr_mut(),\n                    ctag,\n                    b'i' as c_char,\n                    size_of::<i32>() as i32,\n                    [v].as_mut_ptr() as *mut u8,\n                ),\n                Aux::U32(v) => htslib::bam_aux_append(\n                    self.inner_ptr_mut(),\n                    ctag,\n                    b'I' as c_char,\n                    size_of::<u32>() as i32,\n                    [v].as_mut_ptr() as *mut u8,\n                ),\n                Aux::Float(v) => htslib::bam_aux_append(\n                    self.inner_ptr_mut(),\n                    ctag,\n                    b'f' as c_char,\n                    size_of::<f32>() as i32,\n                    [v].as_mut_ptr() as *mut u8,\n                ),\n                // Not part of specs but implemented in `htslib`:\n                Aux::Double(v) => htslib::bam_aux_append(\n                    self.inner_ptr_mut(),\n                    ctag,\n                    b'd' as c_char,\n                    size_of::<f64>() as i32,\n                    [v].as_mut_ptr() as *mut u8,\n                ),\n                Aux::String(v) => {\n                    let c_str = ffi::CString::new(v).map_err(|_| Error::BamAuxStringError)?;\n                    htslib::bam_aux_append(\n                        self.inner_ptr_mut(),\n                        ctag,\n                        b'Z' as c_char,\n                        (v.len() + 1) as i32,\n                        c_str.as_ptr() as *mut u8,\n                    )\n                }\n                Aux::HexByteArray(v) => {\n                    let c_str = ffi::CString::new(v).map_err(|_| Error::BamAuxStringError)?;\n                    htslib::bam_aux_append(\n                        self.inner_ptr_mut(),\n                        ctag,\n                        b'H' as c_char,\n                        (v.len() + 1) as i32,\n                        c_str.as_ptr() as *mut u8,\n                    )\n                }\n                // Not sure it's safe to cast an immutable slice to a mutable pointer in the following branches\n                Aux::ArrayI8(aux_array) => match aux_array {\n                    AuxArray::TargetType(inner) => htslib::bam_aux_update_array(\n                        self.inner_ptr_mut(),\n                        ctag,\n                        b'c',\n                        inner.len() as u32,\n                        inner.slice.as_ptr() as *mut ::libc::c_void,\n                    ),\n                    AuxArray::RawLeBytes(inner) => htslib::bam_aux_update_array(\n                        self.inner_ptr_mut(),\n                        ctag,\n                        b'c',\n                        inner.len() as u32,\n                        inner.slice.as_ptr() as *mut ::libc::c_void,\n                    ),\n                },\n                Aux::ArrayU8(aux_array) => match aux_array {\n                    AuxArray::TargetType(inner) => htslib::bam_aux_update_array(\n                        self.inner_ptr_mut(),\n                        ctag,\n                        b'C',\n                        inner.len() as u32,\n                        inner.slice.as_ptr() as *mut ::libc::c_void,\n                    ),\n                    AuxArray::RawLeBytes(inner) => htslib::bam_aux_update_array(\n                        self.inner_ptr_mut(),\n                        ctag,\n                        b'C',\n                        inner.len() as u32,\n                        inner.slice.as_ptr() as *mut ::libc::c_void,\n                    ),\n                },\n                Aux::ArrayI16(aux_array) => match aux_array {\n                    AuxArray::TargetType(inner) => htslib::bam_aux_update_array(\n                        self.inner_ptr_mut(),\n                        ctag,\n                        b's',\n                        inner.len() as u32,\n                        inner.slice.as_ptr() as *mut ::libc::c_void,\n                    ),\n                    AuxArray::RawLeBytes(inner) => htslib::bam_aux_update_array(\n                        self.inner_ptr_mut(),\n                        ctag,\n                        b's',\n                        inner.len() as u32,\n                        inner.slice.as_ptr() as *mut ::libc::c_void,\n                    ),\n                },\n                Aux::ArrayU16(aux_array) => match aux_array {\n                    AuxArray::TargetType(inner) => htslib::bam_aux_update_array(\n                        self.inner_ptr_mut(),\n                        ctag,\n                        b'S',\n                        inner.len() as u32,\n                        inner.slice.as_ptr() as *mut ::libc::c_void,\n                    ),\n                    AuxArray::RawLeBytes(inner) => htslib::bam_aux_update_array(\n                        self.inner_ptr_mut(),\n                        ctag,\n                        b'S',\n                        inner.len() as u32,\n                        inner.slice.as_ptr() as *mut ::libc::c_void,\n                    ),\n                },\n                Aux::ArrayI32(aux_array) => match aux_array {\n                    AuxArray::TargetType(inner) => htslib::bam_aux_update_array(\n                        self.inner_ptr_mut(),\n                        ctag,\n                        b'i',\n                        inner.len() as u32,\n                        inner.slice.as_ptr() as *mut ::libc::c_void,\n                    ),\n                    AuxArray::RawLeBytes(inner) => htslib::bam_aux_update_array(\n                        self.inner_ptr_mut(),\n                        ctag,\n                        b'i',\n                        inner.len() as u32,\n                        inner.slice.as_ptr() as *mut ::libc::c_void,\n                    ),\n                },\n                Aux::ArrayU32(aux_array) => match aux_array {\n                    AuxArray::TargetType(inner) => htslib::bam_aux_update_array(\n                        self.inner_ptr_mut(),\n                        ctag,\n                        b'I',\n                        inner.len() as u32,\n                        inner.slice.as_ptr() as *mut ::libc::c_void,\n                    ),\n                    AuxArray::RawLeBytes(inner) => htslib::bam_aux_update_array(\n                        self.inner_ptr_mut(),\n                        ctag,\n                        b'I',\n                        inner.len() as u32,\n                        inner.slice.as_ptr() as *mut ::libc::c_void,\n                    ),\n                },\n                Aux::ArrayFloat(aux_array) => match aux_array {\n                    AuxArray::TargetType(inner) => htslib::bam_aux_update_array(\n                        self.inner_ptr_mut(),\n                        ctag,\n                        b'f',\n                        inner.len() as u32,\n                        inner.slice.as_ptr() as *mut ::libc::c_void,\n                    ),\n                    AuxArray::RawLeBytes(inner) => htslib::bam_aux_update_array(\n                        self.inner_ptr_mut(),\n                        ctag,\n                        b'f',\n                        inner.len() as u32,\n                        inner.slice.as_ptr() as *mut ::libc::c_void,\n                    ),\n                },\n            }\n        };\n\n        if ret < 0 {\n            Err(Error::BamAux)\n        } else {\n            Ok(())\n        }\n    }\n\n    /// Update or add auxiliary data.\n    pub fn update_aux(&mut self, tag: &[u8], value: Aux<'_>) -> Result<()> {\n        // Update existing aux data for the given tag if already present in the record\n        // without changing the ordering of tags in the record or append aux data at\n        // the end of the existing aux records if it is a new tag.\n\n        let ctag = tag.as_ptr() as *mut c_char;\n        let ret = unsafe {\n            match value {\n                Aux::Char(_v) => return Err(Error::BamAuxTagUpdatingNotSupported),\n                Aux::I8(v) => htslib::bam_aux_update_int(self.inner_ptr_mut(), ctag, v as i64),\n                Aux::U8(v) => htslib::bam_aux_update_int(self.inner_ptr_mut(), ctag, v as i64),\n                Aux::I16(v) => htslib::bam_aux_update_int(self.inner_ptr_mut(), ctag, v as i64),\n                Aux::U16(v) => htslib::bam_aux_update_int(self.inner_ptr_mut(), ctag, v as i64),\n                Aux::I32(v) => htslib::bam_aux_update_int(self.inner_ptr_mut(), ctag, v as i64),\n                Aux::U32(v) => htslib::bam_aux_update_int(self.inner_ptr_mut(), ctag, v as i64),\n                Aux::Float(v) => htslib::bam_aux_update_float(self.inner_ptr_mut(), ctag, v),\n                // Not part of specs but implemented in `htslib`:\n                Aux::Double(v) => {\n                    htslib::bam_aux_update_float(self.inner_ptr_mut(), ctag, v as f32)\n                }\n                Aux::String(v) => {\n                    let c_str = ffi::CString::new(v).map_err(|_| Error::BamAuxStringError)?;\n                    htslib::bam_aux_update_str(\n                        self.inner_ptr_mut(),\n                        ctag,\n                        (v.len() + 1) as i32,\n                        c_str.as_ptr() as *const c_char,\n                    )\n                }\n                Aux::HexByteArray(_v) => return Err(Error::BamAuxTagUpdatingNotSupported),\n                // Not sure it's safe to cast an immutable slice to a mutable pointer in the following branches\n                Aux::ArrayI8(aux_array) => match aux_array {\n                    AuxArray::TargetType(inner) => htslib::bam_aux_update_array(\n                        self.inner_ptr_mut(),\n                        ctag,\n                        b'c',\n                        inner.len() as u32,\n                        inner.slice.as_ptr() as *mut ::libc::c_void,\n                    ),\n                    AuxArray::RawLeBytes(inner) => htslib::bam_aux_update_array(\n                        self.inner_ptr_mut(),\n                        ctag,\n                        b'c',\n                        inner.len() as u32,\n                        inner.slice.as_ptr() as *mut ::libc::c_void,\n                    ),\n                },\n                Aux::ArrayU8(aux_array) => match aux_array {\n                    AuxArray::TargetType(inner) => htslib::bam_aux_update_array(\n                        self.inner_ptr_mut(),\n                        ctag,\n                        b'C',\n                        inner.len() as u32,\n                        inner.slice.as_ptr() as *mut ::libc::c_void,\n                    ),\n                    AuxArray::RawLeBytes(inner) => htslib::bam_aux_update_array(\n                        self.inner_ptr_mut(),\n                        ctag,\n                        b'C',\n                        inner.len() as u32,\n                        inner.slice.as_ptr() as *mut ::libc::c_void,\n                    ),\n                },\n                Aux::ArrayI16(aux_array) => match aux_array {\n                    AuxArray::TargetType(inner) => htslib::bam_aux_update_array(\n                        self.inner_ptr_mut(),\n                        ctag,\n                        b's',\n                        inner.len() as u32,\n                        inner.slice.as_ptr() as *mut ::libc::c_void,\n                    ),\n                    AuxArray::RawLeBytes(inner) => htslib::bam_aux_update_array(\n                        self.inner_ptr_mut(),\n                        ctag,\n                        b's',\n                        inner.len() as u32,\n                        inner.slice.as_ptr() as *mut ::libc::c_void,\n                    ),\n                },\n                Aux::ArrayU16(aux_array) => match aux_array {\n                    AuxArray::TargetType(inner) => htslib::bam_aux_update_array(\n                        self.inner_ptr_mut(),\n                        ctag,\n                        b'S',\n                        inner.len() as u32,\n                        inner.slice.as_ptr() as *mut ::libc::c_void,\n                    ),\n                    AuxArray::RawLeBytes(inner) => htslib::bam_aux_update_array(\n                        self.inner_ptr_mut(),\n                        ctag,\n                        b'S',\n                        inner.len() as u32,\n                        inner.slice.as_ptr() as *mut ::libc::c_void,\n                    ),\n                },\n                Aux::ArrayI32(aux_array) => match aux_array {\n                    AuxArray::TargetType(inner) => htslib::bam_aux_update_array(\n                        self.inner_ptr_mut(),\n                        ctag,\n                        b'i',\n                        inner.len() as u32,\n                        inner.slice.as_ptr() as *mut ::libc::c_void,\n                    ),\n                    AuxArray::RawLeBytes(inner) => htslib::bam_aux_update_array(\n                        self.inner_ptr_mut(),\n                        ctag,\n                        b'i',\n                        inner.len() as u32,\n                        inner.slice.as_ptr() as *mut ::libc::c_void,\n                    ),\n                },\n                Aux::ArrayU32(aux_array) => match aux_array {\n                    AuxArray::TargetType(inner) => htslib::bam_aux_update_array(\n                        self.inner_ptr_mut(),\n                        ctag,\n                        b'I',\n                        inner.len() as u32,\n                        inner.slice.as_ptr() as *mut ::libc::c_void,\n                    ),\n                    AuxArray::RawLeBytes(inner) => htslib::bam_aux_update_array(\n                        self.inner_ptr_mut(),\n                        ctag,\n                        b'I',\n                        inner.len() as u32,\n                        inner.slice.as_ptr() as *mut ::libc::c_void,\n                    ),\n                },\n                Aux::ArrayFloat(aux_array) => match aux_array {\n                    AuxArray::TargetType(inner) => htslib::bam_aux_update_array(\n                        self.inner_ptr_mut(),\n                        ctag,\n                        b'f',\n                        inner.len() as u32,\n                        inner.slice.as_ptr() as *mut ::libc::c_void,\n                    ),\n                    AuxArray::RawLeBytes(inner) => htslib::bam_aux_update_array(\n                        self.inner_ptr_mut(),\n                        ctag,\n                        b'f',\n                        inner.len() as u32,\n                        inner.slice.as_ptr() as *mut ::libc::c_void,\n                    ),\n                },\n            }\n        };\n\n        if ret < 0 {\n            Err(Error::BamAux)\n        } else {\n            Ok(())\n        }\n    }\n\n    // Delete auxiliary tag.\n    pub fn remove_aux(&mut self, tag: &[u8]) -> Result<()> {\n        if tag.len() < 2 {\n            return Err(Error::BamAuxStringError);\n        }\n        let aux = unsafe {\n            htslib::bam_aux_get(\n                &self.inner as *const htslib::bam1_t,\n                tag.as_ptr() as *const c_char,\n            )\n        };\n        unsafe {\n            if aux.is_null() {\n                Err(Error::BamAuxTagNotFound)\n            } else {\n                htslib::bam_aux_del(self.inner_ptr_mut(), aux);\n                Ok(())\n            }\n        }\n    }\n\n    /// Access the base modifications associated with this Record through the MM tag.\n    /// Example:\n    /// ```\n    ///    use rust_htslib::bam::{Read, Reader, Record};\n    ///    let mut bam = Reader::from_path(\"test/base_mods/MM-orient.sam\").unwrap();\n    ///    let mut mod_count = 0;\n    ///    for r in bam.records() {\n    ///        let record = r.unwrap();\n    ///        if let Ok(mods) = record.basemods_iter() {\n    ///            // print metadata for the modifications present in this record\n    ///            for mod_code in mods.recorded() {\n    ///                if let Ok(mod_metadata) = mods.query_type(*mod_code) {\n    ///                    println!(\"mod found with code {}/{} flags: [{} {} {}]\",\n    ///                              mod_code, *mod_code as u8 as char,\n    ///                              mod_metadata.strand, mod_metadata.implicit, mod_metadata.canonical as u8 as char);\n    ///                }\n    ///            }\n    ///\n    ///            // iterate over the modifications in this record\n    ///            // the modifications are returned as a tuple with the\n    ///            // position within SEQ and an hts_base_mod struct\n    ///            for res in mods {\n    ///                if let Ok( (position, m) ) = res {\n    ///                    println!(\"{} {},{}\", position, m.modified_base as u8 as char, m.qual);\n    ///                    mod_count += 1;\n    ///                }\n    ///            }\n    ///        };\n    ///    }\n    ///    assert_eq!(mod_count, 14);\n    /// ```\n    pub fn basemods_iter(&'_ self) -> Result<BaseModificationsIter<'_>> {\n        BaseModificationsIter::new(self)\n    }\n\n    /// An iterator that returns all of the modifications for each position as a vector.\n    /// This is useful for the case where multiple possible modifications can be annotated\n    /// at a single position (for example a C could be 5-mC or 5-hmC)\n    pub fn basemods_position_iter(&'_ self) -> Result<BaseModificationsPositionIter<'_>> {\n        BaseModificationsPositionIter::new(self)\n    }\n\n    /// Infer read pair orientation from record. Returns `SequenceReadPairOrientation::None` if record\n    /// is not paired, mates are not mapping to the same contig, or mates start at the\n    /// same position.\n    pub fn read_pair_orientation(&self) -> SequenceReadPairOrientation {\n        if self.is_paired()\n            && !self.is_unmapped()\n            && !self.is_mate_unmapped()\n            && self.tid() == self.mtid()\n        {\n            if self.pos() == self.mpos() {\n                // both reads start at the same position, we cannot decide on the orientation.\n                return SequenceReadPairOrientation::None;\n            }\n\n            let (pos_1, pos_2, fwd_1, fwd_2) = if self.is_first_in_template() {\n                (\n                    self.pos(),\n                    self.mpos(),\n                    !self.is_reverse(),\n                    !self.is_mate_reverse(),\n                )\n            } else {\n                (\n                    self.mpos(),\n                    self.pos(),\n                    !self.is_mate_reverse(),\n                    !self.is_reverse(),\n                )\n            };\n\n            if pos_1 < pos_2 {\n                match (fwd_1, fwd_2) {\n                    (true, true) => SequenceReadPairOrientation::F1F2,\n                    (true, false) => SequenceReadPairOrientation::F1R2,\n                    (false, true) => SequenceReadPairOrientation::R1F2,\n                    (false, false) => SequenceReadPairOrientation::R1R2,\n                }\n            } else {\n                match (fwd_2, fwd_1) {\n                    (true, true) => SequenceReadPairOrientation::F2F1,\n                    (true, false) => SequenceReadPairOrientation::F2R1,\n                    (false, true) => SequenceReadPairOrientation::R2F1,\n                    (false, false) => SequenceReadPairOrientation::R2R1,\n                }\n            }\n        } else {\n            SequenceReadPairOrientation::None\n        }\n    }\n\n    flag!(is_paired, set_paired, unset_paired, 1u16);\n    flag!(is_proper_pair, set_proper_pair, unset_proper_pair, 2u16);\n    flag!(is_unmapped, set_unmapped, unset_unmapped, 4u16);\n    flag!(\n        is_mate_unmapped,\n        set_mate_unmapped,\n        unset_mate_unmapped,\n        8u16\n    );\n    flag!(is_reverse, set_reverse, unset_reverse, 16u16);\n    flag!(is_mate_reverse, set_mate_reverse, unset_mate_reverse, 32u16);\n    flag!(\n        is_first_in_template,\n        set_first_in_template,\n        unset_first_in_template,\n        64u16\n    );\n    flag!(\n        is_last_in_template,\n        set_last_in_template,\n        unset_last_in_template,\n        128u16\n    );\n    flag!(is_secondary, set_secondary, unset_secondary, 256u16);\n    flag!(\n        is_quality_check_failed,\n        set_quality_check_failed,\n        unset_quality_check_failed,\n        512u16\n    );\n    flag!(is_duplicate, set_duplicate, unset_duplicate, 1024u16);\n    flag!(\n        is_supplementary,\n        set_supplementary,\n        unset_supplementary,\n        2048u16\n    );\n}\n\nimpl Drop for Record {\n    fn drop(&mut self) {\n        if self.own {\n            unsafe { ::libc::free(self.inner.data as *mut ::libc::c_void) }\n        }\n    }\n}\n\nimpl SequenceRead for Record {\n    fn name(&self) -> &[u8] {\n        self.qname()\n    }\n\n    fn base(&self, i: usize) -> u8 {\n        *decode_base_unchecked(encoded_base(self.seq_data(), i))\n    }\n\n    fn base_qual(&self, i: usize) -> u8 {\n        self.qual()[i]\n    }\n\n    fn len(&self) -> usize {\n        self.seq_len()\n    }\n\n    fn is_empty(&self) -> bool {\n        self.len() == 0\n    }\n}\n\nimpl genome::AbstractInterval for Record {\n    /// Return contig name. Panics if record does not know its header (which happens if it has not been read from a file).\n    fn contig(&self) -> &str {\n        let tid = self.tid();\n        if tid < 0 {\n            panic!(\"invalid tid, must be at least zero\");\n        }\n        str::from_utf8(\n            self.header\n                .as_ref()\n                .expect(\n                    \"header must be set (this is the case if the record has been read from a file)\",\n                )\n                .tid2name(tid as u32),\n        )\n        .expect(\"unable to interpret contig name as UTF-8\")\n    }\n\n    /// Return genomic range covered by alignment. Panics if `Record::cache_cigar()` has not been called first or `Record::pos()` is less than zero.\n    fn range(&self) -> ops::Range<genome::Position> {\n        let end_pos = self\n            .cigar_cached()\n            .expect(\"cigar has not been cached yet, call cache_cigar() first\")\n            .end_pos() as u64;\n\n        if self.pos() < 0 {\n            panic!(\"invalid position, must be positive\")\n        }\n\n        self.pos() as u64..end_pos\n    }\n}\n\n/// Auxiliary record data\n///\n/// The specification allows a wide range of types to be stored as an auxiliary data field of a BAM record.\n///\n/// Please note that the [`Aux::Double`] variant is _not_ part of the specification, but it is supported by `htslib`.\n///\n/// # Examples\n///\n/// ```\n/// use rust_htslib::{\n///     bam,\n///     bam::record::{Aux, AuxArray},\n///     errors::Error,\n/// };\n///\n/// //Set up BAM record\n/// let bam_header = bam::Header::new();\n/// let mut record = bam::Record::from_sam(\n///     &mut bam::HeaderView::from_header(&bam_header),\n///     \"ali1\\t4\\t*\\t0\\t0\\t*\\t*\\t0\\t0\\tACGT\\tFFFF\".as_bytes(),\n/// )\n/// .unwrap();\n///\n/// // Add an integer field\n/// let aux_integer_field = Aux::I32(1234);\n/// record.push_aux(b\"XI\", aux_integer_field).unwrap();\n///\n/// match record.aux(b\"XI\") {\n///     Ok(value) => {\n///         // Typically, callers expect an aux field to be of a certain type.\n///         // If that's not the case, the value can be `match`ed exhaustively.\n///         if let Aux::I32(v) = value {\n///             assert_eq!(v, 1234);\n///         }\n///     }\n///     Err(e) => {\n///         panic!(\"Error reading aux field: {}\", e);\n///     }\n/// }\n///\n/// // Add an array field\n/// let array_like_data = vec![0.4, 0.3, 0.2, 0.1];\n/// let slice_of_data = &array_like_data;\n/// let aux_array: AuxArray<f32> = slice_of_data.into();\n/// let aux_array_field = Aux::ArrayFloat(aux_array);\n/// record.push_aux(b\"XA\", aux_array_field).unwrap();\n///\n/// if let Ok(Aux::ArrayFloat(array)) = record.aux(b\"XA\") {\n///     let read_array = array.iter().collect::<Vec<_>>();\n///     assert_eq!(read_array, array_like_data);\n/// } else {\n///     panic!(\"Could not read array data\");\n/// }\n/// ```\n#[derive(Debug, PartialEq)]\npub enum Aux<'a> {\n    Char(u8),\n    I8(i8),\n    U8(u8),\n    I16(i16),\n    U16(u16),\n    I32(i32),\n    U32(u32),\n    Float(f32),\n    Double(f64), // Not part of specs but implemented in `htslib`\n    String(&'a str),\n    HexByteArray(&'a str),\n    ArrayI8(AuxArray<'a, i8>),\n    ArrayU8(AuxArray<'a, u8>),\n    ArrayI16(AuxArray<'a, i16>),\n    ArrayU16(AuxArray<'a, u16>),\n    ArrayI32(AuxArray<'a, i32>),\n    ArrayU32(AuxArray<'a, u32>),\n    ArrayFloat(AuxArray<'a, f32>),\n}\n\nunsafe impl Send for Aux<'_> {}\nunsafe impl Sync for Aux<'_> {}\n\n/// Types that can be used in aux arrays.\npub trait AuxArrayElement: Copy {\n    fn from_le_bytes(bytes: &[u8]) -> Option<Self>;\n}\n\nimpl AuxArrayElement for i8 {\n    fn from_le_bytes(bytes: &[u8]) -> Option<Self> {\n        std::io::Cursor::new(bytes).read_i8().ok()\n    }\n}\nimpl AuxArrayElement for u8 {\n    fn from_le_bytes(bytes: &[u8]) -> Option<Self> {\n        std::io::Cursor::new(bytes).read_u8().ok()\n    }\n}\nimpl AuxArrayElement for i16 {\n    fn from_le_bytes(bytes: &[u8]) -> Option<Self> {\n        std::io::Cursor::new(bytes).read_i16::<LittleEndian>().ok()\n    }\n}\nimpl AuxArrayElement for u16 {\n    fn from_le_bytes(bytes: &[u8]) -> Option<Self> {\n        std::io::Cursor::new(bytes).read_u16::<LittleEndian>().ok()\n    }\n}\nimpl AuxArrayElement for i32 {\n    fn from_le_bytes(bytes: &[u8]) -> Option<Self> {\n        std::io::Cursor::new(bytes).read_i32::<LittleEndian>().ok()\n    }\n}\nimpl AuxArrayElement for u32 {\n    fn from_le_bytes(bytes: &[u8]) -> Option<Self> {\n        std::io::Cursor::new(bytes).read_u32::<LittleEndian>().ok()\n    }\n}\nimpl AuxArrayElement for f32 {\n    fn from_le_bytes(bytes: &[u8]) -> Option<Self> {\n        std::io::Cursor::new(bytes).read_f32::<LittleEndian>().ok()\n    }\n}\n\n/// Provides access to aux arrays.\n///\n/// Provides methods to either retrieve single elements or an iterator over the\n/// array.\n///\n/// This type is used for wrapping both, array data that was read from a\n/// BAM record and slices of data that are going to be stored in one.\n///\n/// In order to be able to add an `AuxArray` field to a BAM record, `AuxArray`s\n/// can be constructed via the `From` trait which is implemented for all\n/// supported types (see [`AuxArrayElement`] for a list).\n///\n/// # Examples\n///\n/// ```\n/// use rust_htslib::{\n///     bam,\n///     bam::record::{Aux, AuxArray},\n/// };\n///\n/// //Set up BAM record\n/// let bam_header = bam::Header::new();\n/// let mut record = bam::Record::from_sam(\n///     &mut bam::HeaderView::from_header(&bam_header),\n///     \"ali1\\t4\\t*\\t0\\t0\\t*\\t*\\t0\\t0\\tACGT\\tFFFF\".as_bytes(),\n/// ).unwrap();\n///\n/// let data = vec![0.4, 0.3, 0.2, 0.1];\n/// let slice_of_data = &data;\n/// let aux_array: AuxArray<f32> = slice_of_data.into();\n/// let aux_field = Aux::ArrayFloat(aux_array);\n/// record.push_aux(b\"XA\", aux_field);\n///\n/// if let Ok(Aux::ArrayFloat(array)) = record.aux(b\"XA\") {\n///     // Retrieve the second element from the array\n///     assert_eq!(array.get(1).unwrap(), 0.3);\n///     // Iterate over the array and collect it into a `Vec`\n///     let read_array = array.iter().collect::<Vec<_>>();\n///     assert_eq!(read_array, data);\n/// } else {\n///     panic!(\"Could not read array data\");\n/// }\n/// ```\n#[derive(Debug)]\npub enum AuxArray<'a, T> {\n    TargetType(AuxArrayTargetType<'a, T>),\n    RawLeBytes(AuxArrayRawLeBytes<'a, T>),\n}\n\nimpl<T> PartialEq<AuxArray<'_, T>> for AuxArray<'_, T>\nwhere\n    T: AuxArrayElement + PartialEq,\n{\n    fn eq(&self, other: &AuxArray<'_, T>) -> bool {\n        use AuxArray::*;\n        match (self, other) {\n            (TargetType(v), TargetType(v_other)) => v == v_other,\n            (RawLeBytes(v), RawLeBytes(v_other)) => v == v_other,\n            (TargetType(_), RawLeBytes(_)) => self.iter().eq(other.iter()),\n            (RawLeBytes(_), TargetType(_)) => self.iter().eq(other.iter()),\n        }\n    }\n}\n\n/// Create AuxArrays from slices of allowed target types.\nimpl<'a, I, T> From<&'a T> for AuxArray<'a, I>\nwhere\n    I: AuxArrayElement,\n    T: AsRef<[I]> + ?Sized,\n{\n    fn from(src: &'a T) -> Self {\n        AuxArray::TargetType(AuxArrayTargetType {\n            slice: src.as_ref(),\n        })\n    }\n}\n\nimpl<'a, T> AuxArray<'a, T>\nwhere\n    T: AuxArrayElement,\n{\n    /// Returns the element at a position or None if out of bounds.\n    pub fn get(&self, index: usize) -> Option<T> {\n        match self {\n            AuxArray::TargetType(v) => v.get(index),\n            AuxArray::RawLeBytes(v) => v.get(index),\n        }\n    }\n\n    /// Returns the number of elements in the array.\n    pub fn len(&self) -> usize {\n        match self {\n            AuxArray::TargetType(a) => a.len(),\n            AuxArray::RawLeBytes(a) => a.len(),\n        }\n    }\n\n    /// Returns true if the array contains no elements.\n    pub fn is_empty(&self) -> bool {\n        self.len() == 0\n    }\n\n    /// Returns an iterator over the array.\n    pub fn iter(&'_ self) -> AuxArrayIter<'_, T> {\n        AuxArrayIter {\n            index: 0,\n            array: self,\n        }\n    }\n\n    /// Create AuxArrays from raw byte slices borrowed from `bam::Record`.\n    fn from_bytes(bytes: &'a [u8]) -> Self {\n        Self::RawLeBytes(AuxArrayRawLeBytes {\n            slice: bytes,\n            phantom_data: PhantomData,\n        })\n    }\n}\n\n/// Encapsulates slice of target type.\n#[doc(hidden)]\n#[derive(Debug, PartialEq)]\npub struct AuxArrayTargetType<'a, T> {\n    slice: &'a [T],\n}\n\nimpl<T> AuxArrayTargetType<'_, T>\nwhere\n    T: AuxArrayElement,\n{\n    fn get(&self, index: usize) -> Option<T> {\n        self.slice.get(index).copied()\n    }\n\n    fn len(&self) -> usize {\n        self.slice.len()\n    }\n}\n\n/// Encapsulates slice of raw bytes to prevent it from being accidentally accessed.\n#[doc(hidden)]\n#[derive(Debug, PartialEq)]\npub struct AuxArrayRawLeBytes<'a, T> {\n    slice: &'a [u8],\n    phantom_data: PhantomData<T>,\n}\n\nimpl<T> AuxArrayRawLeBytes<'_, T>\nwhere\n    T: AuxArrayElement,\n{\n    fn get(&self, index: usize) -> Option<T> {\n        let type_size = std::mem::size_of::<T>();\n        if index * type_size + type_size > self.slice.len() {\n            return None;\n        }\n        T::from_le_bytes(&self.slice[index * type_size..][..type_size])\n    }\n\n    fn len(&self) -> usize {\n        self.slice.len() / std::mem::size_of::<T>()\n    }\n}\n\n/// Aux array iterator\n///\n/// This struct is created by the [`AuxArray::iter`] method.\npub struct AuxArrayIter<'a, T> {\n    index: usize,\n    array: &'a AuxArray<'a, T>,\n}\n\nimpl<T> Iterator for AuxArrayIter<'_, T>\nwhere\n    T: AuxArrayElement,\n{\n    type Item = T;\n    fn next(&mut self) -> Option<Self::Item> {\n        let value = self.array.get(self.index);\n        self.index += 1;\n        value\n    }\n\n    fn size_hint(&self) -> (usize, Option<usize>) {\n        let array_length = self.array.len() - self.index;\n        (array_length, Some(array_length))\n    }\n}\n\n/// Auxiliary data iterator\n///\n/// This struct is created by the [`Record::aux_iter`] method.\n///\n/// This iterator returns `Result`s that wrap tuples containing\n/// a slice which represents the two-byte tag (`&[u8; 2]`) as\n/// well as an `Aux` enum that wraps the associated value.\n///\n/// When an error occurs, the `Err` variant will be returned\n/// and the iterator will not be able to advance anymore.\npub struct AuxIter<'a> {\n    aux: &'a [u8],\n}\n\nimpl<'a> Iterator for AuxIter<'a> {\n    type Item = Result<(&'a [u8], Aux<'a>)>;\n\n    fn next(&mut self) -> Option<Self::Item> {\n        // We're finished\n        if self.aux.is_empty() {\n            return None;\n        }\n        // Incomplete aux data\n        if (1..=3).contains(&self.aux.len()) {\n            // In the case of an error, we can not safely advance in the aux data, so we terminate the Iteration\n            self.aux = &[];\n            return Some(Err(Error::BamAuxParsingError));\n        }\n        let tag = &self.aux[..2];\n        Some(unsafe {\n            let data_ptr = self.aux[2..].as_ptr();\n            Record::read_aux_field(data_ptr)\n                .map(|(aux, offset)| {\n                    self.aux = &self.aux[offset..];\n                    (tag, aux)\n                })\n                .inspect_err(|_e| {\n                    // In the case of an error, we can not safely advance in the aux data, so we terminate the Iteration\n                    self.aux = &[];\n                })\n        })\n    }\n}\n\nstatic DECODE_BASE: &[u8] = b\"=ACMGRSVTWYHKDBN\";\nstatic ENCODE_BASE: [u8; 256] = [\n    15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n    15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n    1, 2, 4, 8, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 15, 1, 14, 2, 13, 15, 15, 4, 11, 15,\n    15, 12, 15, 3, 15, 15, 15, 15, 5, 6, 8, 15, 7, 9, 15, 10, 15, 15, 15, 15, 15, 15, 15, 1, 14, 2,\n    13, 15, 15, 4, 11, 15, 15, 12, 15, 3, 15, 15, 15, 15, 5, 6, 8, 15, 7, 9, 15, 10, 15, 15, 15,\n    15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n    15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n    15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n    15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n    15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n    15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n];\n\n#[inline]\nfn encoded_base(encoded_seq: &[u8], i: usize) -> u8 {\n    (encoded_seq[i / 2] >> ((!i & 1) << 2)) & 0b1111\n}\n\n#[inline]\nunsafe fn encoded_base_unchecked(encoded_seq: &[u8], i: usize) -> u8 {\n    (encoded_seq.get_unchecked(i / 2) >> ((!i & 1) << 2)) & 0b1111\n}\n\n#[inline]\nfn decode_base_unchecked(base: u8) -> &'static u8 {\n    unsafe { DECODE_BASE.get_unchecked(base as usize) }\n}\n\n/// The sequence of a record.\n#[derive(Debug, Copy, Clone)]\npub struct Seq<'a> {\n    pub encoded: &'a [u8],\n    len: usize,\n}\n\nimpl Seq<'_> {\n    /// Return encoded base. Complexity: O(1).\n    #[inline]\n    pub fn encoded_base(&self, i: usize) -> u8 {\n        encoded_base(self.encoded, i)\n    }\n\n    /// Return encoded base. Complexity: O(1).\n    ///\n    /// # Safety\n    ///\n    /// TODO\n    #[inline]\n    pub unsafe fn encoded_base_unchecked(&self, i: usize) -> u8 {\n        encoded_base_unchecked(self.encoded, i)\n    }\n\n    /// Obtain decoded base without performing bounds checking.\n    /// Use index based access seq()[i], for checked, safe access.\n    /// Complexity: O(1).\n    ///\n    /// # Safety\n    ///\n    /// TODO\n    #[inline]\n    pub unsafe fn decoded_base_unchecked(&self, i: usize) -> u8 {\n        *decode_base_unchecked(self.encoded_base_unchecked(i))\n    }\n\n    /// Return decoded sequence. Complexity: O(m) with m being the read length.\n    pub fn as_bytes(&self) -> Vec<u8> {\n        (0..self.len()).map(|i| self[i]).collect()\n    }\n\n    /// Return length (in bases) of the sequence.\n    pub fn len(&self) -> usize {\n        self.len\n    }\n\n    pub fn is_empty(&self) -> bool {\n        self.len() == 0\n    }\n}\n\nimpl ops::Index<usize> for Seq<'_> {\n    type Output = u8;\n\n    /// Return decoded base at given position within read. Complexity: O(1).\n    fn index(&self, index: usize) -> &u8 {\n        decode_base_unchecked(self.encoded_base(index))\n    }\n}\n\nunsafe impl Send for Seq<'_> {}\nunsafe impl Sync for Seq<'_> {}\n\n#[cfg_attr(feature = \"serde_feature\", derive(Serialize, Deserialize))]\n#[derive(PartialEq, PartialOrd, Eq, Debug, Clone, Copy, Hash)]\npub enum Cigar {\n    Match(u32),    // M\n    Ins(u32),      // I\n    Del(u32),      // D\n    RefSkip(u32),  // N\n    SoftClip(u32), // S\n    HardClip(u32), // H\n    Pad(u32),      // P\n    Equal(u32),    // =\n    Diff(u32),     // X\n}\n\nimpl Cigar {\n    fn encode(self) -> u32 {\n        match self {\n            Cigar::Match(len) => len << 4, // | 0,\n            Cigar::Ins(len) => (len << 4) | 1,\n            Cigar::Del(len) => (len << 4) | 2,\n            Cigar::RefSkip(len) => (len << 4) | 3,\n            Cigar::SoftClip(len) => (len << 4) | 4,\n            Cigar::HardClip(len) => (len << 4) | 5,\n            Cigar::Pad(len) => (len << 4) | 6,\n            Cigar::Equal(len) => (len << 4) | 7,\n            Cigar::Diff(len) => (len << 4) | 8,\n        }\n    }\n\n    /// Return the length of the CIGAR.\n    pub fn len(self) -> u32 {\n        match self {\n            Cigar::Match(len) => len,\n            Cigar::Ins(len) => len,\n            Cigar::Del(len) => len,\n            Cigar::RefSkip(len) => len,\n            Cigar::SoftClip(len) => len,\n            Cigar::HardClip(len) => len,\n            Cigar::Pad(len) => len,\n            Cigar::Equal(len) => len,\n            Cigar::Diff(len) => len,\n        }\n    }\n\n    pub fn is_empty(self) -> bool {\n        self.len() == 0\n    }\n\n    /// Return the character representing the CIGAR.\n    pub fn char(self) -> char {\n        match self {\n            Cigar::Match(_) => 'M',\n            Cigar::Ins(_) => 'I',\n            Cigar::Del(_) => 'D',\n            Cigar::RefSkip(_) => 'N',\n            Cigar::SoftClip(_) => 'S',\n            Cigar::HardClip(_) => 'H',\n            Cigar::Pad(_) => 'P',\n            Cigar::Equal(_) => '=',\n            Cigar::Diff(_) => 'X',\n        }\n    }\n}\n\nimpl fmt::Display for Cigar {\n    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {\n        fmt.write_fmt(format_args!(\"{}{}\", self.len(), self.char()))\n    }\n}\n\nunsafe impl Send for Cigar {}\nunsafe impl Sync for Cigar {}\n\ncustom_derive! {\n    /// A CIGAR string. This type wraps around a `Vec<Cigar>`.\n    ///\n    /// # Example\n    ///\n    /// ```\n    /// use rust_htslib::bam::record::{Cigar, CigarString};\n    ///\n    /// let cigar = CigarString(vec![Cigar::Match(100), Cigar::SoftClip(10)]);\n    ///\n    /// // access by index\n    /// assert_eq!(cigar[0], Cigar::Match(100));\n    /// // format into classical string representation\n    /// assert_eq!(format!(\"{}\", cigar), \"100M10S\");\n    /// // iterate\n    /// for op in &cigar {\n    ///    println!(\"{}\", op);\n    /// }\n    /// ```\n    #[cfg_attr(feature = \"serde_feature\", derive(Serialize, Deserialize))]\n    #[derive(NewtypeDeref,\n            NewtypeDerefMut,\n             NewtypeIndex(usize),\n             NewtypeIndexMut(usize),\n             NewtypeFrom,\n             PartialEq,\n             PartialOrd,\n             Eq,\n             NewtypeDebug,\n             Clone,\n             Hash\n    )]\n    pub struct CigarString(pub Vec<Cigar>);\n}\n\nimpl CigarString {\n    /// Create a `CigarStringView` from this CigarString at position `pos`\n    pub fn into_view(self, pos: i64) -> CigarStringView {\n        CigarStringView::new(self, pos)\n    }\n\n    /// Calculate the bam cigar from the alignment struct. x is the target string\n    /// and y is the reference. `hard_clip` controls how unaligned read bases are encoded in the\n    /// cigar string. Set to true to use the hard clip (`H`) code, or false to use soft clip\n    /// (`S`) code. See the [SAM spec](https://samtools.github.io/hts-specs/SAMv1.pdf) for more details.\n    pub fn from_alignment(alignment: &Alignment, hard_clip: bool) -> Self {\n        match alignment.mode {\n            AlignmentMode::Global => {\n                panic!(\" Bam cigar fn not supported for Global Alignment mode\")\n            }\n            AlignmentMode::Local => panic!(\" Bam cigar fn not supported for Local Alignment mode\"),\n            _ => {}\n        }\n\n        let mut cigar = Vec::new();\n        if alignment.operations.is_empty() {\n            return CigarString(cigar);\n        }\n\n        let add_op = |op: AlignmentOperation, length: u32, cigar: &mut Vec<Cigar>| match op {\n            AlignmentOperation::Del => cigar.push(Cigar::Del(length)),\n            AlignmentOperation::Ins => cigar.push(Cigar::Ins(length)),\n            AlignmentOperation::Subst => cigar.push(Cigar::Diff(length)),\n            AlignmentOperation::Match => cigar.push(Cigar::Equal(length)),\n            _ => {}\n        };\n\n        if alignment.xstart > 0 {\n            cigar.push(if hard_clip {\n                Cigar::HardClip(alignment.xstart as u32)\n            } else {\n                Cigar::SoftClip(alignment.xstart as u32)\n            });\n        }\n\n        let mut last = alignment.operations[0];\n        let mut k = 1u32;\n        for &op in alignment.operations[1..].iter() {\n            if op == last {\n                k += 1;\n            } else {\n                add_op(last, k, &mut cigar);\n                k = 1;\n            }\n            last = op;\n        }\n        add_op(last, k, &mut cigar);\n        if alignment.xlen > alignment.xend {\n            cigar.push(if hard_clip {\n                Cigar::HardClip((alignment.xlen - alignment.xend) as u32)\n            } else {\n                Cigar::SoftClip((alignment.xlen - alignment.xend) as u32)\n            });\n        }\n\n        CigarString(cigar)\n    }\n}\n\nimpl TryFrom<&[u8]> for CigarString {\n    type Error = Error;\n\n    /// Create a CigarString from given &[u8].\n    /// # Example\n    /// ```\n    /// use rust_htslib::bam::record::*;\n    /// use rust_htslib::bam::record::CigarString;\n    /// use rust_htslib::bam::record::Cigar::*;\n    /// use std::convert::TryFrom;\n    ///\n    /// let cigar_str = \"2H10M5X3=2H\".as_bytes();\n    /// let cigar = CigarString::try_from(cigar_str)\n    ///     .expect(\"Unable to parse cigar string.\");\n    /// let expected_cigar = CigarString(vec![\n    ///     HardClip(2),\n    ///     Match(10),\n    ///     Diff(5),\n    ///     Equal(3),\n    ///     HardClip(2),\n    /// ]);\n    /// assert_eq!(cigar, expected_cigar);\n    /// ```\n    fn try_from(bytes: &[u8]) -> Result<Self> {\n        let mut inner = Vec::new();\n        let mut i = 0;\n        let text_len = bytes.len();\n        while i < text_len {\n            let mut j = i;\n            while j < text_len && bytes[j].is_ascii_digit() {\n                j += 1;\n            }\n            // check that length is provided\n            if i == j {\n                return Err(Error::BamParseCigar {\n                    msg: \"Expected length before cigar operation [0-9]+[MIDNSHP=X]\".to_owned(),\n                });\n            }\n            // get the length of the operation\n            let s = str::from_utf8(&bytes[i..j]).map_err(|_| Error::BamParseCigar {\n                msg: format!(\"Invalid utf-8 bytes '{:?}'.\", &bytes[i..j]),\n            })?;\n            let n = s.parse().map_err(|_| Error::BamParseCigar {\n                msg: format!(\"Unable to parse &str '{:?}' to u32.\", s),\n            })?;\n            // get the operation\n            let op = &bytes[j];\n            inner.push(match op {\n                b'M' => Cigar::Match(n),\n                b'I' => Cigar::Ins(n),\n                b'D' => Cigar::Del(n),\n                b'N' => Cigar::RefSkip(n),\n                b'H' => {\n                    if i == 0 || j + 1 == text_len {\n                        Cigar::HardClip(n)\n                    } else {\n                        return Err(Error::BamParseCigar {\n                            msg: \"Hard clipping ('H') is only valid at the start or end of a cigar.\"\n                                .to_owned(),\n                        });\n                    }\n                }\n                b'S' => {\n                    if i == 0\n                        || j + 1 == text_len\n                        || bytes[i-1] == b'H'\n                        || bytes[j+1..].iter().all(|c| c.is_ascii_digit() || *c == b'H') {\n                        Cigar::SoftClip(n)\n                    } else {\n                        return Err(Error::BamParseCigar {\n                        msg: \"Soft clips ('S') can only have hard clips ('H') between them and the end of the CIGAR string.\"\n                            .to_owned(),\n                        });\n                    }\n                },\n                b'P' => Cigar::Pad(n),\n                b'=' => Cigar::Equal(n),\n                b'X' => Cigar::Diff(n),\n                op => {\n                    return Err(Error::BamParseCigar {\n                        msg: format!(\"Expected cigar operation [MIDNSHP=X] but got [{}]\", op),\n                    })\n                }\n            });\n            i = j + 1;\n        }\n        Ok(CigarString(inner))\n    }\n}\n\nimpl TryFrom<&str> for CigarString {\n    type Error = Error;\n\n    /// Create a CigarString from given &str.\n    /// # Example\n    /// ```\n    /// use rust_htslib::bam::record::*;\n    /// use rust_htslib::bam::record::CigarString;\n    /// use rust_htslib::bam::record::Cigar::*;\n    /// use std::convert::TryFrom;\n    ///\n    /// let cigar_str = \"2H10M5X3=2H\";\n    /// let cigar = CigarString::try_from(cigar_str)\n    ///     .expect(\"Unable to parse cigar string.\");\n    /// let expected_cigar = CigarString(vec![\n    ///     HardClip(2),\n    ///     Match(10),\n    ///     Diff(5),\n    ///     Equal(3),\n    ///     HardClip(2),\n    /// ]);\n    /// assert_eq!(cigar, expected_cigar);\n    /// ```\n    fn try_from(text: &str) -> Result<Self> {\n        let bytes = text.as_bytes();\n        if text.chars().count() != bytes.len() {\n            return Err(Error::BamParseCigar {\n                msg: \"CIGAR string contained non-ASCII characters, which are not valid. Valid are [0-9MIDNSHP=X].\".to_owned(),\n            });\n        }\n        CigarString::try_from(bytes)\n    }\n}\n\nimpl<'a> CigarString {\n    pub fn iter(&'a self) -> ::std::slice::Iter<'a, Cigar> {\n        self.into_iter()\n    }\n}\n\nimpl<'a> IntoIterator for &'a CigarString {\n    type Item = &'a Cigar;\n    type IntoIter = ::std::slice::Iter<'a, Cigar>;\n\n    fn into_iter(self) -> Self::IntoIter {\n        self.0.iter()\n    }\n}\n\nimpl fmt::Display for CigarString {\n    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {\n        for op in self {\n            fmt.write_fmt(format_args!(\"{}{}\", op.len(), op.char()))?;\n        }\n        Ok(())\n    }\n}\n\n// Get number of leading/trailing softclips if a CigarString taking hardclips into account\nfn calc_softclips<'a>(mut cigar: impl DoubleEndedIterator<Item = &'a Cigar>) -> i64 {\n    match (cigar.next(), cigar.next()) {\n        (Some(Cigar::HardClip(_)), Some(Cigar::SoftClip(s))) | (Some(Cigar::SoftClip(s)), _) => {\n            *s as i64\n        }\n        _ => 0,\n    }\n}\n\n#[derive(Eq, PartialEq, Clone, Debug)]\npub struct CigarStringView {\n    inner: CigarString,\n    pos: i64,\n}\n\nimpl CigarStringView {\n    /// Construct a new CigarStringView from a CigarString at a position\n    pub fn new(c: CigarString, pos: i64) -> CigarStringView {\n        CigarStringView { inner: c, pos }\n    }\n\n    /// Get (exclusive) end position of alignment.\n    pub fn end_pos(&self) -> i64 {\n        let mut pos = self.pos;\n        for c in self {\n            match c {\n                Cigar::Match(l)\n                | Cigar::RefSkip(l)\n                | Cigar::Del(l)\n                | Cigar::Equal(l)\n                | Cigar::Diff(l) => pos += *l as i64,\n                // these don't add to end_pos on reference\n                Cigar::Ins(_) | Cigar::SoftClip(_) | Cigar::HardClip(_) | Cigar::Pad(_) => (),\n            }\n        }\n        pos\n    }\n\n    /// Get the start position of the alignment (0-based).\n    pub fn pos(&self) -> i64 {\n        self.pos\n    }\n\n    /// Get number of bases softclipped at the beginning of the alignment.\n    pub fn leading_softclips(&self) -> i64 {\n        calc_softclips(self.iter())\n    }\n\n    /// Get number of bases softclipped at the end of the alignment.\n    pub fn trailing_softclips(&self) -> i64 {\n        calc_softclips(self.iter().rev())\n    }\n\n    /// Get number of bases hardclipped at the beginning of the alignment.\n    pub fn leading_hardclips(&self) -> i64 {\n        self.first().map_or(0, |cigar| {\n            if let Cigar::HardClip(s) = cigar {\n                *s as i64\n            } else {\n                0\n            }\n        })\n    }\n\n    /// Get number of bases hardclipped at the end of the alignment.\n    pub fn trailing_hardclips(&self) -> i64 {\n        self.last().map_or(0, |cigar| {\n            if let Cigar::HardClip(s) = cigar {\n                *s as i64\n            } else {\n                0\n            }\n        })\n    }\n\n    /// For a given position in the reference, get corresponding position within read.\n    /// If reference position is outside of the read alignment, return None.\n    ///\n    /// # Arguments\n    ///\n    /// * `ref_pos` - the reference position\n    /// * `include_softclips` - if true, softclips will be considered as matches or mismatches\n    /// * `include_dels` - if true, positions within deletions will be considered (first reference matching read position after deletion will be returned)\n    ///\n    pub fn read_pos(\n        &self,\n        ref_pos: u32,\n        include_softclips: bool,\n        include_dels: bool,\n    ) -> Result<Option<u32>> {\n        let mut rpos = self.pos as u32; // reference position\n        let mut qpos = 0u32; // position within read\n        let mut j = 0; // index into cigar operation vector\n\n        // find first cigar operation referring to qpos = 0 (and thus bases in record.seq()),\n        // because all augmentations of qpos and rpos before that are invalid\n        for (i, c) in self.iter().enumerate() {\n            match c {\n                Cigar::Match(_) |\n                Cigar::Diff(_)  |\n                Cigar::Equal(_) |\n                // this is unexpected, but bwa + GATK indel realignment can produce insertions\n                // before matching positions\n                Cigar::Ins(_) => {\n                    j = i;\n                    break;\n                },\n                Cigar::SoftClip(l) => {\n                    j = i;\n                    if include_softclips {\n                        // Alignment starts with softclip and we want to include it in the\n                        // projection of the reference position. However, the POS field does not\n                        // include the softclip. Hence we have to subtract its length.\n                        rpos = rpos.saturating_sub(*l);\n                    }\n                    break;\n                },\n                Cigar::Del(l) => {\n                    // METHOD: leading deletions can happen in case of trimmed reads where\n                    // a primer has been removed AFTER read mapping.\n                    // Example: 24M8I8D18M9S before trimming, 32H8D18M9S after trimming\n                    // with fgbio. While leading deletions should be impossible with\n                    // normal read mapping, they make perfect sense with primer trimming\n                    // because the mapper still had the evidence to decide in favor of\n                    // the deletion via the primer sequence.\n                    rpos += l;\n                },\n                Cigar::RefSkip(_) => {\n                    return Err(Error::BamUnexpectedCigarOperation {\n                        msg: \"'reference skip' (N) found before any operation describing read sequence\".to_owned()\n                    });\n                },\n                Cigar::HardClip(_) if i > 0 && i < self.len()-1 => {\n                    return Err(Error::BamUnexpectedCigarOperation{\n                        msg: \"'hard clip' (H) found in between operations, contradicting SAMv1 spec that hard clips can only be at the ends of reads\".to_owned()\n                    });\n                },\n                // if we have reached the end of the CigarString with only pads and hard clips, we have no read position matching the variant\n                Cigar::Pad(_) | Cigar::HardClip(_) if i == self.len()-1 => return Ok(None),\n                // skip leading HardClips and Pads, as they consume neither read sequence nor reference sequence\n                Cigar::Pad(_) | Cigar::HardClip(_) => ()\n            }\n        }\n\n        let contains_ref_pos = |cigar_op_start: u32, cigar_op_length: u32| {\n            cigar_op_start <= ref_pos && cigar_op_start + cigar_op_length > ref_pos\n        };\n\n        while rpos <= ref_pos && j < self.len() {\n            match self[j] {\n                // potential SNV evidence\n                Cigar::Match(l) | Cigar::Diff(l) | Cigar::Equal(l) if contains_ref_pos(rpos, l) => {\n                    // difference between desired position and first position of current cigar\n                    // operation\n                    qpos += ref_pos - rpos;\n                    return Ok(Some(qpos));\n                }\n                Cigar::SoftClip(l) if include_softclips && contains_ref_pos(rpos, l) => {\n                    qpos += ref_pos - rpos;\n                    return Ok(Some(qpos));\n                }\n                Cigar::Del(l) if include_dels && contains_ref_pos(rpos, l) => {\n                    // qpos shall resemble the start of the deletion\n                    return Ok(Some(qpos));\n                }\n                // for others, just increase pos and qpos as needed\n                Cigar::Match(l) | Cigar::Diff(l) | Cigar::Equal(l) => {\n                    rpos += l;\n                    qpos += l;\n                    j += 1;\n                }\n                Cigar::SoftClip(l) => {\n                    qpos += l;\n                    j += 1;\n                    if include_softclips {\n                        rpos += l;\n                    }\n                }\n                Cigar::Ins(l) => {\n                    qpos += l;\n                    j += 1;\n                }\n                Cigar::RefSkip(l) | Cigar::Del(l) => {\n                    rpos += l;\n                    j += 1;\n                }\n                Cigar::Pad(_) => {\n                    j += 1;\n                }\n                Cigar::HardClip(_) if j < self.len() - 1 => {\n                    return Err(Error::BamUnexpectedCigarOperation{\n                        msg: \"'hard clip' (H) found in between operations, contradicting SAMv1 spec that hard clips can only be at the ends of reads\".to_owned()\n                    });\n                }\n                Cigar::HardClip(_) => return Ok(None),\n            }\n        }\n\n        Ok(None)\n    }\n\n    /// transfer ownership of the Cigar out of the CigarView\n    pub fn take(self) -> CigarString {\n        self.inner\n    }\n}\n\nimpl ops::Deref for CigarStringView {\n    type Target = CigarString;\n\n    fn deref(&self) -> &CigarString {\n        &self.inner\n    }\n}\n\nimpl ops::Index<usize> for CigarStringView {\n    type Output = Cigar;\n\n    fn index(&self, index: usize) -> &Cigar {\n        self.inner.index(index)\n    }\n}\n\nimpl ops::IndexMut<usize> for CigarStringView {\n    fn index_mut(&mut self, index: usize) -> &mut Cigar {\n        self.inner.index_mut(index)\n    }\n}\n\nimpl<'a> CigarStringView {\n    pub fn iter(&'a self) -> ::std::slice::Iter<'a, Cigar> {\n        self.inner.into_iter()\n    }\n}\n\nimpl<'a> IntoIterator for &'a CigarStringView {\n    type Item = &'a Cigar;\n    type IntoIter = ::std::slice::Iter<'a, Cigar>;\n\n    fn into_iter(self) -> Self::IntoIter {\n        self.inner.into_iter()\n    }\n}\n\nimpl fmt::Display for CigarStringView {\n    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {\n        self.inner.fmt(fmt)\n    }\n}\n\npub struct BaseModificationMetadata {\n    pub strand: i32,\n    pub implicit: i32,\n    pub canonical: u8,\n}\n\n/// struct containing the internal state required to access\n/// the base modifications for a bam::Record\npub struct BaseModificationState<'a> {\n    record: &'a Record,\n    state: *mut htslib::hts_base_mod_state,\n    buffer: Vec<htslib::hts_base_mod>,\n    buffer_pos: i32,\n}\n\nimpl BaseModificationState<'_> {\n    /// Initialize a new BaseModification struct from a bam::Record\n    /// This function allocates memory for the state structure\n    /// and initializes the iterator to the start of the modification\n    /// records.\n    fn new(r: &Record) -> Result<BaseModificationState<'_>> {\n        let mut bm = unsafe {\n            BaseModificationState {\n                record: r,\n                state: hts_sys::hts_base_mod_state_alloc(),\n                buffer: Vec::new(),\n                buffer_pos: -1,\n            }\n        };\n\n        if bm.state.is_null() {\n            panic!(\"Unable to allocate memory for hts_base_mod_state\");\n        }\n\n        // parse the MM tag to initialize the state\n        unsafe {\n            let ret = hts_sys::bam_parse_basemod(bm.record.inner_ptr(), bm.state);\n            if ret != 0 {\n                return Err(Error::BamBaseModificationTagNotFound);\n            }\n        }\n\n        let types = bm.recorded();\n        bm.buffer.reserve(types.len());\n        Ok(bm)\n    }\n\n    pub fn buffer_next_mods(&mut self) -> Result<usize> {\n        unsafe {\n            let ret = hts_sys::bam_next_basemod(\n                self.record.inner_ptr(),\n                self.state,\n                self.buffer.as_mut_ptr(),\n                self.buffer.capacity() as i32,\n                &mut self.buffer_pos,\n            );\n\n            if ret < 0 {\n                return Err(Error::BamBaseModificationIterationFailed);\n            }\n\n            // the htslib API won't write more than buffer.capacity() mods to the output array but it will\n            // return the actual number of modifications found. We return an error to the caller\n            // in the case where there was insufficient storage to return all mods.\n            if ret as usize > self.buffer.capacity() {\n                return Err(Error::BamBaseModificationTooManyMods);\n            }\n\n            // we read the modifications directly into the vector, which does\n            // not update the length so needs to be manually set\n            self.buffer.set_len(ret as usize);\n\n            Ok(ret as usize)\n        }\n    }\n\n    /// Return an array containing the modification codes listed for this record.\n    /// Positive values are ascii character codes (eg m), negative values are chEBI codes.\n    pub fn recorded<'a>(&self) -> &'a [i32] {\n        unsafe {\n            let mut n: i32 = 0;\n            let data_ptr: *const i32 = hts_sys::bam_mods_recorded(self.state, &mut n);\n\n            // htslib should not return a null pointer, even when there are no base mods\n            if data_ptr.is_null() {\n                panic!(\"Unable to obtain pointer to base modifications\");\n            }\n            assert!(n >= 0);\n            slice::from_raw_parts(data_ptr, n as usize)\n        }\n    }\n\n    /// Return metadata for the specified character code indicating the strand\n    /// the base modification was called on, whether the tag uses implicit mode\n    /// and the ascii code for the canonical base.\n    /// If there are multiple modifications with the same code this will return the data\n    /// for the first mod.  See https://github.com/samtools/htslib/issues/1635\n    pub fn query_type(&self, code: i32) -> Result<BaseModificationMetadata> {\n        unsafe {\n            let mut strand: i32 = 0;\n            let mut implicit: i32 = 0;\n            // This may be i8 or u8 in hts_sys.\n            let mut canonical: c_char = 0;\n\n            let ret = hts_sys::bam_mods_query_type(\n                self.state,\n                code,\n                &mut strand,\n                &mut implicit,\n                &mut canonical,\n            );\n            if ret == -1 {\n                Err(Error::BamBaseModificationTypeNotFound)\n            } else {\n                Ok(BaseModificationMetadata {\n                    strand,\n                    implicit,\n                    canonical: canonical.try_into().unwrap(),\n                })\n            }\n        }\n    }\n}\n\nimpl Drop for BaseModificationState<'_> {\n    fn drop<'a>(&mut self) {\n        unsafe {\n            hts_sys::hts_base_mod_state_free(self.state);\n        }\n    }\n}\n\n/// Iterator over the base modifications that returns\n/// a vector for all of the mods at each position\npub struct BaseModificationsPositionIter<'a> {\n    mod_state: BaseModificationState<'a>,\n}\n\nimpl BaseModificationsPositionIter<'_> {\n    fn new(r: &Record) -> Result<BaseModificationsPositionIter<'_>> {\n        let state = BaseModificationState::new(r)?;\n        Ok(BaseModificationsPositionIter { mod_state: state })\n    }\n\n    pub fn recorded<'a>(&self) -> &'a [i32] {\n        self.mod_state.recorded()\n    }\n\n    pub fn query_type(&self, code: i32) -> Result<BaseModificationMetadata> {\n        self.mod_state.query_type(code)\n    }\n}\n\nimpl Iterator for BaseModificationsPositionIter<'_> {\n    type Item = Result<(i32, Vec<hts_sys::hts_base_mod>)>;\n\n    fn next(&mut self) -> Option<Self::Item> {\n        let ret = self.mod_state.buffer_next_mods();\n\n        // Three possible things happened in buffer_next_mods:\n        // 1. the htslib API call was successful but there are no more mods\n        // 2. ths htslib API call was successful and we read some mods\n        // 3. the htslib API call failed, we propogate the error wrapped in an option\n        match ret {\n            Ok(num_mods) => {\n                if num_mods == 0 {\n                    None\n                } else {\n                    let data = (self.mod_state.buffer_pos, self.mod_state.buffer.clone());\n                    Some(Ok(data))\n                }\n            }\n            Err(e) => Some(Err(e)),\n        }\n    }\n}\n\n/// Iterator over the base modifications that returns\n/// the next modification found, one by one\npub struct BaseModificationsIter<'a> {\n    mod_state: BaseModificationState<'a>,\n    buffer_idx: usize,\n}\n\nimpl BaseModificationsIter<'_> {\n    fn new(r: &Record) -> Result<BaseModificationsIter<'_>> {\n        let state = BaseModificationState::new(r)?;\n        Ok(BaseModificationsIter {\n            mod_state: state,\n            buffer_idx: 0,\n        })\n    }\n\n    pub fn recorded<'a>(&self) -> &'a [i32] {\n        self.mod_state.recorded()\n    }\n\n    pub fn query_type(&self, code: i32) -> Result<BaseModificationMetadata> {\n        self.mod_state.query_type(code)\n    }\n}\n\nimpl Iterator for BaseModificationsIter<'_> {\n    type Item = Result<(i32, hts_sys::hts_base_mod)>;\n\n    fn next(&mut self) -> Option<Self::Item> {\n        if self.buffer_idx == self.mod_state.buffer.len() {\n            // need to use the internal state to read the next\n            // set of modifications into the buffer\n            let ret = self.mod_state.buffer_next_mods();\n\n            match ret {\n                Ok(num_mods) => {\n                    if num_mods == 0 {\n                        // done iterating\n                        return None;\n                    } else {\n                        // we read some mods, reset the position in the buffer then fall through\n                        self.buffer_idx = 0;\n                    }\n                }\n                Err(e) => return Some(Err(e)),\n            }\n        }\n\n        // if we got here when there are mods buffered that we haven't emitted yet\n        assert!(self.buffer_idx < self.mod_state.buffer.len());\n        let data = (\n            self.mod_state.buffer_pos,\n            self.mod_state.buffer[self.buffer_idx],\n        );\n        self.buffer_idx += 1;\n        Some(Ok(data))\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    #[test]\n    fn test_cigar_string() {\n        let cigar = CigarString(vec![Cigar::Match(100), Cigar::SoftClip(10)]);\n\n        assert_eq!(cigar[0], Cigar::Match(100));\n        assert_eq!(format!(\"{}\", cigar), \"100M10S\");\n        for op in &cigar {\n            println!(\"{}\", op);\n        }\n    }\n\n    #[test]\n    fn test_cigar_string_view_pos() {\n        let cigar = CigarString(vec![Cigar::Match(100), Cigar::SoftClip(10)]).into_view(5);\n        assert_eq!(cigar.pos(), 5);\n    }\n\n    #[test]\n    fn test_cigar_string_leading_softclips() {\n        let cigar = CigarString(vec![Cigar::SoftClip(10), Cigar::Match(100)]).into_view(0);\n        assert_eq!(cigar.leading_softclips(), 10);\n        let cigar2 = CigarString(vec![\n            Cigar::HardClip(5),\n            Cigar::SoftClip(10),\n            Cigar::Match(100),\n        ])\n        .into_view(0);\n        assert_eq!(cigar2.leading_softclips(), 10);\n    }\n\n    #[test]\n    fn test_cigar_string_trailing_softclips() {\n        let cigar = CigarString(vec![Cigar::Match(100), Cigar::SoftClip(10)]).into_view(0);\n        assert_eq!(cigar.trailing_softclips(), 10);\n        let cigar2 = CigarString(vec![\n            Cigar::Match(100),\n            Cigar::SoftClip(10),\n            Cigar::HardClip(5),\n        ])\n        .into_view(0);\n        assert_eq!(cigar2.trailing_softclips(), 10);\n    }\n\n    #[test]\n    fn test_cigar_read_pos() {\n        let vpos = 5; // variant position\n\n        // Ignore leading HardClip\n        // ref:       00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15\n        // var:                       V\n        // c01: 7H                 M  M\n        // qpos:                  00 01\n        let c01 = CigarString(vec![Cigar::HardClip(7), Cigar::Match(2)]).into_view(4);\n        assert_eq!(c01.read_pos(vpos, false, false).unwrap(), Some(1));\n\n        // Skip leading SoftClip or use as pre-POS matches\n        // ref:       00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15\n        // var:                       V\n        // c02: 5H2S         M  M  M  M  M  M\n        // qpos:  00        02 03 04 05 06 07\n        // c02: 5H     S  S  M  M  M  M  M  M\n        // qpos:      00 01 02 03 04 05 06 07\n        let c02 = CigarString(vec![Cigar::SoftClip(2), Cigar::Match(6)]).into_view(2);\n        assert_eq!(c02.read_pos(vpos, false, false).unwrap(), Some(5));\n        assert_eq!(c02.read_pos(vpos, true, false).unwrap(), Some(5));\n\n        // Skip leading SoftClip returning None for unmatched reference positiong or use as\n        // pre-POS matches\n        // ref:       00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15\n        // var:                       V\n        // c03:  3S                      M  M\n        // qpos: 00                     03 04\n        // c03:                 S  S  S  M  M\n        // qpos:               00 01 02 03 04\n        let c03 = CigarString(vec![Cigar::SoftClip(3), Cigar::Match(6)]).into_view(6);\n        assert_eq!(c03.read_pos(vpos, false, false).unwrap(), None);\n        assert_eq!(c03.read_pos(vpos, true, false).unwrap(), Some(2));\n\n        // Skip leading Insertion before variant position\n        // ref:       00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15\n        // var:                       V\n        // c04:  3I                X  X  X\n        // qpos: 00               03 04 05\n        let c04 = CigarString(vec![Cigar::Ins(3), Cigar::Diff(3)]).into_view(4);\n        assert_eq!(c04.read_pos(vpos, true, false).unwrap(), Some(4));\n\n        // Matches and deletion before variant position\n        // ref:       00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15\n        // var:                       V\n        // c05:        =  =  D  D  X  =  =\n        // qpos:      00 01       02 03 04 05\n        let c05 = CigarString(vec![\n            Cigar::Equal(2),\n            Cigar::Del(2),\n            Cigar::Diff(1),\n            Cigar::Equal(2),\n        ])\n        .into_view(0);\n        assert_eq!(c05.read_pos(vpos, true, false).unwrap(), Some(3));\n\n        // single nucleotide Deletion covering variant position\n        // ref:       00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15\n        // var:                       V\n        // c06:                 =  =  D  X  X\n        // qpos:               00 01    02 03\n        let c06 = CigarString(vec![Cigar::Equal(2), Cigar::Del(1), Cigar::Diff(2)]).into_view(3);\n        assert_eq!(c06.read_pos(vpos, false, true).unwrap(), Some(2));\n        assert_eq!(c06.read_pos(vpos, false, false).unwrap(), None);\n\n        // three nucleotide Deletion covering variant position\n        // ref:       00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15\n        // var:                       V\n        // c07:              =  =  D  D  D  M  M\n        // qpos:            00 01          02 03\n        let c07 = CigarString(vec![Cigar::Equal(2), Cigar::Del(3), Cigar::Match(2)]).into_view(2);\n        assert_eq!(c07.read_pos(vpos, false, true).unwrap(), Some(2));\n        assert_eq!(c07.read_pos(vpos, false, false).unwrap(), None);\n\n        // three nucleotide RefSkip covering variant position\n        // ref:       00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15\n        // var:                       V\n        // c08:              =  X  N  N  N  M  M\n        // qpos:            00 01          02 03\n        let c08 = CigarString(vec![\n            Cigar::Equal(1),\n            Cigar::Diff(1),\n            Cigar::RefSkip(3),\n            Cigar::Match(2),\n        ])\n        .into_view(2);\n        assert_eq!(c08.read_pos(vpos, false, true).unwrap(), None);\n        assert_eq!(c08.read_pos(vpos, false, false).unwrap(), None);\n\n        // internal hard clip before variant pos\n        // ref:       00 01 02 03    04 05 06 07 08 09 10 11 12 13 14 15\n        // var:                          V\n        // c09: 3H           =  = 3H  =  =\n        // qpos:            00 01    02 03\n        let c09 = CigarString(vec![\n            Cigar::HardClip(3),\n            Cigar::Equal(2),\n            Cigar::HardClip(3),\n            Cigar::Equal(2),\n        ])\n        .into_view(2);\n        assert_eq!(c09.read_pos(vpos, false, true).is_err(), true);\n\n        // Deletion right before variant position\n        // ref:       00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15\n        // var:                       V\n        // c10:           M  M  D  D  M  M\n        // qpos:         00 01       02 03\n        let c10 = CigarString(vec![Cigar::Match(2), Cigar::Del(2), Cigar::Match(2)]).into_view(1);\n        assert_eq!(c10.read_pos(vpos, false, false).unwrap(), Some(2));\n\n        // Insertion right before variant position\n        // ref:       00 01 02 03 04    05 06 07 08 09 10 11 12 13 14 15\n        // var:                          V\n        // c11:                 M  M 3I  M\n        // qpos:               00 01 02 05 06\n        let c11 = CigarString(vec![Cigar::Match(2), Cigar::Ins(3), Cigar::Match(2)]).into_view(3);\n        assert_eq!(c11.read_pos(vpos, false, false).unwrap(), Some(5));\n\n        // Insertion right after variant position\n        // ref:       00 01 02 03 04 05    06 07 08 09 10 11 12 13 14 15\n        // var:                       V\n        // c12:                 M  M  M 2I  =\n        // qpos:               00 01 02 03 05\n        let c12 = CigarString(vec![Cigar::Match(3), Cigar::Ins(2), Cigar::Equal(1)]).into_view(3);\n        assert_eq!(c12.read_pos(vpos, false, false).unwrap(), Some(2));\n\n        // Deletion right after variant position\n        // ref:       00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15\n        // var:                       V\n        // c13:                 M  M  M  D  =\n        // qpos:               00 01 02    03\n        let c13 = CigarString(vec![Cigar::Match(3), Cigar::Del(1), Cigar::Equal(1)]).into_view(3);\n        assert_eq!(c13.read_pos(vpos, false, false).unwrap(), Some(2));\n\n        // A messy and complicated example, including a Pad operation\n        let vpos2 = 15;\n        // ref:       00    01 02    03 04 05    06 07 08 09 10 11 12 13 14 15\n        // var:                                                           V\n        // c14: 5H3S   = 2P  M  X 3I  M  M  D 2I  =  =  N  N  N  M  M  M  =  =  5S2H\n        // qpos:  00  03    04 05 06 09 10    11 13 14          15 16 17 18 19\n        let c14 = CigarString(vec![\n            Cigar::HardClip(5),\n            Cigar::SoftClip(3),\n            Cigar::Equal(1),\n            Cigar::Pad(2),\n            Cigar::Match(1),\n            Cigar::Diff(1),\n            Cigar::Ins(3),\n            Cigar::Match(2),\n            Cigar::Del(1),\n            Cigar::Ins(2),\n            Cigar::Equal(2),\n            Cigar::RefSkip(3),\n            Cigar::Match(3),\n            Cigar::Equal(2),\n            Cigar::SoftClip(5),\n            Cigar::HardClip(2),\n        ])\n        .into_view(0);\n        assert_eq!(c14.read_pos(vpos2, false, false).unwrap(), Some(19));\n\n        // HardClip after Pad\n        // ref:       00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15\n        // var:                       V\n        // c15: 5P1H            =  =  =\n        // qpos:               00 01 02\n        let c15 =\n            CigarString(vec![Cigar::Pad(5), Cigar::HardClip(1), Cigar::Equal(3)]).into_view(3);\n        assert_eq!(c15.read_pos(vpos, false, false).is_err(), true);\n\n        // only HardClip and Pad operations\n        // c16: 7H5P2H\n        let c16 =\n            CigarString(vec![Cigar::HardClip(7), Cigar::Pad(5), Cigar::HardClip(2)]).into_view(3);\n        assert_eq!(c16.read_pos(vpos, false, false).unwrap(), None);\n    }\n\n    #[test]\n    fn test_clone() {\n        let mut rec = Record::new();\n        rec.set_pos(300);\n        rec.set_qname(b\"read1\");\n        let clone = rec.clone();\n        assert_eq!(rec, clone);\n    }\n\n    #[test]\n    fn test_flags() {\n        let mut rec = Record::new();\n\n        rec.set_paired();\n        assert_eq!(rec.is_paired(), true);\n\n        rec.set_supplementary();\n        assert_eq!(rec.is_supplementary(), true);\n        assert_eq!(rec.is_supplementary(), true);\n\n        rec.unset_paired();\n        assert_eq!(rec.is_paired(), false);\n        assert_eq!(rec.is_supplementary(), true);\n\n        rec.unset_supplementary();\n        assert_eq!(rec.is_paired(), false);\n        assert_eq!(rec.is_supplementary(), false);\n    }\n\n    #[test]\n    fn test_cigar_parse() {\n        let cigar = \"1S20M1D2I3X1=2H\";\n        let parsed = CigarString::try_from(cigar).unwrap();\n        assert_eq!(parsed.to_string(), cigar);\n    }\n}\n\n#[cfg(test)]\nmod alignment_cigar_tests {\n    use super::*;\n    use crate::bam::{Read, Reader};\n    use bio_types::alignment::AlignmentOperation::{Del, Ins, Match, Subst, Xclip, Yclip};\n    use bio_types::alignment::{Alignment, AlignmentMode};\n\n    #[test]\n    fn test_cigar() {\n        let alignment = Alignment {\n            score: 5,\n            xstart: 3,\n            ystart: 0,\n            xend: 9,\n            yend: 10,\n            ylen: 10,\n            xlen: 10,\n            operations: vec![Match, Match, Match, Subst, Ins, Ins, Del, Del],\n            mode: AlignmentMode::Semiglobal,\n        };\n        assert_eq!(alignment.cigar(false), \"3S3=1X2I2D1S\");\n        assert_eq!(\n            CigarString::from_alignment(&alignment, false).0,\n            vec![\n                Cigar::SoftClip(3),\n                Cigar::Equal(3),\n                Cigar::Diff(1),\n                Cigar::Ins(2),\n                Cigar::Del(2),\n                Cigar::SoftClip(1),\n            ]\n        );\n\n        let alignment = Alignment {\n            score: 5,\n            xstart: 0,\n            ystart: 5,\n            xend: 4,\n            yend: 10,\n            ylen: 10,\n            xlen: 5,\n            operations: vec![Yclip(5), Match, Subst, Subst, Ins, Del, Del, Xclip(1)],\n            mode: AlignmentMode::Custom,\n        };\n        assert_eq!(alignment.cigar(false), \"1=2X1I2D1S\");\n        assert_eq!(alignment.cigar(true), \"1=2X1I2D1H\");\n        assert_eq!(\n            CigarString::from_alignment(&alignment, false).0,\n            vec![\n                Cigar::Equal(1),\n                Cigar::Diff(2),\n                Cigar::Ins(1),\n                Cigar::Del(2),\n                Cigar::SoftClip(1),\n            ]\n        );\n        assert_eq!(\n            CigarString::from_alignment(&alignment, true).0,\n            vec![\n                Cigar::Equal(1),\n                Cigar::Diff(2),\n                Cigar::Ins(1),\n                Cigar::Del(2),\n                Cigar::HardClip(1),\n            ]\n        );\n\n        let alignment = Alignment {\n            score: 5,\n            xstart: 0,\n            ystart: 5,\n            xend: 3,\n            yend: 8,\n            ylen: 10,\n            xlen: 3,\n            operations: vec![Yclip(5), Subst, Match, Subst, Yclip(2)],\n            mode: AlignmentMode::Custom,\n        };\n        assert_eq!(alignment.cigar(false), \"1X1=1X\");\n        assert_eq!(\n            CigarString::from_alignment(&alignment, false).0,\n            vec![Cigar::Diff(1), Cigar::Equal(1), Cigar::Diff(1)]\n        );\n\n        let alignment = Alignment {\n            score: 5,\n            xstart: 0,\n            ystart: 5,\n            xend: 3,\n            yend: 8,\n            ylen: 10,\n            xlen: 3,\n            operations: vec![Subst, Match, Subst],\n            mode: AlignmentMode::Semiglobal,\n        };\n        assert_eq!(alignment.cigar(false), \"1X1=1X\");\n        assert_eq!(\n            CigarString::from_alignment(&alignment, false).0,\n            vec![Cigar::Diff(1), Cigar::Equal(1), Cigar::Diff(1)]\n        );\n    }\n\n    #[test]\n    fn test_read_orientation_f1r2() {\n        let mut bam = Reader::from_path(\"test/test_paired.sam\").unwrap();\n\n        for res in bam.records() {\n            let record = res.unwrap();\n            assert_eq!(\n                record.read_pair_orientation(),\n                SequenceReadPairOrientation::F1R2\n            );\n        }\n    }\n\n    #[test]\n    fn test_read_orientation_f2r1() {\n        let mut bam = Reader::from_path(\"test/test_nonstandard_orientation.sam\").unwrap();\n\n        for res in bam.records() {\n            let record = res.unwrap();\n            assert_eq!(\n                record.read_pair_orientation(),\n                SequenceReadPairOrientation::F2R1\n            );\n        }\n    }\n\n    #[test]\n    fn test_read_orientation_supplementary() {\n        let mut bam = Reader::from_path(\"test/test_orientation_supplementary.sam\").unwrap();\n\n        for res in bam.records() {\n            let record = res.unwrap();\n            assert_eq!(\n                record.read_pair_orientation(),\n                SequenceReadPairOrientation::F2R1\n            );\n        }\n    }\n\n    #[test]\n    pub fn test_cigar_parsing_non_ascii_error() {\n        let cigar_str = \"43ጷ\";\n        let expected_error = Err(Error::BamParseCigar {\n                msg: \"CIGAR string contained non-ASCII characters, which are not valid. Valid are [0-9MIDNSHP=X].\".to_owned(),\n            });\n\n        let result = CigarString::try_from(cigar_str);\n        assert_eq!(expected_error, result);\n    }\n\n    #[test]\n    pub fn test_cigar_parsing() {\n        // parsing test cases\n        let cigar_strs = [\n            \"1H10M4D100I300N1102=10P25X11S\", // test every cigar opt\n            \"100M\",                          // test a single op\n            \"\",                              // test empty input\n            \"1H1=1H\",                        // test simple hardclip\n            \"1S1=1S\",                        // test simple softclip\n            \"11H11S11=11S11H\",               // test complex softclip\n            \"10H\",\n            \"10S\",\n        ];\n        // expected results\n        let cigars = [\n            CigarString(vec![\n                Cigar::HardClip(1),\n                Cigar::Match(10),\n                Cigar::Del(4),\n                Cigar::Ins(100),\n                Cigar::RefSkip(300),\n                Cigar::Equal(1102),\n                Cigar::Pad(10),\n                Cigar::Diff(25),\n                Cigar::SoftClip(11),\n            ]),\n            CigarString(vec![Cigar::Match(100)]),\n            CigarString(vec![]),\n            CigarString(vec![\n                Cigar::HardClip(1),\n                Cigar::Equal(1),\n                Cigar::HardClip(1),\n            ]),\n            CigarString(vec![\n                Cigar::SoftClip(1),\n                Cigar::Equal(1),\n                Cigar::SoftClip(1),\n            ]),\n            CigarString(vec![\n                Cigar::HardClip(11),\n                Cigar::SoftClip(11),\n                Cigar::Equal(11),\n                Cigar::SoftClip(11),\n                Cigar::HardClip(11),\n            ]),\n            CigarString(vec![Cigar::HardClip(10)]),\n            CigarString(vec![Cigar::SoftClip(10)]),\n        ];\n        // compare\n        for (&cigar_str, truth) in cigar_strs.iter().zip(cigars.iter()) {\n            let cigar_parse = CigarString::try_from(cigar_str)\n                .unwrap_or_else(|_| panic!(\"Unable to parse cigar: {}\", cigar_str));\n            assert_eq!(&cigar_parse, truth);\n        }\n    }\n}\n\n#[cfg(test)]\nmod basemod_tests {\n    use crate::bam::{Read, Reader};\n\n    #[test]\n    pub fn test_count_recorded() {\n        let mut bam = Reader::from_path(\"test/base_mods/MM-double.sam\").unwrap();\n\n        for r in bam.records() {\n            let record = r.unwrap();\n            if let Ok(mods) = record.basemods_iter() {\n                let n = mods.recorded().len();\n                assert_eq!(n, 3);\n            };\n        }\n    }\n\n    #[test]\n    pub fn test_query_type() {\n        let mut bam = Reader::from_path(\"test/base_mods/MM-orient.sam\").unwrap();\n\n        let mut n_fwd = 0;\n        let mut n_rev = 0;\n\n        for r in bam.records() {\n            let record = r.unwrap();\n            if let Ok(mods) = record.basemods_iter() {\n                for mod_code in mods.recorded() {\n                    if let Ok(mod_metadata) = mods.query_type(*mod_code) {\n                        if mod_metadata.strand == 0 {\n                            n_fwd += 1;\n                        }\n                        if mod_metadata.strand == 1 {\n                            n_rev += 1;\n                        }\n                    }\n                }\n            };\n        }\n        assert_eq!(n_fwd, 2);\n        assert_eq!(n_rev, 2);\n    }\n\n    #[test]\n    pub fn test_mod_iter() {\n        let mut bam = Reader::from_path(\"test/base_mods/MM-double.sam\").unwrap();\n        let expected_positions = [1, 7, 12, 13, 13, 22, 30, 31];\n        let mut i = 0;\n\n        for r in bam.records() {\n            let record = r.unwrap();\n            for res in record.basemods_iter().unwrap().flatten() {\n                let (position, _m) = res;\n                assert_eq!(position, expected_positions[i]);\n                i += 1;\n            }\n        }\n    }\n\n    #[test]\n    pub fn test_position_iter() {\n        let mut bam = Reader::from_path(\"test/base_mods/MM-double.sam\").unwrap();\n        let expected_positions = [1, 7, 12, 13, 22, 30, 31];\n        let expected_counts = [1, 1, 1, 2, 1, 1, 1];\n        let mut i = 0;\n\n        for r in bam.records() {\n            let record = r.unwrap();\n            for res in record.basemods_position_iter().unwrap().flatten() {\n                let (position, elements) = res;\n                assert_eq!(position, expected_positions[i]);\n                assert_eq!(elements.len(), expected_counts[i]);\n                i += 1;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/bam/record_serde.rs",
    "content": "use std::fmt;\n\nuse serde::de::{self, Deserialize, Deserializer, MapAccess, SeqAccess, Visitor};\nuse serde::ser::SerializeStruct;\nuse serde::{Serialize, Serializer};\nuse serde_bytes::{ByteBuf, Bytes};\n\nuse crate::bam::record::Record;\n\nfn fix_l_extranul(rec: &mut Record) {\n    // first, reset the number of extranuls to 0 for calling .qname(); then calculate how many we actually have\n    rec.inner_mut().core.l_extranul = 0;\n    let l_extranul = rec.qname().iter().rev().take_while(|x| **x == 0u8).count() as u8;\n    rec.inner_mut().core.l_extranul = l_extranul;\n}\n\nimpl Serialize for Record {\n    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>\n    where\n        S: Serializer,\n    {\n        let core = self.inner().core;\n        let mut state = serializer.serialize_struct(\"Record\", 12)?;\n        state.serialize_field(\"tid\", &core.tid)?;\n        state.serialize_field(\"pos\", &core.pos)?;\n        state.serialize_field(\"bin\", &core.bin)?;\n        state.serialize_field(\"mapq\", &core.qual)?;\n        state.serialize_field(\"qname_len\", &core.l_qname)?;\n        state.serialize_field(\"flag\", &core.flag)?;\n        state.serialize_field(\"n_cigar\", &core.n_cigar)?;\n        state.serialize_field(\"seq_len\", &core.l_qseq)?;\n        state.serialize_field(\"mtid\", &core.mtid)?;\n        state.serialize_field(\"mpos\", &core.mpos)?;\n        state.serialize_field(\"isize\", &core.isize_)?;\n        state.serialize_field(\"data\", Bytes::new(self.data()))?;\n        state.end()\n    }\n}\n\nimpl<'de> Deserialize<'de> for Record {\n    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>\n    where\n        D: Deserializer<'de>,\n    {\n        enum Field {\n            Tid,\n            Pos,\n            Bin,\n            Mapq,\n            QnameLen,\n            Flag,\n            NCigar,\n            SeqLen,\n            Mtid,\n            Mpos,\n            Isize,\n            Data,\n        }\n\n        impl<'de> Deserialize<'de> for Field {\n            fn deserialize<D>(deserializer: D) -> Result<Field, D::Error>\n            where\n                D: Deserializer<'de>,\n            {\n                struct FieldVisitor;\n\n                impl Visitor<'_> for FieldVisitor {\n                    type Value = Field;\n\n                    fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {\n                        formatter.write_str(\"expecting a bam field\")\n                    }\n\n                    fn visit_str<E>(self, value: &str) -> Result<Field, E>\n                    where\n                        E: de::Error,\n                    {\n                        match value {\n                            \"tid\" => Ok(Field::Tid),\n                            \"pos\" => Ok(Field::Pos),\n                            \"bin\" => Ok(Field::Bin),\n                            \"mapq\" => Ok(Field::Mapq),\n                            \"qname_len\" => Ok(Field::QnameLen),\n                            \"flag\" => Ok(Field::Flag),\n                            \"n_cigar\" => Ok(Field::NCigar),\n                            \"seq_len\" => Ok(Field::SeqLen),\n                            \"mtid\" => Ok(Field::Mtid),\n                            \"mpos\" => Ok(Field::Mpos),\n                            \"isize\" => Ok(Field::Isize),\n                            \"data\" => Ok(Field::Data),\n                            _ => Err(de::Error::unknown_field(value, FIELDS)),\n                        }\n                    }\n                }\n\n                deserializer.deserialize_identifier(FieldVisitor)\n            }\n        }\n\n        struct RecordVisitor;\n\n        impl<'de> Visitor<'de> for RecordVisitor {\n            type Value = Record;\n\n            fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {\n                formatter.write_str(\"struct Record\")\n            }\n\n            fn visit_seq<V>(self, mut seq: V) -> Result<Record, V::Error>\n            where\n                V: SeqAccess<'de>,\n            {\n                let tid = seq\n                    .next_element()?\n                    .ok_or_else(|| de::Error::invalid_length(0, &self))?;\n                let pos = seq\n                    .next_element()?\n                    .ok_or_else(|| de::Error::invalid_length(0, &self))?;\n                let bin = seq\n                    .next_element()?\n                    .ok_or_else(|| de::Error::invalid_length(0, &self))?;\n                let mapq = seq\n                    .next_element()?\n                    .ok_or_else(|| de::Error::invalid_length(0, &self))?;\n                let qname_len = seq\n                    .next_element()?\n                    .ok_or_else(|| de::Error::invalid_length(0, &self))?;\n                let flag = seq\n                    .next_element()?\n                    .ok_or_else(|| de::Error::invalid_length(0, &self))?;\n                let n_cigar = seq\n                    .next_element()?\n                    .ok_or_else(|| de::Error::invalid_length(0, &self))?;\n                let seq_len = seq\n                    .next_element()?\n                    .ok_or_else(|| de::Error::invalid_length(0, &self))?;\n                let mtid = seq\n                    .next_element()?\n                    .ok_or_else(|| de::Error::invalid_length(0, &self))?;\n                let mpos = seq\n                    .next_element()?\n                    .ok_or_else(|| de::Error::invalid_length(0, &self))?;\n                let isize_ = seq\n                    .next_element()?\n                    .ok_or_else(|| de::Error::invalid_length(0, &self))?;\n                let data = seq\n                    .next_element::<ByteBuf>()?\n                    .ok_or_else(|| de::Error::invalid_length(0, &self))?\n                    .into_vec();\n\n                let mut rec = Record::new();\n                {\n                    let m = &mut rec.inner_mut().core;\n                    m.tid = tid;\n                    m.pos = pos;\n                    m.bin = bin;\n                    m.qual = mapq;\n                    m.l_qname = qname_len;\n                    m.flag = flag;\n                    m.n_cigar = n_cigar;\n                    m.l_qseq = seq_len;\n                    m.mtid = mtid;\n                    m.mpos = mpos;\n                    m.isize_ = isize_;\n                }\n\n                rec.set_data(&data);\n                fix_l_extranul(&mut rec);\n                Ok(rec)\n            }\n\n            fn visit_map<V>(self, mut map: V) -> Result<Record, V::Error>\n            where\n                V: MapAccess<'de>,\n            {\n                let mut tid = None;\n                let mut pos = None;\n                let mut bin = None;\n                let mut mapq = None;\n                let mut qname_len = None;\n                let mut flag = None;\n                let mut n_cigar = None;\n                let mut seq_len = None;\n                let mut mtid = None;\n                let mut mpos = None;\n                let mut isize = None;\n                let mut data: Option<ByteBuf> = None;\n\n                while let Some(key) = map.next_key()? {\n                    match key {\n                        Field::Tid => {\n                            if tid.is_some() {\n                                return Err(de::Error::duplicate_field(\"tid\"));\n                            }\n                            tid = Some(map.next_value()?);\n                        }\n                        Field::Pos => {\n                            if pos.is_some() {\n                                return Err(de::Error::duplicate_field(\"pos\"));\n                            }\n                            pos = Some(map.next_value()?);\n                        }\n                        Field::Bin => {\n                            if bin.is_some() {\n                                return Err(de::Error::duplicate_field(\"bin\"));\n                            }\n                            bin = Some(map.next_value()?);\n                        }\n                        Field::Mapq => {\n                            if mapq.is_some() {\n                                return Err(de::Error::duplicate_field(\"mapq\"));\n                            }\n                            mapq = Some(map.next_value()?);\n                        }\n                        Field::QnameLen => {\n                            if qname_len.is_some() {\n                                return Err(de::Error::duplicate_field(\"qname_len\"));\n                            }\n                            qname_len = Some(map.next_value()?);\n                        }\n                        Field::Flag => {\n                            if flag.is_some() {\n                                return Err(de::Error::duplicate_field(\"flag\"));\n                            }\n                            flag = Some(map.next_value()?);\n                        }\n                        Field::NCigar => {\n                            if n_cigar.is_some() {\n                                return Err(de::Error::duplicate_field(\"n_cigar\"));\n                            }\n                            n_cigar = Some(map.next_value()?);\n                        }\n                        Field::SeqLen => {\n                            if seq_len.is_some() {\n                                return Err(de::Error::duplicate_field(\"seq_len\"));\n                            }\n                            seq_len = Some(map.next_value()?);\n                        }\n                        Field::Mtid => {\n                            if mtid.is_some() {\n                                return Err(de::Error::duplicate_field(\"mtid\"));\n                            }\n                            mtid = Some(map.next_value()?);\n                        }\n                        Field::Mpos => {\n                            if mpos.is_some() {\n                                return Err(de::Error::duplicate_field(\"mpos\"));\n                            }\n                            mpos = Some(map.next_value()?);\n                        }\n                        Field::Isize => {\n                            if isize.is_some() {\n                                return Err(de::Error::duplicate_field(\"isize\"));\n                            }\n                            isize = Some(map.next_value()?);\n                        }\n                        Field::Data => {\n                            if data.is_some() {\n                                return Err(de::Error::duplicate_field(\"data\"));\n                            }\n                            data = Some(map.next_value()?);\n                        }\n                    }\n                }\n\n                let tid = tid.ok_or_else(|| de::Error::missing_field(\"tid\"))?;\n                let pos = pos.ok_or_else(|| de::Error::missing_field(\"pos\"))?;\n                let bin = bin.ok_or_else(|| de::Error::missing_field(\"bin\"))?;\n                let mapq = mapq.ok_or_else(|| de::Error::missing_field(\"mapq\"))?;\n                let qname_len = qname_len.ok_or_else(|| de::Error::missing_field(\"qname_len\"))?;\n                let flag = flag.ok_or_else(|| de::Error::missing_field(\"flag\"))?;\n                let n_cigar = n_cigar.ok_or_else(|| de::Error::missing_field(\"n_cigar\"))?;\n                let seq_len = seq_len.ok_or_else(|| de::Error::missing_field(\"seq_len\"))?;\n                let mtid = mtid.ok_or_else(|| de::Error::missing_field(\"mtid\"))?;\n                let mpos = mpos.ok_or_else(|| de::Error::missing_field(\"mpos\"))?;\n                let isize_ = isize.ok_or_else(|| de::Error::missing_field(\"isize\"))?;\n                let data = data\n                    .ok_or_else(|| de::Error::missing_field(\"data\"))?\n                    .into_vec();\n\n                let mut rec = Record::new();\n                {\n                    let m = &mut rec.inner_mut().core;\n                    m.tid = tid;\n                    m.pos = pos;\n                    m.bin = bin;\n                    m.qual = mapq;\n                    m.l_qname = qname_len;\n                    m.flag = flag;\n                    m.n_cigar = n_cigar;\n                    m.l_qseq = seq_len;\n                    m.mtid = mtid;\n                    m.mpos = mpos;\n                    m.isize_ = isize_;\n                }\n\n                rec.set_data(&data);\n                fix_l_extranul(&mut rec);\n                Ok(rec)\n            }\n        }\n\n        const FIELDS: &[&str] = &[\n            \"tid\", \"pos\", \"bin\", \"qual\", \"l_qname\", \"flag\", \"n_cigar\", \"seq_len\", \"mtid\", \"mpos\",\n            \"isize\", \"data\",\n        ];\n        deserializer.deserialize_struct(\"Record\", FIELDS, RecordVisitor)\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use crate::bam::record::Record;\n    use crate::bam::Read;\n    use crate::bam::Reader;\n\n    use std::path::Path;\n\n    use bincode::{deserialize, serialize};\n    use serde_json;\n\n    #[test]\n    fn test_bincode() {\n        let mut bam = Reader::from_path(Path::new(\"test/test.bam\")).expect(\"Error opening file.\");\n\n        let mut recs = Vec::new();\n        for record in bam.records() {\n            recs.push(record.unwrap());\n        }\n\n        let encoded: Vec<u8> = serialize(&recs).unwrap();\n        let decoded: Vec<Record> = deserialize(&encoded[..]).unwrap();\n        assert_eq!(recs, decoded);\n    }\n\n    #[test]\n    fn test_serde_json() {\n        let mut bam = Reader::from_path(Path::new(\"test/test.bam\")).expect(\"Error opening file.\");\n\n        let mut recs = Vec::new();\n        for record in bam.records() {\n            recs.push(record.unwrap());\n        }\n\n        let encoded: String = serde_json::to_string(&recs).unwrap();\n        println!(\"encoded: {}\", encoded);\n        let decoded: Vec<Record> = serde_json::from_str(&encoded).unwrap();\n        assert_eq!(recs, decoded);\n    }\n}\n"
  },
  {
    "path": "src/bcf/buffer.rs",
    "content": "// Copyright 2017 Johannes Köster.\n// Licensed under the MIT license (http://opensource.org/licenses/MIT)\n// This file may not be copied, modified, or distributed\n// except according to those terms.\n\nuse std::cmp::Ordering;\nuse std::collections::{vec_deque, VecDeque};\nuse std::mem;\n\nuse crate::bcf::{self, Read};\nuse crate::errors::Result;\n\n/// A buffer for BCF records. This allows access regions in a sorted BCF file while iterating\n/// over it in a single pass.\n/// The buffer is implemented as a ringbuffer, such that extension or movement to the right has\n/// linear complexity. The buffer does not use any indexed random access. Hence, for getting a\n/// region at the very end of the BCF, you will have to wait until all records before have\n/// been read.\n#[derive(Debug)]\npub struct RecordBuffer {\n    reader: bcf::Reader,\n    ringbuffer: VecDeque<bcf::Record>,\n    ringbuffer2: VecDeque<bcf::Record>,\n    overflow: Option<bcf::Record>,\n}\n\nunsafe impl Sync for RecordBuffer {}\nunsafe impl Send for RecordBuffer {}\n\nimpl RecordBuffer {\n    /// Create new buffer.\n    pub fn new(reader: bcf::Reader) -> Self {\n        RecordBuffer {\n            reader,\n            ringbuffer: VecDeque::new(),\n            ringbuffer2: VecDeque::new(),\n            overflow: None,\n        }\n    }\n\n    fn last_rid(&self) -> Option<u32> {\n        self.ringbuffer.back().map(|rec| rec.rid().unwrap())\n    }\n\n    fn next_rid(&self) -> Option<u32> {\n        self.ringbuffer2.back().map(|rec| rec.rid().unwrap())\n    }\n\n    fn swap_buffers(&mut self) {\n        // swap with buffer for next rid\n        mem::swap(&mut self.ringbuffer2, &mut self.ringbuffer);\n        // clear second buffer\n        self.ringbuffer2.clear();\n    }\n\n    fn drain_left(&mut self, rid: u32, window_start: u64) -> usize {\n        // remove records too far left or from wrong rid\n        // rec.rid() will always yield Some(), because otherwise we won't put the rec into the\n        // buffer.\n        let to_remove = self\n            .ringbuffer\n            .iter()\n            .take_while(|rec| (rec.pos() as u64) < window_start || rec.rid().unwrap() != rid)\n            .count();\n        self.ringbuffer.drain(..to_remove);\n        to_remove\n    }\n\n    /// Fill the buffer with variants in the given window. The start coordinate has to be right of\n    /// the start coordinate of any previous `fill` operation.\n    /// Coordinates are 0-based, and end is exclusive.\n    /// Returns tuple with numbers of added and deleted records compared to previous fetch.\n    pub fn fetch(&mut self, chrom: &[u8], start: u64, end: u64) -> Result<(usize, usize)> {\n        // TODO panic if start is left of previous start or we have moved past the given chrom\n        // before.\n        let rid = self.reader.header.name2rid(chrom)?;\n        let mut added = 0;\n        let mut deleted = 0;\n\n        // shrink and swap\n        match (self.last_rid(), self.next_rid()) {\n            (Some(last_rid), _) => {\n                if last_rid != rid {\n                    deleted = self.ringbuffer.len();\n                    self.swap_buffers();\n                    added = self.ringbuffer.len();\n                // TODO drain left?\n                } else {\n                    deleted = self.drain_left(rid, start);\n                }\n            }\n            (_, Some(_)) => {\n                // TODO is this really necessary? If there was no fetch before, there is nothing\n                // to delete.\n                deleted = self.ringbuffer.len();\n                self.swap_buffers();\n                deleted += self.drain_left(rid, start);\n                added = self.ringbuffer.len();\n            }\n            _ => (),\n        }\n\n        if !self.ringbuffer2.is_empty() {\n            // We have already read beyond the current rid. Hence we can't extend to the right for\n            // this rid.\n            return Ok((added, deleted));\n        }\n\n        // move overflow from last fill into ringbuffer\n        if self.overflow.is_some() {\n            let pos = self.overflow.as_ref().unwrap().pos() as u64;\n            if pos >= start {\n                if pos <= end {\n                    self.ringbuffer.push_back(self.overflow.take().unwrap());\n                    added += 1;\n                } else {\n                    return Ok((added, deleted));\n                }\n            } else {\n                // discard overflow\n                self.overflow.take();\n            }\n        }\n\n        // extend to the right\n        loop {\n            let mut rec = self.reader.empty_record();\n\n            if self.reader.read(&mut rec).is_none() {\n                // EOF\n                break;\n            }\n            let pos = rec.pos() as u64;\n            if let Some(rec_rid) = rec.rid() {\n                match rec_rid.cmp(&rid) {\n                    Ordering::Equal => {\n                        if pos >= end {\n                            // Record is beyond our window. Store it anyways but stop.\n                            self.overflow = Some(rec);\n                            break;\n                        } else if pos >= start {\n                            // Record is within our window.\n                            self.ringbuffer.push_back(rec);\n                            added += 1;\n                        } else {\n                            // Record is upstream of our window, ignore it\n                            continue;\n                        }\n                    }\n                    Ordering::Greater => {\n                        // record comes from next rid. Store it in second buffer but stop filling.\n                        self.ringbuffer2.push_back(rec);\n                        break;\n                    }\n                    _ => {\n                        // Record comes from previous rid. Ignore it.\n                        continue;\n                    }\n                }\n            } else {\n                // skip records without proper rid\n                continue;\n            }\n        }\n\n        Ok((added, deleted))\n    }\n\n    /// Iterate over records that have been fetched with `fetch`.\n    pub fn iter(&self) -> vec_deque::Iter<'_, bcf::Record> {\n        self.ringbuffer.iter()\n    }\n\n    /// Iterate over mutable references to records that have been fetched with `fetch`.\n    pub fn iter_mut(&mut self) -> vec_deque::IterMut<'_, bcf::Record> {\n        self.ringbuffer.iter_mut()\n    }\n\n    pub fn len(&self) -> usize {\n        self.ringbuffer.len()\n    }\n\n    pub fn is_empty(&self) -> bool {\n        self.len() == 0\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n    use crate::bcf;\n\n    #[test]\n    fn test_buffer() {\n        let reader = bcf::Reader::from_path(\"test/test.bcf\").unwrap();\n        let mut buffer = RecordBuffer::new(reader);\n\n        buffer.fetch(b\"1\", 100, 10023).unwrap();\n        {\n            let records: Vec<_> = buffer.iter().collect();\n            assert_eq!(records.len(), 2);\n            assert_eq!(records[0].pos(), 10021);\n            assert_eq!(records[1].pos(), 10022);\n        }\n\n        buffer.fetch(b\"1\", 10023, 10024).unwrap();\n        {\n            let records: Vec<_> = buffer.iter().collect();\n            assert_eq!(records.len(), 1);\n            assert_eq!(records[0].pos(), 10023);\n        }\n    }\n}\n"
  },
  {
    "path": "src/bcf/header.rs",
    "content": "// Copyright 2014 Johannes Köster.\n// Licensed under the MIT license (http://opensource.org/licenses/MIT)\n// This file may not be copied, modified, or distributed\n// except according to those terms.\n//! Module for working with VCF or BCF headers.\n//!\n//! # Examples\n//! From the header of a VCF file we can\n//!   - Output sample count of a VCF file\n//!   - Output sample names of a VCF file\n//!   - Output sample index given a sample name of a VCF file.\n//! ```\n//! use crate::rust_htslib::bcf::{Reader, Read};\n//! use std::io::Read as IoRead;\n//!\n//! let path = &\"test/test_string.vcf\";\n//! let mut bcf = Reader::from_path(path).expect(\"Error opening file.\");\n//! let header = bcf.header();\n//! assert_eq!(header.sample_count(), 2);  // Sample count\n//! let mut s = String::new();\n//! for (i, mut x) in header.samples().into_iter().enumerate() {\n//!     x.read_to_string(&mut s);  // Read sample name in to `s`\n//!     println!(\"{}\", s);  // output sample name\n//! }\n//! assert_eq!(header.sample_id(b\"one\").unwrap(), 0);  // Sample index wrapped in Option<usize>\n//! assert_eq!(header.sample_id(b\"two\").unwrap(), 1);  // Sample index wrapped in Option<usize>\n//! assert!(header.sample_id(b\"non existent sample\").is_none());  // Return none if not found\n//!\n//! assert_eq!(header.contig_count(), 1); // Number of contig in header.\n//! // obtain the data type of an INFO field\n//! let (tag_type, tag_length) = header.info_type(b\"S1\").unwrap();\n//! let (fmt_type, fmt_length) = header.format_type(b\"GT\").unwrap();\n//! ```\n\nuse std::ffi;\nuse std::os::raw::c_char;\nuse std::slice;\nuse std::str;\nuse std::sync::Arc;\n\nuse crate::htslib;\n\nuse linear_map::LinearMap;\n\nuse crate::errors::{Error, Result};\n\npub type SampleSubset = Vec<i32>;\n\ncustom_derive! {\n    /// A newtype for IDs from BCF headers.\n    #[derive(\n        NewtypeFrom,\n        NewtypeDeref,\n        PartialEq,\n        PartialOrd,\n        Eq,\n        Ord,\n        Copy,\n        Clone,\n        Debug\n    )]\n    pub struct Id(pub u32);\n}\n\n/// A BCF header.\n#[derive(Debug)]\npub struct Header {\n    pub(crate) inner: *mut htslib::bcf_hdr_t,\n    pub subset: Option<SampleSubset>,\n}\n\nunsafe impl Send for Header {}\nunsafe impl Sync for Header {}\n\nimpl Default for Header {\n    fn default() -> Self {\n        Self::new()\n    }\n}\n\nimpl Header {\n    /// Create a new (empty) `Header`.\n    pub fn new() -> Self {\n        let c_str = ffi::CString::new(&b\"w\"[..]).unwrap();\n        Header {\n            inner: unsafe { htslib::bcf_hdr_init(c_str.as_ptr()) },\n            subset: None,\n        }\n    }\n\n    /// Get a pointer to the raw header.\n    ///\n    /// # Safety\n    /// The caller must ensure that the pointer is not used after this `Header`\n    /// is dropped\n    pub unsafe fn inner_ptr(&self) -> *mut htslib::bcf_hdr_t {\n        self.inner\n    }\n\n    /// Create a new `Header` using the given `HeaderView` as the template.\n    ///\n    /// After construction, you can modify the header independently from the template `header`.\n    ///\n    /// # Arguments\n    ///\n    /// - `header` - The `HeaderView` to use as the template.\n    pub fn from_template(header: &HeaderView) -> Self {\n        Header {\n            inner: unsafe { htslib::bcf_hdr_dup(header.inner) },\n            subset: None,\n        }\n    }\n\n    /// Create a new `Header` using the given `HeaderView` as as template, but subsetting to the\n    /// given `samples`.\n    ///\n    /// # Arguments\n    ///\n    /// - `header` - The `HeaderView` to use for the template.\n    /// - `samples` - A slice of byte-encoded (`[u8]`) sample names.\n    pub fn from_template_subset(header: &HeaderView, samples: &[&[u8]]) -> Result<Self> {\n        let mut imap = vec![0; samples.len()];\n        let names: Vec<_> = samples\n            .iter()\n            .map(|&s| ffi::CString::new(s).unwrap())\n            .collect();\n        let name_pointers: Vec<_> = names.iter().map(|s| s.as_ptr() as *mut i8).collect();\n        #[allow(clippy::unnecessary_cast)]\n        let name_pointers_ptr = name_pointers.as_ptr() as *const *mut c_char;\n        let inner = unsafe {\n            htslib::bcf_hdr_subset(\n                header.inner,\n                samples.len() as i32,\n                name_pointers_ptr,\n                imap.as_mut_ptr(),\n            )\n        };\n        if inner.is_null() {\n            Err(Error::BcfDuplicateSampleNames)\n        } else {\n            Ok(Header {\n                inner,\n                subset: Some(imap),\n            })\n        }\n    }\n\n    /// Add a `sample` to the header.\n    ///\n    /// # Arguments\n    ///\n    /// - `sample` - Name of the sample to add (to the end of the sample list).\n    pub fn push_sample(&mut self, sample: &[u8]) -> &mut Self {\n        let c_str = ffi::CString::new(sample).unwrap();\n        unsafe { htslib::bcf_hdr_add_sample(self.inner, c_str.as_ptr()) };\n        self\n    }\n\n    /// Add a record to the header.\n    ///\n    /// # Arguments\n    ///\n    /// - `record` - String representation of the header line\n    ///\n    /// # Example\n    ///\n    /// ```rust,ignore\n    /// header.push_record(format!(\"##contig=<ID={},length={}>\", \"chrX\", 155270560).as_bytes());\n    /// ```\n    pub fn push_record(&mut self, record: &[u8]) -> &mut Self {\n        let c_str = ffi::CString::new(record).unwrap();\n        unsafe { htslib::bcf_hdr_append(self.inner, c_str.as_ptr()) };\n        self\n    }\n\n    /// Remove a `FILTER` entry from the header.\n    ///\n    /// # Arguments\n    ///\n    /// - `tag` - Name of the `FLT` tag to remove.\n    pub fn remove_filter(&mut self, tag: &[u8]) -> &mut Self {\n        self.remove_impl(tag, htslib::BCF_HL_FLT)\n    }\n\n    /// Remove an `INFO` entry from the header.\n    ///\n    /// # Arguments\n    ///\n    /// - `tag` - Name of the `INFO` tag to remove.\n    pub fn remove_info(&mut self, tag: &[u8]) -> &mut Self {\n        self.remove_impl(tag, htslib::BCF_HL_INFO)\n    }\n\n    /// Remove a `FORMAT` entry from the header.\n    ///\n    /// # Arguments\n    ///\n    /// - `tag` - Name of the `FORMAT` tag to remove.\n    pub fn remove_format(&mut self, tag: &[u8]) -> &mut Self {\n        self.remove_impl(tag, htslib::BCF_HL_FMT)\n    }\n\n    /// Remove a contig entry from the header.\n    ///\n    /// # Arguments\n    ///\n    /// - `tag` - Name of the `FORMAT` tag to remove.\n    pub fn remove_contig(&mut self, tag: &[u8]) -> &mut Self {\n        self.remove_impl(tag, htslib::BCF_HL_CTG)\n    }\n\n    /// Remove a structured entry from the header.\n    ///\n    /// # Arguments\n    ///\n    /// - `tag` - Name of the structured tag to remove.\n    pub fn remove_structured(&mut self, tag: &[u8]) -> &mut Self {\n        self.remove_impl(tag, htslib::BCF_HL_STR)\n    }\n\n    /// Remove a generic entry from the header.\n    ///\n    /// # Arguments\n    ///\n    /// - `tag` - Name of the generic tag to remove.\n    pub fn remove_generic(&mut self, tag: &[u8]) -> &mut Self {\n        self.remove_impl(tag, htslib::BCF_HL_GEN)\n    }\n\n    /// Implementation of removing header tags.\n    fn remove_impl(&mut self, tag: &[u8], type_: u32) -> &mut Self {\n        unsafe {\n            let v = tag.to_vec();\n            let c_str = ffi::CString::new(v).unwrap();\n            htslib::bcf_hdr_remove(self.inner, type_ as i32, c_str.as_ptr());\n        }\n        self\n    }\n}\n\nimpl Drop for Header {\n    fn drop(&mut self) {\n        unsafe { htslib::bcf_hdr_destroy(self.inner) };\n    }\n}\n\n/// A header record.\n#[derive(Debug)]\npub enum HeaderRecord {\n    /// A `FILTER` header record.\n    Filter {\n        key: String,\n        values: LinearMap<String, String>,\n    },\n    /// An `INFO` header record.\n    Info {\n        key: String,\n        values: LinearMap<String, String>,\n    },\n    /// A `FORMAT` header record.\n    Format {\n        key: String,\n        values: LinearMap<String, String>,\n    },\n    /// A `contig` header record.\n    Contig {\n        key: String,\n        values: LinearMap<String, String>,\n    },\n    /// A structured header record.\n    Structured {\n        key: String,\n        values: LinearMap<String, String>,\n    },\n    /// A generic, unstructured header record.\n    Generic { key: String, value: String },\n}\n\n#[derive(Debug)]\npub struct HeaderView {\n    pub(crate) inner: *mut htslib::bcf_hdr_t,\n}\n\nunsafe impl Send for HeaderView {}\nunsafe impl Sync for HeaderView {}\n\nimpl HeaderView {\n    /// Create a view from a raw pointer to a header.\n    ///\n    /// # Safety\n    /// The caller must ensure that the header is initialized.\n    pub unsafe fn from_ptr(inner: *mut htslib::bcf_hdr_t) -> Self {\n        HeaderView { inner }\n    }\n\n    /// Get a pointer to the underlying raw header.\n    ///\n    /// # Safety\n    /// The caller must ensure that the pointer is not used after this\n    /// `HeaderView` is dropped\n    pub unsafe fn as_ptr(&self) -> *mut htslib::bcf_hdr_t {\n        self.inner\n    }\n\n    #[inline]\n    fn inner(&self) -> htslib::bcf_hdr_t {\n        unsafe { *self.inner }\n    }\n\n    /// Get the number of samples defined in the header.\n    pub fn sample_count(&self) -> u32 {\n        self.inner().n[htslib::BCF_DT_SAMPLE as usize] as u32\n    }\n\n    /// Get vector of sample names defined in the header.\n    pub fn samples(&self) -> Vec<&[u8]> {\n        let names =\n            unsafe { slice::from_raw_parts(self.inner().samples, self.sample_count() as usize) };\n        names\n            .iter()\n            .map(|name| unsafe { ffi::CStr::from_ptr(*name).to_bytes() })\n            .collect()\n    }\n\n    /// Obtain id (column index) of given sample.\n    /// Returns `None` if sample is not present in header.\n    pub fn sample_id(&self, sample: &[u8]) -> Option<usize> {\n        self.samples().iter().position(|s| *s == sample)\n    }\n\n    /// Get the number of contigs defined in the header.\n    pub fn contig_count(&self) -> u32 {\n        self.inner().n[htslib::BCF_DT_CTG as usize] as u32\n    }\n\n    pub fn rid2name(&self, rid: u32) -> Result<&[u8]> {\n        if rid <= self.contig_count() {\n            unsafe {\n                let dict = self.inner().id[htslib::BCF_DT_CTG as usize];\n                let ptr = (*dict.offset(rid as isize)).key;\n                Ok(ffi::CStr::from_ptr(ptr).to_bytes())\n            }\n        } else {\n            Err(Error::BcfUnknownRID { rid })\n        }\n    }\n\n    /// Retrieve the (internal) chromosome identifier\n    /// # Examples\n    /// ```rust\n    /// use rust_htslib::bcf::header::Header;\n    /// use rust_htslib::bcf::{Format, Writer};\n    ///\n    /// let mut header = Header::new();\n    /// let contig_field = br#\"##contig=<ID=foo,length=10>\"#;\n    /// header.push_record(contig_field);\n    /// let mut vcf = Writer::from_stdout(&header, true, Format::Vcf).unwrap();\n    /// let header_view = vcf.header();\n    /// let rid = header_view.name2rid(b\"foo\").unwrap();\n    /// assert_eq!(rid, 0);\n    /// // try and retrieve a contig not in the header\n    /// let result = header_view.name2rid(b\"bar\");\n    /// assert!(result.is_err())\n    /// ```\n    /// # Errors\n    /// If `name` does not match a chromosome currently in the VCF header, returns [`Error::BcfUnknownContig`]\n    pub fn name2rid(&self, name: &[u8]) -> Result<u32> {\n        let c_str = ffi::CString::new(name).unwrap();\n        unsafe {\n            match htslib::bcf_hdr_id2int(\n                self.inner,\n                htslib::BCF_DT_CTG as i32,\n                c_str.as_ptr() as *mut c_char,\n            ) {\n                -1 => Err(Error::BcfUnknownContig {\n                    contig: str::from_utf8(name).unwrap().to_owned(),\n                }),\n                i => Ok(i as u32),\n            }\n        }\n    }\n\n    pub fn info_type(&self, tag: &[u8]) -> Result<(TagType, TagLength)> {\n        self.tag_type(tag, htslib::BCF_HL_INFO)\n    }\n\n    pub fn format_type(&self, tag: &[u8]) -> Result<(TagType, TagLength)> {\n        self.tag_type(tag, htslib::BCF_HL_FMT)\n    }\n\n    fn tag_type(&self, tag: &[u8], hdr_type: ::libc::c_uint) -> Result<(TagType, TagLength)> {\n        let tag_desc = || str::from_utf8(tag).unwrap().to_owned();\n        let c_str_tag = ffi::CString::new(tag).unwrap();\n        let (_type, length, num_values) = unsafe {\n            let id = htslib::bcf_hdr_id2int(\n                self.inner,\n                htslib::BCF_DT_ID as i32,\n                c_str_tag.as_ptr() as *mut c_char,\n            );\n            if id < 0 {\n                return Err(Error::BcfUndefinedTag { tag: tag_desc() });\n            }\n            let n = (*self.inner).n[htslib::BCF_DT_ID as usize] as usize;\n            let entry = slice::from_raw_parts((*self.inner).id[htslib::BCF_DT_ID as usize], n);\n            let d = (*entry[id as usize].val).info[hdr_type as usize];\n            ((d >> 4) & 0xf, (d >> 8) & 0xf, d >> 12)\n        };\n        let _type = match _type as ::libc::c_uint {\n            htslib::BCF_HT_FLAG => TagType::Flag,\n            htslib::BCF_HT_INT => TagType::Integer,\n            htslib::BCF_HT_REAL => TagType::Float,\n            htslib::BCF_HT_STR => TagType::String,\n            _ => return Err(Error::BcfUnexpectedType { tag: tag_desc() }),\n        };\n        let length = match length as ::libc::c_uint {\n            // XXX: Hacky \"as u32\" cast. Trace back through unsafe{} towards BCF struct and rollback to proper type\n            htslib::BCF_VL_FIXED => TagLength::Fixed(num_values as u32),\n            htslib::BCF_VL_VAR => TagLength::Variable,\n            htslib::BCF_VL_A => TagLength::AltAlleles,\n            htslib::BCF_VL_R => TagLength::Alleles,\n            htslib::BCF_VL_G => TagLength::Genotypes,\n            _ => return Err(Error::BcfUnexpectedType { tag: tag_desc() }),\n        };\n\n        Ok((_type, length))\n    }\n\n    /// Convert string ID (e.g., for a `FILTER` value) to its numeric identifier.\n    pub fn name_to_id(&self, id: &[u8]) -> Result<Id> {\n        let c_str = ffi::CString::new(id).unwrap();\n        unsafe {\n            match htslib::bcf_hdr_id2int(\n                self.inner,\n                htslib::BCF_DT_ID as i32,\n                c_str.as_ptr() as *const c_char,\n            ) {\n                -1 => Err(Error::BcfUnknownID {\n                    id: str::from_utf8(id).unwrap().to_owned(),\n                }),\n                i => Ok(Id(i as u32)),\n            }\n        }\n    }\n\n    /// Convert integer representing an identifier (e.g., a `FILTER` value) to its string\n    /// name.bam.\n    pub fn id_to_name(&self, id: Id) -> Vec<u8> {\n        let key = unsafe {\n            ffi::CStr::from_ptr(\n                (*(*self.inner).id[htslib::BCF_DT_ID as usize].offset(*id as isize)).key,\n            )\n        };\n        key.to_bytes().to_vec()\n    }\n\n    /// Convert string sample name to its numeric identifier.\n    pub fn sample_to_id(&self, id: &[u8]) -> Result<Id> {\n        let c_str = ffi::CString::new(id).unwrap();\n        unsafe {\n            match htslib::bcf_hdr_id2int(\n                self.inner,\n                htslib::BCF_DT_SAMPLE as i32,\n                c_str.as_ptr() as *const c_char,\n            ) {\n                -1 => Err(Error::BcfUnknownSample {\n                    name: str::from_utf8(id).unwrap().to_owned(),\n                }),\n                i => Ok(Id(i as u32)),\n            }\n        }\n    }\n\n    /// Convert integer representing an contig to its name.\n    pub fn id_to_sample(&self, id: Id) -> Vec<u8> {\n        let key = unsafe {\n            ffi::CStr::from_ptr(\n                (*(*self.inner).id[htslib::BCF_DT_SAMPLE as usize].offset(*id as isize)).key,\n            )\n        };\n        key.to_bytes().to_vec()\n    }\n\n    /// Return structured `HeaderRecord`s.\n    pub fn header_records(&self) -> Vec<HeaderRecord> {\n        fn parse_kv(rec: &htslib::bcf_hrec_t) -> LinearMap<String, String> {\n            let mut result: LinearMap<String, String> = LinearMap::new();\n            for i in 0_i32..(rec.nkeys) {\n                let key = unsafe {\n                    ffi::CStr::from_ptr(*rec.keys.offset(i as isize))\n                        .to_str()\n                        .unwrap()\n                        .to_string()\n                };\n                let value = unsafe {\n                    ffi::CStr::from_ptr(*rec.vals.offset(i as isize))\n                        .to_str()\n                        .unwrap()\n                        .to_string()\n                };\n                result.insert(key, value);\n            }\n            result\n        }\n\n        let mut result: Vec<HeaderRecord> = Vec::new();\n        for i in 0_i32..unsafe { (*self.inner).nhrec } {\n            let rec = unsafe { &(**(*self.inner).hrec.offset(i as isize)) };\n            let key = unsafe { ffi::CStr::from_ptr(rec.key).to_str().unwrap().to_string() };\n            let record = match rec.type_ {\n                0 => HeaderRecord::Filter {\n                    key,\n                    values: parse_kv(rec),\n                },\n                1 => HeaderRecord::Info {\n                    key,\n                    values: parse_kv(rec),\n                },\n                2 => HeaderRecord::Format {\n                    key,\n                    values: parse_kv(rec),\n                },\n                3 => HeaderRecord::Contig {\n                    key,\n                    values: parse_kv(rec),\n                },\n                4 => HeaderRecord::Structured {\n                    key,\n                    values: parse_kv(rec),\n                },\n                5 => HeaderRecord::Generic {\n                    key,\n                    value: unsafe { ffi::CStr::from_ptr(rec.value).to_str().unwrap().to_string() },\n                },\n                _ => panic!(\"Unknown type: {}\", rec.type_),\n            };\n            result.push(record);\n        }\n        result\n    }\n\n    /// Create an empty record using this header view.\n    ///\n    /// The record can be reused multiple times.\n    pub fn empty_record(self: &Arc<Self>) -> crate::bcf::Record {\n        crate::bcf::Record::new(self.clone())\n    }\n}\n\nimpl Clone for HeaderView {\n    fn clone(&self) -> Self {\n        HeaderView {\n            inner: unsafe { htslib::bcf_hdr_dup(self.inner) },\n        }\n    }\n}\n\nimpl Drop for HeaderView {\n    fn drop(&mut self) {\n        unsafe {\n            htslib::bcf_hdr_destroy(self.inner);\n        }\n    }\n}\n\n#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]\npub enum TagType {\n    Flag,\n    Integer,\n    Float,\n    String,\n}\n\n#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]\npub enum TagLength {\n    Fixed(u32),\n    AltAlleles,\n    Alleles,\n    Genotypes,\n    Variable,\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n    use crate::bcf::Reader;\n    use crate::htslib;\n\n    #[test]\n    fn test_header_view_empty_record() {\n        // Open a VCF file to get a HeaderView\n        let vcf = Reader::from_path(\"test/test_string.vcf\").expect(\"Error opening file\");\n        let header_view = vcf.header.clone();\n\n        // Create an empty record from the HeaderView\n        let record = header_view.empty_record();\n        eprintln!(\"{:?}\", record.rid());\n\n        // Verify the record is properly initialized with default/empty values\n        assert_eq!(record.rid(), Some(0)); // No chromosome/contig set\n        assert_eq!(record.pos(), 0); // No position set\n        assert_eq!(record.qual(), 0.0); // No quality score set\n    }\n\n    #[test]\n    fn test_header_add_sample_via_raw_pointer() {\n        let sample_name = b\"test-sample\";\n\n        let header = Header::new();\n        let sample = std::ffi::CString::new(sample_name).unwrap();\n\n        let view = unsafe {\n            let ptr = header.inner_ptr();\n            // to avoid double free, as we will wrap this later in a HeaderView\n            std::mem::forget(header);\n            htslib::bcf_hdr_add_sample(ptr, sample.as_ptr());\n            htslib::bcf_hdr_sync(ptr);\n            // When the HeaderView is dropped, the bcf_hdr is freed\n            HeaderView::from_ptr(ptr)\n        };\n\n        assert_eq!(view.samples(), vec![sample_name]);\n    }\n\n    #[test]\n    fn test_header_view_version_via_raw_pointer() {\n        let vcf = Reader::from_path(\"test/test_string.vcf\").expect(\"Error opening file\");\n        let hv = vcf.header.clone();\n\n        let version = unsafe {\n            // the header view will outlive this pointer\n            let ptr = hv.as_ptr();\n            let version_charptr = htslib::bcf_hdr_get_version(ptr);\n            std::ffi::CStr::from_ptr(version_charptr).to_str().unwrap()\n        };\n\n        assert_eq!(version, \"VCFv4.1\");\n    }\n}\n"
  },
  {
    "path": "src/bcf/index.rs",
    "content": "use crate::{htslib, utils};\n\n#[derive(Debug)]\npub struct BcfBuildError {\n    pub msg: String,\n}\n\n/// Index type to build.\npub enum Type {\n    /// Tabix index\n    Tbx,\n    /// CSI index, with given minimum shift\n    Csi(u32),\n}\n\nimpl Type {\n    fn min_shift(&self) -> i32 {\n        match self {\n            Self::Tbx => 0,\n            Self::Csi(x) => *x as i32,\n        }\n    }\n}\n\nimpl BcfBuildError {\n    pub fn error_message(error: i32) -> &'static str {\n        match error {\n            -1 => \"indexing failed\",\n            -2 => \"opening @fn failed\",\n            -3 => \"format not indexable\",\n            -4 => \"failed to create and/or save the index\",\n            _ => \"unknown error\",\n        }\n    }\n}\nimpl std::error::Error for BcfBuildError {}\n\nimpl std::fmt::Display for BcfBuildError {\n    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {\n        write!(f, \"BcfBuildError{{msg: {}}}\", self.msg)\n    }\n}\n\n/// Build a bcf or vcf.gz index.\n/// Builds tbi or csi depending on index_type.\n///\n///```\n/// // Index a sorted bcf file with csi.\n/// let bcf_path = concat!(env!(\"CARGO_MANIFEST_DIR\"), \"/test/test_multi.bcf\");\n/// rust_htslib::bcf::index::build(&bcf_path, Some(&\"built_test.csi\"), /*n_threads=*/ 4u32, rust_htslib::bcf::index::Type::Csi(14)).expect(\"Failed to build csi index for bcf file.\");\n/// assert!(std::path::Path::new(&\"built_test.csi\").exists());\n///\n/// // Index a bgzip-compresed vcf file with tabix.\n/// let vcf_path = concat!(env!(\"CARGO_MANIFEST_DIR\"), \"/test/test_left.vcf.gz\");\n/// rust_htslib::bcf::index::build(&vcf_path, Some(&\"built_test_vcf.tbx\"), /*n_threads=*/ 4u32, rust_htslib::bcf::index::Type::Tbx).expect(\"Failed to build tbx index for vcf file.\");\n/// assert!(std::path::Path::new(&\"built_test_vcf.tbx\").exists());\n///\n/// // Cannot build a tbi index for a bcf file: returns an Err(BcfBuildError).\n/// assert!(std::panic::catch_unwind(|| rust_htslib::bcf::index::build(bcf_path, Some(\"built_test.tbi\"), 4u32, rust_htslib::bcf::index::Type::Tbx).unwrap()).is_err());\n///\n/// // Cannot built a csi index for a vcf file: returns an Err(BcfBuildError).\n/// let vcf_path = concat!(env!(\"CARGO_MANIFEST_DIR\"), \"/test/test_various.vcf\");\n/// assert!(std::panic::catch_unwind(|| rust_htslib::bcf::index::build(&vcf_path, Some(&\"built_test_vcf.csi\"), /*n_threads=*/ 4u32, rust_htslib::bcf::index::Type::Csi(14)).expect(\"Failed to build csi index for vcf file.\")).is_err());\n///```\n///\npub fn build<P: AsRef<std::path::Path>>(\n    bcf_path: P,\n    idx_path: Option<P>,\n    n_threads: u32,\n    index_type: Type,\n) -> Result<(), BcfBuildError> {\n    let min_shift = index_type.min_shift();\n    let idx_path_cstr = idx_path.and_then(|x| utils::path_to_cstring(&x));\n    let bcf_path = utils::path_to_cstring(&bcf_path).ok_or(BcfBuildError {\n        msg: format!(\n            \"Failed to format bcf_path to cstring: {:?}\",\n            bcf_path.as_ref().display()\n        ),\n    })?;\n    let return_code = unsafe {\n        htslib::bcf_index_build3(\n            bcf_path.as_ptr(),\n            idx_path_cstr\n                .as_ref()\n                .map_or(std::ptr::null(), |p| p.as_ptr()),\n            min_shift,\n            n_threads as i32,\n        )\n    };\n    if return_code == 0 {\n        Ok(())\n    } else {\n        Err(BcfBuildError {\n            msg: format!(\n                \"Failed to build  bcf index. Error: {return_code:?}/{}\",\n                BcfBuildError::error_message(return_code)\n            ),\n        })\n    }\n}\n"
  },
  {
    "path": "src/bcf/mod.rs",
    "content": "// Copyright 2014 Johannes Köster.\n// Licensed under the MIT license (http://opensource.org/licenses/MIT)\n// This file may not be copied, modified, or distributed\n// except according to those terms.\n\n//! Module for working with VCF and BCF files.\n//!\n//! # Performance Remarks\n//!\n//! Note that BCF corresponds to the in-memory representation of BCF/VCF records in Htslib\n//! itself. Thus, it comes without a runtime penalty for parsing, in contrast to reading VCF\n//! files.\n//!\n//! # Example (reading)\n//!\n//!   - Obtaining 0-based locus index of the VCF record.\n//!   - Obtaining alleles of the VCF record.\n//!   - calculate alt-allele dosage in a mutli-sample VCF / BCF\n//!\n//! ```\n//! use crate::rust_htslib::bcf::{Reader, Read};\n//! use std::convert::TryFrom;\n//!\n//! let path = &\"test/test_string.vcf\";\n//! let mut bcf = Reader::from_path(path).expect(\"Error opening file.\");\n//! // iterate through each row of the vcf body.\n//! for (i, record_result) in bcf.records().enumerate() {\n//!     let mut record = record_result.expect(\"Fail to read record\");\n//!     let mut s = String::new();\n//!      for allele in record.alleles() {\n//!          for c in allele {\n//!              s.push(char::from(*c))\n//!          }\n//!          s.push(' ')\n//!      }\n//!     // 0-based position and the list of alleles\n//!     println!(\"Locus: {}, Alleles: {}\", record.pos(), s);\n//!     // number of sample in the vcf\n//!     let sample_count = usize::try_from(record.sample_count()).unwrap();\n//!\n//!     // Counting ref, alt and missing alleles for each sample\n//!     let mut n_ref = vec![0; sample_count];\n//!     let mut n_alt = vec![0; sample_count];\n//!     let mut n_missing = vec![0; sample_count];\n//!     let gts = record.genotypes().expect(\"Error reading genotypes\");\n//!     for sample_index in 0..sample_count {\n//!         // for each sample\n//!         for gta in gts.get(sample_index).iter() {\n//!             // for each allele\n//!             match gta.index() {\n//!                 Some(0) => n_ref[sample_index] += 1,  // reference allele\n//!                 Some(_) => n_alt[sample_index] += 1,  // alt allele\n//!                 None => n_missing[sample_index] += 1, // missing allele\n//!             }\n//!         }\n//!     }\n//! }\n//! ```\n//!\n//! # Example (writing)\n//!\n//!   - Setting up a VCF writer from scratch (including a simple header)\n//!   - Creating a VCF record and writing it to the VCF file\n//!\n//! ```\n//! use rust_htslib::bcf::{Format, Writer};\n//! use rust_htslib::bcf::header::Header;\n//! use rust_htslib::bcf::record::GenotypeAllele;\n//!\n//! // Create minimal VCF header with a single contig and a single sample\n//! let mut header = Header::new();\n//! let header_contig_line = r#\"##contig=<ID=1,length=10>\"#;\n//! header.push_record(header_contig_line.as_bytes());\n//! let header_gt_line = r#\"##FORMAT=<ID=GT,Number=1,Type=String,Description=\"Genotype\">\"#;\n//! header.push_record(header_gt_line.as_bytes());\n//! header.push_sample(\"test_sample\".as_bytes());\n//!\n//! // Write uncompressed VCF to stdout with above header and get an empty record\n//! let mut vcf = Writer::from_stdout(&header, true, Format::Vcf).unwrap();\n//! let mut record = vcf.empty_record();\n//!\n//! // Set chrom and pos to 1 and 7, respectively - note the 0-based positions\n//! let rid = vcf.header().name2rid(b\"1\").unwrap();\n//! record.set_rid(Some(rid));\n//! record.set_pos(6);\n//!\n//! // Set record genotype to 0|1 - note first allele is always unphased\n//! let alleles = &[GenotypeAllele::Unphased(0), GenotypeAllele::Phased(1)];\n//! record.push_genotypes(alleles).unwrap();\n//!\n//! // Write record\n//! vcf.write(&record).unwrap()\n//! ```\n//!\n//! This will print the following VCF to stdout:\n//!\n//! ```lang-none\n//! ##fileformat=VCFv4.2\n//! ##FILTER=<ID=PASS,Description=\"All filters passed\">\n//! ##contig=<ID=1,length=10>\n//! ##FORMAT=<ID=GT,Number=1,Type=String,Description=\"Genotype\">\n//! #CHROM  POS     ID      REF     ALT     QUAL    FILTER  INFO    FORMAT  test_sample\n//! 1       7       .       .       .       0       .       .       GT      0|1\n//! ```\n\nuse std::ffi;\nuse std::path::Path;\nuse std::str;\nuse std::sync::Arc;\n\nuse url::Url;\n\npub mod buffer;\npub mod header;\npub mod index;\npub mod record;\n\nuse crate::bcf::header::{HeaderView, SampleSubset};\nuse crate::errors::{Error, Result};\nuse crate::htslib;\n\npub use crate::bcf::header::{Header, HeaderRecord};\npub use crate::bcf::record::Record;\n\n/// A trait for a BCF reader with a read method.\npub trait Read: Sized {\n    /// Read the next record.\n    ///\n    /// # Arguments\n    /// * record - an empty record, that can be created with `bcf::Reader::empty_record`.\n    ///\n    /// # Returns\n    /// None if end of file was reached, otherwise Some will contain\n    /// a result with an error in case of failure.\n    fn read(&mut self, record: &mut record::Record) -> Option<Result<()>>;\n\n    /// Return an iterator over all records of the VCF/BCF file.\n    fn records(&mut self) -> Records<'_, Self>;\n\n    /// Return the header.\n    fn header(&self) -> &HeaderView;\n\n    /// Return empty record.  Can be reused multiple times.\n    fn empty_record(&self) -> Record;\n\n    /// Activate multi-threaded BCF/VCF read support in htslib. This should permit faster\n    /// reading of large VCF files.\n    ///\n    /// Setting `nthreads` to `0` does not change the current state.  Note that it is not\n    /// possible to set the number of background threads below `1` once it has been set.\n    ///\n    /// # Arguments\n    ///\n    /// * `n_threads` - number of extra background writer threads to use, must be `> 0`.\n    fn set_threads(&mut self, n_threads: usize) -> Result<()>;\n}\n\n/// A VCF/BCF reader.\n#[derive(Debug)]\npub struct Reader {\n    inner: *mut htslib::htsFile,\n    header: Arc<HeaderView>,\n}\n\nunsafe impl Send for Reader {}\n\n/// # Safety\n///\n/// Implementation for `Reader::set_threads()` and `Writer::set_threads`.\npub unsafe fn set_threads(hts_file: *mut htslib::htsFile, n_threads: usize) -> Result<()> {\n    assert!(n_threads > 0, \"n_threads must be > 0\");\n\n    let r = htslib::hts_set_threads(hts_file, n_threads as i32);\n    if r != 0 {\n        Err(Error::SetThreads)\n    } else {\n        Ok(())\n    }\n}\n\nimpl Reader {\n    /// Create a new reader from a given path.\n    pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self> {\n        match path.as_ref().to_str() {\n            Some(p) if !path.as_ref().exists() => Err(Error::FileNotFound { path: p.into() }),\n            Some(p) => Self::new(p.as_bytes()),\n            _ => Err(Error::NonUnicodePath),\n        }\n    }\n\n    /// Create a new reader from a given URL.\n    pub fn from_url(url: &Url) -> Result<Self> {\n        Self::new(url.as_str().as_bytes())\n    }\n\n    /// Create a new reader from standard input.\n    pub fn from_stdin() -> Result<Self> {\n        Self::new(b\"-\")\n    }\n\n    fn new(path: &[u8]) -> Result<Self> {\n        let htsfile = bcf_open(path, b\"r\")?;\n        let header = unsafe { htslib::bcf_hdr_read(htsfile) };\n        Ok(Reader {\n            inner: htsfile,\n            header: Arc::new(unsafe { HeaderView::from_ptr(header) }),\n        })\n    }\n}\n\nimpl Read for Reader {\n    fn read(&mut self, record: &mut record::Record) -> Option<Result<()>> {\n        match unsafe { htslib::bcf_read(self.inner, self.header.inner, record.inner) } {\n            0 => {\n                unsafe {\n                    // Always unpack record.\n                    htslib::bcf_unpack(record.inner_mut(), htslib::BCF_UN_ALL as i32);\n                }\n                record.set_header(Arc::clone(&self.header));\n                Some(Ok(()))\n            }\n            -1 => None,\n            _ => Some(Err(Error::BcfInvalidRecord)),\n        }\n    }\n\n    fn records(&mut self) -> Records<'_, Self> {\n        Records::new(self)\n    }\n\n    fn set_threads(&mut self, n_threads: usize) -> Result<()> {\n        unsafe { set_threads(self.inner, n_threads) }\n    }\n\n    fn header(&self) -> &HeaderView {\n        &self.header\n    }\n\n    /// Return empty record.  Can be reused multiple times.\n    fn empty_record(&self) -> Record {\n        Record::new(self.header.clone())\n    }\n}\n\nimpl Drop for Reader {\n    fn drop(&mut self) {\n        unsafe {\n            htslib::hts_close(self.inner);\n        }\n    }\n}\n\n/// An indexed VCF/BCF reader.\n#[derive(Debug)]\npub struct IndexedReader {\n    /// The synced VCF/BCF reader to use internally.\n    inner: *mut htslib::bcf_srs_t,\n    /// The header.\n    header: Arc<HeaderView>,\n\n    /// The position of the previous fetch, if any.\n    current_region: Option<(u32, u64, Option<u64>)>,\n}\n\nunsafe impl Send for IndexedReader {}\n\nimpl IndexedReader {\n    /// Create a new `IndexedReader` from path.\n    ///\n    /// # Arguments\n    ///\n    /// * `path` - the path to open.\n    pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self> {\n        let path = path.as_ref();\n        match path.to_str() {\n            Some(p) if path.exists() => {\n                Self::new(&ffi::CString::new(p).map_err(|_| Error::NonUnicodePath)?)\n            }\n            Some(p) => Err(Error::FileNotFound { path: p.into() }),\n            None => Err(Error::NonUnicodePath),\n        }\n    }\n\n    /// Create a new `IndexedReader` from an URL.\n    pub fn from_url(url: &Url) -> Result<Self> {\n        Self::new(&ffi::CString::new(url.as_str()).unwrap())\n    }\n\n    /// Create a new `IndexedReader`.\n    ///\n    /// # Arguments\n    ///\n    /// * `path` - the path. Use \"-\" for stdin.\n    fn new(path: &ffi::CStr) -> Result<Self> {\n        // Create reader and require existence of index file.\n        let ser_reader = unsafe { htslib::bcf_sr_init() };\n        unsafe {\n            htslib::bcf_sr_set_opt(ser_reader, 0);\n        } // 0: BCF_SR_REQUIRE_IDX\n          // Attach a file with the path from the arguments.\n        if unsafe { htslib::bcf_sr_add_reader(ser_reader, path.as_ptr()) } >= 0 {\n            let header = Arc::new(unsafe {\n                HeaderView::from_ptr(htslib::bcf_hdr_dup(\n                    (*(*ser_reader).readers.offset(0)).header,\n                ))\n            });\n            Ok(IndexedReader {\n                inner: ser_reader,\n                header,\n                current_region: None,\n            })\n        } else {\n            Err(Error::BcfOpen {\n                target: path.to_str().unwrap().to_owned(),\n            })\n        }\n    }\n\n    /// Jump to the given region.\n    ///\n    /// # Arguments\n    ///\n    /// * `rid` - numeric ID of the reference to jump to; use `HeaderView::name2rid` for resolving\n    ///   contig name to ID.\n    /// * `start` - `0`-based **inclusive** start coordinate of region on reference.\n    /// * `end` - Optional `0`-based **inclusive** end coordinate of region on reference. If `None`\n    ///   is given, records are fetched from `start` until the end of the contig.\n    ///\n    /// # Note\n    /// The entire contig can be fetched by setting `start` to `0` and `end` to `None`.\n    pub fn fetch(&mut self, rid: u32, start: u64, end: Option<u64>) -> Result<()> {\n        let contig = self.header.rid2name(rid)?;\n        let contig = ffi::CString::new(contig).unwrap();\n        if unsafe { htslib::bcf_sr_seek(self.inner, contig.as_ptr(), start as i64) } != 0 {\n            Err(Error::GenomicSeek {\n                contig: contig.to_str().unwrap().to_owned(),\n                start,\n            })\n        } else {\n            self.current_region = Some((rid, start, end));\n            Ok(())\n        }\n    }\n}\n\nimpl Read for IndexedReader {\n    fn read(&mut self, record: &mut record::Record) -> Option<Result<()>> {\n        match unsafe { htslib::bcf_sr_next_line(self.inner) } {\n            0 => {\n                if unsafe { (*self.inner).errnum } != 0 {\n                    Some(Err(Error::BcfInvalidRecord))\n                } else {\n                    None\n                }\n            }\n            i => {\n                assert!(i > 0, \"Must not be negative\");\n                // Note that the sync BCF reader has a different interface than the others\n                // as it keeps its own buffer already for each record.  An alternative here\n                // would be to replace the `inner` value by an enum that can be a pointer\n                // into a synced reader or an owning popinter to an allocated record.\n                unsafe {\n                    htslib::bcf_copy(\n                        record.inner,\n                        *(*(*self.inner).readers.offset(0)).buffer.offset(0),\n                    );\n                }\n\n                unsafe {\n                    // Always unpack record.\n                    htslib::bcf_unpack(record.inner_mut(), htslib::BCF_UN_ALL as i32);\n                }\n\n                record.set_header(Arc::clone(&self.header));\n\n                match self.current_region {\n                    Some((rid, _start, end)) => {\n                        let endpos = end.unwrap_or(u64::MAX);\n                        if Some(rid) == record.rid() && record.pos() as u64 <= endpos {\n                            Some(Ok(()))\n                        } else {\n                            None\n                        }\n                    }\n                    None => Some(Ok(())),\n                }\n            }\n        }\n    }\n\n    fn records(&mut self) -> Records<'_, Self> {\n        Records::new(self)\n    }\n\n    fn set_threads(&mut self, n_threads: usize) -> Result<()> {\n        assert!(n_threads > 0, \"n_threads must be > 0\");\n\n        let r = unsafe { htslib::bcf_sr_set_threads(self.inner, n_threads as i32) };\n        if r != 0 {\n            Err(Error::SetThreads)\n        } else {\n            Ok(())\n        }\n    }\n\n    fn header(&self) -> &HeaderView {\n        &self.header\n    }\n\n    fn empty_record(&self) -> Record {\n        Record::new(self.header.clone())\n    }\n}\n\nimpl Drop for IndexedReader {\n    fn drop(&mut self) {\n        unsafe { htslib::bcf_sr_destroy(self.inner) };\n    }\n}\n\n/// This module contains the `SyncedReader` class and related code.\npub mod synced {\n\n    use super::*;\n\n    /// This module contains bitmask constants for `SyncedReader`.\n    pub mod pairing {\n        /// Allow different alleles, as long as they all are SNPs.\n        pub const SNPS: u32 = crate::htslib::BCF_SR_PAIR_SNPS;\n        /// The same as above, but with indels.\n        pub const INDELS: u32 = crate::htslib::BCF_SR_PAIR_INDELS;\n        /// Any combination of alleles can be returned by `bcf_sr_next_line()`.\n        pub const ANY: u32 = crate::htslib::BCF_SR_PAIR_ANY;\n        /// At least some of multiallelic ALTs must match.  Implied by all the others with the exception of `EXACT`.\n        pub const SOME: u32 = crate::htslib::BCF_SR_PAIR_SOME;\n        /// Allow REF-only records with SNPs.\n        pub const SNP_REF: u32 = crate::htslib::BCF_SR_PAIR_SNP_REF;\n        /// Allow REF-only records with indels.\n        pub const INDEL_REF: u32 = crate::htslib::BCF_SR_PAIR_INDEL_REF;\n        /// Require the exact same set of alleles in all files.\n        pub const EXACT: u32 = crate::htslib::BCF_SR_PAIR_EXACT;\n        /// `SNPS | INDELS`.\n        pub const BOTH: u32 = crate::htslib::BCF_SR_PAIR_BOTH;\n        /// `SNPS | INDELS | SNP_REF | INDEL_REF`.\n        pub const BOTH_REF: u32 = crate::htslib::BCF_SR_PAIR_BOTH_REF;\n    }\n\n    /// A wrapper for `bcf_srs_t`; allows joint traversal of multiple VCF and/or BCF files.\n    #[derive(Debug)]\n    pub struct SyncedReader {\n        /// Internal handle for the synced reader.\n        inner: *mut crate::htslib::bcf_srs_t,\n\n        /// Arcs of `HeaderView`s of the readers.\n        headers: Vec<Arc<HeaderView>>,\n\n        /// The position of the previous fetch, if any.\n        current_region: Option<(u32, u64, u64)>,\n    }\n\n    // TODO: add interface for setting threads, ensure that the pool is freed properly\n    impl SyncedReader {\n        pub fn new() -> Result<Self> {\n            let inner = unsafe { crate::htslib::bcf_sr_init() };\n            if inner.is_null() {\n                return Err(Error::BcfAllocationError);\n            }\n\n            Ok(SyncedReader {\n                inner,\n                headers: Vec::new(),\n                current_region: None,\n            })\n        }\n\n        /// Enable or disable requiring of index\n        pub fn set_require_index(&mut self, do_require: bool) {\n            unsafe {\n                (*self.inner).require_index = if do_require { 1 } else { 0 };\n            }\n        }\n\n        /// Set the given bitmask of values from `sr_pairing` module.\n        pub fn set_pairing(&mut self, bitmask: u32) {\n            unsafe {\n                // TODO: 1 actually is BCF_SR_PAIR_LOGIC but is not available here?\n                crate::htslib::bcf_sr_set_opt(self.inner, 1, bitmask);\n            }\n        }\n\n        /// Add new reader with the path to the file.\n        pub fn add_reader<P: AsRef<Path>>(&mut self, path: P) -> Result<()> {\n            match path.as_ref().to_str() {\n                Some(p) if path.as_ref().exists() => {\n                    let p_cstring = ffi::CString::new(p).unwrap();\n                    let res =\n                        unsafe { crate::htslib::bcf_sr_add_reader(self.inner, p_cstring.as_ptr()) };\n\n                    if res == 0 {\n                        return Err(Error::BcfOpen {\n                            target: p.to_owned(),\n                        });\n                    }\n\n                    let i = (self.reader_count() - 1) as isize;\n                    let header = Arc::new(unsafe {\n                        HeaderView::from_ptr(crate::htslib::bcf_hdr_dup(\n                            (*(*self.inner).readers.offset(i)).header,\n                        ))\n                    });\n                    self.headers.push(header);\n                    Ok(())\n                }\n                _ => Err(Error::NonUnicodePath),\n            }\n        }\n\n        /// Remove reader with the given index.\n        pub fn remove_reader(&mut self, idx: u32) {\n            if idx >= self.reader_count() {\n                panic!(\"Invalid reader!\");\n            } else {\n                unsafe {\n                    crate::htslib::bcf_sr_remove_reader(self.inner, idx as i32);\n                }\n                self.headers.remove(idx as usize);\n            }\n        }\n\n        /// Return number of open files/readers.\n        pub fn reader_count(&self) -> u32 {\n            unsafe { (*self.inner).nreaders as u32 }\n        }\n\n        /// Read next line and return number of readers that have the given line (0 if end of all files is reached).\n        pub fn read_next(&mut self) -> Result<u32> {\n            let num = unsafe { crate::htslib::bcf_sr_next_line(self.inner) as u32 };\n\n            if num == 0 {\n                if unsafe { (*self.inner).errnum } != 0 {\n                    return Err(Error::BcfInvalidRecord);\n                }\n                Ok(0)\n            } else {\n                assert!(num > 0, \"num returned by htslib must not be negative\");\n                match self.current_region {\n                    Some((rid, _start, end)) => {\n                        for idx in 0..self.reader_count() {\n                            if !self.has_line(idx) {\n                                continue;\n                            }\n                            unsafe {\n                                let record = *(*(*self.inner).readers.offset(idx as isize))\n                                    .buffer\n                                    .offset(0);\n                                if (*record).rid != (rid as i32) || (*record).pos >= (end as i64) {\n                                    return Ok(0);\n                                }\n                            }\n                        }\n                        Ok(num)\n                    }\n                    None => Ok(num),\n                }\n            }\n        }\n\n        /// Return whether the given reader has the line.\n        pub fn has_line(&self, idx: u32) -> bool {\n            if idx >= self.reader_count() {\n                panic!(\"Invalid reader!\");\n            } else {\n                unsafe { (*(*self.inner).has_line.offset(idx as isize)) != 0 }\n            }\n        }\n\n        /// Return record from the given reader, if any.\n        pub fn record(&self, idx: u32) -> Option<Record> {\n            if self.has_line(idx) {\n                let record = Record::new(self.headers[idx as usize].clone());\n                unsafe {\n                    crate::htslib::bcf_copy(\n                        record.inner,\n                        *(*(*self.inner).readers.offset(idx as isize))\n                            .buffer\n                            .offset(0),\n                    );\n                }\n                Some(record)\n            } else {\n                None\n            }\n        }\n\n        /// Return header from the given reader.\n        pub fn header(&self, idx: u32) -> &HeaderView {\n            // TODO: is the mutability here correct?\n            if idx >= self.reader_count() {\n                panic!(\"Invalid reader!\");\n            } else {\n                &self.headers[idx as usize]\n            }\n        }\n\n        /// Jump to the given region.\n        ///\n        /// # Arguments\n        ///\n        /// * `rid` - numeric ID of the reference to jump to; use `HeaderView::name2rid` for resolving\n        ///   contig name to ID.\n        /// * `start` - `0`-based start coordinate of region on reference.\n        /// * `end` - `0`-based end coordinate of region on reference.\n        pub fn fetch(&mut self, rid: u32, start: u64, end: u64) -> Result<()> {\n            let contig = {\n                let contig = self.header(0).rid2name(rid).unwrap(); //.clone();\n                ffi::CString::new(contig).unwrap()\n            };\n            if unsafe { htslib::bcf_sr_seek(self.inner, contig.as_ptr(), start as i64) } != 0 {\n                Err(Error::GenomicSeek {\n                    contig: contig.to_str().unwrap().to_owned(),\n                    start,\n                })\n            } else {\n                self.current_region = Some((rid, start, end));\n                Ok(())\n            }\n        }\n    }\n\n    impl Drop for SyncedReader {\n        fn drop(&mut self) {\n            unsafe { crate::htslib::bcf_sr_destroy(self.inner) };\n        }\n    }\n}\n\n#[derive(Clone, Copy, Debug, PartialEq, Eq)]\npub enum Format {\n    Vcf,\n    Bcf,\n}\n\n/// A VCF/BCF writer.\n#[derive(Debug)]\npub struct Writer {\n    inner: *mut htslib::htsFile,\n    header: Arc<HeaderView>,\n    subset: Option<SampleSubset>,\n}\n\nunsafe impl Send for Writer {}\n\nimpl Writer {\n    /// Create a new writer that writes to the given path.\n    ///\n    /// # Arguments\n    ///\n    /// * `path` - the path\n    /// * `header` - header definition to use\n    /// * `uncompressed` - disable compression\n    /// * `vcf` - write VCF instead of BCF\n    pub fn from_path<P: AsRef<Path>>(\n        path: P,\n        header: &Header,\n        uncompressed: bool,\n        format: Format,\n    ) -> Result<Self> {\n        if let Some(p) = path.as_ref().to_str() {\n            Ok(Self::new(p.as_bytes(), header, uncompressed, format)?)\n        } else {\n            Err(Error::NonUnicodePath)\n        }\n    }\n\n    /// Create a new writer from a URL.\n    ///\n    /// # Arguments\n    ///\n    /// * `url` - the URL\n    /// * `header` - header definition to use\n    /// * `uncompressed` - disable compression\n    /// * `vcf` - write VCF instead of BCF\n    pub fn from_url(\n        url: &Url,\n        header: &Header,\n        uncompressed: bool,\n        format: Format,\n    ) -> Result<Self> {\n        Self::new(url.as_str().as_bytes(), header, uncompressed, format)\n    }\n\n    /// Create a new writer to stdout.\n    ///\n    /// # Arguments\n    ///\n    /// * `header` - header definition to use\n    /// * `uncompressed` - disable compression\n    /// * `vcf` - write VCF instead of BCF\n    pub fn from_stdout(header: &Header, uncompressed: bool, format: Format) -> Result<Self> {\n        Self::new(b\"-\", header, uncompressed, format)\n    }\n\n    fn new(path: &[u8], header: &Header, uncompressed: bool, format: Format) -> Result<Self> {\n        let mode: &[u8] = match (uncompressed, format) {\n            (true, Format::Vcf) => b\"w\",\n            (false, Format::Vcf) => b\"wz\",\n            (true, Format::Bcf) => b\"wbu\",\n            (false, Format::Bcf) => b\"wb\",\n        };\n\n        let htsfile = bcf_open(path, mode)?;\n        unsafe { htslib::bcf_hdr_write(htsfile, header.inner) };\n        Ok(Writer {\n            inner: htsfile,\n            header: Arc::new(unsafe { HeaderView::from_ptr(htslib::bcf_hdr_dup(header.inner)) }),\n            subset: header.subset.clone(),\n        })\n    }\n\n    /// Obtain reference to the lightweight `HeaderView` of the BCF header.\n    pub fn header(&self) -> &HeaderView {\n        &self.header\n    }\n\n    /// Create empty record for writing to this writer.\n    ///\n    /// This record can then be reused multiple times.\n    pub fn empty_record(&self) -> Record {\n        Record::new(self.header.clone())\n    }\n\n    /// Translate record to header of this writer.\n    ///\n    /// # Arguments\n    ///\n    /// - `record` - The `Record` to translate.\n    pub fn translate(&mut self, record: &mut record::Record) {\n        unsafe {\n            htslib::bcf_translate(self.header.inner, record.header().inner, record.inner);\n        }\n        record.set_header(Arc::clone(&self.header));\n    }\n\n    /// Subset samples of record to match header of this writer.\n    ///\n    /// # Arguments\n    ///\n    /// - `record` - The `Record` to modify.\n    pub fn subset(&mut self, record: &mut record::Record) {\n        if let Some(ref mut subset) = self.subset {\n            unsafe {\n                htslib::bcf_subset(\n                    self.header.inner,\n                    record.inner,\n                    subset.len() as i32,\n                    subset.as_mut_ptr(),\n                );\n            }\n        }\n    }\n\n    /// Write `record` to the Writer.\n    ///\n    /// # Arguments\n    ///\n    /// - `record` - The `Record` to write.\n    pub fn write(&mut self, record: &record::Record) -> Result<()> {\n        if unsafe { htslib::bcf_write(self.inner, self.header.inner, record.inner) } == -1 {\n            Err(Error::WriteRecord)\n        } else {\n            Ok(())\n        }\n    }\n\n    /// Activate multi-threaded BCF write support in htslib. This should permit faster\n    /// writing of large BCF files.\n    ///\n    /// # Arguments\n    ///\n    /// * `n_threads` - number of extra background writer threads to use, must be `> 0`.\n    pub fn set_threads(&mut self, n_threads: usize) -> Result<()> {\n        unsafe { set_threads(self.inner, n_threads) }\n    }\n}\n\nimpl Drop for Writer {\n    fn drop(&mut self) {\n        unsafe {\n            htslib::hts_close(self.inner);\n        }\n    }\n}\n\n#[derive(Debug)]\npub struct Records<'a, R: Read> {\n    reader: &'a mut R,\n}\n\nimpl<'a, R: Read> Records<'a, R> {\n    pub fn new(reader: &'a mut R) -> Self {\n        Self { reader }\n    }\n}\n\nimpl<R: Read> Iterator for Records<'_, R> {\n    type Item = Result<record::Record>;\n\n    fn next(&mut self) -> Option<Result<record::Record>> {\n        let mut record = self.reader.empty_record();\n        match self.reader.read(&mut record) {\n            Some(Err(e)) => Some(Err(e)),\n            Some(Ok(_)) => Some(Ok(record)),\n            None => None,\n        }\n    }\n}\n\n/// Wrapper for opening a BCF file.\nfn bcf_open(target: &[u8], mode: &[u8]) -> Result<*mut htslib::htsFile> {\n    let p = ffi::CString::new(target).unwrap();\n    let c_str = ffi::CString::new(mode).unwrap();\n    let ret = unsafe { htslib::hts_open(p.as_ptr(), c_str.as_ptr()) };\n\n    if ret.is_null() {\n        return Err(Error::BcfOpen {\n            target: str::from_utf8(target).unwrap().to_owned(),\n        });\n    }\n\n    unsafe {\n        if !(mode.contains(&b'w')\n            || (*ret).format.category == htslib::htsFormatCategory_variant_data)\n        {\n            return Err(Error::BcfOpen {\n                target: str::from_utf8(target).unwrap().to_owned(),\n            });\n        }\n    }\n    Ok(ret)\n}\n\n#[cfg(test)]\nmod tests {\n    use tempfile::NamedTempFile;\n\n    use super::record::Buffer;\n    use super::*;\n    use crate::bcf::header::Id;\n    use crate::bcf::record::GenotypeAllele;\n    use crate::bcf::record::Numeric;\n    use crate::bcf::Reader;\n    use std::convert::TryFrom;\n    use std::fs::File;\n    use std::io::prelude::Read as IoRead;\n    use std::path::Path;\n    use std::str;\n\n    fn _test_read<P: AsRef<Path>>(path: &P) {\n        let mut bcf = Reader::from_path(path).expect(\"Error opening file.\");\n        assert_eq!(bcf.header.samples(), [b\"NA12878.subsample-0.25-0\"]);\n\n        for (i, rec) in bcf.records().enumerate() {\n            let record = rec.expect(\"Error reading record.\");\n            assert_eq!(record.sample_count(), 1);\n\n            assert_eq!(record.rid().expect(\"Error reading rid.\"), 0);\n            assert_eq!(record.pos(), 10021 + i as i64);\n            assert!((record.qual() - 0f32).abs() < f32::EPSILON);\n            let mut buffer = Buffer::new();\n            assert!(\n                (record\n                    .info_shared_buffer(b\"MQ0F\", &mut buffer)\n                    .float()\n                    .expect(\"Error reading info.\")\n                    .expect(\"Missing tag\")[0]\n                    - 1.0)\n                    .abs()\n                    < f32::EPSILON\n            );\n            if i == 59 {\n                assert!(\n                    (record\n                        .info_shared_buffer(b\"SGB\", &mut buffer)\n                        .float()\n                        .expect(\"Error reading info.\")\n                        .expect(\"Missing tag\")[0]\n                        - -0.379885)\n                        .abs()\n                        < f32::EPSILON\n                );\n            }\n            // the artificial \"not observed\" allele is present in each record.\n            assert_eq!(record.alleles().iter().last().unwrap(), b\"<X>\");\n\n            let fmt = record.format(b\"PL\");\n            let pl = fmt.integer().expect(\"Error reading format.\");\n            assert_eq!(pl.len(), 1);\n            if i == 59 {\n                assert_eq!(pl[0].len(), 6);\n            } else {\n                assert_eq!(pl[0].len(), 3);\n            }\n        }\n    }\n\n    #[test]\n    fn test_read() {\n        _test_read(&\"test/test.bcf\");\n    }\n\n    #[test]\n    fn test_reader_set_threads() {\n        let path = &\"test/test.bcf\";\n        let mut bcf = Reader::from_path(path).expect(\"Error opening file.\");\n        bcf.set_threads(2).unwrap();\n    }\n\n    #[test]\n    fn test_writer_set_threads() {\n        let path = &\"test/test.bcf\";\n        let tmp = tempfile::Builder::new()\n            .prefix(\"rust-htslib\")\n            .tempdir()\n            .expect(\"Cannot create temp dir\");\n        let bcfpath = tmp.path().join(\"test.bcf\");\n        let bcf = Reader::from_path(path).expect(\"Error opening file.\");\n        let header = Header::from_template_subset(&bcf.header, &[b\"NA12878.subsample-0.25-0\"])\n            .expect(\"Error subsetting samples.\");\n        let mut writer =\n            Writer::from_path(&bcfpath, &header, false, Format::Bcf).expect(\"Error opening file.\");\n        writer.set_threads(2).unwrap();\n    }\n\n    #[test]\n    fn test_fetch() {\n        let mut bcf = IndexedReader::from_path(\"test/test.bcf\").expect(\"Error opening file.\");\n        bcf.set_threads(2).unwrap();\n        let rid = bcf\n            .header()\n            .name2rid(b\"1\")\n            .expect(\"Translating from contig '1' to ID failed.\");\n        bcf.fetch(rid, 10_033, Some(10_060))\n            .expect(\"Fetching failed\");\n        assert_eq!(bcf.records().count(), 28);\n    }\n\n    #[test]\n    fn test_fetch_all() {\n        let mut bcf = IndexedReader::from_path(\"test/test.bcf\").expect(\"Error opening file.\");\n        bcf.set_threads(2).unwrap();\n        let rid = bcf\n            .header()\n            .name2rid(b\"1\")\n            .expect(\"Translating from contig '1' to ID failed.\");\n        bcf.fetch(rid, 0, None).expect(\"Fetching failed\");\n        assert_eq!(bcf.records().count(), 62);\n    }\n\n    #[test]\n    fn test_fetch_open_ended() {\n        let mut bcf = IndexedReader::from_path(\"test/test.bcf\").expect(\"Error opening file.\");\n        bcf.set_threads(2).unwrap();\n        let rid = bcf\n            .header()\n            .name2rid(b\"1\")\n            .expect(\"Translating from contig '1' to ID failed.\");\n        bcf.fetch(rid, 10077, None).expect(\"Fetching failed\");\n        assert_eq!(bcf.records().count(), 6);\n    }\n\n    #[test]\n    fn test_fetch_start_greater_than_last_vcf_pos() {\n        let mut bcf = IndexedReader::from_path(\"test/test.bcf\").expect(\"Error opening file.\");\n        bcf.set_threads(2).unwrap();\n        let rid = bcf\n            .header()\n            .name2rid(b\"1\")\n            .expect(\"Translating from contig '1' to ID failed.\");\n        bcf.fetch(rid, 20077, None).expect(\"Fetching failed\");\n        assert_eq!(bcf.records().count(), 0);\n    }\n\n    #[test]\n    fn test_write() {\n        let mut bcf = Reader::from_path(\"test/test_multi.bcf\").expect(\"Error opening file.\");\n        let tmp = tempfile::Builder::new()\n            .prefix(\"rust-htslib\")\n            .tempdir()\n            .expect(\"Cannot create temp dir\");\n        let bcfpath = tmp.path().join(\"test.bcf\");\n        println!(\"{:?}\", bcfpath);\n        {\n            let header = Header::from_template_subset(&bcf.header, &[b\"NA12878.subsample-0.25-0\"])\n                .expect(\"Error subsetting samples.\");\n            let mut writer = Writer::from_path(&bcfpath, &header, false, Format::Bcf)\n                .expect(\"Error opening file.\");\n            for rec in bcf.records() {\n                let mut record = rec.expect(\"Error reading record.\");\n                writer.translate(&mut record);\n                writer.subset(&mut record);\n                record.trim_alleles().expect(\"Error trimming alleles.\");\n                writer.write(&record).expect(\"Error writing record\");\n            }\n        }\n        {\n            _test_read(&bcfpath);\n        }\n        tmp.close().expect(\"Failed to delete temp dir\");\n    }\n\n    #[test]\n    fn test_strings() {\n        let mut vcf = Reader::from_path(\"test/test_string.vcf\").expect(\"Error opening file.\");\n        let fs1 = [\n            &b\"LongString1\"[..],\n            &b\"LongString2\"[..],\n            &b\".\"[..],\n            &b\"LongString4\"[..],\n            &b\"evenlength\"[..],\n            &b\"ss6\"[..],\n        ];\n        let mut buffer = Buffer::new();\n        for (i, rec) in vcf.records().enumerate() {\n            println!(\"record {}\", i);\n            let record = rec.expect(\"Error reading record.\");\n            assert_eq!(\n                record\n                    .info_shared_buffer(b\"S1\", &mut buffer)\n                    .string()\n                    .expect(\"Error reading string.\")\n                    .expect(\"Missing tag\")[0],\n                format!(\"string{}\", i + 1).as_bytes()\n            );\n            let fs1_str_vec = record\n                .format_shared_buffer(b\"FS1\", &mut buffer)\n                .string()\n                .expect(\"Error reading string.\");\n            assert_eq!(fs1_str_vec.len(), 2);\n            println!(\"{}\", String::from_utf8_lossy(fs1_str_vec[0]));\n            assert_eq!(\n                record\n                    .format(b\"FS1\")\n                    .string()\n                    .expect(\"Error reading string.\")[0],\n                fs1[i]\n            );\n        }\n    }\n\n    #[test]\n    fn test_missing() {\n        let mut vcf = Reader::from_path(\"test/test_missing.vcf\").expect(\"Error opening file.\");\n        let fn4 = [\n            &[\n                i32::missing(),\n                i32::missing(),\n                i32::missing(),\n                i32::missing(),\n            ][..],\n            &[i32::missing()][..],\n        ];\n        let f1 = [false, true];\n        let mut buffer = Buffer::new();\n        for (i, rec) in vcf.records().enumerate() {\n            let record = rec.expect(\"Error reading record.\");\n            assert_eq!(\n                record\n                    .info_shared_buffer(b\"F1\", &mut buffer)\n                    .float()\n                    .expect(\"Error reading float.\")\n                    .expect(\"Missing tag\")[0]\n                    .is_nan(),\n                f1[i]\n            );\n            assert_eq!(\n                record\n                    .format(b\"FN4\")\n                    .integer()\n                    .expect(\"Error reading integer.\")[1],\n                fn4[i]\n            );\n            assert!(\n                record.format(b\"FF4\").float().expect(\"Error reading float.\")[1]\n                    .iter()\n                    .all(|&v| v.is_missing())\n            );\n        }\n    }\n\n    #[test]\n    fn test_genotypes() {\n        let mut vcf = Reader::from_path(\"test/test_string.vcf\").expect(\"Error opening file.\");\n        let expected = [\"./1\", \"1|1\", \"0/1\", \"0|1\", \"1|.\", \"1/1\"];\n        for (rec, exp_gt) in vcf.records().zip(expected.iter()) {\n            let rec = rec.expect(\"Error reading record.\");\n            let genotypes = rec.genotypes().expect(\"Error reading genotypes\");\n            assert_eq!(&format!(\"{}\", genotypes.get(0)), exp_gt);\n        }\n    }\n\n    #[test]\n    fn test_genotypes_read_mixed_ploidy() {\n        let mut vcf = Reader::from_path(\"test/test_non_diploid.vcf\").expect(\"Error opening file.\");\n\n        // Expected genotypes for comparison\n        let expected = [vec![\"0\", \"1\"], vec![\"0/1\", \"1/1\"], vec![\"1|0\", \"1/1|0\"]];\n\n        for (rec, exp_gts) in vcf.records().zip(expected.iter()) {\n            let rec = rec.expect(\"Error reading record.\");\n\n            // Get the genotypes from the record\n            let genotypes = rec.genotypes().expect(\"Error reading genotypes\");\n\n            // Compare each genotype with the expected value\n            for (sample, exp_gt) in exp_gts.iter().enumerate() {\n                assert_eq!(&format!(\"{}\", genotypes.get(sample)), exp_gt);\n            }\n        }\n    }\n\n    #[test]\n    fn test_genotypes_write_and_read_mixed_ploidy() {\n        let mut vcf = Reader::from_path(\"test/test_non_diploid.vcf\").expect(\"Error opening file.\");\n\n        // Create a temporary file to write the modified VCF data\n        let tmp = NamedTempFile::new().unwrap();\n        let path = tmp.path();\n\n        {\n            // Create a VCF writer with the same header as the input VCF\n            let mut writer = Writer::from_path(\n                path,\n                &Header::from_template(vcf.header()),\n                true,\n                Format::Vcf,\n            )\n            .unwrap();\n\n            // Modify record template by adding different genotypes and write the to the temp file.\n            let mut rec_tpl = vcf.records().next().unwrap().unwrap();\n            rec_tpl\n                .push_genotype_structured(\n                    &[\n                        vec![GenotypeAllele::Unphased(0)],\n                        vec![GenotypeAllele::Unphased(1)],\n                    ],\n                    3,\n                )\n                .unwrap();\n            writer.write(&rec_tpl).unwrap();\n            rec_tpl\n                .push_genotype_structured(\n                    &[\n                        vec![GenotypeAllele::Unphased(0), GenotypeAllele::Unphased(1)],\n                        vec![GenotypeAllele::Unphased(1), GenotypeAllele::Unphased(1)],\n                    ],\n                    3,\n                )\n                .unwrap();\n            writer.write(&rec_tpl).unwrap();\n            rec_tpl\n                .push_genotype_structured(\n                    &[\n                        vec![GenotypeAllele::Unphased(1), GenotypeAllele::Phased(0)],\n                        vec![\n                            GenotypeAllele::Unphased(1),\n                            GenotypeAllele::Unphased(1),\n                            GenotypeAllele::Phased(0),\n                        ],\n                    ],\n                    3,\n                )\n                .unwrap();\n            writer.write(&rec_tpl).unwrap();\n        }\n\n        // Read back the temporary file with the modified VCF data\n        let mut reader = Reader::from_path(path).unwrap();\n\n        // Expected genotypes for validation\n        let expected = [vec![\"0\", \"1\"], vec![\"0/1\", \"1/1\"], vec![\"1|0\", \"1/1|0\"]];\n\n        // Iterate over the records in the temporary file and validate the genotypes\n        for (rec, exp_gts) in reader.records().zip(expected.iter()) {\n            let rec = rec.expect(\"Error reading record\");\n            let genotypes = rec.genotypes().expect(\"Error reading genotypes\");\n\n            // Compare each genotype with the expected value\n            for (sample, exp_gt) in exp_gts.iter().enumerate() {\n                assert_eq!(&format!(\"{}\", genotypes.get(sample)), exp_gt);\n            }\n        }\n    }\n\n    #[test]\n    fn test_genotypes_wrong_max_ploidy() {\n        let mut vcf = Reader::from_path(\"test/test_non_diploid.vcf\").expect(\"Error opening file.\");\n\n        // Modify record template by adding different genotypes and write the to the temp file.\n        let mut rec_tpl = vcf.records().next().unwrap().unwrap();\n        let err = rec_tpl\n            .push_genotype_structured(\n                &[\n                    vec![\n                        GenotypeAllele::Unphased(0),\n                        GenotypeAllele::Unphased(1),\n                        GenotypeAllele::Unphased(0),\n                    ],\n                    vec![\n                        GenotypeAllele::Unphased(1),\n                        GenotypeAllele::Unphased(0),\n                        GenotypeAllele::Unphased(1),\n                        GenotypeAllele::Unphased(0),\n                    ],\n                ],\n                3,\n            )\n            .expect_err(\n                \"This should fail since there are more alleles specified (4 for second sample) than max_ploidy (3) suggests\",\n            );\n        assert_eq!(err, crate::errors::Error::BcfSetValues);\n    }\n\n    #[test]\n    fn test_header_ids() {\n        let vcf = Reader::from_path(\"test/test_string.vcf\").expect(\"Error opening file.\");\n        let header = &vcf.header();\n        use crate::bcf::header::Id;\n\n        assert_eq!(header.id_to_name(Id(4)), b\"GT\");\n        assert_eq!(header.name_to_id(b\"GT\").unwrap(), Id(4));\n        assert!(header.name_to_id(b\"XX\").is_err());\n    }\n\n    #[test]\n    fn test_header_samples() {\n        let vcf = Reader::from_path(\"test/test_string.vcf\").expect(\"Error opening file.\");\n        let header = &vcf.header();\n\n        assert_eq!(header.id_to_sample(Id(0)), b\"one\");\n        assert_eq!(header.id_to_sample(Id(1)), b\"two\");\n        assert_eq!(header.sample_to_id(b\"one\").unwrap(), Id(0));\n        assert_eq!(header.sample_to_id(b\"two\").unwrap(), Id(1));\n        assert!(header.sample_to_id(b\"three\").is_err());\n    }\n\n    #[test]\n    fn test_header_contigs() {\n        let vcf = Reader::from_path(\"test/test_multi.bcf\").expect(\"Error opening file.\");\n        let header = &vcf.header();\n\n        assert_eq!(header.contig_count(), 86);\n\n        // test existing contig names and IDs\n        assert_eq!(header.rid2name(0).unwrap(), b\"1\");\n        assert_eq!(header.name2rid(b\"1\").unwrap(), 0);\n\n        assert_eq!(header.rid2name(85).unwrap(), b\"hs37d5\");\n        assert_eq!(header.name2rid(b\"hs37d5\").unwrap(), 85);\n\n        // test nonexistent contig names and IDs\n        assert!(header.name2rid(b\"nonexistent_contig\").is_err());\n        assert!(header.rid2name(100).is_err());\n    }\n\n    #[test]\n    fn test_header_records() {\n        let vcf = Reader::from_path(\"test/test_string.vcf\").expect(\"Error opening file.\");\n        let records = vcf.header().header_records();\n        assert_eq!(records.len(), 10);\n\n        match records[1] {\n            HeaderRecord::Filter {\n                ref key,\n                ref values,\n            } => {\n                assert_eq!(key, \"FILTER\");\n                assert_eq!(values[\"ID\"], \"PASS\");\n            }\n            _ => {\n                panic!(\"Invalid HeaderRecord\");\n            }\n        }\n    }\n\n    #[test]\n    fn test_header_info_types() {\n        let vcf = Reader::from_path(\"test/test.bcf\").unwrap();\n        let header = vcf.header();\n        let truth = vec![\n            (\n                // INFO=<ID=INDEL,Number=0,Type=Flag>\n                \"INDEL\",\n                header::TagType::Flag,\n                header::TagLength::Fixed(0),\n            ),\n            (\n                // INFO=<ID=DP,Number=1,Type=Integer>\n                \"DP\",\n                header::TagType::Integer,\n                header::TagLength::Fixed(1),\n            ),\n            (\n                // INFO=<ID=QS,Number=R,Type=Float>\n                \"QS\",\n                header::TagType::Float,\n                header::TagLength::Alleles,\n            ),\n            (\n                // INFO=<ID=I16,Number=16,Type=Float>\n                \"I16\",\n                header::TagType::Float,\n                header::TagLength::Fixed(16),\n            ),\n        ];\n        for (ref_name, ref_type, ref_length) in truth {\n            let (tag_type, tag_length) = header.info_type(ref_name.as_bytes()).unwrap();\n            assert_eq!(tag_type, ref_type);\n            assert_eq!(tag_length, ref_length);\n        }\n\n        let vcf = Reader::from_path(\"test/test_svlen.vcf\").unwrap();\n        let header = vcf.header();\n        let truth = vec![\n            (\n                // INFO=<ID=IMPRECISE,Number=0,Type=Flag>\n                \"IMPRECISE\",\n                header::TagType::Flag,\n                header::TagLength::Fixed(0),\n            ),\n            (\n                // INFO=<ID=SVTYPE,Number=1,Type=String>\n                \"SVTYPE\",\n                header::TagType::String,\n                header::TagLength::Fixed(1),\n            ),\n            (\n                // INFO=<ID=SVLEN,Number=.,Type=Integer>\n                \"SVLEN\",\n                header::TagType::Integer,\n                header::TagLength::Variable,\n            ),\n            (\n                // INFO<ID=CIGAR,Number=A,Type=String>\n                \"CIGAR\",\n                header::TagType::String,\n                header::TagLength::AltAlleles,\n            ),\n        ];\n        for (ref_name, ref_type, ref_length) in truth {\n            let (tag_type, tag_length) = header.info_type(ref_name.as_bytes()).unwrap();\n            assert_eq!(tag_type, ref_type);\n            assert_eq!(tag_length, ref_length);\n        }\n\n        assert!(header.info_type(b\"NOT_THERE\").is_err());\n    }\n\n    #[test]\n    fn test_remove_alleles() {\n        let mut bcf = Reader::from_path(\"test/test_multi.bcf\").unwrap();\n        for res in bcf.records() {\n            let mut record = res.unwrap();\n            if record.pos() == 10080 {\n                record.remove_alleles(&[false, false, true]).unwrap();\n                assert_eq!(record.alleles(), [b\"A\", b\"C\"]);\n            }\n        }\n    }\n\n    // Helper function reading full file into string.\n    fn read_all<P: AsRef<Path>>(path: P) -> String {\n        let mut file = File::open(path.as_ref())\n            .unwrap_or_else(|_| panic!(\"Unable to open the file: {:?}\", path.as_ref()));\n        let mut contents = String::new();\n        file.read_to_string(&mut contents)\n            .unwrap_or_else(|_| panic!(\"Unable to read the file: {:?}\", path.as_ref()));\n        contents\n    }\n\n    // Open `test_various.vcf`, add a record from scratch to it and write it out again.\n    //\n    // This exercises the full functionality of updating information in a `record::Record`.\n    #[test]\n    fn test_write_various() {\n        // Open reader, then create writer.\n        let tmp = tempfile::Builder::new()\n            .prefix(\"rust-htslib\")\n            .tempdir()\n            .expect(\"Cannot create temp dir\");\n        let out_path = tmp.path().join(\"test_various.out.vcf\");\n\n        let vcf = Reader::from_path(\"test/test_various.vcf\").expect(\"Error opening file.\");\n        // The writer goes into its own block so we can ensure that the file is closed and\n        // all data is written below.\n        {\n            let mut writer = Writer::from_path(\n                &out_path,\n                &Header::from_template(vcf.header()),\n                true,\n                Format::Vcf,\n            )\n            .expect(\"Error opening file.\");\n\n            // Setup empty record, filled below.\n            let mut record = writer.empty_record();\n\n            record.set_rid(Some(0));\n            assert_eq!(record.rid().unwrap(), 0);\n\n            record.set_pos(12);\n            assert_eq!(record.pos(), 12);\n\n            assert_eq!(str::from_utf8(record.id().as_ref()).unwrap(), \".\");\n            record.set_id(b\"to_be_cleared\").unwrap();\n            assert_eq!(\n                str::from_utf8(record.id().as_ref()).unwrap(),\n                \"to_be_cleared\"\n            );\n            record.clear_id().unwrap();\n            assert_eq!(str::from_utf8(record.id().as_ref()).unwrap(), \".\");\n            record.set_id(b\"first_id\").unwrap();\n            record.push_id(b\"second_id\").unwrap();\n            record.push_id(b\"first_id\").unwrap();\n\n            assert!(record.filters().next().is_none());\n            record.set_filters(&[\"q10\".as_bytes()]).unwrap();\n            record.push_filter(\"s50\".as_bytes()).unwrap();\n            record.remove_filter(\"q10\".as_bytes(), true).unwrap();\n            record.push_filter(\"q10\".as_bytes()).unwrap();\n\n            record.set_alleles(&[b\"C\", b\"T\", b\"G\"]).unwrap();\n\n            record.set_qual(10.0);\n\n            record.push_info_integer(b\"N1\", &[32]).unwrap();\n            record.push_info_float(b\"F1\", &[33.0]).unwrap();\n            record.push_info_string(b\"S1\", &[b\"fourtytwo\"]).unwrap();\n            record.push_info_flag(b\"X1\").unwrap();\n\n            record\n                .push_genotypes(&[\n                    GenotypeAllele::Unphased(0),\n                    GenotypeAllele::Unphased(1),\n                    GenotypeAllele::Unphased(1),\n                    GenotypeAllele::Phased(1),\n                ])\n                .unwrap();\n\n            record\n                .push_format_string(b\"FS1\", &[&b\"yes\"[..], &b\"no\"[..]])\n                .unwrap();\n            record.push_format_integer(b\"FF1\", &[43, 11]).unwrap();\n            record.push_format_float(b\"FN1\", &[42.0, 10.0]).unwrap();\n            record\n                .push_format_char(b\"CH1\", &[b\"A\"[0], b\"B\"[0]])\n                .unwrap();\n\n            // Finally, write out the record.\n            writer.write(&record).unwrap();\n        }\n\n        // Now, compare expected and real output.\n        let expected = read_all(\"test/test_various.out.vcf\");\n        let actual = read_all(&out_path);\n        assert_eq!(expected, actual);\n    }\n\n    #[test]\n    fn test_remove_headers() {\n        let vcf = Reader::from_path(\"test/test_headers.vcf\").expect(\"Error opening file.\");\n        let tmp = tempfile::Builder::new()\n            .prefix(\"rust-htslib\")\n            .tempdir()\n            .expect(\"Cannot create temp dir\");\n        let vcfpath = tmp.path().join(\"test.vcf\");\n        let mut header = Header::from_template(&vcf.header);\n        header\n            .remove_contig(b\"contig2\")\n            .remove_info(b\"INFO2\")\n            .remove_format(b\"FORMAT2\")\n            .remove_filter(b\"FILTER2\")\n            .remove_structured(b\"Foo2\")\n            .remove_generic(b\"Bar2\");\n        {\n            let mut _writer = Writer::from_path(&vcfpath, &header, true, Format::Vcf)\n                .expect(\"Error opening output file.\");\n            // Note that we don't need to write anything, we are just looking at the header.\n        }\n\n        let expected = read_all(\"test/test_headers.out.vcf\");\n        let actual = read_all(&vcfpath);\n        assert_eq!(expected, actual);\n    }\n\n    #[test]\n    fn test_synced_reader() {\n        let mut reader = synced::SyncedReader::new().unwrap();\n        reader.set_require_index(true);\n        reader.set_pairing(synced::pairing::SNPS);\n\n        assert_eq!(reader.reader_count(), 0);\n        reader.add_reader(\"test/test_left.vcf.gz\").unwrap();\n        reader.add_reader(\"test/test_right.vcf.gz\").unwrap();\n        assert_eq!(reader.reader_count(), 2);\n\n        let res1 = reader.read_next();\n        assert_eq!(res1.unwrap(), 2);\n        assert!(reader.has_line(0));\n        assert!(reader.has_line(1));\n\n        let res2 = reader.read_next();\n        assert_eq!(res2.unwrap(), 1);\n        assert!(reader.has_line(0));\n        assert!(!reader.has_line(1));\n\n        let res3 = reader.read_next();\n        assert_eq!(res3.unwrap(), 1);\n        assert!(!reader.has_line(0));\n        assert!(reader.has_line(1));\n\n        let res4 = reader.read_next();\n        assert_eq!(res4.unwrap(), 0);\n    }\n\n    #[test]\n    fn test_synced_reader_fetch() {\n        let mut reader = synced::SyncedReader::new().unwrap();\n        reader.set_require_index(true);\n        reader.set_pairing(synced::pairing::SNPS);\n\n        assert_eq!(reader.reader_count(), 0);\n        reader.add_reader(\"test/test_left.vcf.gz\").unwrap();\n        reader.add_reader(\"test/test_right.vcf.gz\").unwrap();\n        assert_eq!(reader.reader_count(), 2);\n\n        reader.fetch(0, 0, 1000).unwrap();\n        let res1 = reader.read_next();\n        assert_eq!(res1.unwrap(), 2);\n        assert!(reader.has_line(0));\n        assert!(reader.has_line(1));\n\n        let res2 = reader.read_next();\n        assert_eq!(res2.unwrap(), 1);\n        assert!(reader.has_line(0));\n        assert!(!reader.has_line(1));\n\n        let res3 = reader.read_next();\n        assert_eq!(res3.unwrap(), 1);\n        assert!(!reader.has_line(0));\n        assert!(reader.has_line(1));\n\n        let res4 = reader.read_next();\n        assert_eq!(res4.unwrap(), 0);\n    }\n\n    #[test]\n    fn test_svlen() {\n        let mut reader = Reader::from_path(\"test/test_svlen.vcf\").unwrap();\n\n        let mut record = reader.empty_record();\n        reader.read(&mut record).unwrap().unwrap();\n\n        assert_eq!(\n            *record.info(b\"SVLEN\").integer().unwrap().unwrap(),\n            &[-127][..]\n        );\n    }\n\n    #[test]\n    fn test_fails_on_bam() {\n        let reader = Reader::from_path(\"test/test.bam\");\n        assert!(reader.is_err());\n    }\n\n    #[test]\n    fn test_fails_on_non_existiant() {\n        let reader = Reader::from_path(\"test/no_such_file\");\n        assert!(reader.is_err());\n    }\n\n    #[test]\n    fn test_multi_string_info_tag() {\n        let mut reader = Reader::from_path(\"test/test-info-multi-string.vcf\").unwrap();\n        let mut rec = reader.empty_record();\n        let _ = reader.read(&mut rec);\n\n        assert_eq!(\n            rec.info_shared_buffer(b\"ANN\", Buffer::new())\n                .string()\n                .unwrap()\n                .unwrap()\n                .len(),\n            14\n        );\n    }\n\n    #[test]\n    fn test_multi_string_info_tag_number_a() {\n        let mut reader = Reader::from_path(\"test/test-info-multi-string-number=A.vcf\").unwrap();\n        let mut rec = reader.empty_record();\n        let _ = reader.read(&mut rec);\n\n        assert_eq!(\n            rec.info_shared_buffer(b\"X\", Buffer::new())\n                .string()\n                .unwrap()\n                .unwrap()\n                .len(),\n            2\n        );\n    }\n\n    #[test]\n    fn test_genotype_allele_conversion() {\n        let allele = GenotypeAllele::Unphased(1);\n        let converted: i32 = allele.into();\n        let expected = 4;\n        assert_eq!(converted, expected);\n        let reverse_conversion = GenotypeAllele::from(expected);\n        assert_eq!(allele, reverse_conversion);\n    }\n\n    #[test]\n    fn test_genotype_missing_allele_conversion() {\n        let allele = GenotypeAllele::PhasedMissing;\n        let converted: i32 = allele.into();\n        let expected = 1;\n        assert_eq!(converted, expected);\n        let reverse_conversion = GenotypeAllele::from(expected);\n        assert_eq!(allele, reverse_conversion);\n    }\n\n    #[test]\n    fn test_alt_allele_dosage() {\n        let path = &\"test/test_string.vcf\";\n        let mut bcf = Reader::from_path(path).expect(\"Error opening file.\");\n        let _header = bcf.header();\n        // FORMAT fields of first record of the vcf should look like:\n        // GT:FS1:FN1\t./1:LongString1:1\t1/1:ss1:2\n        let first_record = bcf.records().next().unwrap().expect(\"Fail to read record\");\n        let sample_count = usize::try_from(first_record.sample_count()).unwrap();\n        assert_eq!(sample_count, 2);\n        let mut n_ref = vec![0; sample_count];\n        let mut n_alt = vec![0; sample_count];\n        let mut n_missing = vec![0; sample_count];\n        let gts = first_record.genotypes().expect(\"Error reading genotypes\");\n        for sample_index in 0..sample_count {\n            // for each sample\n            for gta in gts.get(sample_index).iter() {\n                // for each allele\n                match gta.index() {\n                    Some(0) => n_ref[sample_index] += 1,  // reference allele\n                    Some(_) => n_alt[sample_index] += 1,  // alt allele\n                    None => n_missing[sample_index] += 1, // missing allele\n                }\n            }\n        }\n        assert_eq!(n_ref, [0, 0]);\n        assert_eq!(n_alt, [1, 2]);\n        assert_eq!(n_missing, [1, 0]);\n    }\n\n    #[test]\n    fn test_obs_cornercase() {\n        let mut reader = Reader::from_path(\"test/obs-cornercase.vcf\").unwrap();\n        let first_record = reader\n            .records()\n            .next()\n            .unwrap()\n            .expect(\"Fail to read record\");\n\n        assert_eq!(\n            *first_record.info(b\"EVENT\").string().unwrap().unwrap(),\n            [b\"gridss33fb_1085\"]\n        );\n        assert_eq!(\n            *first_record.info(b\"MATEID\").string().unwrap().unwrap(),\n            [b\"gridss33fb_1085h\"]\n        );\n    }\n\n    #[test]\n    fn test_trailing_omitted_format_fields() {\n        let mut reader = Reader::from_path(\"test/test_trailing_omitted_format.vcf\").unwrap();\n        let first_record = reader\n            .records()\n            .next()\n            .unwrap()\n            .expect(\"Fail to read record\");\n\n        let expected: Vec<&[u8]> = Vec::new();\n        assert_eq!(*first_record.format(b\"STR\").string().unwrap(), expected,);\n        assert_eq!(\n            *first_record.format(b\"INT\").integer().unwrap(),\n            vec![&[i32::missing()]],\n        );\n        assert!(first_record.format(b\"FLT\").float().unwrap()[0][0].is_nan(),);\n    }\n\n    // #[test]\n    // fn test_buffer_lifetime() {\n    //     let mut reader = Reader::from_path(\"test/obs-cornercase.vcf\").unwrap();\n    //     let first_record = reader\n    //         .records()\n    //         .next()\n    //         .unwrap()\n    //         .expect(\"Fail to read record\");\n\n    //     fn get_value<'a, 'b>(record: &'a Record) -> &'b [u8] {\n    //         // FIXME: this should not be possible, because the slice outlives the buffer.\n    //         let buffer: BufferBacked<'b, _, _> = record.info(b\"EVENT\").string().unwrap().unwrap();\n    //         let value: &'b [u8] = buffer[0];\n    //         value\n    //     }\n\n    //     let buffered = first_record.info(b\"EVENT\").string().unwrap().unwrap();\n    //     assert_eq!(get_value(&first_record), buffered[0]);\n    // }\n}\n"
  },
  {
    "path": "src/bcf/record.rs",
    "content": "// Copyright 2014 Johannes Köster.\n// Licensed under the MIT license (http://opensource.org/licenses/MIT)\n// This file may not be copied, modified, or distributed\n// except according to those terms.\n\nuse std::borrow::{Borrow, BorrowMut};\nuse std::fmt;\nuse std::marker::PhantomData;\nuse std::ops::Deref;\nuse std::os::raw::c_char;\nuse std::ptr;\nuse std::slice;\nuse std::str;\nuse std::sync::Arc;\nuse std::{ffi, iter};\n\nuse bio_types::genome;\nuse derive_new::new;\nuse ieee754::Ieee754;\nuse lazy_static::lazy_static;\n\nuse crate::bcf::header::{HeaderView, Id};\nuse crate::bcf::Error;\nuse crate::errors::Result;\nuse crate::htslib;\n\nconst MISSING_INTEGER: i32 = i32::MIN;\nconst VECTOR_END_INTEGER: i32 = i32::MIN + 1;\n\nlazy_static! {\n    static ref MISSING_FLOAT: f32 = Ieee754::from_bits(0x7F80_0001);\n    static ref VECTOR_END_FLOAT: f32 = Ieee754::from_bits(0x7F80_0002);\n}\n\n/// Common methods for numeric INFO and FORMAT entries\npub trait Numeric {\n    /// Return true if entry is a missing value\n    fn is_missing(&self) -> bool;\n\n    /// Return missing value for storage in BCF record.\n    fn missing() -> Self;\n}\n\nimpl Numeric for f32 {\n    fn is_missing(&self) -> bool {\n        self.bits() == MISSING_FLOAT.bits()\n    }\n\n    fn missing() -> f32 {\n        *MISSING_FLOAT\n    }\n}\n\nimpl Numeric for i32 {\n    fn is_missing(&self) -> bool {\n        *self == MISSING_INTEGER\n    }\n\n    fn missing() -> i32 {\n        MISSING_INTEGER\n    }\n}\n\ntrait NumericUtils {\n    /// Return true if entry marks the end of the record.\n    fn is_vector_end(&self) -> bool;\n}\n\nimpl NumericUtils for f32 {\n    fn is_vector_end(&self) -> bool {\n        self.bits() == VECTOR_END_FLOAT.bits()\n    }\n}\n\nimpl NumericUtils for i32 {\n    fn is_vector_end(&self) -> bool {\n        *self == VECTOR_END_INTEGER\n    }\n}\n\n/// A trait to allow for seamless use of bytes or integer identifiers for filters\npub trait FilterId {\n    fn id_from_header(&self, header: &HeaderView) -> Result<Id>;\n    fn is_pass(&self) -> bool;\n}\n\nimpl FilterId for [u8] {\n    fn id_from_header(&self, header: &HeaderView) -> Result<Id> {\n        header.name_to_id(self)\n    }\n    fn is_pass(&self) -> bool {\n        matches!(self, b\"PASS\" | b\".\")\n    }\n}\n\nimpl FilterId for Id {\n    fn id_from_header(&self, _header: &HeaderView) -> Result<Id> {\n        Ok(*self)\n    }\n    fn is_pass(&self) -> bool {\n        *self == Id(0)\n    }\n}\n\n/// A buffer for info or format data.\n#[derive(Debug)]\npub struct Buffer {\n    inner: *mut ::std::os::raw::c_void,\n    len: i32,\n}\n\nimpl Buffer {\n    pub fn new() -> Self {\n        Buffer {\n            inner: ptr::null_mut(),\n            len: 0,\n        }\n    }\n}\n\nimpl Default for Buffer {\n    fn default() -> Self {\n        Self::new()\n    }\n}\n\nimpl Drop for Buffer {\n    fn drop(&mut self) {\n        unsafe {\n            ::libc::free(self.inner);\n        }\n    }\n}\n\n#[derive(new, Debug)]\npub struct BufferBacked<'a, T: 'a + fmt::Debug, B: Borrow<Buffer> + 'a> {\n    value: T,\n    _buffer: B,\n    #[new(default)]\n    phantom: PhantomData<&'a B>,\n}\n\nimpl<'a, T: 'a + fmt::Debug, B: Borrow<Buffer> + 'a> Deref for BufferBacked<'a, T, B> {\n    type Target = T;\n\n    fn deref(&self) -> &T {\n        &self.value\n    }\n}\n\nimpl<'a, T: 'a + fmt::Debug + fmt::Display, B: Borrow<Buffer> + 'a> fmt::Display\n    for BufferBacked<'a, T, B>\n{\n    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {\n        fmt::Display::fmt(&self.value, f)\n    }\n}\n\n/// A VCF/BCF record.\n/// New records can be created by the `empty_record` methods of [`bcf::Reader`](crate::bcf::Reader)\n/// and [`bcf::Writer`](crate::bcf::Writer).\n/// # Example\n/// ```rust\n/// use rust_htslib::bcf::{Format, Writer};\n/// use rust_htslib::bcf::header::Header;\n///\n/// // Create minimal VCF header with a single sample\n/// let mut header = Header::new();\n/// header.push_sample(\"sample\".as_bytes());\n///\n/// // Write uncompressed VCF to stdout with above header and get an empty record\n/// let mut vcf = Writer::from_stdout(&header, true, Format::Vcf).unwrap();\n/// let mut record = vcf.empty_record();\n/// ```\n#[derive(Debug)]\npub struct Record {\n    pub inner: *mut htslib::bcf1_t,\n    header: Arc<HeaderView>,\n}\n\nimpl Record {\n    /// Construct record with reference to header `HeaderView`, for create-internal use.\n    pub fn new(header: Arc<HeaderView>) -> Self {\n        let inner = unsafe {\n            let inner = htslib::bcf_init();\n            // Always unpack record.\n            htslib::bcf_unpack(inner, htslib::BCF_UN_ALL as i32);\n            inner\n        };\n        Record { inner, header }\n    }\n\n    /// Force unpacking of internal record values.\n    pub fn unpack(&mut self) {\n        unsafe { htslib::bcf_unpack(self.inner, htslib::BCF_UN_ALL as i32) };\n    }\n\n    /// Return associated header.\n    pub fn header(&self) -> &HeaderView {\n        self.header.as_ref()\n    }\n\n    /// Translate the record to the given header.\n    pub fn translate(&mut self, dst_header: &mut Arc<HeaderView>) -> Result<()> {\n        if unsafe { htslib::bcf_translate(dst_header.inner, self.header().inner, self.inner) } == 0\n        {\n            self.set_header(Arc::clone(dst_header));\n            Ok(())\n        } else {\n            Err(Error::BcfTranslate)\n        }\n    }\n\n    /// Set the record header.\n    pub(crate) fn set_header(&mut self, header: Arc<HeaderView>) {\n        self.header = header;\n    }\n\n    /// Return reference to the inner C struct.\n    ///\n    /// # Remarks\n    ///\n    /// Note that this function is only required as long as Rust-Htslib does not provide full\n    /// access to all aspects of Htslib.\n    pub fn inner(&self) -> &htslib::bcf1_t {\n        unsafe { &*self.inner }\n    }\n\n    /// Return mutable reference to inner C struct.\n    ///\n    /// # Remarks\n    ///\n    /// Note that this function is only required as long as Rust-Htslib does not provide full\n    /// access to all aspects of Htslib.\n    pub fn inner_mut(&mut self) -> &mut htslib::bcf1_t {\n        unsafe { &mut *self.inner }\n    }\n\n    /// Get the reference id of the record.\n    ///\n    /// To look up the contig name,\n    /// use [`HeaderView::rid2name`](../header/struct.HeaderView.html#method.rid2name).\n    ///\n    /// # Returns\n    ///\n    /// - `Some(rid)` if the internal `rid` is set to a value that is not `-1`\n    /// - `None` if the internal `rid` is set to `-1`\n    pub fn rid(&self) -> Option<u32> {\n        match self.inner().rid {\n            -1 => None,\n            rid => Some(rid as u32),\n        }\n    }\n\n    /// Update the reference id of the record.\n    ///\n    /// To look up reference id for a contig name,\n    /// use [`HeaderView::name2rid`](../header/struct.HeaderView.html#method.name2rid).\n    ///\n    /// # Example\n    ///\n    /// Example assumes we have a Record `record` from a VCF with a header containing region\n    /// named `1`. See [module documentation](../index.html#example-writing) for how to set\n    /// up VCF, header, and record.\n    ///\n    /// ```\n    /// # use rust_htslib::bcf::{Format, Writer};\n    /// # use rust_htslib::bcf::header::Header;\n    /// # let mut header = Header::new();\n    /// # let header_contig_line = r#\"##contig=<ID=1,length=10>\"#;\n    /// # header.push_record(header_contig_line.as_bytes());\n    /// # header.push_sample(\"test_sample\".as_bytes());\n    /// # let mut vcf = Writer::from_stdout(&header, true, Format::Vcf).unwrap();\n    /// # let mut record = vcf.empty_record();\n    /// let rid = record.header().name2rid(b\"1\").ok();\n    /// record.set_rid(rid);\n    /// assert_eq!(record.rid(), rid);\n    /// let name = record.header().rid2name(record.rid().unwrap()).ok();\n    /// assert_eq!(Some(\"1\".as_bytes()), name);\n    /// ```\n    pub fn set_rid(&mut self, rid: Option<u32>) {\n        match rid {\n            Some(rid) => self.inner_mut().rid = rid as i32,\n            None => self.inner_mut().rid = -1,\n        }\n    }\n\n    /// Return **0-based** position\n    pub fn pos(&self) -> i64 {\n        self.inner().pos\n    }\n\n    /// Set **0-based** position\n    pub fn set_pos(&mut self, pos: i64) {\n        self.inner_mut().pos = pos;\n    }\n\n    /// Return the **0-based, exclusive** end position\n    ///\n    /// # Example\n    /// ```rust\n    /// # use rust_htslib::bcf::{Format, Header, Writer};\n    /// # use tempfile::NamedTempFile;\n    /// # let tmp = NamedTempFile::new().unwrap();\n    /// # let path = tmp.path();\n    /// # let header = Header::new();\n    /// # let vcf = Writer::from_path(path, &header, true, Format::Vcf).unwrap();\n    /// # let mut record = vcf.empty_record();\n    /// let alleles: &[&[u8]] = &[b\"AGG\", b\"TG\"];\n    /// record.set_alleles(alleles).expect(\"Failed to set alleles\");\n    /// record.set_pos(5);\n    ///\n    /// assert_eq!(record.end(), 8)\n    /// ```\n    pub fn end(&self) -> i64 {\n        self.pos() + self.rlen()\n    }\n\n    /// Return the value of the ID column.\n    ///\n    /// When empty, returns `b\".\".to_vec()`.\n    pub fn id(&self) -> Vec<u8> {\n        if self.inner().d.id.is_null() {\n            b\".\".to_vec()\n        } else {\n            let id = unsafe { ffi::CStr::from_ptr(self.inner().d.id) };\n            id.to_bytes().to_vec()\n        }\n    }\n\n    /// Update the ID string to the given value.\n    pub fn set_id(&mut self, id: &[u8]) -> Result<()> {\n        let c_str = ffi::CString::new(id).unwrap();\n        if unsafe {\n            htslib::bcf_update_id(\n                self.header().inner,\n                self.inner,\n                c_str.as_ptr() as *mut c_char,\n            )\n        } == 0\n        {\n            Ok(())\n        } else {\n            Err(Error::BcfSetValues)\n        }\n    }\n\n    /// Clear the ID column (set it to `\".\"`).\n    pub fn clear_id(&mut self) -> Result<()> {\n        let c_str = ffi::CString::new(&b\".\"[..]).unwrap();\n        if unsafe {\n            htslib::bcf_update_id(\n                self.header().inner,\n                self.inner,\n                c_str.as_ptr() as *mut c_char,\n            )\n        } == 0\n        {\n            Ok(())\n        } else {\n            Err(Error::BcfSetValues)\n        }\n    }\n\n    /// Add the ID string (the ID field is semicolon-separated), checking for duplicates.\n    pub fn push_id(&mut self, id: &[u8]) -> Result<()> {\n        let c_str = ffi::CString::new(id).unwrap();\n        if unsafe {\n            htslib::bcf_add_id(\n                self.header().inner,\n                self.inner,\n                c_str.as_ptr() as *mut c_char,\n            )\n        } == 0\n        {\n            Ok(())\n        } else {\n            Err(Error::BcfSetValues)\n        }\n    }\n\n    /// Return `Filters` iterator for enumerating all filters that have been set.\n    ///\n    /// A record having the `PASS` filter will return an empty `Filter` here.\n    pub fn filters(&self) -> Filters<'_> {\n        Filters::new(self)\n    }\n\n    /// Query whether the filter with the given ID has been set.\n    ///\n    /// This method can be used to check if a record passes filtering by using either `Id(0)`,\n    /// `PASS` or `.`\n    ///\n    /// # Example\n    /// ```rust\n    /// # use rust_htslib::bcf::{Format, Header, Writer};\n    /// # use rust_htslib::bcf::header::Id;\n    /// # use tempfile::NamedTempFile;\n    /// # let tmp = tempfile::NamedTempFile::new().unwrap();\n    /// # let path = tmp.path();\n    /// let mut header = Header::new();\n    /// header.push_record(br#\"##FILTER=<ID=foo,Description=\"sample is a foo fighter\">\"#);\n    /// # let vcf = Writer::from_path(path, &header, true, Format::Vcf).unwrap();\n    /// # let mut record = vcf.empty_record();\n    /// assert!(record.has_filter(\"PASS\".as_bytes()));\n    /// assert!(record.has_filter(\".\".as_bytes()));\n    /// assert!(record.has_filter(&Id(0)));\n    ///\n    /// record.push_filter(\"foo\".as_bytes()).unwrap();\n    /// assert!(record.has_filter(\"foo\".as_bytes()));\n    /// assert!(!record.has_filter(\"PASS\".as_bytes()))\n    /// ```\n    pub fn has_filter<T: FilterId + ?Sized>(&self, flt_id: &T) -> bool {\n        if flt_id.is_pass() && self.inner().d.n_flt == 0 {\n            return true;\n        }\n        let id = match flt_id.id_from_header(self.header()) {\n            Ok(i) => *i,\n            Err(_) => return false,\n        };\n        for i in 0..(self.inner().d.n_flt as isize) {\n            if unsafe { *self.inner().d.flt.offset(i) } == id as i32 {\n                return true;\n            }\n        }\n        false\n    }\n\n    /// Set the given filter IDs to the FILTER column.\n    ///\n    /// Setting an empty slice removes all filters and sets `PASS`.\n    ///\n    /// # Example\n    /// ```rust\n    /// # use rust_htslib::bcf::{Format, Header, Writer};\n    /// # use rust_htslib::bcf::header::Id;\n    /// # use tempfile::NamedTempFile;\n    /// # let tmp = tempfile::NamedTempFile::new().unwrap();\n    /// # let path = tmp.path();\n    /// let mut header = Header::new();\n    /// header.push_record(br#\"##FILTER=<ID=foo,Description=\"sample is a foo fighter\">\"#);\n    /// header.push_record(br#\"##FILTER=<ID=bar,Description=\"a horse walks into...\">\"#);\n    /// # let vcf = Writer::from_path(path, &header, true, Format::Vcf).unwrap();\n    /// # let mut record = vcf.empty_record();\n    /// let foo = record.header().name_to_id(b\"foo\").unwrap();\n    /// let bar = record.header().name_to_id(b\"bar\").unwrap();\n    /// assert!(record.has_filter(\"PASS\".as_bytes()));\n    /// let mut filters = vec![&foo, &bar];\n    /// record.set_filters(&filters).unwrap();\n    /// assert!(record.has_filter(&foo));\n    /// assert!(record.has_filter(&bar));\n    /// assert!(!record.has_filter(\"PASS\".as_bytes()));\n    /// filters.clear();\n    /// record.set_filters(&filters).unwrap();\n    /// assert!(record.has_filter(\"PASS\".as_bytes()));\n    /// assert!(!record.has_filter(\"foo\".as_bytes()));\n    /// // 'baz' isn't in the header\n    /// assert!(record.set_filters(&[\"baz\".as_bytes()]).is_err())\n    /// ```\n    ///\n    /// # Errors\n    /// If any of the filter IDs do not exist in the header, an [`Error::BcfUnknownID`] is returned.\n    ///\n    pub fn set_filters<T: FilterId + ?Sized>(&mut self, flt_ids: &[&T]) -> Result<()> {\n        let mut ids: Vec<i32> = flt_ids\n            .iter()\n            .map(|id| id.id_from_header(self.header()).map(|id| *id as i32))\n            .collect::<Result<Vec<i32>>>()?;\n        unsafe {\n            htslib::bcf_update_filter(\n                self.header().inner,\n                self.inner,\n                ids.as_mut_ptr(),\n                ids.len() as i32,\n            );\n        };\n        Ok(())\n    }\n\n    /// Add the given filter to the FILTER column.\n    ///\n    /// If `flt_id` is `PASS` or `.` then all existing filters are removed first. Otherwise,\n    /// any existing `PASS` filter is removed.\n    ///\n    /// # Example\n    /// ```rust\n    /// # use rust_htslib::bcf::{Format, Header, Writer};\n    /// # use tempfile::NamedTempFile;\n    /// # let tmp = tempfile::NamedTempFile::new().unwrap();\n    /// # let path = tmp.path();\n    /// let mut header = Header::new();\n    /// header.push_record(br#\"##FILTER=<ID=foo,Description=\"sample is a foo fighter\">\"#);\n    /// header.push_record(br#\"##FILTER=<ID=bar,Description=\"dranks\">\"#);\n    /// # let vcf = Writer::from_path(path, &header, true, Format::Vcf).unwrap();\n    /// # let mut record = vcf.empty_record();\n    /// let foo = \"foo\".as_bytes();\n    /// let bar = record.header().name_to_id(b\"bar\").unwrap();\n    /// assert!(record.has_filter(\"PASS\".as_bytes()));\n    ///\n    /// record.push_filter(foo).unwrap();\n    /// record.push_filter(&bar).unwrap();\n    /// assert!(record.has_filter(foo));\n    /// assert!(record.has_filter(&bar));\n    /// // filter must exist in the header\n    /// assert!(record.push_filter(\"baz\".as_bytes()).is_err())\n    /// ```\n    ///\n    /// # Errors\n    /// If the `flt_id` does not exist in the header, an [`Error::BcfUnknownID`] is returned.\n    ///\n    pub fn push_filter<T: FilterId + ?Sized>(&mut self, flt_id: &T) -> Result<()> {\n        let id = flt_id.id_from_header(self.header())?;\n        unsafe {\n            htslib::bcf_add_filter(self.header().inner, self.inner, *id as i32);\n        };\n        Ok(())\n    }\n\n    /// Remove the given filter from the FILTER column.\n    ///\n    /// # Arguments\n    ///\n    /// - `flt_id` - The corresponding filter ID to remove.\n    /// - `pass_on_empty` - Set to `PASS` when removing the last filter.\n    ///\n    /// # Example\n    /// ```rust\n    /// # use rust_htslib::bcf::{Format, Header, Writer};\n    /// # use tempfile::NamedTempFile;\n    /// # let tmp = tempfile::NamedTempFile::new().unwrap();\n    /// # let path = tmp.path();\n    /// let mut header = Header::new();\n    /// header.push_record(br#\"##FILTER=<ID=foo,Description=\"sample is a foo fighter\">\"#);\n    /// header.push_record(br#\"##FILTER=<ID=bar,Description=\"a horse walks into...\">\"#);\n    /// # let vcf = Writer::from_path(path, &header, true, Format::Vcf).unwrap();\n    /// # let mut record = vcf.empty_record();\n    /// let foo = \"foo\".as_bytes();\n    /// let bar = \"bar\".as_bytes();\n    /// record.set_filters(&[foo, bar]).unwrap();\n    /// assert!(record.has_filter(foo));\n    /// assert!(record.has_filter(bar));\n    ///\n    /// record.remove_filter(foo, true).unwrap();\n    /// assert!(!record.has_filter(foo));\n    /// assert!(record.has_filter(bar));\n    /// // 'baz' is not in the header\n    /// assert!(record.remove_filter(\"baz\".as_bytes(), true).is_err());\n    ///\n    /// record.remove_filter(bar, true).unwrap();\n    /// assert!(!record.has_filter(bar));\n    /// assert!(record.has_filter(\"PASS\".as_bytes()));\n    /// ```\n    ///\n    /// # Errors\n    /// If the `flt_id` does not exist in the header, an [`Error::BcfUnknownID`] is returned.\n    ///\n    pub fn remove_filter<T: FilterId + ?Sized>(\n        &mut self,\n        flt_id: &T,\n        pass_on_empty: bool,\n    ) -> Result<()> {\n        let id = flt_id.id_from_header(self.header())?;\n        unsafe {\n            htslib::bcf_remove_filter(\n                self.header().inner,\n                self.inner,\n                *id as i32,\n                pass_on_empty as i32,\n            )\n        };\n        Ok(())\n    }\n\n    /// Get alleles strings.\n    ///\n    /// The first allele is the reference allele.\n    pub fn alleles(&self) -> Vec<&[u8]> {\n        unsafe { htslib::bcf_unpack(self.inner, htslib::BCF_UN_ALL as i32) };\n        let n = self.inner().n_allele() as usize;\n        let dec = self.inner().d;\n        let alleles = unsafe { slice::from_raw_parts(dec.allele, n) };\n        (0..n)\n            .map(|i| unsafe { ffi::CStr::from_ptr(alleles[i]).to_bytes() })\n            .collect()\n    }\n\n    /// Set alleles. The first allele is the reference allele.\n    ///\n    /// # Example\n    /// ```rust\n    /// # use rust_htslib::bcf::{Format, Writer};\n    /// # use rust_htslib::bcf::header::Header;\n    /// #\n    /// # // Create minimal VCF header with a single sample\n    /// # let mut header = Header::new();\n    /// # header.push_sample(\"sample\".as_bytes());\n    /// #\n    /// # // Write uncompressed VCF to stdout with above header and get an empty record\n    /// # let mut vcf = Writer::from_stdout(&header, true, Format::Vcf).unwrap();\n    /// # let mut record = vcf.empty_record();\n    /// assert_eq!(record.allele_count(), 0);\n    ///\n    /// let alleles: &[&[u8]] = &[b\"A\", b\"TG\"];\n    /// record.set_alleles(alleles).expect(\"Failed to set alleles\");\n    /// assert_eq!(record.allele_count(), 2)\n    /// ```\n    pub fn set_alleles(&mut self, alleles: &[&[u8]]) -> Result<()> {\n        let cstrings: Vec<ffi::CString> = alleles\n            .iter()\n            .map(|vec| ffi::CString::new(*vec).unwrap())\n            .collect();\n        let mut ptrs: Vec<*const c_char> = cstrings\n            .iter()\n            .map(|cstr| cstr.as_ptr() as *const c_char)\n            .collect();\n        if unsafe {\n            htslib::bcf_update_alleles(\n                self.header().inner,\n                self.inner,\n                ptrs.as_mut_ptr(),\n                alleles.len() as i32,\n            )\n        } == 0\n        {\n            Ok(())\n        } else {\n            Err(Error::BcfSetValues)\n        }\n    }\n\n    /// Get variant quality.\n    pub fn qual(&self) -> f32 {\n        self.inner().qual\n    }\n\n    /// Set variant quality.\n    pub fn set_qual(&mut self, qual: f32) {\n        self.inner_mut().qual = qual;\n    }\n\n    pub fn info<'a>(&'a self, tag: &'a [u8]) -> Info<'a, Buffer> {\n        self.info_shared_buffer(tag, Buffer::new())\n    }\n\n    /// Get the value of the given info tag.\n    pub fn info_shared_buffer<'a, 'b, B: BorrowMut<Buffer> + Borrow<Buffer> + 'b>(\n        &'a self,\n        tag: &'a [u8],\n        buffer: B,\n    ) -> Info<'a, B> {\n        Info {\n            record: self,\n            tag,\n            buffer,\n        }\n    }\n\n    /// Get the number of samples in the record.\n    pub fn sample_count(&self) -> u32 {\n        self.inner().n_sample()\n    }\n\n    /// Get the number of alleles, including reference allele.\n    pub fn allele_count(&self) -> u32 {\n        self.inner().n_allele()\n    }\n\n    /// Add/replace genotypes in FORMAT GT tag.\n    ///\n    /// # Arguments\n    ///\n    /// - `genotypes` - a flattened, two-dimensional array of GenotypeAllele,\n    ///   the first dimension contains one array for each sample.\n    ///\n    /// # Errors\n    ///\n    /// Returns error if GT tag is not present in header.\n    ///\n    /// # Example\n    ///\n    /// Example assumes we have a Record `record` from a VCF with a `GT` `FORMAT` tag.\n    /// See [module documentation](../index.html#example-writing) for how to set up\n    /// VCF, header, and record.\n    ///\n    /// ```\n    /// # use rust_htslib::bcf::{Format, Writer};\n    /// # use rust_htslib::bcf::header::Header;\n    /// # use rust_htslib::bcf::record::GenotypeAllele;\n    /// # let mut header = Header::new();\n    /// # let header_contig_line = r#\"##contig=<ID=1,length=10>\"#;\n    /// # header.push_record(header_contig_line.as_bytes());\n    /// # let header_gt_line = r#\"##FORMAT=<ID=GT,Number=1,Type=String,Description=\"Genotype\">\"#;\n    /// # header.push_record(header_gt_line.as_bytes());\n    /// # header.push_sample(\"test_sample\".as_bytes());\n    /// # let mut vcf = Writer::from_stdout(&header, true, Format::Vcf).unwrap();\n    /// # let mut record = vcf.empty_record();\n    /// let alleles = &[GenotypeAllele::Unphased(1), GenotypeAllele::Unphased(1)];\n    /// record.push_genotypes(alleles);\n    /// assert_eq!(\"1/1\", &format!(\"{}\", record.genotypes().unwrap().get(0)));\n    /// ```\n    pub fn push_genotypes(&mut self, genotypes: &[GenotypeAllele]) -> Result<()> {\n        let encoded: Vec<i32> = genotypes.iter().map(|gt| i32::from(*gt)).collect();\n        self.push_format_integer(b\"GT\", &encoded)\n    }\n\n    /// Add/replace genotypes in FORMAT GT tag by providing a list of genotypes.\n    ///\n    /// # Arguments\n    ///\n    /// - `genotypes` - a two-dimensional array of GenotypeAllele\n    /// - `max_ploidy` - the maximum number of alleles allowed for any genotype on any sample.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if any genotype has more allelles than `max_ploidy` or if the GT tag is not present in the header.\n    ///\n    /// # Example\n    ///\n    /// Example assumes we have a Record `record` from a VCF with a `GT` `FORMAT` tag and three samples.\n    /// See [module documentation](../index.html#example-writing) for how to set up\n    /// VCF, header, and record.\n    ///\n    /// ```\n    /// # use rust_htslib::bcf::{Format, Writer};\n    /// # use rust_htslib::bcf::header::Header;\n    /// # use rust_htslib::bcf::record::GenotypeAllele;\n    /// # use std::iter;\n    /// # let mut header = Header::new();\n    /// # let header_contig_line = r#\"##contig=<ID=1,length=10>\"#;\n    /// # header.push_record(header_contig_line.as_bytes());\n    /// # let header_gt_line = r#\"##FORMAT=<ID=GT,Number=1,Type=String,Description=\"Genotype\">\"#;\n    /// # header.push_record(header_gt_line.as_bytes());\n    /// # header.push_sample(\"first_sample\".as_bytes());\n    /// # header.push_sample(\"second_sample\".as_bytes());\n    /// # header.push_sample(\"third_sample\".as_bytes());\n    /// # let mut vcf = Writer::from_stdout(&header, true, Format::Vcf)?;\n    /// # let mut record = vcf.empty_record();\n    /// let alleles = vec![\n    ///     vec![GenotypeAllele::Unphased(1), GenotypeAllele::Unphased(1)],\n    ///     vec![GenotypeAllele::Unphased(0), GenotypeAllele::Phased(1)],\n    ///     vec![GenotypeAllele::Unphased(0)],\n    /// ];\n    /// record.push_genotype_structured(&alleles, 2);\n    /// let gts = record.genotypes()?;\n    /// assert_eq!(\"1/1\", &format!(\"{}\", gts.get(0)));\n    /// assert_eq!(\"0|1\", &format!(\"{}\", gts.get(1)));\n    /// assert_eq!(\"0\", &format!(\"{}\", gts.get(2)));\n    /// # Ok::<(), rust_htslib::errors::Error>(())\n    /// ```\n    pub fn push_genotype_structured<GT>(\n        &mut self,\n        genotypes: &[GT],\n        max_ploidy: usize,\n    ) -> Result<()>\n    where\n        GT: AsRef<[GenotypeAllele]>,\n    {\n        let mut data = Vec::with_capacity(max_ploidy * genotypes.len());\n        for gt in genotypes {\n            if gt.as_ref().len() > max_ploidy {\n                return Err(Error::BcfSetValues);\n            }\n            data.extend(\n                gt.as_ref()\n                    .iter()\n                    .map(|gta| i32::from(*gta))\n                    .chain(iter::repeat_n(\n                        VECTOR_END_INTEGER,\n                        max_ploidy - gt.as_ref().len(),\n                    )),\n            );\n        }\n        self.push_format_integer(b\"GT\", &data)\n    }\n\n    /// Get genotypes as vector of one `Genotype` per sample.\n    ///\n    /// # Example\n    /// Parsing genotype field (`GT` tag) from a VCF record:\n    /// ```\n    /// use crate::rust_htslib::bcf::{Reader, Read};\n    /// let mut vcf = Reader::from_path(&\"test/test_string.vcf\").expect(\"Error opening file.\");\n    /// let expected = [\"./1\", \"1|1\", \"0/1\", \"0|1\", \"1|.\", \"1/1\"];\n    /// for (rec, exp_gt) in vcf.records().zip(expected.iter()) {\n    ///     let mut rec = rec.expect(\"Error reading record.\");\n    ///     let genotypes = rec.genotypes().expect(\"Error reading genotypes\");\n    ///     assert_eq!(&format!(\"{}\", genotypes.get(0)), exp_gt);\n    /// }\n    /// ```\n    pub fn genotypes(&self) -> Result<Genotypes<'_, Buffer>> {\n        self.genotypes_shared_buffer(Buffer::new())\n    }\n\n    /// Get genotypes as vector of one `Genotype` per sample, using a given shared buffer\n    /// to avoid unnecessary allocations.\n    pub fn genotypes_shared_buffer<'a, B>(&self, buffer: B) -> Result<Genotypes<'a, B>>\n    where\n        B: BorrowMut<Buffer> + Borrow<Buffer> + 'a,\n    {\n        Ok(Genotypes {\n            encoded: self.format_shared_buffer(b\"GT\", buffer).integer()?,\n        })\n    }\n\n    /// Retrieve data for a `FORMAT` field\n    ///\n    /// # Example\n    /// *Note: some boilerplate for the example is hidden for clarity. See [module documentation](../index.html#example-writing)\n    /// for an example of the setup used here.*\n    ///\n    /// ```rust\n    /// # use rust_htslib::bcf::{Format, Writer};\n    /// # use rust_htslib::bcf::header::Header;\n    /// #\n    /// # // Create minimal VCF header with a single sample\n    /// # let mut header = Header::new();\n    /// header.push_sample(b\"sample1\").push_sample(b\"sample2\").push_record(br#\"##FORMAT=<ID=DP,Number=1,Type=Integer,Description=\"Read Depth\">\"#);\n    /// #\n    /// # // Write uncompressed VCF to stdout with above header and get an empty record\n    /// # let mut vcf = Writer::from_stdout(&header, true, Format::Vcf).unwrap();\n    /// # let mut record = vcf.empty_record();\n    /// record.push_format_integer(b\"DP\", &[20, 12]).expect(\"Failed to set DP format field\");\n    ///\n    /// let read_depths = record.format(b\"DP\").integer().expect(\"Couldn't retrieve DP field\");\n    /// let sample1_depth = read_depths[0];\n    /// assert_eq!(sample1_depth, &[20]);\n    /// let sample2_depth = read_depths[1];\n    /// assert_eq!(sample2_depth, &[12])\n    /// ```\n    ///\n    /// # Errors\n    /// **Attention:** the returned [`BufferBacked`] from [`integer()`](Format::integer)\n    /// (`read_depths`), which holds the data, has to be kept in scope as long as the data is\n    /// accessed. If parts of the data are accessed after the `BufferBacked` object is been\n    /// dropped, you will access unallocated memory.\n    pub fn format<'a>(&'a self, tag: &'a [u8]) -> Format<'a, Buffer> {\n        self.format_shared_buffer(tag, Buffer::new())\n    }\n\n    /// Get the value of the given format tag for each sample.\n    pub fn format_shared_buffer<'a, 'b, B: BorrowMut<Buffer> + Borrow<Buffer> + 'b>(\n        &'a self,\n        tag: &'a [u8],\n        buffer: B,\n    ) -> Format<'a, B> {\n        Format::new(self, tag, buffer)\n    }\n\n    /// Add/replace an integer-typed FORMAT tag.\n    ///\n    /// # Arguments\n    ///\n    /// - `tag` - The tag's string.\n    /// - `data` - a flattened, two-dimensional array, the first dimension contains one array\n    ///   for each sample.\n    ///\n    /// # Errors\n    ///\n    /// Returns error if tag is not present in header.\n    pub fn push_format_integer(&mut self, tag: &[u8], data: &[i32]) -> Result<()> {\n        self.push_format(tag, data, htslib::BCF_HT_INT)\n    }\n\n    /// Add/replace a float-typed FORMAT tag.\n    ///\n    /// # Arguments\n    ///\n    /// - `tag` - The tag's string.\n    /// - `data` - a flattened, two-dimensional array, the first dimension contains one array\n    ///   for each sample.\n    ///\n    /// # Errors\n    ///\n    /// Returns error if tag is not present in header.\n    ///\n    /// # Example\n    ///\n    /// Example assumes we have a Record `record` from a VCF with an `AF` `FORMAT` tag.\n    /// See [module documentation](../index.html#example-writing) for how to set up\n    /// VCF, header, and record.\n    ///\n    /// ```\n    /// # use rust_htslib::bcf::{Format, Writer};\n    /// # use rust_htslib::bcf::header::Header;\n    /// # use rust_htslib::bcf::record::GenotypeAllele;\n    /// # let mut header = Header::new();\n    /// # let header_contig_line = r#\"##contig=<ID=1,length=10>\"#;\n    /// # header.push_record(header_contig_line.as_bytes());\n    /// # let header_af_line = r#\"##FORMAT=<ID=AF,Number=1,Type=Float,Description=\"Frequency\">\"#;\n    /// # header.push_record(header_af_line.as_bytes());\n    /// # header.push_sample(\"test_sample\".as_bytes());\n    /// # let mut vcf = Writer::from_stdout(&header, true, Format::Vcf).unwrap();\n    /// # let mut record = vcf.empty_record();\n    /// record.push_format_float(b\"AF\", &[0.5]);\n    /// assert_eq!(0.5, record.format(b\"AF\").float().unwrap()[0][0]);\n    /// ```\n    pub fn push_format_float(&mut self, tag: &[u8], data: &[f32]) -> Result<()> {\n        self.push_format(tag, data, htslib::BCF_HT_REAL)\n    }\n\n    /// Add/replace a single-char-typed FORMAT tag.\n    ///\n    /// # Arguments\n    ///\n    /// - `tag` - The tag's string.\n    /// - `data` - a flattened, two-dimensional array, the first dimension contains one array\n    ///   for each sample.\n    ///\n    /// # Errors\n    ///\n    /// Returns error if tag is not present in header.\n    pub fn push_format_char(&mut self, tag: &[u8], data: &[u8]) -> Result<()> {\n        self.push_format(tag, data, htslib::BCF_HT_STR)\n    }\n\n    /// Add a format tag. Data is a flattened two-dimensional array.\n    /// The first dimension contains one array for each sample.\n    fn push_format<T>(&mut self, tag: &[u8], data: &[T], ht: u32) -> Result<()> {\n        let tag_c_str = ffi::CString::new(tag).unwrap();\n        unsafe {\n            if htslib::bcf_update_format(\n                self.header().inner,\n                self.inner,\n                tag_c_str.as_ptr() as *mut c_char,\n                data.as_ptr() as *const ::std::os::raw::c_void,\n                data.len() as i32,\n                ht as i32,\n            ) == 0\n            {\n                Ok(())\n            } else {\n                Err(Error::BcfSetTag {\n                    tag: str::from_utf8(tag).unwrap().to_owned(),\n                })\n            }\n        }\n    }\n\n    // TODO: should we add convenience methods clear_format_*?\n\n    /// Add a string-typed FORMAT tag. Note that genotypes are treated as a special case\n    /// and cannot be added with this method. See instead [push_genotypes](#method.push_genotypes).\n    ///\n    /// # Arguments\n    ///\n    /// - `tag` - The tag's string.\n    /// - `data` - a two-dimensional array, the first dimension contains one array\n    ///   for each sample. Must be non-empty.\n    ///\n    /// # Errors\n    ///\n    /// Returns error if tag is not present in header.\n    pub fn push_format_string<D: Borrow<[u8]>>(&mut self, tag: &[u8], data: &[D]) -> Result<()> {\n        assert!(\n            !data.is_empty(),\n            \"given string data must have at least 1 element\"\n        );\n        let c_data = data\n            .iter()\n            .map(|s| ffi::CString::new(s.borrow()).unwrap())\n            .collect::<Vec<ffi::CString>>();\n        let c_ptrs = c_data\n            .iter()\n            .map(|s| s.as_ptr() as *mut i8)\n            .collect::<Vec<*mut i8>>();\n        let tag_c_str = ffi::CString::new(tag).unwrap();\n        unsafe {\n            if htslib::bcf_update_format_string(\n                self.header().inner,\n                self.inner,\n                tag_c_str.as_ptr() as *mut c_char,\n                c_ptrs.as_slice().as_ptr() as *mut *const c_char,\n                data.len() as i32,\n            ) == 0\n            {\n                Ok(())\n            } else {\n                Err(Error::BcfSetTag {\n                    tag: str::from_utf8(tag).unwrap().to_owned(),\n                })\n            }\n        }\n    }\n\n    /// Add/replace an integer-typed INFO entry.\n    pub fn push_info_integer(&mut self, tag: &[u8], data: &[i32]) -> Result<()> {\n        self.push_info(tag, data, htslib::BCF_HT_INT)\n    }\n\n    /// Remove the integer-typed INFO entry.\n    pub fn clear_info_integer(&mut self, tag: &[u8]) -> Result<()> {\n        self.push_info::<i32>(tag, &[], htslib::BCF_HT_INT)\n    }\n\n    /// Add/replace a float-typed INFO entry.\n    pub fn push_info_float(&mut self, tag: &[u8], data: &[f32]) -> Result<()> {\n        self.push_info(tag, data, htslib::BCF_HT_REAL)\n    }\n\n    /// Remove the float-typed INFO entry.\n    pub fn clear_info_float(&mut self, tag: &[u8]) -> Result<()> {\n        self.push_info::<u8>(tag, &[], htslib::BCF_HT_REAL)\n    }\n\n    /// Add/replace an INFO tag.\n    ///\n    /// # Arguments\n    /// * `tag` - the tag to add/replace\n    /// * `data` - the data to set\n    /// * `ht` - the HTSLib type to use\n    fn push_info<T>(&mut self, tag: &[u8], data: &[T], ht: u32) -> Result<()> {\n        let tag_c_str = ffi::CString::new(tag).unwrap();\n        unsafe {\n            if htslib::bcf_update_info(\n                self.header().inner,\n                self.inner,\n                tag_c_str.as_ptr() as *mut c_char,\n                data.as_ptr() as *const ::std::os::raw::c_void,\n                data.len() as i32,\n                ht as i32,\n            ) == 0\n            {\n                Ok(())\n            } else {\n                Err(Error::BcfSetTag {\n                    tag: str::from_utf8(tag).unwrap().to_owned(),\n                })\n            }\n        }\n    }\n\n    /// Set flag into the INFO column.\n    pub fn push_info_flag(&mut self, tag: &[u8]) -> Result<()> {\n        self.push_info_string_impl(tag, &[b\"\"], htslib::BCF_HT_FLAG)\n    }\n\n    /// Remove the flag from the INFO column.\n    pub fn clear_info_flag(&mut self, tag: &[u8]) -> Result<()> {\n        self.push_info_string_impl(tag, &[], htslib::BCF_HT_FLAG)\n    }\n\n    /// Add/replace a string-typed INFO entry.\n    pub fn push_info_string(&mut self, tag: &[u8], data: &[&[u8]]) -> Result<()> {\n        self.push_info_string_impl(tag, data, htslib::BCF_HT_STR)\n    }\n\n    /// Remove the string field from the INFO column.\n    pub fn clear_info_string(&mut self, tag: &[u8]) -> Result<()> {\n        self.push_info_string_impl(tag, &[], htslib::BCF_HT_STR)\n    }\n\n    /// Add an string-valued INFO tag.\n    fn push_info_string_impl(&mut self, tag: &[u8], data: &[&[u8]], ht: u32) -> Result<()> {\n        let mut buf: Vec<u8> = Vec::new();\n        for (i, &s) in data.iter().enumerate() {\n            if i > 0 {\n                buf.extend(b\",\");\n            }\n            buf.extend(s);\n        }\n        let c_str = ffi::CString::new(buf).unwrap();\n        let len = if ht == htslib::BCF_HT_FLAG {\n            data.len()\n        } else {\n            c_str.to_bytes().len()\n        };\n        let tag_c_str = ffi::CString::new(tag).unwrap();\n        unsafe {\n            if htslib::bcf_update_info(\n                self.header().inner,\n                self.inner,\n                tag_c_str.as_ptr() as *mut c_char,\n                c_str.as_ptr() as *const ::std::os::raw::c_void,\n                len as i32,\n                ht as i32,\n            ) == 0\n            {\n                Ok(())\n            } else {\n                Err(Error::BcfSetTag {\n                    tag: str::from_utf8(tag).unwrap().to_owned(),\n                })\n            }\n        }\n    }\n\n    /// Remove unused alleles.\n    pub fn trim_alleles(&mut self) -> Result<()> {\n        match unsafe { htslib::bcf_trim_alleles(self.header().inner, self.inner) } {\n            -1 => Err(Error::BcfRemoveAlleles),\n            _ => Ok(()),\n        }\n    }\n\n    pub fn remove_alleles(&mut self, remove: &[bool]) -> Result<()> {\n        let rm_set = unsafe { htslib::kbs_init(remove.len()) };\n\n        for (i, &r) in remove.iter().enumerate() {\n            if r {\n                unsafe {\n                    htslib::kbs_insert(rm_set, i as i32);\n                }\n            }\n        }\n\n        let ret = unsafe { htslib::bcf_remove_allele_set(self.header().inner, self.inner, rm_set) };\n\n        unsafe {\n            htslib::kbs_destroy(rm_set);\n        }\n\n        match ret {\n            -1 => Err(Error::BcfRemoveAlleles),\n            _ => Ok(()),\n        }\n    }\n\n    /// Get the length of the reference allele. If the record has no reference allele, then the\n    /// result will be `0`.\n    ///\n    /// # Example\n    /// ```rust\n    /// # use rust_htslib::bcf::{Format, Writer};\n    /// # use rust_htslib::bcf::header::Header;\n    /// #\n    /// # // Create minimal VCF header with a single sample\n    /// # let mut header = Header::new();\n    /// # header.push_sample(\"sample\".as_bytes());\n    /// #\n    /// # // Write uncompressed VCF to stdout with above header and get an empty record\n    /// # let mut vcf = Writer::from_stdout(&header, true, Format::Vcf).unwrap();\n    /// # let mut record = vcf.empty_record();\n    /// # assert_eq!(record.rlen(), 0);\n    /// let alleles: &[&[u8]] = &[b\"AGG\", b\"TG\"];\n    /// record.set_alleles(alleles).expect(\"Failed to set alleles\");\n    /// assert_eq!(record.rlen(), 3)\n    /// ```\n    pub fn rlen(&self) -> i64 {\n        self.inner().rlen\n    }\n\n    /// Clear all parts of the record. Useful if you plan to reuse a record object multiple times.\n    ///\n    /// # Example\n    /// ```rust\n    /// # use rust_htslib::bcf::{Format, Writer};\n    /// # use rust_htslib::bcf::header::Header;\n    /// #\n    /// # // Create minimal VCF header with a single sample\n    /// # let mut header = Header::new();\n    /// # header.push_sample(\"sample\".as_bytes());\n    /// #\n    /// # // Write uncompressed VCF to stdout with above header and get an empty record\n    /// # let mut vcf = Writer::from_stdout(&header, true, Format::Vcf).unwrap();\n    /// # let mut record = vcf.empty_record();\n    /// let alleles: &[&[u8]] = &[b\"AGG\", b\"TG\"];\n    /// record.set_alleles(alleles).expect(\"Failed to set alleles\");\n    /// record.set_pos(6);\n    /// record.clear();\n    /// assert_eq!(record.rlen(), 0);\n    /// assert_eq!(record.pos(), 0)\n    /// ```\n    pub fn clear(&self) {\n        unsafe { htslib::bcf_clear(self.inner) }\n    }\n\n    /// Provide short description of record for locating it in the BCF/VCF file.\n    pub fn desc(&self) -> String {\n        if let Some(rid) = self.rid() {\n            if let Ok(contig) = self.header.rid2name(rid) {\n                return format!(\"{}:{}\", str::from_utf8(contig).unwrap(), self.pos());\n            }\n        }\n        \"\".to_owned()\n    }\n\n    /// Convert to VCF String\n    ///\n    /// Intended for debug only. Use Writer for efficient VCF output.\n    ///\n    pub fn to_vcf_string(&self) -> Result<String> {\n        let mut buf = htslib::kstring_t {\n            l: 0,\n            m: 0,\n            s: ptr::null_mut(),\n        };\n        let ret = unsafe { htslib::vcf_format(self.header().inner, self.inner, &mut buf) };\n\n        if ret < 0 {\n            if !buf.s.is_null() {\n                unsafe {\n                    libc::free(buf.s as *mut libc::c_void);\n                }\n            }\n            return Err(Error::BcfToString);\n        }\n\n        let vcf_str = unsafe {\n            let vcf_str = String::from(ffi::CStr::from_ptr(buf.s).to_str().unwrap());\n            if !buf.s.is_null() {\n                libc::free(buf.s as *mut libc::c_void);\n            }\n            vcf_str\n        };\n\n        Ok(vcf_str)\n    }\n}\n\nimpl Clone for Record {\n    fn clone(&self) -> Self {\n        let inner = unsafe { htslib::bcf_dup(self.inner) };\n        Record {\n            inner,\n            header: self.header.clone(),\n        }\n    }\n}\n\nimpl genome::AbstractLocus for Record {\n    fn contig(&self) -> &str {\n        str::from_utf8(\n            self.header()\n                .rid2name(self.rid().expect(\"rid not set\"))\n                .expect(\"unable to find rid in header\"),\n        )\n        .expect(\"unable to interpret contig name as UTF-8\")\n    }\n\n    fn pos(&self) -> u64 {\n        self.pos() as u64\n    }\n}\n\n/// Phased or unphased alleles, represented as indices.\n#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]\npub enum GenotypeAllele {\n    Unphased(i32),\n    Phased(i32),\n    UnphasedMissing,\n    PhasedMissing,\n}\n\nimpl GenotypeAllele {\n    /// Decode given integer according to BCF standard.\n    #[deprecated(\n        since = \"0.36.0\",\n        note = \"Please use the conversion trait From<i32> for GenotypeAllele instead.\"\n    )]\n    pub fn from_encoded(encoded: i32) -> Self {\n        match (encoded, encoded & 1) {\n            (0, 0) => GenotypeAllele::UnphasedMissing,\n            (1, 1) => GenotypeAllele::PhasedMissing,\n            (e, 1) => GenotypeAllele::Phased((e >> 1) - 1),\n            (e, 0) => GenotypeAllele::Unphased((e >> 1) - 1),\n            _ => panic!(\"unexpected phasing type\"),\n        }\n    }\n\n    /// Get the index into the list of alleles.\n    pub fn index(self) -> Option<u32> {\n        match self {\n            GenotypeAllele::Unphased(i) | GenotypeAllele::Phased(i) => Some(i as u32),\n            GenotypeAllele::UnphasedMissing | GenotypeAllele::PhasedMissing => None,\n        }\n    }\n}\n\nimpl fmt::Display for GenotypeAllele {\n    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {\n        match self.index() {\n            Some(a) => write!(f, \"{}\", a),\n            None => write!(f, \".\"),\n        }\n    }\n}\n\nimpl From<GenotypeAllele> for i32 {\n    fn from(allele: GenotypeAllele) -> i32 {\n        let (allele, phased) = match allele {\n            GenotypeAllele::UnphasedMissing => (-1, 0),\n            GenotypeAllele::PhasedMissing => (-1, 1),\n            GenotypeAllele::Unphased(a) => (a, 0),\n            GenotypeAllele::Phased(a) => (a, 1),\n        };\n        ((allele + 1) << 1) | phased\n    }\n}\n\nimpl From<i32> for GenotypeAllele {\n    fn from(encoded: i32) -> GenotypeAllele {\n        match (encoded, encoded & 1) {\n            (0, 0) => GenotypeAllele::UnphasedMissing,\n            (1, 1) => GenotypeAllele::PhasedMissing,\n            (e, 1) => GenotypeAllele::Phased((e >> 1) - 1),\n            (e, 0) => GenotypeAllele::Unphased((e >> 1) - 1),\n            _ => panic!(\"unexpected phasing type\"),\n        }\n    }\n}\n\ncustom_derive! {\n    /// Genotype representation as a vector of `GenotypeAllele`.\n    #[derive(NewtypeDeref, Debug, Clone, PartialEq, Eq, Hash)]\n    pub struct Genotype(Vec<GenotypeAllele>);\n}\n\nimpl fmt::Display for Genotype {\n    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {\n        let Genotype(alleles) = self;\n        write!(f, \"{}\", alleles[0])?;\n        for a in &alleles[1..] {\n            let sep = match a {\n                GenotypeAllele::Phased(_) | GenotypeAllele::PhasedMissing => '|',\n                GenotypeAllele::Unphased(_) | GenotypeAllele::UnphasedMissing => '/',\n            };\n            write!(f, \"{}{}\", sep, a)?;\n        }\n        Ok(())\n    }\n}\n\n/// Lazy representation of genotypes, that does no computation until a particular genotype is queried.\n#[derive(Debug)]\npub struct Genotypes<'a, B>\nwhere\n    B: Borrow<Buffer> + 'a,\n{\n    encoded: BufferBacked<'a, Vec<&'a [i32]>, B>,\n}\n\nimpl<'a, B: Borrow<Buffer> + 'a> Genotypes<'a, B> {\n    /// Get genotype of ith sample.\n    ///\n    /// Note that the result complies with the BCF spec. This means that the\n    /// first allele will always be marked as `Unphased`. That is, if you have 1|1 in the VCF,\n    /// this method will return `[Unphased(1), Phased(1)]`.\n    pub fn get(&self, i: usize) -> Genotype {\n        let igt = self.encoded[i];\n        let allelles = igt\n            .iter()\n            .take_while(|&&i| i != VECTOR_END_INTEGER)\n            .map(|&i| GenotypeAllele::from(i))\n            .collect();\n        Genotype(allelles)\n    }\n}\n\nimpl Drop for Record {\n    fn drop(&mut self) {\n        unsafe { htslib::bcf_destroy(self.inner) };\n    }\n}\n\nunsafe impl Send for Record {}\n\nunsafe impl Sync for Record {}\n\n/// Info tag representation.\n#[derive(Debug)]\npub struct Info<'a, B: BorrowMut<Buffer> + Borrow<Buffer>> {\n    record: &'a Record,\n    tag: &'a [u8],\n    buffer: B,\n}\n\npub type BufferBackedOption<'b, B> = Option<BufferBacked<'b, Vec<&'b [u8]>, B>>;\n\nimpl<'b, B: BorrowMut<Buffer> + Borrow<Buffer> + 'b> Info<'_, B> {\n    /// Short description of info tag.\n    pub fn desc(&self) -> String {\n        str::from_utf8(self.tag).unwrap().to_owned()\n    }\n\n    fn data(&mut self, data_type: u32) -> Result<Option<i32>> {\n        let mut n: i32 = self.buffer.borrow().len;\n        let c_str = ffi::CString::new(self.tag).unwrap();\n        let ret = unsafe {\n            htslib::bcf_get_info_values(\n                self.record.header().inner,\n                self.record.inner,\n                c_str.as_ptr() as *mut c_char,\n                &mut self.buffer.borrow_mut().inner,\n                &mut n,\n                data_type as i32,\n            )\n        };\n        self.buffer.borrow_mut().len = n;\n\n        match ret {\n            -1 => Err(Error::BcfUndefinedTag { tag: self.desc() }),\n            -2 => Err(Error::BcfUnexpectedType { tag: self.desc() }),\n            -3 => Ok(None),\n            ret => Ok(Some(ret)),\n        }\n    }\n\n    /// Get integers from tag. `None` if tag not present in record.\n    ///\n    /// Import `bcf::record::Numeric` for missing value handling.\n    ///\n    /// **Attention:** the returned BufferBacked which holds the data has to be kept in scope\n    /// as along as the data is accessed. If parts of the data are accessed while\n    /// the BufferBacked object is already dropped, you will access unallocated\n    /// memory.\n    pub fn integer(mut self) -> Result<Option<BufferBacked<'b, &'b [i32], B>>> {\n        self.data(htslib::BCF_HT_INT).map(|data| {\n            data.map(|ret| {\n                let values = unsafe {\n                    slice::from_raw_parts(self.buffer.borrow().inner as *const i32, ret as usize)\n                };\n                BufferBacked::new(&values[..ret as usize], self.buffer)\n            })\n        })\n    }\n\n    /// Get floats from tag. `None` if tag not present in record.\n    ///\n    /// Import `bcf::record::Numeric` for missing value handling.\n    ///\n    /// **Attention:** the returned BufferBacked which holds the data has to be kept in scope\n    /// as along as the data is accessed. If parts of the data are accessed while\n    /// the BufferBacked object is already dropped, you will access unallocated\n    /// memory.\n    pub fn float(mut self) -> Result<Option<BufferBacked<'b, &'b [f32], B>>> {\n        self.data(htslib::BCF_HT_REAL).map(|data| {\n            data.map(|ret| {\n                let values = unsafe {\n                    slice::from_raw_parts(self.buffer.borrow().inner as *const f32, ret as usize)\n                };\n                BufferBacked::new(&values[..ret as usize], self.buffer)\n            })\n        })\n    }\n\n    /// Get flags from tag. `false` if not set.\n    pub fn flag(&mut self) -> Result<bool> {\n        self.data(htslib::BCF_HT_FLAG).map(|data| match data {\n            Some(ret) => ret == 1,\n            None => false,\n        })\n    }\n\n    /// Get strings from tag. `None` if tag not present in record.\n    ///\n    /// **Attention:** the returned BufferBacked which holds the data has to be kept in scope\n    /// as along as the data is accessed. If parts of the data are accessed while\n    /// the BufferBacked object is already dropped, you will access unallocated\n    /// memory.\n    pub fn string(mut self) -> Result<BufferBackedOption<'b, B>> {\n        self.data(htslib::BCF_HT_STR).map(|data| {\n            data.map(|ret| {\n                BufferBacked::new(\n                    unsafe {\n                        slice::from_raw_parts(self.buffer.borrow().inner as *const u8, ret as usize)\n                    }\n                    .split(|c| *c == b',')\n                    .map(|s| {\n                        // stop at zero character\n                        s.split(|c| *c == 0u8)\n                            .next()\n                            .expect(\"Bug: returned string should not be empty.\")\n                    })\n                    .collect(),\n                    self.buffer,\n                )\n            })\n        })\n    }\n}\n\nunsafe impl<B: BorrowMut<Buffer> + Borrow<Buffer>> Send for Info<'_, B> {}\n\nunsafe impl<B: BorrowMut<Buffer> + Borrow<Buffer>> Sync for Info<'_, B> {}\n\nfn trim_slice<T: PartialEq + NumericUtils>(s: &[T]) -> &[T] {\n    s.split(|v| v.is_vector_end())\n        .next()\n        .expect(\"Bug: returned slice should not be empty.\")\n}\n\n// Representation of per-sample data.\n#[derive(Debug)]\npub struct Format<'a, B: BorrowMut<Buffer> + Borrow<Buffer>> {\n    record: &'a Record,\n    tag: &'a [u8],\n    inner: *mut htslib::bcf_fmt_t,\n    buffer: B,\n}\n\nimpl<'a, 'b, B: BorrowMut<Buffer> + Borrow<Buffer> + 'b> Format<'a, B> {\n    /// Create new format data in a given record.\n    fn new(record: &'a Record, tag: &'a [u8], buffer: B) -> Format<'a, B> {\n        let c_str = ffi::CString::new(tag).unwrap();\n        let inner = unsafe {\n            htslib::bcf_get_fmt(\n                record.header().inner,\n                record.inner,\n                c_str.as_ptr() as *mut c_char,\n            )\n        };\n        Format {\n            record,\n            tag,\n            inner,\n            buffer,\n        }\n    }\n\n    /// Provide short description of format entry (just the tag name).\n    pub fn desc(&self) -> String {\n        str::from_utf8(self.tag).unwrap().to_owned()\n    }\n\n    pub fn inner(&self) -> &htslib::bcf_fmt_t {\n        unsafe { &*self.inner }\n    }\n\n    pub fn inner_mut(&mut self) -> &mut htslib::bcf_fmt_t {\n        unsafe { &mut *self.inner }\n    }\n\n    fn values_per_sample(&self) -> usize {\n        self.inner().n as usize\n    }\n\n    /// Read and decode format data into a given type.\n    fn data(&mut self, data_type: u32) -> Result<i32> {\n        let mut n: i32 = self.buffer.borrow().len;\n        let c_str = ffi::CString::new(self.tag).unwrap();\n        let ret = unsafe {\n            htslib::bcf_get_format_values(\n                self.record.header().inner,\n                self.record.inner,\n                c_str.as_ptr() as *mut c_char,\n                &mut self.buffer.borrow_mut().inner,\n                &mut n,\n                data_type as i32,\n            )\n        };\n        self.buffer.borrow_mut().len = n;\n        match ret {\n            -1 => Err(Error::BcfUndefinedTag { tag: self.desc() }),\n            -2 => Err(Error::BcfUnexpectedType { tag: self.desc() }),\n            -3 => Err(Error::BcfMissingTag {\n                tag: self.desc(),\n                record: self.record.desc(),\n            }),\n            ret => Ok(ret),\n        }\n    }\n\n    /// Get format data as integers.\n    ///\n    /// **Attention:** the returned BufferBacked which holds the data has to be kept in scope\n    /// as long as the data is accessed. If parts of the data are accessed while\n    /// the BufferBacked object is already dropped, you will access unallocated\n    /// memory.\n    pub fn integer(mut self) -> Result<BufferBacked<'b, Vec<&'b [i32]>, B>> {\n        self.data(htslib::BCF_HT_INT).map(|ret| {\n            BufferBacked::new(\n                unsafe {\n                    slice::from_raw_parts(\n                        self.buffer.borrow_mut().inner as *const i32,\n                        ret as usize,\n                    )\n                }\n                .chunks(self.values_per_sample())\n                .map(trim_slice)\n                .collect(),\n                self.buffer,\n            )\n        })\n    }\n\n    /// Get format data as floats.\n    ///\n    /// **Attention:** the returned BufferBacked which holds the data has to be kept in scope\n    /// as along as the data is accessed. If parts of the data are accessed while\n    /// the BufferBacked object is already dropped, you will access unallocated\n    /// memory.\n    pub fn float(mut self) -> Result<BufferBacked<'b, Vec<&'b [f32]>, B>> {\n        self.data(htslib::BCF_HT_REAL).map(|ret| {\n            BufferBacked::new(\n                unsafe {\n                    slice::from_raw_parts(\n                        self.buffer.borrow_mut().inner as *const f32,\n                        ret as usize,\n                    )\n                }\n                .chunks(self.values_per_sample())\n                .map(trim_slice)\n                .collect(),\n                self.buffer,\n            )\n        })\n    }\n\n    /// Get format data as byte slices. To obtain the values strings, use `std::str::from_utf8`.\n    ///\n    /// **Attention:** the returned BufferBacked which holds the data has to be kept in scope\n    /// as along as the data is accessed. If parts of the data are accessed while\n    /// the BufferBacked object is already dropped, you will access unallocated\n    /// memory.\n    pub fn string(mut self) -> Result<BufferBacked<'b, Vec<&'b [u8]>, B>> {\n        self.data(htslib::BCF_HT_STR).map(|ret| {\n            if ret == 0 {\n                return BufferBacked::new(Vec::new(), self.buffer);\n            }\n            BufferBacked::new(\n                unsafe {\n                    slice::from_raw_parts(self.buffer.borrow_mut().inner as *const u8, ret as usize)\n                }\n                .chunks(self.values_per_sample())\n                .map(|s| {\n                    // stop at zero character\n                    s.split(|c| *c == 0u8)\n                        .next()\n                        .expect(\"Bug: returned string should not be empty.\")\n                })\n                .collect(),\n                self.buffer,\n            )\n        })\n    }\n}\n\nunsafe impl<B: BorrowMut<Buffer> + Borrow<Buffer>> Send for Format<'_, B> {}\n\nunsafe impl<B: BorrowMut<Buffer> + Borrow<Buffer>> Sync for Format<'_, B> {}\n\n#[derive(Debug)]\npub struct Filters<'a> {\n    /// Reference to the `Record` to enumerate records for.\n    record: &'a Record,\n    /// Index of the next filter to return, if not at end.\n    idx: i32,\n}\n\nimpl<'a> Filters<'a> {\n    pub fn new(record: &'a Record) -> Self {\n        Filters { record, idx: 0 }\n    }\n}\n\nimpl Iterator for Filters<'_> {\n    type Item = Id;\n\n    fn next(&mut self) -> Option<Id> {\n        if self.record.inner().d.n_flt <= self.idx {\n            None\n        } else {\n            let i = self.idx as isize;\n            self.idx += 1;\n            Some(Id(unsafe { *self.record.inner().d.flt.offset(i) } as u32))\n        }\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n    use crate::bcf::{Format, Header, Writer};\n    use tempfile::NamedTempFile;\n\n    #[test]\n    fn test_missing_float() {\n        let expected: u32 = 0x7F80_0001;\n        assert_eq!(MISSING_FLOAT.bits(), expected);\n    }\n\n    #[test]\n    fn test_vector_end_float() {\n        let expected: u32 = 0x7F80_0002;\n        assert_eq!(VECTOR_END_FLOAT.bits(), expected);\n    }\n\n    #[test]\n    fn test_record_rlen() {\n        let tmp = NamedTempFile::new().unwrap();\n        let path = tmp.path();\n        let header = Header::new();\n        let vcf = Writer::from_path(path, &header, true, Format::Vcf).unwrap();\n        let mut record = vcf.empty_record();\n        assert_eq!(record.rlen(), 0);\n        let alleles: &[&[u8]] = &[b\"AGG\", b\"TG\"];\n        record.set_alleles(alleles).expect(\"Failed to set alleles\");\n        assert_eq!(record.rlen(), 3)\n    }\n\n    #[test]\n    fn test_record_end() {\n        let tmp = NamedTempFile::new().unwrap();\n        let path = tmp.path();\n        let header = Header::new();\n        let vcf = Writer::from_path(path, &header, true, Format::Vcf).unwrap();\n        let mut record = vcf.empty_record();\n        let alleles: &[&[u8]] = &[b\"AGG\", b\"TG\"];\n        record.set_alleles(alleles).expect(\"Failed to set alleles\");\n        record.set_pos(5);\n\n        assert_eq!(record.end(), 8)\n    }\n\n    #[test]\n    fn test_record_clear() {\n        let tmp = NamedTempFile::new().unwrap();\n        let path = tmp.path();\n        let mut header = Header::new();\n        header.push_sample(\"sample\".as_bytes());\n        let vcf = Writer::from_path(path, &header, true, Format::Vcf).unwrap();\n        let mut record = vcf.empty_record();\n        let alleles: &[&[u8]] = &[b\"AGG\", b\"TG\"];\n        record.set_alleles(alleles).expect(\"Failed to set alleles\");\n        record.set_pos(6);\n        record.clear();\n\n        assert_eq!(record.rlen(), 0);\n        assert_eq!(record.sample_count(), 0);\n        assert_eq!(record.pos(), 0)\n    }\n\n    #[test]\n    fn test_record_clone() {\n        let tmp = NamedTempFile::new().unwrap();\n        let path = tmp.path();\n        let header = Header::new();\n        let vcf = Writer::from_path(path, &header, true, Format::Vcf).unwrap();\n        let mut record = vcf.empty_record();\n        let alleles: &[&[u8]] = &[b\"AGG\", b\"TG\"];\n        record.set_alleles(alleles).expect(\"Failed to set alleles\");\n        record.set_pos(6);\n\n        let mut cloned_record = record.clone();\n        cloned_record.set_pos(5);\n\n        assert_eq!(record.pos(), 6);\n        assert_eq!(record.allele_count(), 2);\n        assert_eq!(cloned_record.pos(), 5);\n        assert_eq!(cloned_record.allele_count(), 2);\n    }\n\n    #[test]\n    fn test_record_has_filter_pass_is_default() {\n        let tmp = NamedTempFile::new().unwrap();\n        let path = tmp.path();\n        let header = Header::new();\n        let vcf = Writer::from_path(path, &header, true, Format::Vcf).unwrap();\n        let record = vcf.empty_record();\n\n        assert!(record.has_filter(\"PASS\".as_bytes()));\n        assert!(record.has_filter(\".\".as_bytes()));\n        assert!(record.has_filter(&Id(0)));\n        assert!(!record.has_filter(\"foo\".as_bytes()));\n        assert!(!record.has_filter(&Id(2)));\n    }\n\n    #[test]\n    fn test_record_has_filter_custom() {\n        let tmp = NamedTempFile::new().unwrap();\n        let path = tmp.path();\n        let mut header = Header::new();\n        header.push_record(br#\"##FILTER=<ID=foo,Description=\"sample is a foo fighter\">\"#);\n        let vcf = Writer::from_path(path, &header, true, Format::Vcf).unwrap();\n        let mut record = vcf.empty_record();\n        record.push_filter(\"foo\".as_bytes()).unwrap();\n\n        assert!(record.has_filter(\"foo\".as_bytes()));\n        assert!(!record.has_filter(\"PASS\".as_bytes()))\n    }\n\n    #[test]\n    fn test_record_push_filter() {\n        let tmp = NamedTempFile::new().unwrap();\n        let path = tmp.path();\n        let mut header = Header::new();\n        header.push_record(br#\"##FILTER=<ID=foo,Description=\"sample is a foo fighter\">\"#);\n        header.push_record(br#\"##FILTER=<ID=bar,Description=\"dranks\">\"#);\n        let vcf = Writer::from_path(path, &header, true, Format::Vcf).unwrap();\n        let mut record = vcf.empty_record();\n        assert!(record.has_filter(\"PASS\".as_bytes()));\n        record.push_filter(\"foo\".as_bytes()).unwrap();\n        let bar = record.header().name_to_id(b\"bar\").unwrap();\n        record.push_filter(&bar).unwrap();\n        assert!(record.has_filter(\"foo\".as_bytes()));\n        assert!(record.has_filter(&bar));\n        assert!(!record.has_filter(\"PASS\".as_bytes()));\n        assert!(record.push_filter(\"baz\".as_bytes()).is_err())\n    }\n\n    #[test]\n    fn test_record_set_filters() {\n        let tmp = NamedTempFile::new().unwrap();\n        let path = tmp.path();\n        let mut header = Header::new();\n        header.push_record(br#\"##FILTER=<ID=foo,Description=\"sample is a foo fighter\">\"#);\n        header.push_record(br#\"##FILTER=<ID=bar,Description=\"a horse walks into...\">\"#);\n        let vcf = Writer::from_path(path, &header, true, Format::Vcf).unwrap();\n        let mut record = vcf.empty_record();\n        assert!(record.has_filter(\"PASS\".as_bytes()));\n        record\n            .set_filters(&[\"foo\".as_bytes(), \"bar\".as_bytes()])\n            .unwrap();\n        assert!(record.has_filter(\"foo\".as_bytes()));\n        assert!(record.has_filter(\"bar\".as_bytes()));\n        assert!(!record.has_filter(\"PASS\".as_bytes()));\n        let filters: &[&Id] = &[];\n        record.set_filters(filters).unwrap();\n        assert!(record.has_filter(\"PASS\".as_bytes()));\n        assert!(!record.has_filter(\"foo\".as_bytes()));\n        assert!(record\n            .set_filters(&[\"foo\".as_bytes(), \"baz\".as_bytes()])\n            .is_err())\n    }\n\n    #[test]\n    fn test_record_remove_filter() {\n        let tmp = NamedTempFile::new().unwrap();\n        let path = tmp.path();\n        let mut header = Header::new();\n        header.push_record(br#\"##FILTER=<ID=foo,Description=\"sample is a foo fighter\">\"#);\n        header.push_record(br#\"##FILTER=<ID=bar,Description=\"a horse walks into...\">\"#);\n        let vcf = Writer::from_path(path, &header, true, Format::Vcf).unwrap();\n        let mut record = vcf.empty_record();\n        let foo = record.header().name_to_id(b\"foo\").unwrap();\n        let bar = record.header().name_to_id(b\"bar\").unwrap();\n        record.set_filters(&[&foo, &bar]).unwrap();\n        assert!(record.has_filter(&foo));\n        assert!(record.has_filter(&bar));\n        record.remove_filter(&foo, true).unwrap();\n        assert!(!record.has_filter(&foo));\n        assert!(record.has_filter(&bar));\n        assert!(record.remove_filter(\"baz\".as_bytes(), true).is_err());\n        record.remove_filter(&bar, true).unwrap();\n        assert!(!record.has_filter(&bar));\n        assert!(record.has_filter(\"PASS\".as_bytes()));\n    }\n\n    #[test]\n    fn test_record_to_vcf_string_err() {\n        let tmp = NamedTempFile::new().unwrap();\n        let path = tmp.path();\n        let header = Header::new();\n        let vcf = Writer::from_path(path, &header, true, Format::Vcf).unwrap();\n        let record = vcf.empty_record();\n        assert!(record.to_vcf_string().is_err());\n    }\n\n    #[test]\n    fn test_record_to_vcf_string() {\n        let tmp = NamedTempFile::new().unwrap();\n        let path = tmp.path();\n        let mut header = Header::new();\n        header.push_record(b\"##contig=<ID=chr1,length=1000>\");\n        header.push_record(br#\"##FILTER=<ID=foo,Description=\"sample is a foo fighter\">\"#);\n        let vcf = Writer::from_path(path, &header, true, Format::Vcf).unwrap();\n        let mut record = vcf.empty_record();\n        record.push_filter(\"foo\".as_bytes()).unwrap();\n        assert_eq!(\n            record.to_vcf_string().unwrap(),\n            \"chr1\\t1\\t.\\t.\\t.\\t0\\tfoo\\t.\\n\"\n        );\n    }\n}\n"
  },
  {
    "path": "src/bgzf/mod.rs",
    "content": "// Copyright 2020 Manuel Landesfeind, Evotec International GmbH\n// Licensed under the MIT license (http://opensource.org/licenses/MIT)\n// This file may not be copied, modified, or distributed\n// except according to those terms.\n\n//!\n//! Module for working with bgzipped file.\n//!\n\nuse std::ffi;\nuse std::path::Path;\nuse url::Url;\n\nuse crate::htslib;\nuse crate::tpool::ThreadPool;\n\nuse crate::errors::{Error, Result};\n\nfn path_as_bytes<'a, P: 'a + AsRef<Path>>(path: P, must_exist: bool) -> Result<Vec<u8>> {\n    if path.as_ref().exists() || !must_exist {\n        Ok(path\n            .as_ref()\n            .to_str()\n            .ok_or(Error::NonUnicodePath)?\n            .as_bytes()\n            .to_owned())\n    } else {\n        Err(Error::FileNotFound {\n            path: path.as_ref().to_owned(),\n        })\n    }\n}\n\n/// Test if a file is a Bgzip compressed file\n///\n/// # Arguments\n///\n/// * `path` - the path to test.\n///\n/// # Returns:\n/// Will return `Ok(true)` or `Ok(false)` if the file at `path` is BGZIP compressed. Will return an `Err` in\n/// cases where no testing is possible.\npub fn is_bgzip<P: AsRef<Path>>(path: P) -> Result<bool, Error> {\n    let byte_path = path_as_bytes(path, true)?;\n    let cpath = ffi::CString::new(byte_path).unwrap();\n    let is_bgzf = unsafe { htslib::bgzf_is_bgzf(cpath.as_ptr()) == 1 };\n    Ok(is_bgzf)\n}\n\n/// A reader that transparently reads uncompressed, gzip, and bgzip files.\n#[derive(Debug)]\npub struct Reader {\n    inner: *mut htslib::BGZF,\n}\n\nimpl Reader {\n    /// Create a new Reader to read from stdin.\n    pub fn from_stdin() -> Result<Self, Error> {\n        Self::new(b\"-\")\n    }\n\n    /// Create a new Reader from a path.\n    ///\n    /// # Arguments\n    ///\n    /// * `path` - the path to open.\n    pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self, Error> {\n        Self::new(&path_as_bytes(path, true)?)\n    }\n\n    /// Create a new Reader from an URL.\n    ///\n    /// # Arguments\n    ///\n    /// * `url` - the url to open\n    pub fn from_url(url: &Url) -> Result<Self, Error> {\n        Self::new(url.as_str().as_bytes())\n    }\n\n    /// Internal function to create a Reader from some sort of path (could be file path but also URL).\n    /// The path or URL will be handled by the c-implementation transparently.\n    ///\n    /// # Arguments\n    ///\n    /// * `path` - the path or URL to open\n    fn new(path: &[u8]) -> Result<Self, Error> {\n        let mode = ffi::CString::new(\"r\").unwrap();\n        let cpath = ffi::CString::new(path).unwrap();\n        let inner = unsafe { htslib::bgzf_open(cpath.as_ptr(), mode.as_ptr()) };\n        if !inner.is_null() {\n            Ok(Self { inner })\n        } else {\n            Err(Error::FileOpen {\n                path: String::from_utf8(path.to_vec()).unwrap(),\n            })\n        }\n    }\n\n    /// Set the thread pool to use for parallel decompression.\n    ///\n    /// # Arguments\n    ///\n    /// * `tpool` - the thread-pool to use\n    pub fn set_thread_pool(&mut self, tpool: &ThreadPool) -> Result<()> {\n        let b = tpool.handle.borrow_mut();\n        let r = unsafe {\n            htslib::bgzf_thread_pool(self.inner, b.inner.pool as *mut _, 0) // let htslib decide on the queue-size\n        };\n\n        if r != 0 {\n            Err(Error::ThreadPool)\n        } else {\n            Ok(())\n        }\n    }\n}\n\nimpl std::io::Read for Reader {\n    fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {\n        let nbytes = unsafe {\n            htslib::bgzf_read(self.inner, buf.as_mut_ptr() as *mut libc::c_void, buf.len())\n        };\n        if nbytes < 0 {\n            Err(std::io::Error::other(\"Can not read\"))\n        } else {\n            Ok(nbytes as usize)\n        }\n    }\n}\n\n/// The CompressionLevel used by the underlying GZIP writer\n/// Note that the special level NoCompression will not use the GZIP writer.\n/// Compression levels in BGZF files\n///\n/// * Uncompressed: No compression, zlib level 0\n/// * Fastest: Lowest compression level, zlib level 1\n/// * Maximum: Highest compression level, zlib level 9\n/// * Default: Default compression level, zlib level 6\n/// * Level(i): Custom compression level in the range [0, 9]\n/// * NoCompression: No compression, zlib not used. Output will be identical to input\n#[derive(Debug, Clone, Copy)]\npub enum CompressionLevel {\n    Default,\n    NoCompression,\n    Uncompressed,\n    Fastest,\n    Maximum,\n    Level(i8),\n}\nimpl CompressionLevel {\n    // Convert and check the variants of the `CompressionLevel` enum to a numeric level\n    fn convert(self) -> Result<i8> {\n        match self {\n            CompressionLevel::NoCompression => Ok(-2),\n            CompressionLevel::Default => Ok(-1),\n            CompressionLevel::Uncompressed => Ok(0),\n            CompressionLevel::Fastest => Ok(1),\n            CompressionLevel::Maximum => Ok(9),\n            CompressionLevel::Level(i @ -2..=9) => Ok(i),\n            CompressionLevel::Level(i) => Err(Error::BgzfInvalidCompressionLevel { level: i }),\n        }\n    }\n}\n\n/// A writer that writes uncompressed, gzip, and bgzip files.\n#[derive(Debug)]\npub struct Writer {\n    inner: *mut htslib::BGZF,\n    tpool: Option<ThreadPool>,\n}\n\nimpl Writer {\n    /// Create a new Writer to write to stdout with default compression.\n    pub fn from_stdout() -> Result<Self, Error> {\n        Self::from_stdout_with_compression(CompressionLevel::Default)\n    }\n\n    /// Create a new Writer to write to stdout with specific compression\n    ///\n    /// # Arguments\n    ///\n    /// * `level` the compression level to use\n    pub fn from_stdout_with_compression(level: CompressionLevel) -> Result<Self, Error> {\n        Self::new(b\"-\", level)\n    }\n\n    /// Create a new Writer from a path with default compression.\n    ///\n    /// # Arguments\n    ///\n    /// * `path` - the path to open.\n    pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self, Error> {\n        Self::from_path_with_level(path, CompressionLevel::Default)\n    }\n\n    /// Create a new Writer from a path with a specific compression level.\n    ///\n    /// # Arguments\n    ///\n    /// * `path` - the path to open.\n    pub fn from_path_with_level<P: AsRef<Path>>(\n        path: P,\n        level: CompressionLevel,\n    ) -> Result<Self, Error> {\n        Self::new(&path_as_bytes(path, false)?, level)\n    }\n\n    /// Internal function to create a Writer from a file path\n    ///\n    /// # Arguments\n    ///\n    /// * `path` - the path or URL to open\n    fn new(path: &[u8], level: CompressionLevel) -> Result<Self, Error> {\n        let mode = Self::get_open_mode(level)?;\n        let cpath = ffi::CString::new(path).unwrap();\n        let inner = unsafe { htslib::bgzf_open(cpath.as_ptr(), mode.as_ptr()) };\n        if !inner.is_null() {\n            Ok(Self { inner, tpool: None })\n        } else {\n            Err(Error::FileOpen {\n                path: String::from_utf8(path.to_vec()).unwrap(),\n            })\n        }\n    }\n\n    /// Internal function to convert compression level to \"mode\"\n    /// bgzf.c expects mode for writers to be one of: 'w', 'wu', 'w#', where # is 0-9.\n    /// # Arguments\n    ///\n    /// * `level` - the level of compression to use\n    fn get_open_mode(level: CompressionLevel) -> Result<ffi::CString, Error> {\n        let write_string = match level.convert() {\n            Ok(-2) => \"wu\".to_string(),\n            Ok(-1) => \"w\".to_string(),\n            Ok(n @ 0..=9) => format!(\"w{}\", n),\n            Err(e) => return Err(e),\n            // This should be unreachable\n            Ok(i) => return Err(Error::BgzfInvalidCompressionLevel { level: i }),\n        };\n        Ok(ffi::CString::new(write_string).unwrap())\n    }\n\n    /// Set the thread pool to use for parallel compression.\n    ///\n    /// # Arguments\n    ///\n    /// * `tpool` - the thread-pool to use\n    pub fn set_thread_pool(&mut self, tpool: &ThreadPool) -> Result<()> {\n        self.tpool = Some(tpool.clone());\n        let b = tpool.handle.borrow_mut();\n        let r = unsafe {\n            htslib::bgzf_thread_pool(self.inner, b.inner.pool as *mut _, 0) // let htslib decide on the queue-size\n        };\n\n        if r != 0 {\n            Err(Error::ThreadPool)\n        } else {\n            Ok(())\n        }\n    }\n}\n\nimpl std::io::Write for Writer {\n    fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {\n        let nbytes =\n            unsafe { htslib::bgzf_write(self.inner, buf.as_ptr() as *mut libc::c_void, buf.len()) };\n        if nbytes < 0 {\n            Err(std::io::Error::other(\"Can not write\"))\n        } else {\n            Ok(nbytes as usize)\n        }\n    }\n\n    fn flush(&mut self) -> std::io::Result<()> {\n        let exit_code: i32 = unsafe { htslib::bgzf_flush(self.inner) };\n        if exit_code == 0 {\n            Ok(())\n        } else {\n            Err(std::io::Error::other(\"Can not flush\"))\n        }\n    }\n}\n\nimpl std::ops::Drop for Writer {\n    fn drop(&mut self) {\n        unsafe {\n            htslib::bgzf_close(self.inner);\n        }\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n    use std::io::Read;\n    use std::io::Write;\n\n    // Define paths to the test files\n    const FN_PLAIN: &str = concat!(env!(\"CARGO_MANIFEST_DIR\"), \"/test/bgzip/plain.vcf\");\n    const FN_GZIP: &str = concat!(env!(\"CARGO_MANIFEST_DIR\"), \"/test/bgzip/gzip.vcf.gz\");\n    const FN_BGZIP: &str = concat!(env!(\"CARGO_MANIFEST_DIR\"), \"/test/bgzip/bgzip.vcf.gz\");\n\n    const CONTENT: &str = include_str!(\"../../test/bgzip/plain.vcf\");\n\n    #[test]\n    fn test_is_bgzip_plain() {\n        assert!(\n            !is_bgzip(FN_PLAIN).unwrap(),\n            \"Plain file not detected as BGZIP\"\n        );\n        assert!(\n            !is_bgzip(FN_GZIP).unwrap(),\n            \"Zip file not detected as BGZIP\"\n        );\n        assert!(is_bgzip(FN_BGZIP).unwrap(), \"Bgzip file detected as BGZIP\");\n    }\n\n    #[test]\n    fn test_open_plain() {\n        let r_result = Reader::from_path(FN_PLAIN);\n        assert!(r_result.is_ok(), \"Open plain file with Bgzip reader\");\n\n        let mut my_content = String::new();\n        let reading_result = r_result.unwrap().read_to_string(&mut my_content);\n        assert!(\n            reading_result.is_ok(),\n            \"Reading plain file into buffer is ok\"\n        );\n        assert_eq!(\n            reading_result.unwrap(),\n            190,\n            \"Reading plain file into buffer is correct size\"\n        );\n        assert_eq!(\n            my_content, CONTENT,\n            \"Reading plain file with correct content\"\n        );\n    }\n\n    #[test]\n    fn test_open_gzip() {\n        let r_result = Reader::from_path(FN_GZIP);\n        assert!(r_result.is_ok(), \"Open gzip file with Bgzip reader\");\n\n        let mut my_content = String::new();\n        let reading_result = r_result.unwrap().read_to_string(&mut my_content);\n        assert!(\n            reading_result.is_ok(),\n            \"Reading gzip file into buffer is ok\"\n        );\n        assert_eq!(\n            reading_result.unwrap(),\n            190,\n            \"Reading gzip file into buffer is correct size\"\n        );\n        assert_eq!(\n            my_content, CONTENT,\n            \"Reading gzip file with correct content\"\n        );\n    }\n\n    #[test]\n    fn test_open_bgzip() {\n        let r_result = Reader::from_path(FN_BGZIP);\n        assert!(r_result.is_ok(), \"Open bgzip file with Bgzip reader\");\n\n        let mut my_content = String::new();\n        let reading_result = r_result.unwrap().read_to_string(&mut my_content);\n        assert!(\n            reading_result.is_ok(),\n            \"Reading bgzip file into buffer is ok\"\n        );\n        assert_eq!(\n            reading_result.unwrap(),\n            190,\n            \"Reading bgzip file into buffer is correct size\"\n        );\n        assert_eq!(\n            my_content, CONTENT,\n            \"Reading bgzip file with correct content\"\n        );\n    }\n    #[test]\n    fn test_set_threadpool() {\n        let r_result = Reader::from_path(FN_BGZIP);\n        assert!(r_result.is_ok(), \"Open bgzip file with Bgzip reader\");\n        let mut r = r_result.unwrap();\n\n        let tpool_result = ThreadPool::new(5);\n        assert!(tpool_result.is_ok(), \"Creating thread pool\");\n        let tpool = tpool_result.unwrap();\n\n        let set_result = r.set_thread_pool(&tpool);\n        assert_eq!(set_result, Ok(()), \"Setting thread pool okay\");\n\n        let mut my_content = String::new();\n        let reading_result = r.read_to_string(&mut my_content);\n        assert!(\n            reading_result.is_ok(),\n            \"Reading bgzip file into buffer is ok - using a threadpool\"\n        );\n        assert_eq!(\n            reading_result.unwrap(),\n            190,\n            \"Reading bgzip file into buffer is correct size using a threadpool\"\n        );\n        assert_eq!(\n            my_content, CONTENT,\n            \"Reading bgzip file with correct content using a threadpool\"\n        );\n    }\n\n    #[test]\n    fn test_write_plain() {\n        let tmp = tempfile::Builder::new()\n            .prefix(\"rust-htslib\")\n            .tempdir()\n            .expect(\"Cannot create temp dir\");\n        let out_path = tmp.path().join(\"test.vcf\");\n        println!(\"{:?}\", out_path);\n\n        {\n            let w_result = Writer::from_path_with_level(&out_path, CompressionLevel::NoCompression);\n            if let Err(ref e) = w_result {\n                println!(\"w_result is {}\", e);\n            }\n            assert!(w_result.is_ok(), \"Create plain file with Bgzip writer\");\n            assert!(out_path.exists(), \"Plain file is created with Bgzip writer\");\n            let mut w = w_result.unwrap();\n            let write_result = w.write_all(CONTENT.as_bytes());\n            assert!(\n                write_result.is_ok(),\n                \"Plain file can write with Bgzip writer\"\n            );\n        } // let Writer fall out of scope and implicitly close\n        assert!(\n            !is_bgzip(&out_path).unwrap(),\n            \"NoCompression file should not be detected as BGZIP\"\n        );\n        let my_content = std::fs::read_to_string(&out_path).unwrap();\n        assert_eq!(\n            my_content, CONTENT,\n            \"Writing bgzip file with no compression\"\n        );\n\n        tmp.close().expect(\"Failed to delete temp dir\");\n    }\n\n    #[test]\n    fn test_write_default() {\n        let tmp = tempfile::Builder::new()\n            .prefix(\"rust-htslib\")\n            .tempdir()\n            .expect(\"Cannot create temp dir\");\n        let out_path = tmp.path().join(\"test.vcf.bgzf\");\n        println!(\"{:?}\", out_path);\n        {\n            let w_result = Writer::from_path(&out_path);\n            if let Err(ref e) = w_result {\n                println!(\"w_result is {}\", e);\n            }\n            assert!(w_result.is_ok(), \"Create bgzip file with Bgzip writer\");\n            assert!(\n                std::path::Path::new(&out_path).exists(),\n                \"Bgzip file is created with Bgzip writer\"\n            );\n            let mut w = w_result.unwrap();\n            let write_result = w.write_all(CONTENT.as_bytes());\n            assert!(\n                write_result.is_ok(),\n                \"Bgzip file can write with Bgzip writer\"\n            );\n        } // let Writer fall out of scope and implicitly close\n\n        // Read in with bgzip reader\n        let mut my_content = String::new();\n        Reader::from_path(&out_path)\n            .unwrap()\n            .read_to_string(&mut my_content)\n            .unwrap();\n        assert_eq!(\n            my_content, CONTENT,\n            \"Writing bgzip file with default compression\"\n        );\n\n        assert!(\n            is_bgzip(&out_path).unwrap(),\n            \"Default BGZIP file detected as BGZIP\"\n        );\n        tmp.close().expect(\"Failed to delete temp dir\");\n    }\n\n    #[test]\n    fn test_write_compression_levels() {\n        let tmp = tempfile::Builder::new()\n            .prefix(\"rust-htslib\")\n            .tempdir()\n            .expect(\"Cannot create temp dir\");\n        let out_path = tmp.path().join(\"test.vcf.bgzf\");\n\n        // Test all levels except NoCompression\n        let compression_levels = vec![\n            CompressionLevel::Fastest,\n            CompressionLevel::Maximum,\n            CompressionLevel::Uncompressed,\n        ]\n        .into_iter()\n        .chain((-1..=9_i8).map(CompressionLevel::Level));\n\n        for level in compression_levels {\n            {\n                let w_result = Writer::from_path_with_level(&out_path, level);\n                if let Err(ref e) = w_result {\n                    println!(\"w_result is {}\", e);\n                }\n                assert!(w_result.is_ok(), \"Create bgzip file with Bgzip writer\");\n                assert!(\n                    std::path::Path::new(&out_path).exists(),\n                    \"Bgzip file is created with Bgzip writer\"\n                );\n                let mut w = w_result.unwrap();\n                let write_result = w.write_all(CONTENT.as_bytes());\n                assert!(\n                    write_result.is_ok(),\n                    \"Bgzip file can write with Bgzip writer\"\n                );\n            } // let Writer fall out of scope and implicitly close\n\n            // Read in with bgzip reader\n            let mut my_content = String::new();\n            Reader::from_path(&out_path)\n                .unwrap()\n                .read_to_string(&mut my_content)\n                .unwrap();\n            assert_eq!(\n                my_content, CONTENT,\n                \"Writing bgzip file with {:?} compression\",\n                level\n            );\n\n            assert!(\n                is_bgzip(&out_path).unwrap(),\n                \"Writing BGZIP file with {:?} compression detected as BGZIP\",\n                level\n            );\n        }\n        tmp.close().expect(\"Failed to delete temp dir\");\n    }\n\n    #[test]\n    fn test_write_with_threadpool() {\n        let tmp = tempfile::Builder::new()\n            .prefix(\"rust-htslib\")\n            .tempdir()\n            .expect(\"Cannot create temp dir\");\n        let out_path = tmp.path().join(\"test.vcf.bgzf\");\n\n        let content = CONTENT.as_bytes();\n        println!(\"{:?}\", out_path);\n        {\n            let w_result = Writer::from_path(&out_path);\n            if let Err(ref e) = w_result {\n                println!(\"w_result is {}\", e);\n            }\n            assert!(w_result.is_ok(), \"Create bgzip file with Bgzip threadpool\");\n            assert!(\n                std::path::Path::new(&out_path).exists(),\n                \"Bgzip file is created with Bgzip threadpool\"\n            );\n\n            let mut w = w_result.unwrap();\n            let tpool_result = ThreadPool::new(5);\n            assert!(tpool_result.is_ok(), \"Creating thread pool\");\n            let tpool = tpool_result.unwrap();\n\n            let set_tpool_result = w.set_thread_pool(&tpool);\n            assert!(set_tpool_result.is_ok(), \"Setting thread pool\");\n\n            let write_result = w.write_all(content);\n            assert!(\n                write_result.is_ok(),\n                \"Bgzip file can write with Bgzip threadpool\"\n            );\n        } // let Writer fall out of scope and implicitly close\n\n        // Read in with bgzip reader\n        let mut my_content = String::new();\n        Reader::from_path(&out_path)\n            .unwrap()\n            .read_to_string(&mut my_content)\n            .unwrap();\n        assert_eq!(my_content, CONTENT, \"Writing bgzip file with threadpool\");\n\n        assert!(\n            is_bgzip(&out_path).unwrap(),\n            \"Threadpool BGZIP file detected as BGZIP\"\n        );\n\n        tmp.close().expect(\"Failed to delete temp dir\");\n    }\n}\n"
  },
  {
    "path": "src/errors.rs",
    "content": "use std::path::PathBuf;\nuse thiserror::Error;\n\n/// Generic result type for functions in this crate with\n/// a global error class.\npub type Result<T, E = Error> = std::result::Result<T, E>;\n\n#[derive(Error, Debug, PartialEq)]\npub enum Error {\n    // General errors\n    #[error(\"file not found: {path}\")]\n    FileNotFound { path: PathBuf },\n    #[error(\"file could not be opened: {path}\")]\n    FileOpen { path: String },\n    #[error(\"invalid (non-unicode) characters in path\")]\n    NonUnicodePath,\n    #[error(\"failed to fetch region\")]\n    Fetch,\n    #[error(\"error seeking to file offset\")]\n    FileSeek,\n    #[error(\"error seeking to {contig:?}:{start} in indexed file\")]\n    GenomicSeek { contig: String, start: u64 },\n    #[error(\"sequence {sequence} not found in index\")]\n    UnknownSequence { sequence: String },\n    #[error(\"error setting threads for file reading\")]\n    SetThreads,\n    #[error(\"failed to create htslib thread pool\")]\n    ThreadPool,\n\n    #[error(\"failed to write BAM/BCF record (out of disk space?)\")]\n    WriteRecord,\n\n    // Errors for faidx\n    #[error(\"The given position is too large to be converted to i64\")]\n    FaidxPositionTooLarge,\n    #[error(\"bad conversion of sequence name\")]\n    FaidxBadSeqName,\n    #[error(\"failed to build index for fasta file {path:?}\")]\n    FaidxBuildFailed { path: std::path::PathBuf },\n\n    // Errors for Tbx\n    #[error(\"previous iterator generation failed\")]\n    TabixNoIter,\n    #[error(\"truncated tabix record\")]\n    TabixTruncatedRecord,\n    #[error(\"invalid tabix index\")]\n    TabixInvalidIndex,\n\n    // Errors for BAM\n    #[error(\"error parsing CIGAR string: {msg}\")]\n    BamParseCigar { msg: String },\n    #[error(\"unexpected CIGAR operation: {msg}\")]\n    BamUnexpectedCigarOperation { msg: String },\n    #[error(\"error parsing SAM record: {rec}\")]\n    BamParseSAM { rec: String },\n    #[error(\"invalid path to CRAM-reference {path}\")]\n    BamInvalidReferencePath { path: PathBuf },\n    #[error(\"invalid compression level {level}\")]\n    BamInvalidCompressionLevel { level: u32 },\n    #[error(\"unable to open SAM/BAM/CRAM file at {target}\")]\n    BamOpen { target: String },\n    #[error(\"unable to open SAM/BAM/CRAM index for {target}; please create an index\")]\n    BamInvalidIndex { target: String },\n    #[error(\"invalid record in SAM/BAM/CRAM file\")]\n    BamInvalidRecord,\n    #[error(\"truncated record in SAM/BAM/CRAM file\")]\n    BamTruncatedRecord,\n    #[error(\n        \"format not indexable by htslib (format is detected as something else than SAM/BAM/CRAM)\"\n    )]\n    BamNotIndexable,\n    #[error(\"failed to write BAM/CRAM index (out of disk space?)\")]\n    BamWriteIndex,\n    #[error(\"failed to build BAM/CRAM index\")]\n    BamBuildIndex,\n    #[error(\"failed to create SAM/BAM/CRAM pileup\")]\n    BamPileup,\n    #[error(\"file is not sorted by position\")]\n    BamUnsorted,\n\n    // Errors for BAM auxiliary fields\n    #[error(\"failed to add aux field (out of memory?)\")]\n    BamAux,\n    #[error(\"provided string contains internal 0 byte(s)\")]\n    BamAuxStringError,\n    #[error(\"failed to parse aux data\")]\n    BamAuxParsingError,\n    #[error(\"the specified tag does could not be found\")]\n    BamAuxTagNotFound,\n    #[error(\"data type of aux field is not known\")]\n    BamAuxUnknownType,\n    #[error(\"failed to add aux field, tag is already present\")]\n    BamAuxTagAlreadyPresent,\n    #[error(\"updating the aux field for this datatype is not supported\")]\n    BamAuxTagUpdatingNotSupported,\n\n    // Errors for base modification fields\n    #[error(\"no base modification tag found for record\")]\n    BamBaseModificationTagNotFound,\n    #[error(\"no base modification with the specified code found in record\")]\n    BamBaseModificationTypeNotFound,\n    #[error(\"base modification iteration failed\")]\n    BamBaseModificationIterationFailed,\n    #[error(\"base modification found too many modifications\")]\n    BamBaseModificationTooManyMods,\n\n    // Errors for BCF\n    #[error(\"error allocating internal data structure for BCF/VCF reader (out of memory?)\")]\n    BcfAllocationError,\n    #[error(\"failed to open BCF/VCF from {target:?}\")]\n    BcfOpen { target: String },\n    #[error(\"invalid record in BCF/VCF file\")]\n    BcfInvalidRecord,\n    #[error(\"tag {tag} undefined in BCF/VCF header\")]\n    BcfUndefinedTag { tag: String },\n    #[error(\"unexpected type for tag {tag} in BCF/VCF file\")]\n    BcfUnexpectedType { tag: String },\n    #[error(\"tag {tag} missing from record {record} in BCF/VCF file\")]\n    BcfMissingTag { tag: String, record: String },\n    #[error(\"error setting tag {tag} in BCF/VCF record (out of memory?)\")]\n    BcfSetTag { tag: String },\n    #[error(\"ID {rid} not found in BCF/VCF header\")]\n    BcfUnknownRID { rid: u32 },\n    #[error(\"contig {contig} not found in BCF/VCF header\")]\n    BcfUnknownContig { contig: String },\n    #[error(\"ID {id} not found in BCF/VCF header\")]\n    BcfUnknownID { id: String },\n    #[error(\"sample {name} not found in BCF/VCF header\")]\n    BcfUnknownSample { name: String },\n    #[error(\"duplicate sample names given for subsetting BCF/VCF\")]\n    BcfDuplicateSampleNames,\n    #[error(\"failed to set values in BCF/VCF record (out of memory?)\")]\n    BcfSetValues,\n    #[error(\"failed to remove alleles in BCF/VCF record\")]\n    BcfRemoveAlleles,\n    #[error(\"failed to render BCF record as string\")]\n    BcfToString,\n    #[error(\"failed to translate BCF/VCF record\")]\n    BcfTranslate,\n\n    #[error(\"invalid compression level {level}\")]\n    BgzfInvalidCompressionLevel { level: i8 },\n    #[error(\"failed setting hts reading options\")]\n    HtsSetOpt,\n    #[error(\"failed calculating slow index statistics\")]\n    SlowIdxStats,\n    #[error(\"invalid tid {tid}\")]\n    InvalidTid { tid: i32 },\n    #[error(\"No sequences in the reference\")]\n    NoSequencesInReference,\n}\n"
  },
  {
    "path": "src/faidx/mod.rs",
    "content": "// Copyright 2020 Manuel Landesfeind, Evotec International GmbH\n// Licensed under the MIT license (http://opensource.org/licenses/MIT)\n// This file may not be copied, modified, or distributed\n// except according to those terms.\n\n//!\n//! Module for working with faidx-indexed FASTA files.\n//!\n\nuse std::ffi;\nuse std::path::Path;\nuse url::Url;\n\nuse crate::htslib;\n\nuse crate::errors::{Error, Result};\nuse crate::utils::path_as_bytes;\n\n/// A Fasta reader.\n#[derive(Debug)]\npub struct Reader {\n    inner: *mut htslib::faidx_t,\n}\n\n///\n/// Build a faidx for input path.\n///\n/// # Errors\n/// If indexing fails. Could be malformatted or file could not be accessible.\n///\n///```\n/// use rust_htslib::faidx::build;\n/// let path = std::path::PathBuf::from(concat!(env!(\"CARGO_MANIFEST_DIR\"),\"/test/test_cram.fa\"));\n/// build(&path).expect(\"Failed to build fasta index\");\n///```\n///\npub fn build(\n    path: impl Into<std::path::PathBuf>,\n) -> Result<(), std::boxed::Box<dyn std::error::Error>> {\n    let path = path.into();\n    let os_path = std::ffi::CString::new(path.display().to_string())?;\n    let rc = unsafe { htslib::fai_build(os_path.as_ptr()) };\n    if rc < 0 {\n        Err(Error::FaidxBuildFailed { path })?\n    } else {\n        Ok(())\n    }\n}\n\nimpl Reader {\n    /// Create a new Reader from a path.\n    ///\n    /// # Arguments\n    ///\n    /// * `path` - the path to open.\n    pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self, Error> {\n        Self::new(&path_as_bytes(path, true)?)\n    }\n\n    /// Create a new Reader from an URL.\n    ///\n    /// # Arguments\n    ///\n    /// * `url` - the url to open\n    pub fn from_url(url: &Url) -> Result<Self, Error> {\n        Self::new(url.as_str().as_bytes())\n    }\n\n    /// Internal function to create a Reader from some sort of path (could be file path but also URL).\n    /// The path or URL will be handled by the c-implementation transparently.\n    ///\n    /// # Arguments\n    ///\n    /// * `path` - the path or URL to open\n    fn new(path: &[u8]) -> Result<Self, Error> {\n        let cpath = ffi::CString::new(path).unwrap();\n        let inner = unsafe { htslib::fai_load(cpath.as_ptr()) };\n        Ok(Self { inner })\n    }\n\n    /// Fetch the sequence as a byte array.\n    ///\n    /// # Arguments\n    ///\n    /// * `name` - the name of the template sequence (e.g., \"chr1\")\n    /// * `begin` - the offset within the template sequence (starting with 0)\n    /// * `end` - the end position to return (if smaller than `begin`, the behavior is undefined).\n    pub fn fetch_seq<N: AsRef<str>>(&self, name: N, begin: usize, end: usize) -> Result<Vec<u8>> {\n        if begin > i64::MAX as usize {\n            return Err(Error::FaidxPositionTooLarge);\n        }\n        if end > i64::MAX as usize {\n            return Err(Error::FaidxPositionTooLarge);\n        }\n        let cname = ffi::CString::new(name.as_ref().as_bytes()).unwrap();\n        let mut len_out: htslib::hts_pos_t = 0;\n        let ptr = unsafe {\n            htslib::faidx_fetch_seq64(\n                self.inner,                 //*const faidx_t,\n                cname.as_ptr(),             // c_name\n                begin as htslib::hts_pos_t, // p_beg_i\n                end as htslib::hts_pos_t,   // p_end_i\n                &mut len_out,               //len\n            )\n        };\n        let vec =\n            unsafe { Vec::from_raw_parts(ptr as *mut u8, len_out as usize, len_out as usize) };\n        Ok(vec)\n    }\n\n    /// Fetches the sequence and returns it as string.\n    ///\n    /// # Arguments\n    ///\n    /// * `name` - the name of the template sequence (e.g., \"chr1\")\n    /// * `begin` - the offset within the template sequence (starting with 0)\n    /// * `end` - the end position to return (if smaller than `begin`, the behavior is undefined).\n    pub fn fetch_seq_string<N: AsRef<str>>(\n        &self,\n        name: N,\n        begin: usize,\n        end: usize,\n    ) -> Result<String> {\n        let bytes = self.fetch_seq(name, begin, end)?;\n        Ok(std::str::from_utf8(&bytes).unwrap().to_owned())\n    }\n\n    /// Fetches the number of sequences in the fai index\n    pub fn n_seqs(&self) -> u64 {\n        let n = unsafe { htslib::faidx_nseq(self.inner) };\n        n as u64\n    }\n\n    /// Fetches the i-th sequence name\n    ///\n    /// # Arguments\n    ///\n    /// * `i` - index to query\n    pub fn seq_name(&self, i: i32) -> Result<String> {\n        let cname = unsafe {\n            let ptr = htslib::faidx_iseq(self.inner, i);\n            ffi::CStr::from_ptr(ptr)\n        };\n\n        let out = match cname.to_str() {\n            Ok(s) => s.to_string(),\n            Err(_) => {\n                return Err(Error::FaidxBadSeqName);\n            }\n        };\n\n        Ok(out)\n    }\n\n    /// Fetches the length of the given sequence name.\n    ///\n    /// # Arguments\n    ///\n    /// * `name` - the name of the template sequence (e.g., \"chr1\")\n    pub fn fetch_seq_len<N: AsRef<str>>(&self, name: N) -> u64 {\n        let cname = ffi::CString::new(name.as_ref().as_bytes()).unwrap();\n        let seq_len = unsafe { htslib::faidx_seq_len(self.inner, cname.as_ptr()) };\n        seq_len as u64\n    }\n\n    /// Returns a Result<Vector<String>> for all seq names.\n    /// # Errors\n    ///\n    /// * `errors::Error::FaidxBadSeqName` - missing sequence name for sequence id.\n    ///\n    /// If thrown, the index is malformed, and the number of sequences in the index does not match the number of sequence names available.\n    ///```\n    /// use rust_htslib::faidx::build;\n    /// let path = std::path::PathBuf::from(concat!(env!(\"CARGO_MANIFEST_DIR\"),\"/test/test_cram.fa\"));\n    /// build(&path).expect(\"Failed to build fasta index\");\n    /// let reader = rust_htslib::faidx::Reader::from_path(path).expect(\"Failed to open faidx\");\n    /// assert_eq!(reader.seq_names(), Ok(vec![\"chr1\".to_string(), \"chr2\".to_string(), \"chr3\".to_string()]));\n    ///```\n    ///\n    pub fn seq_names(&self) -> Result<Vec<String>> {\n        let num_seq = self.n_seqs();\n        let mut ret = Vec::with_capacity(num_seq as usize);\n        for seq_id in 0..num_seq {\n            ret.push(self.seq_name(seq_id as i32)?);\n        }\n        Ok(ret)\n    }\n}\n\nimpl Drop for Reader {\n    fn drop(&mut self) {\n        unsafe {\n            htslib::fai_destroy(self.inner);\n        }\n    }\n}\n\nunsafe impl Send for Reader {}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    fn open_reader() -> Reader {\n        Reader::from_path(format!(\"{}/test/test_cram.fa\", env!(\"CARGO_MANIFEST_DIR\")))\n            .ok()\n            .unwrap()\n    }\n    #[test]\n    fn faidx_open() {\n        open_reader();\n    }\n\n    #[test]\n    fn faidx_read_chr_first_base() {\n        let r = open_reader();\n\n        let bseq = r.fetch_seq(\"chr1\", 0, 0).unwrap();\n        assert_eq!(bseq.len(), 1);\n        assert_eq!(bseq, b\"G\");\n\n        let seq = r.fetch_seq_string(\"chr1\", 0, 0).unwrap();\n        assert_eq!(seq.len(), 1);\n        assert_eq!(seq, \"G\");\n    }\n\n    #[test]\n    fn faidx_read_chr_start() {\n        let r = open_reader();\n\n        //for _i in 0..100_000_000 { // loop to check for memory leaks\n        let bseq = r.fetch_seq(\"chr1\", 0, 9).unwrap();\n        assert_eq!(bseq.len(), 10);\n        assert_eq!(bseq, b\"GGGCACAGCC\");\n\n        let seq = r.fetch_seq_string(\"chr1\", 0, 9).unwrap();\n        assert_eq!(seq.len(), 10);\n        assert_eq!(seq, \"GGGCACAGCC\");\n        //}\n    }\n\n    #[test]\n    fn faidx_read_chr_between() {\n        let r = open_reader();\n\n        let bseq = r.fetch_seq(\"chr1\", 4, 14).unwrap();\n        assert_eq!(bseq.len(), 11);\n        assert_eq!(bseq, b\"ACAGCCTCACC\");\n\n        let seq = r.fetch_seq_string(\"chr1\", 4, 14).unwrap();\n        assert_eq!(seq.len(), 11);\n        assert_eq!(seq, \"ACAGCCTCACC\");\n    }\n\n    #[test]\n    fn faidx_read_chr_end() {\n        let r = open_reader();\n\n        let bseq = r.fetch_seq(\"chr1\", 110, 120).unwrap();\n        assert_eq!(bseq.len(), 10);\n        assert_eq!(bseq, b\"CCCCTCCGTG\");\n\n        let seq = r.fetch_seq_string(\"chr1\", 110, 120).unwrap();\n        assert_eq!(seq.len(), 10);\n        assert_eq!(seq, \"CCCCTCCGTG\");\n    }\n\n    #[test]\n    fn faidx_read_twice_string() {\n        let r = open_reader();\n        let seq = r.fetch_seq_string(\"chr1\", 110, 120).unwrap();\n        assert_eq!(seq.len(), 10);\n        assert_eq!(seq, \"CCCCTCCGTG\");\n\n        let seq = r.fetch_seq_string(\"chr1\", 5, 9).unwrap();\n        assert_eq!(seq.len(), 5);\n        assert_eq!(seq, \"CAGCC\");\n    }\n\n    #[test]\n    fn faidx_read_twice_bytes() {\n        let r = open_reader();\n        let seq = r.fetch_seq(\"chr1\", 110, 120).unwrap();\n        assert_eq!(seq.len(), 10);\n        assert_eq!(seq, b\"CCCCTCCGTG\");\n\n        let seq = r.fetch_seq(\"chr1\", 5, 9).unwrap();\n        assert_eq!(seq.len(), 5);\n        assert_eq!(seq, b\"CAGCC\");\n    }\n\n    #[test]\n    fn faidx_position_too_large() {\n        let r = open_reader();\n        let position_too_large = i64::MAX as usize;\n        let res = r.fetch_seq(\"chr1\", position_too_large, position_too_large + 1);\n        assert_eq!(res, Err(Error::FaidxPositionTooLarge));\n    }\n\n    #[test]\n    fn faidx_n_seqs() {\n        let r = open_reader();\n        assert_eq!(r.n_seqs(), 3);\n    }\n\n    #[test]\n    fn faidx_seq_name() {\n        let r = open_reader();\n        let n = r.seq_name(1).unwrap();\n        assert_eq!(n, \"chr2\");\n    }\n\n    #[test]\n    fn faidx_get_seq_len() {\n        let r = open_reader();\n        let chr1_len = r.fetch_seq_len(\"chr1\");\n        let chr2_len = r.fetch_seq_len(\"chr2\");\n        assert_eq!(chr1_len, 120u64);\n        assert_eq!(chr2_len, 120u64);\n    }\n\n    #[test]\n    fn open_many_readers() {\n        for _ in 0..500_000 {\n            let reader = open_reader();\n            drop(reader);\n        }\n    }\n}\n"
  },
  {
    "path": "src/htslib.rs",
    "content": "//! Re-export hts-sys htslib bindings\npub use hts_sys::*;\n"
  },
  {
    "path": "src/lib.rs",
    "content": "// Copyright 2014-2021 Johannes Köster.\n// Licensed under the MIT license (http://opensource.org/licenses/MIT)\n// This file may not be copied, modified, or distributed\n// except according to those terms.\n\n//! Rust-Htslib provides a high level API to working with the common HTS file formats.\n//!\n//! Htslib itself is the *de facto* standard implementation for reading and writing files for\n//! HTS alignments (SAM and BAM) as well as variant calls in VCF and BCF format.\n//!\n//! For example, let's say that we use samtools to view the header of a test file:\n//!\n//! ```bash\n//! samtools view -H test/test.bam\n//! @SQ    SN:CHROMOSOME_I    LN:15072423\n//! @SQ    SN:CHROMOSOME_II    LN:15279345\n//! @SQ    SN:CHROMOSOME_III    LN:13783700\n//! @SQ    SN:CHROMOSOME_IV    LN:17493793\n//! @SQ    SN:CHROMOSOME_V    LN:20924149\n//! ```\n//!\n//! We can reproduce that with Rust-Htslib. Reading BAM files and printing the header\n//! to the screen is as easy as\n//!\n//! ```\n//! use rust_htslib::{bam, bam::Read};\n//!\n//!\n//! let bam = bam::Reader::from_path(&\"test/test.bam\").unwrap();\n//! let header = bam::Header::from_template(bam.header());\n//!\n//! // print header records to the terminal, akin to samtool\n//! for (key, records) in header.to_hashmap() {\n//!     for record in records {\n//!          println!(\"@{}\\tSN:{}\\tLN:{}\", key, record[\"SN\"], record[\"LN\"]);\n//!     }\n//! }\n//! ```\n//!\n//! which results in the following output, equivalent to samtools.\n//!\n//! ```bash\n//! @SQ    SN:CHROMOSOME_I    LN:15072423\n//! @SQ    SN:CHROMOSOME_II    LN:15279345\n//! @SQ    SN:CHROMOSOME_III    LN:13783700\n//! @SQ    SN:CHROMOSOME_IV    LN:17493793\n//! @SQ    SN:CHROMOSOME_V    LN:20924149\n//! ```\n//!\n//! We can also read directly from the BAM file and write to an output file\n//!\n//! ```\n//! use rust_htslib::{bam, bam::Read};\n//!\n//! let mut bam = bam::Reader::from_path(&\"test/test.bam\").unwrap();\n//! let header = bam::Header::from_template(bam.header());\n//! let mut out = bam::Writer::from_path(&\"test/out.bam\", &header, bam::Format::Bam).unwrap();\n//!\n//! // copy reverse reads to new BAM file\n//! for r in bam.records() {\n//!     let record = r.unwrap();\n//!     if record.is_reverse() {\n//!         out.write(&record).unwrap();\n//!     }\n//! }\n//! ```\n//!\n//! Pileups can be performed with\n//!\n//! ```\n//! use rust_htslib::{bam, bam::Read};\n//!\n//! let mut bam = bam::Reader::from_path(&\"test/test.bam\").unwrap();\n//!\n//! // pileup over all covered sites\n//! for p in bam.pileup() {\n//!     let pileup = p.unwrap();\n//!     println!(\"{}:{} depth {}\", pileup.tid(), pileup.pos(), pileup.depth());\n//!\n//!     for alignment in pileup.alignments() {\n//!         if !alignment.is_del() && !alignment.is_refskip() {\n//!             println!(\"Base {}\", alignment.record().seq()[alignment.qpos().unwrap()]);\n//!         }\n//!         // mark indel start\n//!         match alignment.indel() {\n//!             bam::pileup::Indel::Ins(len) => println!(\"Insertion of length {} between this and next position.\", len),\n//!             bam::pileup::Indel::Del(len) => println!(\"Deletion of length {} between this and next position.\", len),\n//!             bam::pileup::Indel::None => ()\n//!         }\n//!     }\n//! }\n//! ```\n//!\n//! In both cases, indexed BAM files can be seeked for specific regions using [`fetch`](bam/struct.IndexedReader.html#method.fetch), constraining either the record iterator or the pileups:\n//!\n//! ```\n//! use rust_htslib::{bam, bam::Read};\n//!\n//! let mut bam = bam::IndexedReader::from_path(&\"test/test.bam\").unwrap();\n//!\n//! bam.fetch((\"CHROMOSOME_I\", 0, 20)).unwrap();\n//! // afterwards, read or pileup in this region\n//! ```\n//!\n//! See\n//! * [`fetch`](bam/struct.IndexedReader.html#method.fetch)\n//! * [`records`](bam/struct.IndexedReader.html#method.records)\n//! * [`read`](bam/struct.IndexedReader.html#method.read)\n//! * [`pileup`](bam/struct.IndexedReader.html#method.pileup)\n\n#[macro_use]\nextern crate custom_derive;\n\n#[macro_use]\nextern crate newtype_derive;\n\n#[cfg(feature = \"serde_feature\")]\nextern crate serde;\n\n#[cfg(test)] // <-- not needed in examples + integration tests\n#[macro_use]\nextern crate pretty_assertions;\n#[cfg(all(test, feature = \"serde_feature\"))]\nextern crate serde_json;\n\npub mod bam;\npub mod bcf;\npub mod bgzf;\npub mod errors;\npub mod faidx;\npub mod htslib;\npub mod tbx;\npub mod tpool;\npub mod utils;\n"
  },
  {
    "path": "src/tbx/mod.rs",
    "content": "// Copyright 2018 Manuel Holtgrewe, Berlin Institute of Health.\n// Licensed under the MIT license (http://opensource.org/licenses/MIT)\n// This file may not be copied, modified, or distributed\n// except according to those terms.\n\n//! Module for working with tabix-indexed text files.\n//!\n//! This module allows to read tabix-indexed text files (such as BED) in a convenient but in a\n//! line-based (and thus format-agnostic way). For accessing tabix-inxed VCF files, using the\n//! `bcf` module is probably a better choice as this module gives you lines from the text files\n//! which you then have to take care of parsing.\n//!\n//! In general, for reading tabix-indexed files, first to open the file by creating a `tbx::Reader`\n//! objects, possibly translate the chromosome name to its numeric ID in the file, fetch the region\n//! of interest using `fetch()`, and finally iterate over the records using `records()`.\n//!\n//! # Examples\n//!\n//! ```rust,no_run\n//! use rust_htslib::tbx::{self, Read};\n//!\n//! // Create a tabix reader for reading a tabix-indexed BED file.\n//! let path_bed = \"file.bed.gz\";\n//! let mut tbx_reader = tbx::Reader::from_path(&path_bed)\n//!     .expect(&format!(\"Could not open {}\", path_bed));\n//!\n//! // Resolve chromosome name to numeric ID.\n//! let tid = match tbx_reader.tid(\"chr1\") {\n//!     Ok(tid) => tid,\n//!     Err(_) => panic!(\"Could not resolve 'chr1' to contig ID\"),\n//! };\n//!\n//! // Set region to fetch.\n//! tbx_reader\n//!     .fetch(tid, 0, 100_000)\n//!     .expect(\"Could not seek to chr1:1-100,000\");\n//!\n//! // Read through all records in region.\n//! for record in tbx_reader.records() {\n//!     // ... actually do some work\n//! }\n//! ```\n\nuse std::ffi;\nuse std::path::Path;\nuse std::ptr;\nuse url::Url;\n\nuse crate::errors::{Error, Result};\nuse crate::htslib;\nuse crate::utils::path_as_bytes;\n\n/// A trait for a Tabix reader with a read method.\npub trait Read: Sized {\n    /// Read next line into the given `Vec<u8>` (i.e., ASCII string).\n    ///\n    /// Use this method in combination with a single allocated record to avoid the reallocations\n    /// occurring with the iterator.\n    ///\n    /// # Arguments\n    ///\n    /// * `record` - the `Vec<u8>` to be filled\n    ///\n    /// # Returns\n    /// Ok(true) if record was read, Ok(false) if no more record in file\n    fn read(&mut self, record: &mut Vec<u8>) -> Result<bool>;\n\n    /// Iterator over the lines/records of the seeked region.\n    ///\n    /// Note that, while being convenient, this is less efficient than pre-allocating a\n    /// `Vec<u8>` and reading into it with the `read()` method, since every iteration involves\n    /// the allocation of a new `Vec<u8>`.\n    fn records(&mut self) -> Records<'_, Self>;\n\n    /// Return the text headers, split by line.\n    fn header(&self) -> &Vec<String>;\n}\n\n/// A Tabix file reader.\n///\n/// This struct and its associated functions are meant for reading plain-text tabix indexed\n/// by `tabix`.\n///\n/// Note that the `tabix` command from `htslib` can actually several more things, including\n/// building indices and converting BCF to VCF text output.  Both is out of scope here.\n#[derive(Debug)]\npub struct Reader {\n    /// The header lines (if any).\n    header: Vec<String>,\n\n    /// The file to read from.\n    hts_file: *mut htslib::htsFile,\n    /// The file format information.\n    hts_format: htslib::htsExactFormat,\n    /// The tbx_t structure to read from.\n    tbx: *mut htslib::tbx_t,\n    /// The current buffer.\n    buf: htslib::kstring_t,\n    /// Iterator over the buffer.\n    itr: Option<*mut htslib::hts_itr_t>,\n\n    /// The currently fetch region's tid.\n    tid: i64,\n    /// The currently fetch region's 0-based begin pos.\n    start: i64,\n    /// The currently fetch region's 0-based end pos.\n    end: i64,\n}\n\nunsafe impl Send for Reader {}\n\n/// Redefinition of `KS_SEP_LINE` from `htslib/kseq.h`.\nconst KS_SEP_LINE: i32 = 2;\n\nimpl Reader {\n    /// Create a new Reader from path.\n    ///\n    /// # Arguments\n    ///\n    /// * `path` - the path to open.\n    pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self> {\n        Self::new(&path_as_bytes(path, true)?)\n    }\n\n    pub fn from_url(url: &Url) -> Result<Self> {\n        Self::new(url.as_str().as_bytes())\n    }\n\n    /// Create a new Reader.\n    ///\n    /// # Arguments\n    ///\n    /// * `path` - the path.\n    fn new(path: &[u8]) -> Result<Self> {\n        let path = ffi::CString::new(path).unwrap();\n        let c_str = ffi::CString::new(\"r\").unwrap();\n        let hts_file = unsafe { htslib::hts_open(path.as_ptr(), c_str.as_ptr()) };\n        let hts_format: u32 = unsafe {\n            let file_format: *const hts_sys::htsFormat = htslib::hts_get_format(hts_file);\n            (*file_format).format\n        };\n\n        let tbx = unsafe { htslib::tbx_index_load(path.as_ptr()) };\n        if tbx.is_null() {\n            return Err(Error::TabixInvalidIndex);\n        }\n        let mut header = Vec::new();\n        let mut buf = htslib::kstring_t {\n            l: 0,\n            m: 0,\n            s: ptr::null_mut(),\n        };\n        unsafe {\n            while htslib::hts_getline(hts_file, KS_SEP_LINE, &mut buf) >= 0 {\n                if buf.l > 0 && i32::from(*buf.s) == (*tbx).conf.meta_char {\n                    header.push(String::from(ffi::CStr::from_ptr(buf.s).to_str().unwrap()));\n                } else {\n                    break;\n                }\n            }\n        }\n\n        Ok(Reader {\n            header,\n            hts_file,\n            hts_format,\n            tbx,\n            buf,\n            itr: None,\n            tid: -1,\n            start: -1,\n            end: -1,\n        })\n    }\n\n    /// Get sequence/target ID from sequence name.\n    pub fn tid(&self, name: &str) -> Result<u64> {\n        let name_cstr = ffi::CString::new(name.as_bytes()).unwrap();\n        let res = unsafe { htslib::tbx_name2id(self.tbx, name_cstr.as_ptr()) };\n        if res < 0 {\n            Err(Error::UnknownSequence {\n                sequence: name.to_owned(),\n            })\n        } else {\n            Ok(res as u64)\n        }\n    }\n\n    /// Fetch region given by numeric sequence number and 0-based begin and end position.\n    pub fn fetch(&mut self, tid: u64, start: u64, end: u64) -> Result<()> {\n        self.tid = tid as i64;\n        self.start = start as i64;\n        self.end = end as i64;\n\n        if let Some(itr) = self.itr {\n            unsafe {\n                htslib::hts_itr_destroy(itr);\n            }\n        }\n        let itr = unsafe {\n            htslib::hts_itr_query(\n                (*self.tbx).idx,\n                tid as i32,\n                start as i64,\n                end as i64,\n                Some(htslib::tbx_readrec),\n            )\n        };\n        if itr.is_null() {\n            self.itr = None;\n            Err(Error::Fetch)\n        } else {\n            self.itr = Some(itr);\n            Ok(())\n        }\n    }\n\n    /// Return the sequence contig names.\n    pub fn seqnames(&self) -> Vec<String> {\n        let mut result = Vec::new();\n\n        let mut nseq: i32 = 0;\n        let seqs = unsafe { htslib::tbx_seqnames(self.tbx, &mut nseq) };\n        for i in 0..nseq {\n            unsafe {\n                result.push(String::from(\n                    ffi::CStr::from_ptr(*seqs.offset(i as isize))\n                        .to_str()\n                        .unwrap(),\n                ));\n            }\n        }\n        unsafe {\n            libc::free(seqs as *mut libc::c_void);\n        };\n\n        result\n    }\n\n    /// Activate multi-threaded BGZF read support in htslib. This should permit faster\n    /// reading of large BGZF files.\n    ///\n    /// # Arguments\n    ///\n    /// * `n_threads` - number of extra background reader threads to use\n    pub fn set_threads(&mut self, n_threads: usize) -> Result<()> {\n        assert!(n_threads > 0, \"n_threads must be > 0\");\n\n        let r = unsafe { htslib::hts_set_threads(self.hts_file, n_threads as i32) };\n        if r != 0 {\n            Err(Error::SetThreads)\n        } else {\n            Ok(())\n        }\n    }\n\n    pub fn hts_format(&self) -> htslib::htsExactFormat {\n        self.hts_format\n    }\n}\n\n/// Return whether the two given genomic intervals overlap.\nfn overlap(tid1: i64, begin1: i64, end1: i64, tid2: i64, begin2: i64, end2: i64) -> bool {\n    (tid1 == tid2) && (begin1 < end2) && (begin2 < end1)\n}\n\nimpl Read for Reader {\n    fn read(&mut self, record: &mut Vec<u8>) -> Result<bool> {\n        match self.itr {\n            Some(itr) => {\n                loop {\n                    // Try to read next line.\n                    let ret = unsafe {\n                        htslib::hts_itr_next(\n                            htslib::hts_get_bgzfp(self.hts_file),\n                            itr,\n                            //mem::transmute(&mut self.buf),\n                            &mut self.buf as *mut htslib::kstring_t as *mut libc::c_void,\n                            //mem::transmute(self.tbx),\n                            self.tbx as *mut libc::c_void,\n                        )\n                    };\n                    // Handle errors first.\n                    if ret == -1 {\n                        return Ok(false);\n                    } else if ret == -2 {\n                        return Err(Error::TabixTruncatedRecord);\n                    } else if ret < 0 {\n                        panic!(\"Return value should not be <0 but was: {}\", ret);\n                    }\n                    // Return first overlapping record (loop will stop when `hts_itr_next(...)`\n                    // returns `< 0`).\n                    let (tid, start, end) =\n                        unsafe { ((*itr).curr_tid, (*itr).curr_beg, (*itr).curr_end) };\n                    // XXX: Careful with this tid conversion!!!\n                    if overlap(self.tid, self.start, self.end, tid as i64, start, end) {\n                        *record =\n                            unsafe { Vec::from(ffi::CStr::from_ptr(self.buf.s).to_str().unwrap()) };\n                        return Ok(true);\n                    }\n                }\n            }\n            _ => Err(Error::TabixNoIter),\n        }\n    }\n\n    fn records(&mut self) -> Records<'_, Self> {\n        Records { reader: self }\n    }\n\n    fn header(&self) -> &Vec<String> {\n        &self.header\n    }\n}\n\nimpl Drop for Reader {\n    fn drop(&mut self) {\n        unsafe {\n            if self.itr.is_some() {\n                htslib::hts_itr_destroy(self.itr.unwrap());\n            }\n            htslib::tbx_destroy(self.tbx);\n            htslib::hts_close(self.hts_file);\n        }\n    }\n}\n\n/// Iterator over the lines of a tabix file.\n#[derive(Debug)]\npub struct Records<'a, R: Read> {\n    reader: &'a mut R,\n}\n\nimpl<R: Read> Iterator for Records<'_, R> {\n    type Item = Result<Vec<u8>>;\n\n    #[allow(clippy::read_zero_byte_vec)]\n    fn next(&mut self) -> Option<Result<Vec<u8>>> {\n        let mut record = Vec::new();\n        match self.reader.read(&mut record) {\n            Ok(false) => None,\n            Ok(true) => Some(Ok(record)),\n            Err(err) => Some(Err(err)),\n        }\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    #[test]\n    fn bed_basic() {\n        let reader =\n            Reader::from_path(\"test/tabix_reader/test_bed3.bed.gz\").expect(\"Error opening file.\");\n\n        // Check sequence name vector.\n        assert_eq!(\n            reader.seqnames(),\n            vec![String::from(\"chr1\"), String::from(\"chr2\")]\n        );\n\n        // Check mapping between name and idx.\n        assert_eq!(reader.tid(\"chr1\").unwrap(), 0);\n        assert_eq!(reader.tid(\"chr2\").unwrap(), 1);\n        assert!(reader.tid(\"chr3\").is_err());\n    }\n\n    #[test]\n    fn bed_fetch_from_chr1_read_api() {\n        let mut reader =\n            Reader::from_path(\"test/tabix_reader/test_bed3.bed.gz\").expect(\"Error opening file.\");\n\n        let chr1_id = reader.tid(\"chr1\").unwrap();\n        assert!(reader.fetch(chr1_id, 1000, 1003).is_ok());\n\n        let mut record = Vec::new();\n        assert!(reader.read(&mut record).is_ok());\n        assert_eq!(record, Vec::from(\"chr1\\t1001\\t1002\"));\n        assert_eq!(reader.read(&mut record), Ok(false)); // EOF\n    }\n\n    #[test]\n    fn bed_fetch_from_chr1_iterator_api() {\n        let mut reader =\n            Reader::from_path(\"test/tabix_reader/test_bed3.bed.gz\").expect(\"Error opening file.\");\n\n        let chr1_id = reader.tid(\"chr1\").unwrap();\n        assert!(reader.fetch(chr1_id, 1000, 1003).is_ok());\n\n        let records: Vec<Vec<u8>> = reader.records().map(|r| r.unwrap()).collect();\n        assert_eq!(records, vec![Vec::from(\"chr1\\t1001\\t1002\")]);\n    }\n\n    #[test]\n    fn test_fails_on_bam() {\n        let reader = Reader::from_path(\"test/test.bam\");\n        assert!(reader.is_err());\n    }\n\n    #[test]\n    fn test_fails_on_non_existiant() {\n        let reader = Reader::from_path(\"test/no_such_file\");\n        assert!(reader.is_err());\n    }\n\n    #[test]\n    fn test_fails_on_vcf() {\n        let reader = Reader::from_path(\"test/test_left.vcf\");\n        assert!(reader.is_err());\n    }\n\n    #[test]\n    fn test_text_header_regions() {\n        // This file has chromosome, start, and end positions with a header line.\n        Reader::from_path(\"test/tabix_reader/genomic_regions_header.txt.gz\")\n            .expect(\"Error opening file.\");\n    }\n\n    #[test]\n    fn test_text_header_positions() {\n        // This file has chromosome and position with a header line, indexed with\n        // `tabix -b2 -e2 <file>`.\n        Reader::from_path(\"test/tabix_reader/genomic_positions_header.txt.gz\")\n            .expect(\"Error opening file.\");\n    }\n\n    #[test]\n    fn test_text_bad_header() {\n        // This is a duplicate of the above file but the index file is nonsense text.\n        Reader::from_path(\"test/tabix_reader/bad_header.txt.gz\")\n            .expect_err(\"Invalid index file should fail.\");\n    }\n}\n"
  },
  {
    "path": "src/tpool.rs",
    "content": "use std::cell::RefCell;\nuse std::rc::Rc;\n\npub use crate::errors::{Error, Result};\nuse crate::htslib;\n\n/// An HTSlib thread pool. Create a thread pool and use `set_thread_pool()` methods\n/// to share a thread pool across multiple BAM readers & writers.\n/// The Rust wrapper holds the htslib thread pool behind a Rc, and a Rc reference\n/// to the thread pool is held by each reader / writer so you don't need to\n/// explicitly manage the lifetime of the `ThreadPool`.\n#[derive(Clone, Debug)]\npub struct ThreadPool {\n    pub(crate) handle: Rc<RefCell<InnerThreadPool>>,\n}\n\nimpl ThreadPool {\n    /// Create a new thread pool with `n_threads` threads.\n    pub fn new(n_threads: u32) -> Result<ThreadPool> {\n        let ret = unsafe { htslib::hts_tpool_init(n_threads as i32) };\n\n        if ret.is_null() {\n            Err(Error::ThreadPool)\n        } else {\n            let inner = htslib::htsThreadPool {\n                pool: ret,\n                // this matches the default size\n                // used in hts_set_threads.\n                qsize: n_threads as i32 * 2,\n            };\n            let inner = InnerThreadPool { inner };\n\n            let handle = Rc::new(RefCell::new(inner));\n            Ok(ThreadPool { handle })\n        }\n    }\n}\n\n/// Internal htsThreadPool\n#[derive(Clone, Debug)]\npub struct InnerThreadPool {\n    pub(crate) inner: htslib::htsThreadPool,\n}\n\nimpl Drop for InnerThreadPool {\n    fn drop(&mut self) {\n        if !self.inner.pool.is_null() {\n            unsafe {\n                htslib::hts_tpool_destroy(self.inner.pool);\n            }\n        }\n\n        self.inner.pool = std::ptr::null_mut();\n    }\n}\n"
  },
  {
    "path": "src/utils.rs",
    "content": "// Copyright 2014 Christopher Schröder, Johannes Köster.\n// Licensed under the MIT license (http://opensource.org/licenses/MIT)\n// This file may not be copied, modified, or distributed\n// except according to those terms.\n\n//! Module with utility code.\n\nuse crate::errors::{Error, Result};\nuse std::ffi;\nuse std::path::Path;\nuse std::ptr;\n\n/// Copies data from `src` to `dst`\n/// TODO remove once stable in standard library.\n///\n/// Panics if the length of `dst` is less than the length of `src`.\n#[inline]\npub fn copy_memory(src: &[u8], dst: &mut [u8]) {\n    let len_src = src.len();\n    assert!(\n        dst.len() >= len_src,\n        \"dst len {} < src len {}\",\n        dst.len(),\n        src.len()\n    );\n    // `dst` is unaliasable, so we know statically it doesn't overlap\n    // with `src`.\n    unsafe {\n        ptr::copy_nonoverlapping(src.as_ptr(), dst.as_mut_ptr(), len_src);\n    }\n}\n\npub fn path_to_cstring<P: AsRef<Path>>(path: &P) -> Option<ffi::CString> {\n    path.as_ref()\n        .to_str()\n        .and_then(|p| ffi::CString::new(p).ok())\n}\n\n/// Convert a path into a byte-vector\npub fn path_as_bytes<'a, P: 'a + AsRef<Path>>(path: P, must_exist: bool) -> Result<Vec<u8>> {\n    if path.as_ref().exists() || !must_exist {\n        Ok(path\n            .as_ref()\n            .to_str()\n            .ok_or(Error::NonUnicodePath)?\n            .as_bytes()\n            .to_owned())\n    } else {\n        Err(Error::FileNotFound {\n            path: path.as_ref().to_owned(),\n        })\n    }\n}\n"
  },
  {
    "path": "test/bam2sam_expected.sam",
    "content": "@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\tLN:17493793\n@SQ\tSN:CHROMOSOME_V\tLN:20924149\nI\t16\tCHROMOSOME_I\t2\t1\t27M1D73M\t*\t0\t0\tCCTAGCCCTAACCCTAACCCTAACCCTAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA\t#############################@B?8B?BA@@DDBCDDCBC@CDCDCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC\tXG:i:1\tXM:i:5\tXN:i:0\tXO:i:1\tXS:i:-18\tAS:i:-18\tYT:Z:UU\nII.14978392\t16\tCHROMOSOME_I\t2\t1\t27M1D73M\t*\t0\t0\tCCTAGCCCTAACCCTAACCCTAACCCTAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA\t#############################@B?8B?BA@@DDBCDDCBC@CDCDCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC\tXG:i:1\tXM:i:5\tXN:i:0\tXO:i:1\tXS:i:-18\tAS:i:-18\tYT:Z:UU\nIII\t16\tCHROMOSOME_I\t2\t1\t27M1D73M\t*\t0\t0\tCCTAGCCCTAACCCTAACCCTAACCCTAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA\t#############################@B?8B?BA@@DDBCDDCBC@CDCDCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC\tXG:i:1\tXM:i:5\tXN:i:0\tXO:i:1\tXS:i:-18\tAS:i:-18\tYT:Z:UU\nIV\t16\tCHROMOSOME_I\t2\t40\t27M1D73M\t*\t0\t0\tCCTAGCCCTAACCCTAACCCTAACCCTAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA\t#############################@B?8B?BA@@DDBCDDCBC@CDCDCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC\tXG:i:1\tXM:i:5\tXN:i:0\tXO:i:1\tXS:i:-18\tAS:i:-18\tYT:Z:UU\nV\t16\tCHROMOSOME_I\t2\t1\t27M1D73M\t*\t0\t0\tCCTAGCCCTAACCCTAACCCTAACCCTAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA\t#############################@B?8B?BA@@DDBCDDCBC@CDCDCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC\tXG:i:1\tXM:i:5\tXN:i:0\tXO:i:1\tXS:i:-18\tAS:i:-18\tYT:Z:UU\nVI\t2048\tCHROMOSOME_I\t2\t1\t27M100000D73M\t*\t0\t0\tACTAAGCCTAAGCCTAAGCCTAAGCCAATTATCGATTTCTGAAAAAATTATCGAATTTTCTAGAAATTTTGCAAATTTTTTCATAAAATTATCGATTTTA\t#############################@B?8B?BA@@DDBCDDCBC@CDCDCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC\n"
  },
  {
    "path": "test/bam2sam_out.sam",
    "content": "@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\tLN:17493793\n@SQ\tSN:CHROMOSOME_V\tLN:20924149\nI\t16\tCHROMOSOME_I\t2\t1\t27M1D73M\t*\t0\t0\tCCTAGCCCTAACCCTAACCCTAACCCTAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA\t#############################@B?8B?BA@@DDBCDDCBC@CDCDCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC\tXG:i:1\tXM:i:5\tXN:i:0\tXO:i:1\tXS:i:-18\tAS:i:-18\tYT:Z:UU\nII.14978392\t16\tCHROMOSOME_I\t2\t1\t27M1D73M\t*\t0\t0\tCCTAGCCCTAACCCTAACCCTAACCCTAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA\t#############################@B?8B?BA@@DDBCDDCBC@CDCDCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC\tXG:i:1\tXM:i:5\tXN:i:0\tXO:i:1\tXS:i:-18\tAS:i:-18\tYT:Z:UU\nIII\t16\tCHROMOSOME_I\t2\t1\t27M1D73M\t*\t0\t0\tCCTAGCCCTAACCCTAACCCTAACCCTAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA\t#############################@B?8B?BA@@DDBCDDCBC@CDCDCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC\tXG:i:1\tXM:i:5\tXN:i:0\tXO:i:1\tXS:i:-18\tAS:i:-18\tYT:Z:UU\nIV\t16\tCHROMOSOME_I\t2\t40\t27M1D73M\t*\t0\t0\tCCTAGCCCTAACCCTAACCCTAACCCTAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA\t#############################@B?8B?BA@@DDBCDDCBC@CDCDCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC\tXG:i:1\tXM:i:5\tXN:i:0\tXO:i:1\tXS:i:-18\tAS:i:-18\tYT:Z:UU\nV\t16\tCHROMOSOME_I\t2\t1\t27M1D73M\t*\t0\t0\tCCTAGCCCTAACCCTAACCCTAACCCTAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA\t#############################@B?8B?BA@@DDBCDDCBC@CDCDCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC\tXG:i:1\tXM:i:5\tXN:i:0\tXO:i:1\tXS:i:-18\tAS:i:-18\tYT:Z:UU\nVI\t2048\tCHROMOSOME_I\t2\t1\t27M100000D73M\t*\t0\t0\tACTAAGCCTAAGCCTAAGCCTAAGCCAATTATCGATTTCTGAAAAAATTATCGAATTTTCTAGAAATTTTGCAAATTTTTTCATAAAATTATCGATTTTA\t#############################@B?8B?BA@@DDBCDDCBC@CDCDCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC\n"
  },
  {
    "path": "test/base_mods/MM-double.sam",
    "content": "@CO\tModifications called on both strands of the same record,\n@CO\tincluding potentially at the same location simultaneously.\n*\t0\t*\t0\t0\t*\t*\t0\t0\tAGGATCTCTAGCGGATCGGCGGGGGATATGCCATAT\t*\tMm:Z:C+m,1,3,0;G-m,0,2,0,4;G+o,4;\tMl:B:C,128,153,179,115,141,166,192,102\n"
  },
  {
    "path": "test/base_mods/MM-orient.sam",
    "content": "@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*\t*\t0\t0\tAGGATCTCTAGCGGATCGGCGGGGGATATGCCATAT\t*\tMm:Z:C+m,1,3,0;\tMl:B:C,128,153,179\ntop-rev\t16\t*\t0\t0\t*\t*\t0\t0\tATATGGCATATCCCCCGCCGATCCGCTAGAGATCCT\t*\tMm:Z:C+m,1,3,0;\tMl:B:C,128,153,179\nbot-fwd\t0\t*\t0\t0\t*\t*\t0\t0\tAGGATCTCTAGCGGATCGGCGGGGGATATGCCATAT\t*\tMm:Z:G-m,0,0,4,3;\tMl:B:C,115,141,166,192\nbot-rev\t16\t*\t0\t0\t*\t*\t0\t0\tATATGGCATATCCCCCGCCGATCCGCTAGAGATCCT\t*\tMm:Z:G-m,0,0,4,3;\tMl:B:C,115,141,166,192\n"
  },
  {
    "path": "test/bgzip/plain.vcf",
    "content": "##fileformat=VCFv4.1\n##FORMAT=<ID=GT,Number=1,Type=String,Description=\"Genotype\">\n#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tone\ttwo\n1\t100\t.\tC\tA\t.\t.\t.\tGT\t0/1\t.\n1\t101\t.\tT\tG\t.\t.\t.\tGT\t0/1\t.\n"
  },
  {
    "path": "test/obs-cornercase.vcf",
    "content": "##fileformat=VCFv4.2\n##FILTER=<ID=PASS,Description=\"All filters passed\">\n##INFO=<ID=SVLEN,Number=A,Type=Integer,Description=\"Difference in length between REF and ALT alleles\">\n##INFO=<ID=END,Number=A,Type=Integer,Description=\"End position of structural variant (inclusive, 1-based).\">\n##INFO=<ID=SVTYPE,Number=A,Type=String,Description=\"Structural variant type\">\n##INFO=<ID=EVENT,Number=A,Type=String,Description=\"ID of event associated to breakend\">\n##INFO=<ID=MATEID,Number=1,Type=String,Description=\"ID of mate breakend\">\n##contig=<ID=10,length=2601>\n##INFO=<ID=PROB_MAPPING,Number=.,Type=Integer,Description=\"Varlociraptor observations (binary encoded, meant for internal use only).\">\n##INFO=<ID=PROB_ALT,Number=.,Type=Integer,Description=\"Varlociraptor observations (binary encoded, meant for internal use only).\">\n##INFO=<ID=PROB_REF,Number=.,Type=Integer,Description=\"Varlociraptor observations (binary encoded, meant for internal use only).\">\n##INFO=<ID=PROB_MISSED_ALLELE,Number=.,Type=Integer,Description=\"Varlociraptor observations (binary encoded, meant for internal use only).\">\n##INFO=<ID=PROB_SAMPLE_ALT,Number=.,Type=Integer,Description=\"Varlociraptor observations (binary encoded, meant for internal use only).\">\n##INFO=<ID=PROB_DOUBLE_OVERLAP,Number=.,Type=Integer,Description=\"Varlociraptor observations (binary encoded, meant for internal use only).\">\n##INFO=<ID=STRAND,Number=.,Type=Integer,Description=\"Varlociraptor observations (binary encoded, meant for internal use only).\">\n##INFO=<ID=READ_ORIENTATION,Number=.,Type=Integer,Description=\"Varlociraptor observations (binary encoded, meant for internal use only).\">\n##INFO=<ID=SOFTCLIPPED,Number=.,Type=Integer,Description=\"Varlociraptor observations (binary encoded, meant for internal use only).\">\n##varlociraptor_preprocess_args={\"Preprocess\":{\"kind\":{\"Variants\":{\"reference\":\"ref.fa\",\"candidates\":\"candidates.vcf\",\"bam\":\"patient13.bam\",\"reference_buffer_size\":10,\"min_bam_refetch_distance\":1,\"alignment_properties\":null,\"output\":\"patient13.obs.bcf\",\"spurious_ins_rate\":2.8e-6,\"spurious_del_rate\":5.1e-6,\"spurious_insext_rate\":0.0,\"spurious_delext_rate\":0.0,\"protocol_strandedness\":\"Opposite\",\"realignment_window\":64,\"max_depth\":200,\"omit_insert_size\":false,\"pairhmm_mode\":\"exact\"}}}}\n##varlociraptor_observation_format_version=5\n##bcftools_viewVersion=1.11+htslib-1.11\n##bcftools_viewCommand=view patient13.obs.bcf; Date=Tue Nov 17 13:48:51 2020\n#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\n10\t1301\tgridss33fb_1085o\tT\tT[10:2000[\t2.1391e+09\t.\tEVENT=gridss33fb_1085;SVTYPE=BND;MATEID=gridss33fb_1085h;PROB_MAPPING=2,0,0,0,1,0,6982,48788,1,0,3556,48946;PROB_REF=2,0,0,0,1,0,29208,48945,1,0,29208,48945;PROB_ALT=2,0,0,0,0,0,53400,0,0,53537;PROB_MISSED_ALLELE=2,0,0,0,1,0,29208,49073,1,0,29208,49073;PROB_SAMPLE_ALT=2,0,0,0,1,0,64758,48272,1,0,64758,48272;PROB_DOUBLE_OVERLAP=2,0,0,0,0,0,64512,0,0,64512;STRAND=2,0,0,0,0,0,1,0;READ_ORIENTATION=2,0,0,0,0,0,0,0;SOFTCLIPPED=257,0,0,0,768,2,0,0,0\n"
  },
  {
    "path": "test/results/.gitignore",
    "content": "*\n!.gitignore\n"
  },
  {
    "path": "test/tabix_reader/bad_header.txt.gz.tbi",
    "content": "INVALID INDEX DATA\n"
  },
  {
    "path": "test/test-info-multi-string-number=A.vcf",
    "content": "##fileformat=VCFv4.2\n##FILTER=<ID=PASS,Description=\"All filters passed\">\n##INFO=<ID=PROB_GERMLINE_HET,Number=A,Type=Float,Description=\"Posterior probability for event germline_het\">\n##INFO=<ID=PROB_SOMATIC_TUMOR_MEDIUM,Number=A,Type=Float,Description=\"Posterior probability for event somatic_tumor_medium\">\n##INFO=<ID=PROB_ABSENT,Number=A,Type=Float,Description=\"Posterior probability for event absent\">\n##INFO=<ID=PROB_SOMATIC_NORMAL,Number=A,Type=Float,Description=\"Posterior probability for event somatic_normal\">\n##INFO=<ID=PROB_SOMATIC_TUMOR_HIGH,Number=A,Type=Float,Description=\"Posterior probability for event somatic_tumor_high\">\n##INFO=<ID=PROB_SOMATIC_TUMOR_LOW,Number=A,Type=Float,Description=\"Posterior probability for event somatic_tumor_low\">\n##INFO=<ID=PROB_GERMLINE_HOM,Number=A,Type=Float,Description=\"Posterior probability for event germline_hom\">\n##INFO=<ID=PROB_ARTIFACT,Number=A,Type=Float,Description=\"Posterior probability for strand bias artifact\">\n##INFO=<ID=SVLEN,Number=A,Type=Integer,Description=\"Difference in length between REF and ALT alleles\">\n##FORMAT=<ID=DP,Number=A,Type=Integer,Description=\"Expected sequencing depth, while considering mapping uncertainty\">\n##FORMAT=<ID=AF,Number=A,Type=Float,Description=\"Maximum a posteriori probability estimate of allele frequency\">\n##FORMAT=<ID=OBS,Number=A,Type=String,Description=\"Posterior odds for alt allele of each fragment as Kass Raftery scores: N=none, B=barely, P=positive, S=strong, V=very strong (lower case if probability for correct mapping of fragment is <95%)\">\n##FORMAT=<ID=SB,Number=A,Type=String,Description=\"Strand bias estimate: + indicates that ALT allele is associated with forward strand, - indicates that ALT allele is associated with reverse strand, - indicates no strand bias.\">\n##contig=<ID=1,length=248956422>\n##contig=<ID=2,length=242193529>\n##contig=<ID=3,length=198295559>\n##contig=<ID=4,length=190214555>\n##contig=<ID=5,length=181538259>\n##contig=<ID=6,length=170805979>\n##contig=<ID=7,length=159345973>\n##contig=<ID=8,length=145138636>\n##contig=<ID=9,length=138394717>\n##contig=<ID=10,length=133797422>\n##contig=<ID=11,length=135086622>\n##contig=<ID=12,length=133275309>\n##contig=<ID=13,length=114364328>\n##contig=<ID=14,length=107043718>\n##contig=<ID=15,length=101991189>\n##contig=<ID=16,length=90338345>\n##contig=<ID=17,length=83257441>\n##contig=<ID=18,length=80373285>\n##contig=<ID=19,length=58617616>\n##contig=<ID=20,length=64444167>\n##contig=<ID=21,length=46709983>\n##contig=<ID=22,length=50818468>\n##contig=<ID=X,length=156040895>\n##contig=<ID=Y,length=57227415>\n##contig=<ID=M,length=16569>\n##contig=<ID=1_KI270706v1_random,length=175055>\n##contig=<ID=1_KI270707v1_random,length=32032>\n##contig=<ID=1_KI270708v1_random,length=127682>\n##contig=<ID=1_KI270709v1_random,length=66860>\n##contig=<ID=1_KI270710v1_random,length=40176>\n##contig=<ID=1_KI270711v1_random,length=42210>\n##contig=<ID=1_KI270712v1_random,length=176043>\n##contig=<ID=1_KI270713v1_random,length=40745>\n##contig=<ID=1_KI270714v1_random,length=41717>\n##contig=<ID=2_KI270715v1_random,length=161471>\n##contig=<ID=2_KI270716v1_random,length=153799>\n##contig=<ID=3_GL000221v1_random,length=155397>\n##contig=<ID=4_GL000008v2_random,length=209709>\n##contig=<ID=5_GL000208v1_random,length=92689>\n##contig=<ID=9_KI270717v1_random,length=40062>\n##contig=<ID=9_KI270718v1_random,length=38054>\n##contig=<ID=9_KI270719v1_random,length=176845>\n##contig=<ID=9_KI270720v1_random,length=39050>\n##contig=<ID=11_KI270721v1_random,length=100316>\n##contig=<ID=14_GL000009v2_random,length=201709>\n##contig=<ID=14_GL000225v1_random,length=211173>\n##contig=<ID=14_KI270722v1_random,length=194050>\n##contig=<ID=14_GL000194v1_random,length=191469>\n##contig=<ID=14_KI270723v1_random,length=38115>\n##contig=<ID=14_KI270724v1_random,length=39555>\n##contig=<ID=14_KI270725v1_random,length=172810>\n##contig=<ID=14_KI270726v1_random,length=43739>\n##contig=<ID=15_KI270727v1_random,length=448248>\n##contig=<ID=16_KI270728v1_random,length=1872759>\n##contig=<ID=17_GL000205v2_random,length=185591>\n##contig=<ID=17_KI270729v1_random,length=280839>\n##contig=<ID=17_KI270730v1_random,length=112551>\n##contig=<ID=22_KI270731v1_random,length=150754>\n##contig=<ID=22_KI270732v1_random,length=41543>\n##contig=<ID=22_KI270733v1_random,length=179772>\n##contig=<ID=22_KI270734v1_random,length=165050>\n##contig=<ID=22_KI270735v1_random,length=42811>\n##contig=<ID=22_KI270736v1_random,length=181920>\n##contig=<ID=22_KI270737v1_random,length=103838>\n##contig=<ID=22_KI270738v1_random,length=99375>\n##contig=<ID=22_KI270739v1_random,length=73985>\n##contig=<ID=Y_KI270740v1_random,length=37240>\n##contig=<ID=Un_KI270302v1,length=2274>\n##contig=<ID=Un_KI270304v1,length=2165>\n##contig=<ID=Un_KI270303v1,length=1942>\n##contig=<ID=Un_KI270305v1,length=1472>\n##contig=<ID=Un_KI270322v1,length=21476>\n##contig=<ID=Un_KI270320v1,length=4416>\n##contig=<ID=Un_KI270310v1,length=1201>\n##contig=<ID=Un_KI270316v1,length=1444>\n##contig=<ID=Un_KI270315v1,length=2276>\n##contig=<ID=Un_KI270312v1,length=998>\n##contig=<ID=Un_KI270311v1,length=12399>\n##contig=<ID=Un_KI270317v1,length=37690>\n##contig=<ID=Un_KI270412v1,length=1179>\n##contig=<ID=Un_KI270411v1,length=2646>\n##contig=<ID=Un_KI270414v1,length=2489>\n##contig=<ID=Un_KI270419v1,length=1029>\n##contig=<ID=Un_KI270418v1,length=2145>\n##contig=<ID=Un_KI270420v1,length=2321>\n##contig=<ID=Un_KI270424v1,length=2140>\n##contig=<ID=Un_KI270417v1,length=2043>\n##contig=<ID=Un_KI270422v1,length=1445>\n##contig=<ID=Un_KI270423v1,length=981>\n##contig=<ID=Un_KI270425v1,length=1884>\n##contig=<ID=Un_KI270429v1,length=1361>\n##contig=<ID=Un_KI270442v1,length=392061>\n##contig=<ID=Un_KI270466v1,length=1233>\n##contig=<ID=Un_KI270465v1,length=1774>\n##contig=<ID=Un_KI270467v1,length=3920>\n##contig=<ID=Un_KI270435v1,length=92983>\n##contig=<ID=Un_KI270438v1,length=112505>\n##contig=<ID=Un_KI270468v1,length=4055>\n##contig=<ID=Un_KI270510v1,length=2415>\n##contig=<ID=Un_KI270509v1,length=2318>\n##contig=<ID=Un_KI270518v1,length=2186>\n##contig=<ID=Un_KI270508v1,length=1951>\n##contig=<ID=Un_KI270516v1,length=1300>\n##contig=<ID=Un_KI270512v1,length=22689>\n##contig=<ID=Un_KI270519v1,length=138126>\n##contig=<ID=Un_KI270522v1,length=5674>\n##contig=<ID=Un_KI270511v1,length=8127>\n##contig=<ID=Un_KI270515v1,length=6361>\n##contig=<ID=Un_KI270507v1,length=5353>\n##contig=<ID=Un_KI270517v1,length=3253>\n##contig=<ID=Un_KI270529v1,length=1899>\n##contig=<ID=Un_KI270528v1,length=2983>\n##contig=<ID=Un_KI270530v1,length=2168>\n##contig=<ID=Un_KI270539v1,length=993>\n##contig=<ID=Un_KI270538v1,length=91309>\n##contig=<ID=Un_KI270544v1,length=1202>\n##contig=<ID=Un_KI270548v1,length=1599>\n##contig=<ID=Un_KI270583v1,length=1400>\n##contig=<ID=Un_KI270587v1,length=2969>\n##contig=<ID=Un_KI270580v1,length=1553>\n##contig=<ID=Un_KI270581v1,length=7046>\n##contig=<ID=Un_KI270579v1,length=31033>\n##contig=<ID=Un_KI270589v1,length=44474>\n##contig=<ID=Un_KI270590v1,length=4685>\n##contig=<ID=Un_KI270584v1,length=4513>\n##contig=<ID=Un_KI270582v1,length=6504>\n##contig=<ID=Un_KI270588v1,length=6158>\n##contig=<ID=Un_KI270593v1,length=3041>\n##contig=<ID=Un_KI270591v1,length=5796>\n##contig=<ID=Un_KI270330v1,length=1652>\n##contig=<ID=Un_KI270329v1,length=1040>\n##contig=<ID=Un_KI270334v1,length=1368>\n##contig=<ID=Un_KI270333v1,length=2699>\n##contig=<ID=Un_KI270335v1,length=1048>\n##contig=<ID=Un_KI270338v1,length=1428>\n##contig=<ID=Un_KI270340v1,length=1428>\n##contig=<ID=Un_KI270336v1,length=1026>\n##contig=<ID=Un_KI270337v1,length=1121>\n##contig=<ID=Un_KI270363v1,length=1803>\n##contig=<ID=Un_KI270364v1,length=2855>\n##contig=<ID=Un_KI270362v1,length=3530>\n##contig=<ID=Un_KI270366v1,length=8320>\n##contig=<ID=Un_KI270378v1,length=1048>\n##contig=<ID=Un_KI270379v1,length=1045>\n##contig=<ID=Un_KI270389v1,length=1298>\n##contig=<ID=Un_KI270390v1,length=2387>\n##contig=<ID=Un_KI270387v1,length=1537>\n##contig=<ID=Un_KI270395v1,length=1143>\n##contig=<ID=Un_KI270396v1,length=1880>\n##contig=<ID=Un_KI270388v1,length=1216>\n##contig=<ID=Un_KI270394v1,length=970>\n##contig=<ID=Un_KI270386v1,length=1788>\n##contig=<ID=Un_KI270391v1,length=1484>\n##contig=<ID=Un_KI270383v1,length=1750>\n##contig=<ID=Un_KI270393v1,length=1308>\n##contig=<ID=Un_KI270384v1,length=1658>\n##contig=<ID=Un_KI270392v1,length=971>\n##contig=<ID=Un_KI270381v1,length=1930>\n##contig=<ID=Un_KI270385v1,length=990>\n##contig=<ID=Un_KI270382v1,length=4215>\n##contig=<ID=Un_KI270376v1,length=1136>\n##contig=<ID=Un_KI270374v1,length=2656>\n##contig=<ID=Un_KI270372v1,length=1650>\n##contig=<ID=Un_KI270373v1,length=1451>\n##contig=<ID=Un_KI270375v1,length=2378>\n##contig=<ID=Un_KI270371v1,length=2805>\n##contig=<ID=Un_KI270448v1,length=7992>\n##contig=<ID=Un_KI270521v1,length=7642>\n##contig=<ID=Un_GL000195v1,length=182896>\n##contig=<ID=Un_GL000219v1,length=179198>\n##contig=<ID=Un_GL000220v1,length=161802>\n##contig=<ID=Un_GL000224v1,length=179693>\n##contig=<ID=Un_KI270741v1,length=157432>\n##contig=<ID=Un_GL000226v1,length=15008>\n##contig=<ID=Un_GL000213v1,length=164239>\n##contig=<ID=Un_KI270743v1,length=210658>\n##contig=<ID=Un_KI270744v1,length=168472>\n##contig=<ID=Un_KI270745v1,length=41891>\n##contig=<ID=Un_KI270746v1,length=66486>\n##contig=<ID=Un_KI270747v1,length=198735>\n##contig=<ID=Un_KI270748v1,length=93321>\n##contig=<ID=Un_KI270749v1,length=158759>\n##contig=<ID=Un_KI270750v1,length=148850>\n##contig=<ID=Un_KI270751v1,length=150742>\n##contig=<ID=Un_KI270752v1,length=27745>\n##contig=<ID=Un_KI270753v1,length=62944>\n##contig=<ID=Un_KI270754v1,length=40191>\n##contig=<ID=Un_KI270755v1,length=36723>\n##contig=<ID=Un_KI270756v1,length=79590>\n##contig=<ID=Un_KI270757v1,length=71251>\n##contig=<ID=Un_GL000214v1,length=137718>\n##contig=<ID=Un_KI270742v1,length=186739>\n##contig=<ID=Un_GL000216v2,length=176608>\n##contig=<ID=Un_GL000218v1,length=161147>\n##contig=<ID=EBV,length=171823>\n##contig=<ID=Un_KN707606v1_decoy,length=2200>\n##contig=<ID=Un_KN707607v1_decoy,length=3033>\n##contig=<ID=Un_KN707608v1_decoy,length=3112>\n##contig=<ID=Un_KN707609v1_decoy,length=1642>\n##contig=<ID=Un_KN707610v1_decoy,length=1393>\n##contig=<ID=Un_KN707611v1_decoy,length=1103>\n##contig=<ID=Un_KN707612v1_decoy,length=1039>\n##contig=<ID=Un_KN707613v1_decoy,length=1619>\n##contig=<ID=Un_KN707614v1_decoy,length=3122>\n##contig=<ID=Un_KN707615v1_decoy,length=1934>\n##contig=<ID=Un_KN707616v1_decoy,length=3111>\n##contig=<ID=Un_KN707617v1_decoy,length=2545>\n##contig=<ID=Un_KN707618v1_decoy,length=2295>\n##contig=<ID=Un_KN707619v1_decoy,length=1551>\n##contig=<ID=Un_KN707620v1_decoy,length=2046>\n##contig=<ID=Un_KN707621v1_decoy,length=1222>\n##contig=<ID=Un_KN707622v1_decoy,length=1535>\n##contig=<ID=Un_KN707623v1_decoy,length=3784>\n##contig=<ID=Un_KN707624v1_decoy,length=1329>\n##contig=<ID=Un_KN707625v1_decoy,length=1238>\n##contig=<ID=Un_KN707626v1_decoy,length=5623>\n##contig=<ID=Un_KN707627v1_decoy,length=5821>\n##contig=<ID=Un_KN707628v1_decoy,length=2960>\n##contig=<ID=Un_KN707629v1_decoy,length=1848>\n##contig=<ID=Un_KN707630v1_decoy,length=2315>\n##contig=<ID=Un_KN707631v1_decoy,length=1945>\n##contig=<ID=Un_KN707632v1_decoy,length=1424>\n##contig=<ID=Un_KN707633v1_decoy,length=1274>\n##contig=<ID=Un_KN707634v1_decoy,length=1007>\n##contig=<ID=Un_KN707635v1_decoy,length=1414>\n##contig=<ID=Un_KN707636v1_decoy,length=1725>\n##contig=<ID=Un_KN707637v1_decoy,length=5354>\n##contig=<ID=Un_KN707638v1_decoy,length=2189>\n##contig=<ID=Un_KN707639v1_decoy,length=1294>\n##contig=<ID=Un_KN707640v1_decoy,length=1831>\n##contig=<ID=Un_KN707641v1_decoy,length=1647>\n##contig=<ID=Un_KN707642v1_decoy,length=2943>\n##contig=<ID=Un_KN707643v1_decoy,length=2857>\n##contig=<ID=Un_KN707644v1_decoy,length=1030>\n##contig=<ID=Un_KN707645v1_decoy,length=1070>\n##contig=<ID=Un_KN707646v1_decoy,length=1735>\n##contig=<ID=Un_KN707647v1_decoy,length=1982>\n##contig=<ID=Un_KN707648v1_decoy,length=1564>\n##contig=<ID=Un_KN707649v1_decoy,length=1775>\n##contig=<ID=Un_KN707650v1_decoy,length=1540>\n##contig=<ID=Un_KN707651v1_decoy,length=2013>\n##contig=<ID=Un_KN707652v1_decoy,length=1176>\n##contig=<ID=Un_KN707653v1_decoy,length=1890>\n##contig=<ID=Un_KN707654v1_decoy,length=3644>\n##contig=<ID=Un_KN707655v1_decoy,length=2785>\n##contig=<ID=Un_KN707656v1_decoy,length=1017>\n##contig=<ID=Un_KN707657v1_decoy,length=1068>\n##contig=<ID=Un_KN707658v1_decoy,length=1007>\n##contig=<ID=Un_KN707659v1_decoy,length=2605>\n##contig=<ID=Un_KN707660v1_decoy,length=8410>\n##contig=<ID=Un_KN707661v1_decoy,length=5534>\n##contig=<ID=Un_KN707662v1_decoy,length=2173>\n##contig=<ID=Un_KN707663v1_decoy,length=1065>\n##contig=<ID=Un_KN707664v1_decoy,length=8683>\n##contig=<ID=Un_KN707665v1_decoy,length=2670>\n##contig=<ID=Un_KN707666v1_decoy,length=2420>\n##contig=<ID=Un_KN707667v1_decoy,length=2189>\n##contig=<ID=Un_KN707668v1_decoy,length=2093>\n##contig=<ID=Un_KN707669v1_decoy,length=1184>\n##contig=<ID=Un_KN707670v1_decoy,length=1205>\n##contig=<ID=Un_KN707671v1_decoy,length=2786>\n##contig=<ID=Un_KN707672v1_decoy,length=2794>\n##contig=<ID=Un_KN707673v1_decoy,length=19544>\n##contig=<ID=Un_KN707674v1_decoy,length=2848>\n##contig=<ID=Un_KN707675v1_decoy,length=10556>\n##contig=<ID=Un_KN707676v1_decoy,length=9066>\n##contig=<ID=Un_KN707677v1_decoy,length=7267>\n##contig=<ID=Un_KN707678v1_decoy,length=2462>\n##contig=<ID=Un_KN707679v1_decoy,length=1774>\n##contig=<ID=Un_KN707680v1_decoy,length=1297>\n##contig=<ID=Un_KN707681v1_decoy,length=4379>\n##contig=<ID=Un_KN707682v1_decoy,length=4208>\n##contig=<ID=Un_KN707683v1_decoy,length=4068>\n##contig=<ID=Un_KN707684v1_decoy,length=2940>\n##contig=<ID=Un_KN707685v1_decoy,length=3938>\n##contig=<ID=Un_KN707686v1_decoy,length=2072>\n##contig=<ID=Un_KN707687v1_decoy,length=1136>\n##contig=<ID=Un_KN707688v1_decoy,length=4248>\n##contig=<ID=Un_KN707689v1_decoy,length=5823>\n##contig=<ID=Un_KN707690v1_decoy,length=3715>\n##contig=<ID=Un_KN707691v1_decoy,length=4885>\n##contig=<ID=Un_KN707692v1_decoy,length=4813>\n##contig=<ID=Un_KN707693v1_decoy,length=2899>\n##contig=<ID=Un_KN707694v1_decoy,length=1228>\n##contig=<ID=Un_KN707695v1_decoy,length=3119>\n##contig=<ID=Un_KN707696v1_decoy,length=3828>\n##contig=<ID=Un_KN707697v1_decoy,length=1186>\n##contig=<ID=Un_KN707698v1_decoy,length=1908>\n##contig=<ID=Un_KN707699v1_decoy,length=2795>\n##contig=<ID=Un_KN707700v1_decoy,length=3703>\n##contig=<ID=Un_KN707701v1_decoy,length=6722>\n##contig=<ID=Un_KN707702v1_decoy,length=6466>\n##contig=<ID=Un_KN707703v1_decoy,length=2235>\n##contig=<ID=Un_KN707704v1_decoy,length=2871>\n##contig=<ID=Un_KN707705v1_decoy,length=4632>\n##contig=<ID=Un_KN707706v1_decoy,length=4225>\n##contig=<ID=Un_KN707707v1_decoy,length=4339>\n##contig=<ID=Un_KN707708v1_decoy,length=2305>\n##contig=<ID=Un_KN707709v1_decoy,length=3273>\n##contig=<ID=Un_KN707710v1_decoy,length=5701>\n##contig=<ID=Un_KN707711v1_decoy,length=4154>\n##contig=<ID=Un_KN707712v1_decoy,length=1243>\n##contig=<ID=Un_KN707713v1_decoy,length=1308>\n##contig=<ID=Un_KN707714v1_decoy,length=2922>\n##contig=<ID=Un_KN707715v1_decoy,length=3044>\n##contig=<ID=Un_KN707716v1_decoy,length=2888>\n##contig=<ID=Un_KN707717v1_decoy,length=1742>\n##contig=<ID=Un_KN707718v1_decoy,length=4969>\n##contig=<ID=Un_KN707719v1_decoy,length=3270>\n##contig=<ID=Un_KN707720v1_decoy,length=6028>\n##contig=<ID=Un_KN707721v1_decoy,length=1105>\n##contig=<ID=Un_KN707722v1_decoy,length=2884>\n##contig=<ID=Un_KN707723v1_decoy,length=1124>\n##contig=<ID=Un_KN707724v1_decoy,length=1454>\n##contig=<ID=Un_KN707725v1_decoy,length=2565>\n##contig=<ID=Un_KN707726v1_decoy,length=2149>\n##contig=<ID=Un_KN707727v1_decoy,length=2630>\n##contig=<ID=Un_KN707728v1_decoy,length=14625>\n##contig=<ID=Un_KN707729v1_decoy,length=7431>\n##contig=<ID=Un_KN707730v1_decoy,length=5776>\n##contig=<ID=Un_KN707731v1_decoy,length=4820>\n##contig=<ID=Un_KN707732v1_decoy,length=1227>\n##contig=<ID=Un_KN707733v1_decoy,length=7503>\n##contig=<ID=Un_KN707734v1_decoy,length=9652>\n##contig=<ID=Un_KN707735v1_decoy,length=1091>\n##contig=<ID=Un_KN707736v1_decoy,length=2467>\n##contig=<ID=Un_KN707737v1_decoy,length=1270>\n##contig=<ID=Un_KN707738v1_decoy,length=4365>\n##contig=<ID=Un_KN707739v1_decoy,length=4284>\n##contig=<ID=Un_KN707740v1_decoy,length=10282>\n##contig=<ID=Un_KN707741v1_decoy,length=5601>\n##contig=<ID=Un_KN707742v1_decoy,length=4758>\n##contig=<ID=Un_KN707743v1_decoy,length=1624>\n##contig=<ID=Un_KN707744v1_decoy,length=4024>\n##contig=<ID=Un_KN707745v1_decoy,length=1276>\n##contig=<ID=Un_KN707746v1_decoy,length=5083>\n##contig=<ID=Un_KN707747v1_decoy,length=2075>\n##contig=<ID=Un_KN707748v1_decoy,length=3553>\n##contig=<ID=Un_KN707749v1_decoy,length=7010>\n##contig=<ID=Un_KN707750v1_decoy,length=4718>\n##contig=<ID=Un_KN707751v1_decoy,length=3546>\n##contig=<ID=Un_KN707752v1_decoy,length=2873>\n##contig=<ID=Un_KN707753v1_decoy,length=2144>\n##contig=<ID=Un_KN707754v1_decoy,length=2243>\n##contig=<ID=Un_KN707755v1_decoy,length=5343>\n##contig=<ID=Un_KN707756v1_decoy,length=4877>\n##contig=<ID=Un_KN707757v1_decoy,length=3034>\n##contig=<ID=Un_KN707758v1_decoy,length=2826>\n##contig=<ID=Un_KN707759v1_decoy,length=1221>\n##contig=<ID=Un_KN707760v1_decoy,length=1169>\n##contig=<ID=Un_KN707761v1_decoy,length=2319>\n##contig=<ID=Un_KN707762v1_decoy,length=3450>\n##contig=<ID=Un_KN707763v1_decoy,length=2674>\n##contig=<ID=Un_KN707764v1_decoy,length=3912>\n##contig=<ID=Un_KN707765v1_decoy,length=6020>\n##contig=<ID=Un_KN707766v1_decoy,length=2303>\n##contig=<ID=Un_KN707767v1_decoy,length=2552>\n##contig=<ID=Un_KN707768v1_decoy,length=3656>\n##contig=<ID=Un_KN707769v1_decoy,length=1591>\n##contig=<ID=Un_KN707770v1_decoy,length=1209>\n##contig=<ID=Un_KN707771v1_decoy,length=3176>\n##contig=<ID=Un_KN707772v1_decoy,length=8915>\n##contig=<ID=Un_KN707773v1_decoy,length=4902>\n##contig=<ID=Un_KN707774v1_decoy,length=3324>\n##contig=<ID=Un_KN707775v1_decoy,length=5997>\n##contig=<ID=Un_KN707776v1_decoy,length=2618>\n##contig=<ID=Un_KN707777v1_decoy,length=10311>\n##contig=<ID=Un_KN707778v1_decoy,length=2440>\n##contig=<ID=Un_KN707779v1_decoy,length=12444>\n##contig=<ID=Un_KN707780v1_decoy,length=5691>\n##contig=<ID=Un_KN707781v1_decoy,length=2717>\n##contig=<ID=Un_KN707782v1_decoy,length=5277>\n##contig=<ID=Un_KN707783v1_decoy,length=4373>\n##contig=<ID=Un_KN707784v1_decoy,length=3224>\n##contig=<ID=Un_KN707785v1_decoy,length=2631>\n##contig=<ID=Un_KN707786v1_decoy,length=5385>\n##contig=<ID=Un_KN707787v1_decoy,length=3678>\n##contig=<ID=Un_KN707788v1_decoy,length=1412>\n##contig=<ID=Un_KN707789v1_decoy,length=1443>\n##contig=<ID=Un_KN707790v1_decoy,length=1098>\n##contig=<ID=Un_KN707791v1_decoy,length=3240>\n##contig=<ID=Un_KN707792v1_decoy,length=1915>\n##contig=<ID=Un_KN707793v1_decoy,length=4667>\n##contig=<ID=Un_KN707794v1_decoy,length=7219>\n##contig=<ID=Un_KN707795v1_decoy,length=3277>\n##contig=<ID=Un_KN707796v1_decoy,length=3473>\n##contig=<ID=Un_KN707797v1_decoy,length=4243>\n##contig=<ID=Un_KN707798v1_decoy,length=17599>\n##contig=<ID=Un_KN707799v1_decoy,length=5095>\n##contig=<ID=Un_KN707800v1_decoy,length=2237>\n##contig=<ID=Un_KN707801v1_decoy,length=2901>\n##contig=<ID=Un_KN707802v1_decoy,length=2666>\n##contig=<ID=Un_KN707803v1_decoy,length=5336>\n##contig=<ID=Un_KN707804v1_decoy,length=4383>\n##contig=<ID=Un_KN707805v1_decoy,length=5446>\n##contig=<ID=Un_KN707806v1_decoy,length=6252>\n##contig=<ID=Un_KN707807v1_decoy,length=4616>\n##contig=<ID=Un_KN707808v1_decoy,length=3021>\n##contig=<ID=Un_KN707809v1_decoy,length=3667>\n##contig=<ID=Un_KN707810v1_decoy,length=4563>\n##contig=<ID=Un_KN707811v1_decoy,length=1120>\n##contig=<ID=Un_KN707812v1_decoy,length=3845>\n##contig=<ID=Un_KN707813v1_decoy,length=2272>\n##contig=<ID=Un_KN707814v1_decoy,length=4764>\n##contig=<ID=Un_KN707815v1_decoy,length=5410>\n##contig=<ID=Un_KN707816v1_decoy,length=7150>\n##contig=<ID=Un_KN707817v1_decoy,length=1762>\n##contig=<ID=Un_KN707818v1_decoy,length=1207>\n##contig=<ID=Un_KN707819v1_decoy,length=1331>\n##contig=<ID=Un_KN707820v1_decoy,length=8307>\n##contig=<ID=Un_KN707821v1_decoy,length=2276>\n##contig=<ID=Un_KN707822v1_decoy,length=2575>\n##contig=<ID=Un_KN707823v1_decoy,length=3970>\n##contig=<ID=Un_KN707824v1_decoy,length=1352>\n##contig=<ID=Un_KN707825v1_decoy,length=3040>\n##contig=<ID=Un_KN707826v1_decoy,length=2070>\n##contig=<ID=Un_KN707827v1_decoy,length=2913>\n##contig=<ID=Un_KN707828v1_decoy,length=2389>\n##contig=<ID=Un_KN707829v1_decoy,length=1835>\n##contig=<ID=Un_KN707830v1_decoy,length=4807>\n##contig=<ID=Un_KN707831v1_decoy,length=2201>\n##contig=<ID=Un_KN707832v1_decoy,length=1265>\n##contig=<ID=Un_KN707833v1_decoy,length=1961>\n##contig=<ID=Un_KN707834v1_decoy,length=1064>\n##contig=<ID=Un_KN707835v1_decoy,length=1932>\n##contig=<ID=Un_KN707836v1_decoy,length=3213>\n##contig=<ID=Un_KN707837v1_decoy,length=1178>\n##contig=<ID=Un_KN707838v1_decoy,length=2926>\n##contig=<ID=Un_KN707839v1_decoy,length=1038>\n##contig=<ID=Un_KN707840v1_decoy,length=3298>\n##contig=<ID=Un_KN707841v1_decoy,length=8992>\n##contig=<ID=Un_KN707842v1_decoy,length=6698>\n##contig=<ID=Un_KN707843v1_decoy,length=4880>\n##contig=<ID=Un_KN707844v1_decoy,length=1766>\n##contig=<ID=Un_KN707845v1_decoy,length=3532>\n##contig=<ID=Un_KN707846v1_decoy,length=2297>\n##contig=<ID=Un_KN707847v1_decoy,length=1234>\n##contig=<ID=Un_KN707848v1_decoy,length=1205>\n##contig=<ID=Un_KN707849v1_decoy,length=2790>\n##contig=<ID=Un_KN707850v1_decoy,length=2006>\n##contig=<ID=Un_KN707851v1_decoy,length=4593>\n##contig=<ID=Un_KN707852v1_decoy,length=1579>\n##contig=<ID=Un_KN707853v1_decoy,length=9597>\n##contig=<ID=Un_KN707854v1_decoy,length=10451>\n##contig=<ID=Un_KN707855v1_decoy,length=3219>\n##contig=<ID=Un_KN707856v1_decoy,length=2300>\n##contig=<ID=Un_KN707857v1_decoy,length=5985>\n##contig=<ID=Un_KN707858v1_decoy,length=2959>\n##contig=<ID=Un_KN707859v1_decoy,length=1340>\n##contig=<ID=Un_KN707860v1_decoy,length=3148>\n##contig=<ID=Un_KN707861v1_decoy,length=2242>\n##contig=<ID=Un_KN707862v1_decoy,length=16513>\n##contig=<ID=Un_KN707863v1_decoy,length=7821>\n##contig=<ID=Un_KN707864v1_decoy,length=2159>\n##contig=<ID=Un_KN707865v1_decoy,length=2114>\n##contig=<ID=Un_KN707866v1_decoy,length=4109>\n##contig=<ID=Un_KN707867v1_decoy,length=1544>\n##contig=<ID=Un_KN707868v1_decoy,length=1005>\n##contig=<ID=Un_KN707869v1_decoy,length=8632>\n##contig=<ID=Un_KN707870v1_decoy,length=1012>\n##contig=<ID=Un_KN707871v1_decoy,length=4728>\n##contig=<ID=Un_KN707872v1_decoy,length=2165>\n##contig=<ID=Un_KN707873v1_decoy,length=7591>\n##contig=<ID=Un_KN707874v1_decoy,length=5202>\n##contig=<ID=Un_KN707875v1_decoy,length=4241>\n##contig=<ID=Un_KN707876v1_decoy,length=4131>\n##contig=<ID=Un_KN707877v1_decoy,length=2272>\n##contig=<ID=Un_KN707878v1_decoy,length=2085>\n##contig=<ID=Un_KN707879v1_decoy,length=4346>\n##contig=<ID=Un_KN707880v1_decoy,length=1208>\n##contig=<ID=Un_KN707881v1_decoy,length=4543>\n##contig=<ID=Un_KN707882v1_decoy,length=2772>\n##contig=<ID=Un_KN707883v1_decoy,length=2490>\n##contig=<ID=Un_KN707884v1_decoy,length=4568>\n##contig=<ID=Un_KN707885v1_decoy,length=1776>\n##contig=<ID=Un_KN707886v1_decoy,length=2699>\n##contig=<ID=Un_KN707887v1_decoy,length=3534>\n##contig=<ID=Un_KN707888v1_decoy,length=2424>\n##contig=<ID=Un_KN707889v1_decoy,length=1747>\n##contig=<ID=Un_KN707890v1_decoy,length=1088>\n##contig=<ID=Un_KN707891v1_decoy,length=1143>\n##contig=<ID=Un_KN707892v1_decoy,length=2530>\n##contig=<ID=Un_KN707893v1_decoy,length=8049>\n##contig=<ID=Un_KN707894v1_decoy,length=1366>\n##contig=<ID=Un_KN707895v1_decoy,length=4284>\n##contig=<ID=Un_KN707896v1_decoy,length=33125>\n##contig=<ID=Un_KN707897v1_decoy,length=2137>\n##contig=<ID=Un_KN707898v1_decoy,length=3840>\n##contig=<ID=Un_KN707899v1_decoy,length=3087>\n##contig=<ID=Un_KN707900v1_decoy,length=2041>\n##contig=<ID=Un_KN707901v1_decoy,length=3344>\n##contig=<ID=Un_KN707902v1_decoy,length=2921>\n##contig=<ID=Un_KN707903v1_decoy,length=6581>\n##contig=<ID=Un_KN707904v1_decoy,length=3968>\n##contig=<ID=Un_KN707905v1_decoy,length=2339>\n##contig=<ID=Un_KN707906v1_decoy,length=1243>\n##contig=<ID=Un_KN707907v1_decoy,length=7776>\n##contig=<ID=Un_KN707908v1_decoy,length=19837>\n##contig=<ID=Un_KN707909v1_decoy,length=1737>\n##contig=<ID=Un_KN707910v1_decoy,length=1098>\n##contig=<ID=Un_KN707911v1_decoy,length=1893>\n##contig=<ID=Un_KN707912v1_decoy,length=1281>\n##contig=<ID=Un_KN707913v1_decoy,length=1527>\n##contig=<ID=Un_KN707914v1_decoy,length=2055>\n##contig=<ID=Un_KN707915v1_decoy,length=2527>\n##contig=<ID=Un_KN707916v1_decoy,length=3275>\n##contig=<ID=Un_KN707917v1_decoy,length=1265>\n##contig=<ID=Un_KN707918v1_decoy,length=2623>\n##contig=<ID=Un_KN707919v1_decoy,length=4850>\n##contig=<ID=Un_KN707920v1_decoy,length=3584>\n##contig=<ID=Un_KN707921v1_decoy,length=2561>\n##contig=<ID=Un_KN707922v1_decoy,length=3041>\n##contig=<ID=Un_KN707923v1_decoy,length=1409>\n##contig=<ID=Un_KN707924v1_decoy,length=4596>\n##contig=<ID=Un_KN707925v1_decoy,length=11555>\n##contig=<ID=Un_KN707926v1_decoy,length=1266>\n##contig=<ID=Un_KN707927v1_decoy,length=1079>\n##contig=<ID=Un_KN707928v1_decoy,length=1087>\n##contig=<ID=Un_KN707929v1_decoy,length=1226>\n##contig=<ID=Un_KN707930v1_decoy,length=1131>\n##contig=<ID=Un_KN707931v1_decoy,length=1199>\n##contig=<ID=Un_KN707932v1_decoy,length=1084>\n##contig=<ID=Un_KN707933v1_decoy,length=2038>\n##contig=<ID=Un_KN707934v1_decoy,length=1070>\n##contig=<ID=Un_KN707935v1_decoy,length=1312>\n##contig=<ID=Un_KN707936v1_decoy,length=4031>\n##contig=<ID=Un_KN707937v1_decoy,length=7445>\n##contig=<ID=Un_KN707938v1_decoy,length=1770>\n##contig=<ID=Un_KN707939v1_decoy,length=5600>\n##contig=<ID=Un_KN707940v1_decoy,length=1882>\n##contig=<ID=Un_KN707941v1_decoy,length=1170>\n##contig=<ID=Un_KN707942v1_decoy,length=1300>\n##contig=<ID=Un_KN707943v1_decoy,length=5325>\n##contig=<ID=Un_KN707944v1_decoy,length=2043>\n##contig=<ID=Un_KN707945v1_decoy,length=1072>\n##contig=<ID=Un_KN707946v1_decoy,length=2463>\n##contig=<ID=Un_KN707947v1_decoy,length=1010>\n##contig=<ID=Un_KN707948v1_decoy,length=1432>\n##contig=<ID=Un_KN707949v1_decoy,length=1162>\n##contig=<ID=Un_KN707950v1_decoy,length=1095>\n##contig=<ID=Un_KN707951v1_decoy,length=1118>\n##contig=<ID=Un_KN707952v1_decoy,length=1383>\n##contig=<ID=Un_KN707953v1_decoy,length=2289>\n##contig=<ID=Un_KN707954v1_decoy,length=1648>\n##contig=<ID=Un_KN707955v1_decoy,length=2203>\n##contig=<ID=Un_KN707956v1_decoy,length=3270>\n##contig=<ID=Un_KN707957v1_decoy,length=11499>\n##contig=<ID=Un_KN707958v1_decoy,length=2474>\n##contig=<ID=Un_KN707959v1_decoy,length=2294>\n##contig=<ID=Un_KN707960v1_decoy,length=1238>\n##contig=<ID=Un_KN707961v1_decoy,length=3410>\n##contig=<ID=Un_KN707962v1_decoy,length=1523>\n##contig=<ID=Un_KN707963v1_decoy,length=62955>\n##contig=<ID=Un_KN707964v1_decoy,length=6282>\n##contig=<ID=Un_KN707965v1_decoy,length=3836>\n##contig=<ID=Un_KN707966v1_decoy,length=6486>\n##contig=<ID=Un_KN707967v1_decoy,length=15368>\n##contig=<ID=Un_KN707968v1_decoy,length=9572>\n##contig=<ID=Un_KN707969v1_decoy,length=6413>\n##contig=<ID=Un_KN707970v1_decoy,length=4104>\n##contig=<ID=Un_KN707971v1_decoy,length=12943>\n##contig=<ID=Un_KN707972v1_decoy,length=4650>\n##contig=<ID=Un_KN707973v1_decoy,length=3080>\n##contig=<ID=Un_KN707974v1_decoy,length=3134>\n##contig=<ID=Un_KN707975v1_decoy,length=6211>\n##contig=<ID=Un_KN707976v1_decoy,length=1126>\n##contig=<ID=Un_KN707977v1_decoy,length=1101>\n##contig=<ID=Un_KN707978v1_decoy,length=1101>\n##contig=<ID=Un_KN707979v1_decoy,length=2648>\n##contig=<ID=Un_KN707980v1_decoy,length=2973>\n##contig=<ID=Un_KN707981v1_decoy,length=2520>\n##contig=<ID=Un_KN707982v1_decoy,length=2318>\n##contig=<ID=Un_KN707983v1_decoy,length=2606>\n##contig=<ID=Un_KN707984v1_decoy,length=2205>\n##contig=<ID=Un_KN707985v1_decoy,length=2929>\n##contig=<ID=Un_KN707986v1_decoy,length=3869>\n##contig=<ID=Un_KN707987v1_decoy,length=1117>\n##contig=<ID=Un_KN707988v1_decoy,length=2960>\n##contig=<ID=Un_KN707989v1_decoy,length=1009>\n##contig=<ID=Un_KN707990v1_decoy,length=4048>\n##contig=<ID=Un_KN707991v1_decoy,length=2193>\n##contig=<ID=Un_KN707992v1_decoy,length=1830>\n##contig=<ID=Un_JTFH01000001v1_decoy,length=25139>\n##contig=<ID=Un_JTFH01000002v1_decoy,length=18532>\n##contig=<ID=Un_JTFH01000003v1_decoy,length=15240>\n##contig=<ID=Un_JTFH01000004v1_decoy,length=13739>\n##contig=<ID=Un_JTFH01000005v1_decoy,length=11297>\n##contig=<ID=Un_JTFH01000006v1_decoy,length=10074>\n##contig=<ID=Un_JTFH01000007v1_decoy,length=9891>\n##contig=<ID=Un_JTFH01000008v1_decoy,length=9774>\n##contig=<ID=Un_JTFH01000009v1_decoy,length=9727>\n##contig=<ID=Un_JTFH01000010v1_decoy,length=9358>\n##contig=<ID=Un_JTFH01000011v1_decoy,length=8920>\n##contig=<ID=Un_JTFH01000012v1_decoy,length=8479>\n##contig=<ID=Un_JTFH01000013v1_decoy,length=8312>\n##contig=<ID=Un_JTFH01000014v1_decoy,length=8261>\n##contig=<ID=Un_JTFH01000015v1_decoy,length=8131>\n##contig=<ID=Un_JTFH01000016v1_decoy,length=8051>\n##contig=<ID=Un_JTFH01000017v1_decoy,length=7832>\n##contig=<ID=Un_JTFH01000018v1_decoy,length=7710>\n##contig=<ID=Un_JTFH01000019v1_decoy,length=7702>\n##contig=<ID=Un_JTFH01000020v1_decoy,length=7479>\n##contig=<ID=Un_JTFH01000021v1_decoy,length=7368>\n##contig=<ID=Un_JTFH01000022v1_decoy,length=7162>\n##contig=<ID=Un_JTFH01000023v1_decoy,length=7065>\n##contig=<ID=Un_JTFH01000024v1_decoy,length=7019>\n##contig=<ID=Un_JTFH01000025v1_decoy,length=6997>\n##contig=<ID=Un_JTFH01000026v1_decoy,length=6994>\n##contig=<ID=Un_JTFH01000027v1_decoy,length=6979>\n##contig=<ID=Un_JTFH01000028v1_decoy,length=6797>\n##contig=<ID=Un_JTFH01000029v1_decoy,length=6525>\n##contig=<ID=Un_JTFH01000030v1_decoy,length=6246>\n##contig=<ID=Un_JTFH01000031v1_decoy,length=5926>\n##contig=<ID=Un_JTFH01000032v1_decoy,length=5914>\n##contig=<ID=Un_JTFH01000033v1_decoy,length=5898>\n##contig=<ID=Un_JTFH01000034v1_decoy,length=5879>\n##contig=<ID=Un_JTFH01000035v1_decoy,length=5834>\n##contig=<ID=Un_JTFH01000036v1_decoy,length=5743>\n##contig=<ID=Un_JTFH01000037v1_decoy,length=5577>\n##contig=<ID=Un_JTFH01000038v1_decoy,length=5413>\n##contig=<ID=Un_JTFH01000039v1_decoy,length=5250>\n##contig=<ID=Un_JTFH01000040v1_decoy,length=5246>\n##contig=<ID=Un_JTFH01000041v1_decoy,length=5118>\n##contig=<ID=Un_JTFH01000042v1_decoy,length=5058>\n##contig=<ID=Un_JTFH01000043v1_decoy,length=4959>\n##contig=<ID=Un_JTFH01000044v1_decoy,length=4853>\n##contig=<ID=Un_JTFH01000045v1_decoy,length=4828>\n##contig=<ID=Un_JTFH01000046v1_decoy,length=4819>\n##contig=<ID=Un_JTFH01000047v1_decoy,length=4809>\n##contig=<ID=Un_JTFH01000048v1_decoy,length=4710>\n##contig=<ID=Un_JTFH01000049v1_decoy,length=4680>\n##contig=<ID=Un_JTFH01000050v1_decoy,length=4645>\n##contig=<ID=Un_JTFH01000051v1_decoy,length=4514>\n##contig=<ID=Un_JTFH01000052v1_decoy,length=4439>\n##contig=<ID=Un_JTFH01000053v1_decoy,length=4416>\n##contig=<ID=Un_JTFH01000054v1_decoy,length=4409>\n##contig=<ID=Un_JTFH01000055v1_decoy,length=4392>\n##contig=<ID=Un_JTFH01000056v1_decoy,length=4359>\n##contig=<ID=Un_JTFH01000057v1_decoy,length=4319>\n##contig=<ID=Un_JTFH01000058v1_decoy,length=4290>\n##contig=<ID=Un_JTFH01000059v1_decoy,length=4242>\n##contig=<ID=Un_JTFH01000060v1_decoy,length=4228>\n##contig=<ID=Un_JTFH01000061v1_decoy,length=4222>\n##contig=<ID=Un_JTFH01000062v1_decoy,length=4216>\n##contig=<ID=Un_JTFH01000063v1_decoy,length=4210>\n##contig=<ID=Un_JTFH01000064v1_decoy,length=4206>\n##contig=<ID=Un_JTFH01000065v1_decoy,length=4102>\n##contig=<ID=Un_JTFH01000066v1_decoy,length=4101>\n##contig=<ID=Un_JTFH01000067v1_decoy,length=4083>\n##contig=<ID=Un_JTFH01000068v1_decoy,length=3967>\n##contig=<ID=Un_JTFH01000069v1_decoy,length=3955>\n##contig=<ID=Un_JTFH01000070v1_decoy,length=3945>\n##contig=<ID=Un_JTFH01000071v1_decoy,length=3930>\n##contig=<ID=Un_JTFH01000072v1_decoy,length=3929>\n##contig=<ID=Un_JTFH01000073v1_decoy,length=3924>\n##contig=<ID=Un_JTFH01000074v1_decoy,length=3919>\n##contig=<ID=Un_JTFH01000075v1_decoy,length=3908>\n##contig=<ID=Un_JTFH01000076v1_decoy,length=3892>\n##contig=<ID=Un_JTFH01000077v1_decoy,length=3890>\n##contig=<ID=Un_JTFH01000078v1_decoy,length=3859>\n##contig=<ID=Un_JTFH01000079v1_decoy,length=3846>\n##contig=<ID=Un_JTFH01000080v1_decoy,length=3835>\n##contig=<ID=Un_JTFH01000081v1_decoy,length=3830>\n##contig=<ID=Un_JTFH01000082v1_decoy,length=3828>\n##contig=<ID=Un_JTFH01000083v1_decoy,length=3825>\n##contig=<ID=Un_JTFH01000084v1_decoy,length=3821>\n##contig=<ID=Un_JTFH01000085v1_decoy,length=3809>\n##contig=<ID=Un_JTFH01000086v1_decoy,length=3801>\n##contig=<ID=Un_JTFH01000087v1_decoy,length=3799>\n##contig=<ID=Un_JTFH01000088v1_decoy,length=3737>\n##contig=<ID=Un_JTFH01000089v1_decoy,length=3701>\n##contig=<ID=Un_JTFH01000090v1_decoy,length=3698>\n##contig=<ID=Un_JTFH01000091v1_decoy,length=3692>\n##contig=<ID=Un_JTFH01000092v1_decoy,length=3686>\n##contig=<ID=Un_JTFH01000093v1_decoy,length=3677>\n##contig=<ID=Un_JTFH01000094v1_decoy,length=3664>\n##contig=<ID=Un_JTFH01000095v1_decoy,length=3613>\n##contig=<ID=Un_JTFH01000096v1_decoy,length=3611>\n##contig=<ID=Un_JTFH01000097v1_decoy,length=3606>\n##contig=<ID=Un_JTFH01000098v1_decoy,length=3584>\n##contig=<ID=Un_JTFH01000099v1_decoy,length=3581>\n##contig=<ID=Un_JTFH01000100v1_decoy,length=3543>\n##contig=<ID=Un_JTFH01000101v1_decoy,length=3528>\n##contig=<ID=Un_JTFH01000102v1_decoy,length=3527>\n##contig=<ID=Un_JTFH01000103v1_decoy,length=3496>\n##contig=<ID=Un_JTFH01000104v1_decoy,length=3493>\n##contig=<ID=Un_JTFH01000105v1_decoy,length=3484>\n##contig=<ID=Un_JTFH01000106v1_decoy,length=3435>\n##contig=<ID=Un_JTFH01000107v1_decoy,length=3391>\n##contig=<ID=Un_JTFH01000108v1_decoy,length=3374>\n##contig=<ID=Un_JTFH01000109v1_decoy,length=3371>\n##contig=<ID=Un_JTFH01000110v1_decoy,length=3361>\n##contig=<ID=Un_JTFH01000111v1_decoy,length=3351>\n##contig=<ID=Un_JTFH01000112v1_decoy,length=3340>\n##contig=<ID=Un_JTFH01000113v1_decoy,length=3320>\n##contig=<ID=Un_JTFH01000114v1_decoy,length=3282>\n##contig=<ID=Un_JTFH01000115v1_decoy,length=3278>\n##contig=<ID=Un_JTFH01000116v1_decoy,length=3260>\n##contig=<ID=Un_JTFH01000117v1_decoy,length=3258>\n##contig=<ID=Un_JTFH01000118v1_decoy,length=3253>\n##contig=<ID=Un_JTFH01000119v1_decoy,length=3247>\n##contig=<ID=Un_JTFH01000120v1_decoy,length=3230>\n##contig=<ID=Un_JTFH01000121v1_decoy,length=3224>\n##contig=<ID=Un_JTFH01000122v1_decoy,length=3216>\n##contig=<ID=Un_JTFH01000123v1_decoy,length=3212>\n##contig=<ID=Un_JTFH01000124v1_decoy,length=3194>\n##contig=<ID=Un_JTFH01000125v1_decoy,length=3189>\n##contig=<ID=Un_JTFH01000126v1_decoy,length=3177>\n##contig=<ID=Un_JTFH01000127v1_decoy,length=3176>\n##contig=<ID=Un_JTFH01000128v1_decoy,length=3173>\n##contig=<ID=Un_JTFH01000129v1_decoy,length=3170>\n##contig=<ID=Un_JTFH01000130v1_decoy,length=3166>\n##contig=<ID=Un_JTFH01000131v1_decoy,length=3163>\n##contig=<ID=Un_JTFH01000132v1_decoy,length=3143>\n##contig=<ID=Un_JTFH01000133v1_decoy,length=3137>\n##contig=<ID=Un_JTFH01000134v1_decoy,length=3116>\n##contig=<ID=Un_JTFH01000135v1_decoy,length=3106>\n##contig=<ID=Un_JTFH01000136v1_decoy,length=3093>\n##contig=<ID=Un_JTFH01000137v1_decoy,length=3079>\n##contig=<ID=Un_JTFH01000138v1_decoy,length=3053>\n##contig=<ID=Un_JTFH01000139v1_decoy,length=3051>\n##contig=<ID=Un_JTFH01000140v1_decoy,length=3015>\n##contig=<ID=Un_JTFH01000141v1_decoy,length=3012>\n##contig=<ID=Un_JTFH01000142v1_decoy,length=3009>\n##contig=<ID=Un_JTFH01000143v1_decoy,length=2997>\n##contig=<ID=Un_JTFH01000144v1_decoy,length=2997>\n##contig=<ID=Un_JTFH01000145v1_decoy,length=2983>\n##contig=<ID=Un_JTFH01000146v1_decoy,length=2979>\n##contig=<ID=Un_JTFH01000147v1_decoy,length=2967>\n##contig=<ID=Un_JTFH01000148v1_decoy,length=2967>\n##contig=<ID=Un_JTFH01000149v1_decoy,length=2966>\n##contig=<ID=Un_JTFH01000150v1_decoy,length=2954>\n##contig=<ID=Un_JTFH01000151v1_decoy,length=2952>\n##contig=<ID=Un_JTFH01000152v1_decoy,length=2934>\n##contig=<ID=Un_JTFH01000153v1_decoy,length=2918>\n##contig=<ID=Un_JTFH01000154v1_decoy,length=2895>\n##contig=<ID=Un_JTFH01000155v1_decoy,length=2887>\n##contig=<ID=Un_JTFH01000156v1_decoy,length=2879>\n##contig=<ID=Un_JTFH01000157v1_decoy,length=2878>\n##contig=<ID=Un_JTFH01000158v1_decoy,length=2872>\n##contig=<ID=Un_JTFH01000159v1_decoy,length=2868>\n##contig=<ID=Un_JTFH01000160v1_decoy,length=2866>\n##contig=<ID=Un_JTFH01000161v1_decoy,length=2865>\n##contig=<ID=Un_JTFH01000162v1_decoy,length=2864>\n##contig=<ID=Un_JTFH01000163v1_decoy,length=2859>\n##contig=<ID=Un_JTFH01000164v1_decoy,length=2854>\n##contig=<ID=Un_JTFH01000165v1_decoy,length=2830>\n##contig=<ID=Un_JTFH01000166v1_decoy,length=2828>\n##contig=<ID=Un_JTFH01000167v1_decoy,length=2824>\n##contig=<ID=Un_JTFH01000168v1_decoy,length=2819>\n##contig=<ID=Un_JTFH01000169v1_decoy,length=2813>\n##contig=<ID=Un_JTFH01000170v1_decoy,length=2809>\n##contig=<ID=Un_JTFH01000171v1_decoy,length=2802>\n##contig=<ID=Un_JTFH01000172v1_decoy,length=2791>\n##contig=<ID=Un_JTFH01000173v1_decoy,length=2783>\n##contig=<ID=Un_JTFH01000174v1_decoy,length=2778>\n##contig=<ID=Un_JTFH01000175v1_decoy,length=2777>\n##contig=<ID=Un_JTFH01000176v1_decoy,length=2770>\n##contig=<ID=Un_JTFH01000177v1_decoy,length=2769>\n##contig=<ID=Un_JTFH01000178v1_decoy,length=2767>\n##contig=<ID=Un_JTFH01000179v1_decoy,length=2763>\n##contig=<ID=Un_JTFH01000180v1_decoy,length=2745>\n##contig=<ID=Un_JTFH01000181v1_decoy,length=2742>\n##contig=<ID=Un_JTFH01000182v1_decoy,length=2736>\n##contig=<ID=Un_JTFH01000183v1_decoy,length=2729>\n##contig=<ID=Un_JTFH01000184v1_decoy,length=2726>\n##contig=<ID=Un_JTFH01000185v1_decoy,length=2719>\n##contig=<ID=Un_JTFH01000186v1_decoy,length=2715>\n##contig=<ID=Un_JTFH01000187v1_decoy,length=2708>\n##contig=<ID=Un_JTFH01000188v1_decoy,length=2704>\n##contig=<ID=Un_JTFH01000189v1_decoy,length=2692>\n##contig=<ID=Un_JTFH01000190v1_decoy,length=2691>\n##contig=<ID=Un_JTFH01000191v1_decoy,length=2690>\n##contig=<ID=Un_JTFH01000192v1_decoy,length=2687>\n##contig=<ID=Un_JTFH01000193v1_decoy,length=2677>\n##contig=<ID=Un_JTFH01000194v1_decoy,length=2668>\n##contig=<ID=Un_JTFH01000195v1_decoy,length=2668>\n##contig=<ID=Un_JTFH01000196v1_decoy,length=2663>\n##contig=<ID=Un_JTFH01000197v1_decoy,length=2655>\n##contig=<ID=Un_JTFH01000198v1_decoy,length=2644>\n##contig=<ID=Un_JTFH01000199v1_decoy,length=2642>\n##contig=<ID=Un_JTFH01000200v1_decoy,length=2632>\n##contig=<ID=Un_JTFH01000201v1_decoy,length=2632>\n##contig=<ID=Un_JTFH01000202v1_decoy,length=2628>\n##contig=<ID=Un_JTFH01000203v1_decoy,length=2623>\n##contig=<ID=Un_JTFH01000204v1_decoy,length=2622>\n##contig=<ID=Un_JTFH01000205v1_decoy,length=2619>\n##contig=<ID=Un_JTFH01000206v1_decoy,length=2605>\n##contig=<ID=Un_JTFH01000207v1_decoy,length=2603>\n##contig=<ID=Un_JTFH01000208v1_decoy,length=2601>\n##contig=<ID=Un_JTFH01000209v1_decoy,length=2598>\n##contig=<ID=Un_JTFH01000210v1_decoy,length=2597>\n##contig=<ID=Un_JTFH01000211v1_decoy,length=2596>\n##contig=<ID=Un_JTFH01000212v1_decoy,length=2594>\n##contig=<ID=Un_JTFH01000213v1_decoy,length=2586>\n##contig=<ID=Un_JTFH01000214v1_decoy,length=2585>\n##contig=<ID=Un_JTFH01000215v1_decoy,length=2583>\n##contig=<ID=Un_JTFH01000216v1_decoy,length=2578>\n##contig=<ID=Un_JTFH01000217v1_decoy,length=2569>\n##contig=<ID=Un_JTFH01000218v1_decoy,length=2569>\n##contig=<ID=Un_JTFH01000219v1_decoy,length=2551>\n##contig=<ID=Un_JTFH01000220v1_decoy,length=2548>\n##contig=<ID=Un_JTFH01000221v1_decoy,length=2548>\n##contig=<ID=Un_JTFH01000222v1_decoy,length=2546>\n##contig=<ID=Un_JTFH01000223v1_decoy,length=2545>\n##contig=<ID=Un_JTFH01000224v1_decoy,length=2534>\n##contig=<ID=Un_JTFH01000225v1_decoy,length=2533>\n##contig=<ID=Un_JTFH01000226v1_decoy,length=2522>\n##contig=<ID=Un_JTFH01000227v1_decoy,length=2522>\n##contig=<ID=Un_JTFH01000228v1_decoy,length=2515>\n##contig=<ID=Un_JTFH01000229v1_decoy,length=2513>\n##contig=<ID=Un_JTFH01000230v1_decoy,length=2507>\n##contig=<ID=Un_JTFH01000231v1_decoy,length=2504>\n##contig=<ID=Un_JTFH01000232v1_decoy,length=2497>\n##contig=<ID=Un_JTFH01000233v1_decoy,length=2471>\n##contig=<ID=Un_JTFH01000234v1_decoy,length=2465>\n##contig=<ID=Un_JTFH01000235v1_decoy,length=2464>\n##contig=<ID=Un_JTFH01000236v1_decoy,length=2459>\n##contig=<ID=Un_JTFH01000237v1_decoy,length=2457>\n##contig=<ID=Un_JTFH01000238v1_decoy,length=2450>\n##contig=<ID=Un_JTFH01000239v1_decoy,length=2435>\n##contig=<ID=Un_JTFH01000240v1_decoy,length=2434>\n##contig=<ID=Un_JTFH01000241v1_decoy,length=2432>\n##contig=<ID=Un_JTFH01000242v1_decoy,length=2427>\n##contig=<ID=Un_JTFH01000243v1_decoy,length=2421>\n##contig=<ID=Un_JTFH01000244v1_decoy,length=2420>\n##contig=<ID=Un_JTFH01000245v1_decoy,length=2414>\n##contig=<ID=Un_JTFH01000246v1_decoy,length=2404>\n##contig=<ID=Un_JTFH01000247v1_decoy,length=2403>\n##contig=<ID=Un_JTFH01000248v1_decoy,length=2402>\n##contig=<ID=Un_JTFH01000249v1_decoy,length=2397>\n##contig=<ID=Un_JTFH01000250v1_decoy,length=2395>\n##contig=<ID=Un_JTFH01000251v1_decoy,length=2394>\n##contig=<ID=Un_JTFH01000252v1_decoy,length=2388>\n##contig=<ID=Un_JTFH01000253v1_decoy,length=2382>\n##contig=<ID=Un_JTFH01000254v1_decoy,length=2381>\n##contig=<ID=Un_JTFH01000255v1_decoy,length=2380>\n##contig=<ID=Un_JTFH01000256v1_decoy,length=2368>\n##contig=<ID=Un_JTFH01000257v1_decoy,length=2364>\n##contig=<ID=Un_JTFH01000258v1_decoy,length=2363>\n##contig=<ID=Un_JTFH01000259v1_decoy,length=2348>\n##contig=<ID=Un_JTFH01000260v1_decoy,length=2339>\n##contig=<ID=Un_JTFH01000261v1_decoy,length=2335>\n##contig=<ID=Un_JTFH01000262v1_decoy,length=2332>\n##contig=<ID=Un_JTFH01000263v1_decoy,length=2331>\n##contig=<ID=Un_JTFH01000264v1_decoy,length=2330>\n##contig=<ID=Un_JTFH01000265v1_decoy,length=2323>\n##contig=<ID=Un_JTFH01000266v1_decoy,length=2319>\n##contig=<ID=Un_JTFH01000267v1_decoy,length=2314>\n##contig=<ID=Un_JTFH01000268v1_decoy,length=2308>\n##contig=<ID=Un_JTFH01000269v1_decoy,length=2306>\n##contig=<ID=Un_JTFH01000270v1_decoy,length=2296>\n##contig=<ID=Un_JTFH01000271v1_decoy,length=2287>\n##contig=<ID=Un_JTFH01000272v1_decoy,length=2279>\n##contig=<ID=Un_JTFH01000273v1_decoy,length=2276>\n##contig=<ID=Un_JTFH01000274v1_decoy,length=2273>\n##contig=<ID=Un_JTFH01000275v1_decoy,length=2262>\n##contig=<ID=Un_JTFH01000276v1_decoy,length=2254>\n##contig=<ID=Un_JTFH01000277v1_decoy,length=2252>\n##contig=<ID=Un_JTFH01000278v1_decoy,length=2245>\n##contig=<ID=Un_JTFH01000279v1_decoy,length=2239>\n##contig=<ID=Un_JTFH01000280v1_decoy,length=2223>\n##contig=<ID=Un_JTFH01000281v1_decoy,length=2220>\n##contig=<ID=Un_JTFH01000282v1_decoy,length=2218>\n##contig=<ID=Un_JTFH01000283v1_decoy,length=2215>\n##contig=<ID=Un_JTFH01000284v1_decoy,length=2213>\n##contig=<ID=Un_JTFH01000285v1_decoy,length=2203>\n##contig=<ID=Un_JTFH01000286v1_decoy,length=2200>\n##contig=<ID=Un_JTFH01000287v1_decoy,length=2197>\n##contig=<ID=Un_JTFH01000288v1_decoy,length=2194>\n##contig=<ID=Un_JTFH01000289v1_decoy,length=2183>\n##contig=<ID=Un_JTFH01000290v1_decoy,length=2179>\n##contig=<ID=Un_JTFH01000291v1_decoy,length=2177>\n##contig=<ID=Un_JTFH01000292v1_decoy,length=2177>\n##contig=<ID=Un_JTFH01000293v1_decoy,length=2177>\n##contig=<ID=Un_JTFH01000294v1_decoy,length=2168>\n##contig=<ID=Un_JTFH01000295v1_decoy,length=2160>\n##contig=<ID=Un_JTFH01000296v1_decoy,length=2155>\n##contig=<ID=Un_JTFH01000297v1_decoy,length=2144>\n##contig=<ID=Un_JTFH01000298v1_decoy,length=2143>\n##contig=<ID=Un_JTFH01000299v1_decoy,length=2136>\n##contig=<ID=Un_JTFH01000300v1_decoy,length=2134>\n##contig=<ID=Un_JTFH01000301v1_decoy,length=2129>\n##contig=<ID=Un_JTFH01000302v1_decoy,length=2128>\n##contig=<ID=Un_JTFH01000303v1_decoy,length=2125>\n##contig=<ID=Un_JTFH01000304v1_decoy,length=2125>\n##contig=<ID=Un_JTFH01000305v1_decoy,length=2122>\n##contig=<ID=Un_JTFH01000306v1_decoy,length=2111>\n##contig=<ID=Un_JTFH01000307v1_decoy,length=2106>\n##contig=<ID=Un_JTFH01000308v1_decoy,length=2094>\n##contig=<ID=Un_JTFH01000309v1_decoy,length=2093>\n##contig=<ID=Un_JTFH01000310v1_decoy,length=2088>\n##contig=<ID=Un_JTFH01000311v1_decoy,length=2086>\n##contig=<ID=Un_JTFH01000312v1_decoy,length=2086>\n##contig=<ID=Un_JTFH01000313v1_decoy,length=2084>\n##contig=<ID=Un_JTFH01000314v1_decoy,length=2080>\n##contig=<ID=Un_JTFH01000315v1_decoy,length=2079>\n##contig=<ID=Un_JTFH01000316v1_decoy,length=2076>\n##contig=<ID=Un_JTFH01000317v1_decoy,length=2071>\n##contig=<ID=Un_JTFH01000318v1_decoy,length=2066>\n##contig=<ID=Un_JTFH01000319v1_decoy,length=2061>\n##contig=<ID=Un_JTFH01000320v1_decoy,length=2055>\n##contig=<ID=Un_JTFH01000321v1_decoy,length=2053>\n##contig=<ID=Un_JTFH01000322v1_decoy,length=2040>\n##contig=<ID=Un_JTFH01000323v1_decoy,length=2036>\n##contig=<ID=Un_JTFH01000324v1_decoy,length=2035>\n##contig=<ID=Un_JTFH01000325v1_decoy,length=2034>\n##contig=<ID=Un_JTFH01000326v1_decoy,length=2032>\n##contig=<ID=Un_JTFH01000327v1_decoy,length=2029>\n##contig=<ID=Un_JTFH01000328v1_decoy,length=2025>\n##contig=<ID=Un_JTFH01000329v1_decoy,length=2021>\n##contig=<ID=Un_JTFH01000330v1_decoy,length=2018>\n##contig=<ID=Un_JTFH01000331v1_decoy,length=2015>\n##contig=<ID=Un_JTFH01000332v1_decoy,length=2009>\n##contig=<ID=Un_JTFH01000333v1_decoy,length=2007>\n##contig=<ID=Un_JTFH01000334v1_decoy,length=2005>\n##contig=<ID=Un_JTFH01000335v1_decoy,length=2003>\n##contig=<ID=Un_JTFH01000336v1_decoy,length=2001>\n##contig=<ID=Un_JTFH01000337v1_decoy,length=2001>\n##contig=<ID=Un_JTFH01000338v1_decoy,length=2000>\n##contig=<ID=Un_JTFH01000339v1_decoy,length=1996>\n##contig=<ID=Un_JTFH01000340v1_decoy,length=1992>\n##contig=<ID=Un_JTFH01000341v1_decoy,length=1985>\n##contig=<ID=Un_JTFH01000342v1_decoy,length=1981>\n##contig=<ID=Un_JTFH01000343v1_decoy,length=1977>\n##contig=<ID=Un_JTFH01000344v1_decoy,length=1971>\n##contig=<ID=Un_JTFH01000345v1_decoy,length=1968>\n##contig=<ID=Un_JTFH01000346v1_decoy,length=1962>\n##contig=<ID=Un_JTFH01000347v1_decoy,length=1961>\n##contig=<ID=Un_JTFH01000348v1_decoy,length=1960>\n##contig=<ID=Un_JTFH01000349v1_decoy,length=1960>\n##contig=<ID=Un_JTFH01000350v1_decoy,length=1954>\n##contig=<ID=Un_JTFH01000351v1_decoy,length=1952>\n##contig=<ID=Un_JTFH01000352v1_decoy,length=1947>\n##contig=<ID=Un_JTFH01000353v1_decoy,length=1944>\n##contig=<ID=Un_JTFH01000354v1_decoy,length=1943>\n##contig=<ID=Un_JTFH01000355v1_decoy,length=1941>\n##contig=<ID=Un_JTFH01000356v1_decoy,length=1937>\n##contig=<ID=Un_JTFH01000357v1_decoy,length=1934>\n##contig=<ID=Un_JTFH01000358v1_decoy,length=1929>\n##contig=<ID=Un_JTFH01000359v1_decoy,length=1924>\n##contig=<ID=Un_JTFH01000360v1_decoy,length=1924>\n##contig=<ID=Un_JTFH01000361v1_decoy,length=1923>\n##contig=<ID=Un_JTFH01000362v1_decoy,length=1921>\n##contig=<ID=Un_JTFH01000363v1_decoy,length=1918>\n##contig=<ID=Un_JTFH01000364v1_decoy,length=1915>\n##contig=<ID=Un_JTFH01000365v1_decoy,length=1915>\n##contig=<ID=Un_JTFH01000366v1_decoy,length=1914>\n##contig=<ID=Un_JTFH01000367v1_decoy,length=1912>\n##contig=<ID=Un_JTFH01000368v1_decoy,length=1910>\n##contig=<ID=Un_JTFH01000369v1_decoy,length=1907>\n##contig=<ID=Un_JTFH01000370v1_decoy,length=1904>\n##contig=<ID=Un_JTFH01000371v1_decoy,length=1897>\n##contig=<ID=Un_JTFH01000372v1_decoy,length=1891>\n##contig=<ID=Un_JTFH01000373v1_decoy,length=1890>\n##contig=<ID=Un_JTFH01000374v1_decoy,length=1888>\n##contig=<ID=Un_JTFH01000375v1_decoy,length=1888>\n##contig=<ID=Un_JTFH01000376v1_decoy,length=1885>\n##contig=<ID=Un_JTFH01000377v1_decoy,length=1881>\n##contig=<ID=Un_JTFH01000378v1_decoy,length=1879>\n##contig=<ID=Un_JTFH01000379v1_decoy,length=1877>\n##contig=<ID=Un_JTFH01000380v1_decoy,length=1876>\n##contig=<ID=Un_JTFH01000381v1_decoy,length=1876>\n##contig=<ID=Un_JTFH01000382v1_decoy,length=1874>\n##contig=<ID=Un_JTFH01000383v1_decoy,length=1872>\n##contig=<ID=Un_JTFH01000384v1_decoy,length=1869>\n##contig=<ID=Un_JTFH01000385v1_decoy,length=1866>\n##contig=<ID=Un_JTFH01000386v1_decoy,length=1865>\n##contig=<ID=Un_JTFH01000387v1_decoy,length=1865>\n##contig=<ID=Un_JTFH01000388v1_decoy,length=1865>\n##contig=<ID=Un_JTFH01000389v1_decoy,length=1862>\n##contig=<ID=Un_JTFH01000390v1_decoy,length=1862>\n##contig=<ID=Un_JTFH01000391v1_decoy,length=1859>\n##contig=<ID=Un_JTFH01000392v1_decoy,length=1856>\n##contig=<ID=Un_JTFH01000393v1_decoy,length=1856>\n##contig=<ID=Un_JTFH01000394v1_decoy,length=1854>\n##contig=<ID=Un_JTFH01000395v1_decoy,length=1850>\n##contig=<ID=Un_JTFH01000396v1_decoy,length=1849>\n##contig=<ID=Un_JTFH01000397v1_decoy,length=1849>\n##contig=<ID=Un_JTFH01000398v1_decoy,length=1847>\n##contig=<ID=Un_JTFH01000399v1_decoy,length=1839>\n##contig=<ID=Un_JTFH01000400v1_decoy,length=1834>\n##contig=<ID=Un_JTFH01000401v1_decoy,length=1821>\n##contig=<ID=Un_JTFH01000402v1_decoy,length=1815>\n##contig=<ID=Un_JTFH01000403v1_decoy,length=1811>\n##contig=<ID=Un_JTFH01000404v1_decoy,length=1808>\n##contig=<ID=Un_JTFH01000405v1_decoy,length=1808>\n##contig=<ID=Un_JTFH01000406v1_decoy,length=1807>\n##contig=<ID=Un_JTFH01000407v1_decoy,length=1807>\n##contig=<ID=Un_JTFH01000408v1_decoy,length=1802>\n##contig=<ID=Un_JTFH01000409v1_decoy,length=1801>\n##contig=<ID=Un_JTFH01000410v1_decoy,length=1800>\n##contig=<ID=Un_JTFH01000411v1_decoy,length=1795>\n##contig=<ID=Un_JTFH01000412v1_decoy,length=1794>\n##contig=<ID=Un_JTFH01000413v1_decoy,length=1792>\n##contig=<ID=Un_JTFH01000414v1_decoy,length=1788>\n##contig=<ID=Un_JTFH01000415v1_decoy,length=1786>\n##contig=<ID=Un_JTFH01000416v1_decoy,length=1782>\n##contig=<ID=Un_JTFH01000417v1_decoy,length=1782>\n##contig=<ID=Un_JTFH01000418v1_decoy,length=1781>\n##contig=<ID=Un_JTFH01000419v1_decoy,length=1781>\n##contig=<ID=Un_JTFH01000420v1_decoy,length=1779>\n##contig=<ID=Un_JTFH01000421v1_decoy,length=1777>\n##contig=<ID=Un_JTFH01000422v1_decoy,length=1764>\n##contig=<ID=Un_JTFH01000423v1_decoy,length=1762>\n##contig=<ID=Un_JTFH01000424v1_decoy,length=1755>\n##contig=<ID=Un_JTFH01000425v1_decoy,length=1749>\n##contig=<ID=Un_JTFH01000426v1_decoy,length=1747>\n##contig=<ID=Un_JTFH01000427v1_decoy,length=1746>\n##contig=<ID=Un_JTFH01000428v1_decoy,length=1745>\n##contig=<ID=Un_JTFH01000429v1_decoy,length=1744>\n##contig=<ID=Un_JTFH01000430v1_decoy,length=1742>\n##contig=<ID=Un_JTFH01000431v1_decoy,length=1740>\n##contig=<ID=Un_JTFH01000432v1_decoy,length=1740>\n##contig=<ID=Un_JTFH01000433v1_decoy,length=1736>\n##contig=<ID=Un_JTFH01000434v1_decoy,length=1735>\n##contig=<ID=Un_JTFH01000435v1_decoy,length=1732>\n##contig=<ID=Un_JTFH01000436v1_decoy,length=1732>\n##contig=<ID=Un_JTFH01000437v1_decoy,length=1730>\n##contig=<ID=Un_JTFH01000438v1_decoy,length=1727>\n##contig=<ID=Un_JTFH01000439v1_decoy,length=1722>\n##contig=<ID=Un_JTFH01000440v1_decoy,length=1718>\n##contig=<ID=Un_JTFH01000441v1_decoy,length=1716>\n##contig=<ID=Un_JTFH01000442v1_decoy,length=1710>\n##contig=<ID=Un_JTFH01000443v1_decoy,length=1708>\n##contig=<ID=Un_JTFH01000444v1_decoy,length=1707>\n##contig=<ID=Un_JTFH01000445v1_decoy,length=1706>\n##contig=<ID=Un_JTFH01000446v1_decoy,length=1705>\n##contig=<ID=Un_JTFH01000447v1_decoy,length=1704>\n##contig=<ID=Un_JTFH01000448v1_decoy,length=1699>\n##contig=<ID=Un_JTFH01000449v1_decoy,length=1698>\n##contig=<ID=Un_JTFH01000450v1_decoy,length=1697>\n##contig=<ID=Un_JTFH01000451v1_decoy,length=1697>\n##contig=<ID=Un_JTFH01000452v1_decoy,length=1695>\n##contig=<ID=Un_JTFH01000453v1_decoy,length=1695>\n##contig=<ID=Un_JTFH01000454v1_decoy,length=1693>\n##contig=<ID=Un_JTFH01000455v1_decoy,length=1687>\n##contig=<ID=Un_JTFH01000456v1_decoy,length=1686>\n##contig=<ID=Un_JTFH01000457v1_decoy,length=1680>\n##contig=<ID=Un_JTFH01000458v1_decoy,length=1679>\n##contig=<ID=Un_JTFH01000459v1_decoy,length=1679>\n##contig=<ID=Un_JTFH01000460v1_decoy,length=1678>\n##contig=<ID=Un_JTFH01000461v1_decoy,length=1674>\n##contig=<ID=Un_JTFH01000462v1_decoy,length=1674>\n##contig=<ID=Un_JTFH01000463v1_decoy,length=1671>\n##contig=<ID=Un_JTFH01000464v1_decoy,length=1669>\n##contig=<ID=Un_JTFH01000465v1_decoy,length=1665>\n##contig=<ID=Un_JTFH01000466v1_decoy,length=1663>\n##contig=<ID=Un_JTFH01000467v1_decoy,length=1657>\n##contig=<ID=Un_JTFH01000468v1_decoy,length=1653>\n##contig=<ID=Un_JTFH01000469v1_decoy,length=1652>\n##contig=<ID=Un_JTFH01000470v1_decoy,length=1650>\n##contig=<ID=Un_JTFH01000471v1_decoy,length=1649>\n##contig=<ID=Un_JTFH01000472v1_decoy,length=1649>\n##contig=<ID=Un_JTFH01000473v1_decoy,length=1640>\n##contig=<ID=Un_JTFH01000474v1_decoy,length=1638>\n##contig=<ID=Un_JTFH01000475v1_decoy,length=1636>\n##contig=<ID=Un_JTFH01000476v1_decoy,length=1632>\n##contig=<ID=Un_JTFH01000477v1_decoy,length=1631>\n##contig=<ID=Un_JTFH01000478v1_decoy,length=1630>\n##contig=<ID=Un_JTFH01000479v1_decoy,length=1627>\n##contig=<ID=Un_JTFH01000480v1_decoy,length=1624>\n##contig=<ID=Un_JTFH01000481v1_decoy,length=1617>\n##contig=<ID=Un_JTFH01000482v1_decoy,length=1616>\n##contig=<ID=Un_JTFH01000483v1_decoy,length=1615>\n##contig=<ID=Un_JTFH01000484v1_decoy,length=1611>\n##contig=<ID=Un_JTFH01000485v1_decoy,length=1611>\n##contig=<ID=Un_JTFH01000486v1_decoy,length=1606>\n##contig=<ID=Un_JTFH01000487v1_decoy,length=1605>\n##contig=<ID=Un_JTFH01000488v1_decoy,length=1605>\n##contig=<ID=Un_JTFH01000489v1_decoy,length=1600>\n##contig=<ID=Un_JTFH01000490v1_decoy,length=1598>\n##contig=<ID=Un_JTFH01000491v1_decoy,length=1598>\n##contig=<ID=Un_JTFH01000492v1_decoy,length=1597>\n##contig=<ID=Un_JTFH01000493v1_decoy,length=1596>\n##contig=<ID=Un_JTFH01000494v1_decoy,length=1595>\n##contig=<ID=Un_JTFH01000495v1_decoy,length=1592>\n##contig=<ID=Un_JTFH01000496v1_decoy,length=1589>\n##contig=<ID=Un_JTFH01000497v1_decoy,length=1585>\n##contig=<ID=Un_JTFH01000498v1_decoy,length=1579>\n##contig=<ID=Un_JTFH01000499v1_decoy,length=1578>\n##contig=<ID=Un_JTFH01000500v1_decoy,length=1577>\n##contig=<ID=Un_JTFH01000501v1_decoy,length=1577>\n##contig=<ID=Un_JTFH01000502v1_decoy,length=1577>\n##contig=<ID=Un_JTFH01000503v1_decoy,length=1576>\n##contig=<ID=Un_JTFH01000504v1_decoy,length=1575>\n##contig=<ID=Un_JTFH01000505v1_decoy,length=1574>\n##contig=<ID=Un_JTFH01000506v1_decoy,length=1572>\n##contig=<ID=Un_JTFH01000507v1_decoy,length=1571>\n##contig=<ID=Un_JTFH01000508v1_decoy,length=1563>\n##contig=<ID=Un_JTFH01000509v1_decoy,length=1561>\n##contig=<ID=Un_JTFH01000510v1_decoy,length=1561>\n##contig=<ID=Un_JTFH01000511v1_decoy,length=1560>\n##contig=<ID=Un_JTFH01000512v1_decoy,length=1560>\n##contig=<ID=Un_JTFH01000513v1_decoy,length=1554>\n##contig=<ID=Un_JTFH01000514v1_decoy,length=1552>\n##contig=<ID=Un_JTFH01000515v1_decoy,length=1548>\n##contig=<ID=Un_JTFH01000516v1_decoy,length=1546>\n##contig=<ID=Un_JTFH01000517v1_decoy,length=1541>\n##contig=<ID=Un_JTFH01000518v1_decoy,length=1536>\n##contig=<ID=Un_JTFH01000519v1_decoy,length=1533>\n##contig=<ID=Un_JTFH01000520v1_decoy,length=1532>\n##contig=<ID=Un_JTFH01000521v1_decoy,length=1532>\n##contig=<ID=Un_JTFH01000522v1_decoy,length=1530>\n##contig=<ID=Un_JTFH01000523v1_decoy,length=1527>\n##contig=<ID=Un_JTFH01000524v1_decoy,length=1526>\n##contig=<ID=Un_JTFH01000525v1_decoy,length=1524>\n##contig=<ID=Un_JTFH01000526v1_decoy,length=1523>\n##contig=<ID=Un_JTFH01000527v1_decoy,length=1523>\n##contig=<ID=Un_JTFH01000528v1_decoy,length=1522>\n##contig=<ID=Un_JTFH01000529v1_decoy,length=1522>\n##contig=<ID=Un_JTFH01000530v1_decoy,length=1519>\n##contig=<ID=Un_JTFH01000531v1_decoy,length=1513>\n##contig=<ID=Un_JTFH01000532v1_decoy,length=1508>\n##contig=<ID=Un_JTFH01000533v1_decoy,length=1508>\n##contig=<ID=Un_JTFH01000534v1_decoy,length=1505>\n##contig=<ID=Un_JTFH01000535v1_decoy,length=1503>\n##contig=<ID=Un_JTFH01000536v1_decoy,length=1496>\n##contig=<ID=Un_JTFH01000537v1_decoy,length=1491>\n##contig=<ID=Un_JTFH01000538v1_decoy,length=1490>\n##contig=<ID=Un_JTFH01000539v1_decoy,length=1490>\n##contig=<ID=Un_JTFH01000540v1_decoy,length=1487>\n##contig=<ID=Un_JTFH01000541v1_decoy,length=1486>\n##contig=<ID=Un_JTFH01000542v1_decoy,length=1485>\n##contig=<ID=Un_JTFH01000543v1_decoy,length=1484>\n##contig=<ID=Un_JTFH01000544v1_decoy,length=1483>\n##contig=<ID=Un_JTFH01000545v1_decoy,length=1479>\n##contig=<ID=Un_JTFH01000546v1_decoy,length=1479>\n##contig=<ID=Un_JTFH01000547v1_decoy,length=1476>\n##contig=<ID=Un_JTFH01000548v1_decoy,length=1475>\n##contig=<ID=Un_JTFH01000549v1_decoy,length=1472>\n##contig=<ID=Un_JTFH01000550v1_decoy,length=1469>\n##contig=<ID=Un_JTFH01000551v1_decoy,length=1468>\n##contig=<ID=Un_JTFH01000552v1_decoy,length=1467>\n##contig=<ID=Un_JTFH01000553v1_decoy,length=1465>\n##contig=<ID=Un_JTFH01000554v1_decoy,length=1464>\n##contig=<ID=Un_JTFH01000555v1_decoy,length=1463>\n##contig=<ID=Un_JTFH01000556v1_decoy,length=1463>\n##contig=<ID=Un_JTFH01000557v1_decoy,length=1459>\n##contig=<ID=Un_JTFH01000558v1_decoy,length=1459>\n##contig=<ID=Un_JTFH01000559v1_decoy,length=1458>\n##contig=<ID=Un_JTFH01000560v1_decoy,length=1458>\n##contig=<ID=Un_JTFH01000561v1_decoy,length=1454>\n##contig=<ID=Un_JTFH01000562v1_decoy,length=1449>\n##contig=<ID=Un_JTFH01000563v1_decoy,length=1449>\n##contig=<ID=Un_JTFH01000564v1_decoy,length=1448>\n##contig=<ID=Un_JTFH01000565v1_decoy,length=1446>\n##contig=<ID=Un_JTFH01000566v1_decoy,length=1442>\n##contig=<ID=Un_JTFH01000567v1_decoy,length=1441>\n##contig=<ID=Un_JTFH01000568v1_decoy,length=1440>\n##contig=<ID=Un_JTFH01000569v1_decoy,length=1439>\n##contig=<ID=Un_JTFH01000570v1_decoy,length=1437>\n##contig=<ID=Un_JTFH01000571v1_decoy,length=1436>\n##contig=<ID=Un_JTFH01000572v1_decoy,length=1429>\n##contig=<ID=Un_JTFH01000573v1_decoy,length=1429>\n##contig=<ID=Un_JTFH01000574v1_decoy,length=1427>\n##contig=<ID=Un_JTFH01000575v1_decoy,length=1426>\n##contig=<ID=Un_JTFH01000576v1_decoy,length=1425>\n##contig=<ID=Un_JTFH01000577v1_decoy,length=1424>\n##contig=<ID=Un_JTFH01000578v1_decoy,length=1424>\n##contig=<ID=Un_JTFH01000579v1_decoy,length=1423>\n##contig=<ID=Un_JTFH01000580v1_decoy,length=1423>\n##contig=<ID=Un_JTFH01000581v1_decoy,length=1423>\n##contig=<ID=Un_JTFH01000582v1_decoy,length=1414>\n##contig=<ID=Un_JTFH01000583v1_decoy,length=1414>\n##contig=<ID=Un_JTFH01000584v1_decoy,length=1413>\n##contig=<ID=Un_JTFH01000585v1_decoy,length=1413>\n##contig=<ID=Un_JTFH01000586v1_decoy,length=1410>\n##contig=<ID=Un_JTFH01000587v1_decoy,length=1409>\n##contig=<ID=Un_JTFH01000588v1_decoy,length=1409>\n##contig=<ID=Un_JTFH01000589v1_decoy,length=1406>\n##contig=<ID=Un_JTFH01000590v1_decoy,length=1405>\n##contig=<ID=Un_JTFH01000591v1_decoy,length=1405>\n##contig=<ID=Un_JTFH01000592v1_decoy,length=1404>\n##contig=<ID=Un_JTFH01000593v1_decoy,length=1404>\n##contig=<ID=Un_JTFH01000594v1_decoy,length=1402>\n##contig=<ID=Un_JTFH01000595v1_decoy,length=1402>\n##contig=<ID=Un_JTFH01000596v1_decoy,length=1402>\n##contig=<ID=Un_JTFH01000597v1_decoy,length=1402>\n##contig=<ID=Un_JTFH01000598v1_decoy,length=1400>\n##contig=<ID=Un_JTFH01000599v1_decoy,length=1398>\n##contig=<ID=Un_JTFH01000600v1_decoy,length=1396>\n##contig=<ID=Un_JTFH01000601v1_decoy,length=1395>\n##contig=<ID=Un_JTFH01000602v1_decoy,length=1394>\n##contig=<ID=Un_JTFH01000603v1_decoy,length=1393>\n##contig=<ID=Un_JTFH01000604v1_decoy,length=1391>\n##contig=<ID=Un_JTFH01000605v1_decoy,length=1389>\n##contig=<ID=Un_JTFH01000606v1_decoy,length=1389>\n##contig=<ID=Un_JTFH01000607v1_decoy,length=1388>\n##contig=<ID=Un_JTFH01000608v1_decoy,length=1387>\n##contig=<ID=Un_JTFH01000609v1_decoy,length=1384>\n##contig=<ID=Un_JTFH01000610v1_decoy,length=1381>\n##contig=<ID=Un_JTFH01000611v1_decoy,length=1381>\n##contig=<ID=Un_JTFH01000612v1_decoy,length=1379>\n##contig=<ID=Un_JTFH01000613v1_decoy,length=1377>\n##contig=<ID=Un_JTFH01000614v1_decoy,length=1376>\n##contig=<ID=Un_JTFH01000615v1_decoy,length=1376>\n##contig=<ID=Un_JTFH01000616v1_decoy,length=1375>\n##contig=<ID=Un_JTFH01000617v1_decoy,length=1374>\n##contig=<ID=Un_JTFH01000618v1_decoy,length=1372>\n##contig=<ID=Un_JTFH01000619v1_decoy,length=1371>\n##contig=<ID=Un_JTFH01000620v1_decoy,length=1370>\n##contig=<ID=Un_JTFH01000621v1_decoy,length=1370>\n##contig=<ID=Un_JTFH01000622v1_decoy,length=1366>\n##contig=<ID=Un_JTFH01000623v1_decoy,length=1363>\n##contig=<ID=Un_JTFH01000624v1_decoy,length=1360>\n##contig=<ID=Un_JTFH01000625v1_decoy,length=1356>\n##contig=<ID=Un_JTFH01000626v1_decoy,length=1355>\n##contig=<ID=Un_JTFH01000627v1_decoy,length=1355>\n##contig=<ID=Un_JTFH01000628v1_decoy,length=1352>\n##contig=<ID=Un_JTFH01000629v1_decoy,length=1345>\n##contig=<ID=Un_JTFH01000630v1_decoy,length=1344>\n##contig=<ID=Un_JTFH01000631v1_decoy,length=1344>\n##contig=<ID=Un_JTFH01000632v1_decoy,length=1342>\n##contig=<ID=Un_JTFH01000633v1_decoy,length=1342>\n##contig=<ID=Un_JTFH01000634v1_decoy,length=1336>\n##contig=<ID=Un_JTFH01000635v1_decoy,length=1334>\n##contig=<ID=Un_JTFH01000636v1_decoy,length=1334>\n##contig=<ID=Un_JTFH01000637v1_decoy,length=1333>\n##contig=<ID=Un_JTFH01000638v1_decoy,length=1332>\n##contig=<ID=Un_JTFH01000639v1_decoy,length=1328>\n##contig=<ID=Un_JTFH01000640v1_decoy,length=1328>\n##contig=<ID=Un_JTFH01000641v1_decoy,length=1328>\n##contig=<ID=Un_JTFH01000642v1_decoy,length=1327>\n##contig=<ID=Un_JTFH01000643v1_decoy,length=1325>\n##contig=<ID=Un_JTFH01000644v1_decoy,length=1322>\n##contig=<ID=Un_JTFH01000645v1_decoy,length=1320>\n##contig=<ID=Un_JTFH01000646v1_decoy,length=1319>\n##contig=<ID=Un_JTFH01000647v1_decoy,length=1318>\n##contig=<ID=Un_JTFH01000648v1_decoy,length=1315>\n##contig=<ID=Un_JTFH01000649v1_decoy,length=1314>\n##contig=<ID=Un_JTFH01000650v1_decoy,length=1313>\n##contig=<ID=Un_JTFH01000651v1_decoy,length=1313>\n##contig=<ID=Un_JTFH01000652v1_decoy,length=1312>\n##contig=<ID=Un_JTFH01000653v1_decoy,length=1310>\n##contig=<ID=Un_JTFH01000654v1_decoy,length=1309>\n##contig=<ID=Un_JTFH01000655v1_decoy,length=1309>\n##contig=<ID=Un_JTFH01000656v1_decoy,length=1307>\n##contig=<ID=Un_JTFH01000657v1_decoy,length=1307>\n##contig=<ID=Un_JTFH01000658v1_decoy,length=1305>\n##contig=<ID=Un_JTFH01000659v1_decoy,length=1304>\n##contig=<ID=Un_JTFH01000660v1_decoy,length=1303>\n##contig=<ID=Un_JTFH01000661v1_decoy,length=1302>\n##contig=<ID=Un_JTFH01000662v1_decoy,length=1302>\n##contig=<ID=Un_JTFH01000663v1_decoy,length=1301>\n##contig=<ID=Un_JTFH01000664v1_decoy,length=1301>\n##contig=<ID=Un_JTFH01000665v1_decoy,length=1300>\n##contig=<ID=Un_JTFH01000666v1_decoy,length=1299>\n##contig=<ID=Un_JTFH01000667v1_decoy,length=1297>\n##contig=<ID=Un_JTFH01000668v1_decoy,length=1295>\n##contig=<ID=Un_JTFH01000669v1_decoy,length=1294>\n##contig=<ID=Un_JTFH01000670v1_decoy,length=1293>\n##contig=<ID=Un_JTFH01000671v1_decoy,length=1291>\n##contig=<ID=Un_JTFH01000672v1_decoy,length=1291>\n##contig=<ID=Un_JTFH01000673v1_decoy,length=1289>\n##contig=<ID=Un_JTFH01000674v1_decoy,length=1288>\n##contig=<ID=Un_JTFH01000675v1_decoy,length=1288>\n##contig=<ID=Un_JTFH01000676v1_decoy,length=1287>\n##contig=<ID=Un_JTFH01000677v1_decoy,length=1287>\n##contig=<ID=Un_JTFH01000678v1_decoy,length=1287>\n##contig=<ID=Un_JTFH01000679v1_decoy,length=1286>\n##contig=<ID=Un_JTFH01000680v1_decoy,length=1283>\n##contig=<ID=Un_JTFH01000681v1_decoy,length=1281>\n##contig=<ID=Un_JTFH01000682v1_decoy,length=1277>\n##contig=<ID=Un_JTFH01000683v1_decoy,length=1274>\n##contig=<ID=Un_JTFH01000684v1_decoy,length=1270>\n##contig=<ID=Un_JTFH01000685v1_decoy,length=1267>\n##contig=<ID=Un_JTFH01000686v1_decoy,length=1266>\n##contig=<ID=Un_JTFH01000687v1_decoy,length=1260>\n##contig=<ID=Un_JTFH01000688v1_decoy,length=1259>\n##contig=<ID=Un_JTFH01000689v1_decoy,length=1258>\n##contig=<ID=Un_JTFH01000690v1_decoy,length=1258>\n##contig=<ID=Un_JTFH01000691v1_decoy,length=1258>\n##contig=<ID=Un_JTFH01000692v1_decoy,length=1256>\n##contig=<ID=Un_JTFH01000693v1_decoy,length=1255>\n##contig=<ID=Un_JTFH01000694v1_decoy,length=1254>\n##contig=<ID=Un_JTFH01000695v1_decoy,length=1254>\n##contig=<ID=Un_JTFH01000696v1_decoy,length=1253>\n##contig=<ID=Un_JTFH01000697v1_decoy,length=1250>\n##contig=<ID=Un_JTFH01000698v1_decoy,length=1249>\n##contig=<ID=Un_JTFH01000699v1_decoy,length=1248>\n##contig=<ID=Un_JTFH01000700v1_decoy,length=1248>\n##contig=<ID=Un_JTFH01000701v1_decoy,length=1247>\n##contig=<ID=Un_JTFH01000702v1_decoy,length=1242>\n##contig=<ID=Un_JTFH01000703v1_decoy,length=1242>\n##contig=<ID=Un_JTFH01000704v1_decoy,length=1241>\n##contig=<ID=Un_JTFH01000705v1_decoy,length=1241>\n##contig=<ID=Un_JTFH01000706v1_decoy,length=1241>\n##contig=<ID=Un_JTFH01000707v1_decoy,length=1239>\n##contig=<ID=Un_JTFH01000708v1_decoy,length=1238>\n##contig=<ID=Un_JTFH01000709v1_decoy,length=1237>\n##contig=<ID=Un_JTFH01000710v1_decoy,length=1236>\n##contig=<ID=Un_JTFH01000711v1_decoy,length=1235>\n##contig=<ID=Un_JTFH01000712v1_decoy,length=1234>\n##contig=<ID=Un_JTFH01000713v1_decoy,length=1234>\n##contig=<ID=Un_JTFH01000714v1_decoy,length=1234>\n##contig=<ID=Un_JTFH01000715v1_decoy,length=1233>\n##contig=<ID=Un_JTFH01000716v1_decoy,length=1232>\n##contig=<ID=Un_JTFH01000717v1_decoy,length=1232>\n##contig=<ID=Un_JTFH01000718v1_decoy,length=1231>\n##contig=<ID=Un_JTFH01000719v1_decoy,length=1230>\n##contig=<ID=Un_JTFH01000720v1_decoy,length=1228>\n##contig=<ID=Un_JTFH01000721v1_decoy,length=1227>\n##contig=<ID=Un_JTFH01000722v1_decoy,length=1227>\n##contig=<ID=Un_JTFH01000723v1_decoy,length=1226>\n##contig=<ID=Un_JTFH01000724v1_decoy,length=1224>\n##contig=<ID=Un_JTFH01000725v1_decoy,length=1224>\n##contig=<ID=Un_JTFH01000726v1_decoy,length=1220>\n##contig=<ID=Un_JTFH01000727v1_decoy,length=1220>\n##contig=<ID=Un_JTFH01000728v1_decoy,length=1219>\n##contig=<ID=Un_JTFH01000729v1_decoy,length=1217>\n##contig=<ID=Un_JTFH01000730v1_decoy,length=1216>\n##contig=<ID=Un_JTFH01000731v1_decoy,length=1215>\n##contig=<ID=Un_JTFH01000732v1_decoy,length=1214>\n##contig=<ID=Un_JTFH01000733v1_decoy,length=1214>\n##contig=<ID=Un_JTFH01000734v1_decoy,length=1214>\n##contig=<ID=Un_JTFH01000735v1_decoy,length=1213>\n##contig=<ID=Un_JTFH01000736v1_decoy,length=1212>\n##contig=<ID=Un_JTFH01000737v1_decoy,length=1209>\n##contig=<ID=Un_JTFH01000738v1_decoy,length=1208>\n##contig=<ID=Un_JTFH01000739v1_decoy,length=1207>\n##contig=<ID=Un_JTFH01000740v1_decoy,length=1207>\n##contig=<ID=Un_JTFH01000741v1_decoy,length=1207>\n##contig=<ID=Un_JTFH01000742v1_decoy,length=1206>\n##contig=<ID=Un_JTFH01000743v1_decoy,length=1206>\n##contig=<ID=Un_JTFH01000744v1_decoy,length=1205>\n##contig=<ID=Un_JTFH01000745v1_decoy,length=1205>\n##contig=<ID=Un_JTFH01000746v1_decoy,length=1204>\n##contig=<ID=Un_JTFH01000747v1_decoy,length=1204>\n##contig=<ID=Un_JTFH01000748v1_decoy,length=1204>\n##contig=<ID=Un_JTFH01000749v1_decoy,length=1203>\n##contig=<ID=Un_JTFH01000750v1_decoy,length=1201>\n##contig=<ID=Un_JTFH01000751v1_decoy,length=1201>\n##contig=<ID=Un_JTFH01000752v1_decoy,length=1200>\n##contig=<ID=Un_JTFH01000753v1_decoy,length=1200>\n##contig=<ID=Un_JTFH01000754v1_decoy,length=1199>\n##contig=<ID=Un_JTFH01000755v1_decoy,length=1198>\n##contig=<ID=Un_JTFH01000756v1_decoy,length=1197>\n##contig=<ID=Un_JTFH01000757v1_decoy,length=1196>\n##contig=<ID=Un_JTFH01000758v1_decoy,length=1195>\n##contig=<ID=Un_JTFH01000759v1_decoy,length=1194>\n##contig=<ID=Un_JTFH01000760v1_decoy,length=1194>\n##contig=<ID=Un_JTFH01000761v1_decoy,length=1191>\n##contig=<ID=Un_JTFH01000762v1_decoy,length=1189>\n##contig=<ID=Un_JTFH01000763v1_decoy,length=1186>\n##contig=<ID=Un_JTFH01000764v1_decoy,length=1186>\n##contig=<ID=Un_JTFH01000765v1_decoy,length=1184>\n##contig=<ID=Un_JTFH01000766v1_decoy,length=1183>\n##contig=<ID=Un_JTFH01000767v1_decoy,length=1183>\n##contig=<ID=Un_JTFH01000768v1_decoy,length=1182>\n##contig=<ID=Un_JTFH01000769v1_decoy,length=1181>\n##contig=<ID=Un_JTFH01000770v1_decoy,length=1181>\n##contig=<ID=Un_JTFH01000771v1_decoy,length=1181>\n##contig=<ID=Un_JTFH01000772v1_decoy,length=1181>\n##contig=<ID=Un_JTFH01000773v1_decoy,length=1179>\n##contig=<ID=Un_JTFH01000774v1_decoy,length=1178>\n##contig=<ID=Un_JTFH01000775v1_decoy,length=1178>\n##contig=<ID=Un_JTFH01000776v1_decoy,length=1177>\n##contig=<ID=Un_JTFH01000777v1_decoy,length=1177>\n##contig=<ID=Un_JTFH01000778v1_decoy,length=1171>\n##contig=<ID=Un_JTFH01000779v1_decoy,length=1171>\n##contig=<ID=Un_JTFH01000780v1_decoy,length=1171>\n##contig=<ID=Un_JTFH01000781v1_decoy,length=1170>\n##contig=<ID=Un_JTFH01000782v1_decoy,length=1170>\n##contig=<ID=Un_JTFH01000783v1_decoy,length=1167>\n##contig=<ID=Un_JTFH01000784v1_decoy,length=1167>\n##contig=<ID=Un_JTFH01000785v1_decoy,length=1167>\n##contig=<ID=Un_JTFH01000786v1_decoy,length=1165>\n##contig=<ID=Un_JTFH01000787v1_decoy,length=1165>\n##contig=<ID=Un_JTFH01000788v1_decoy,length=1162>\n##contig=<ID=Un_JTFH01000789v1_decoy,length=1157>\n##contig=<ID=Un_JTFH01000790v1_decoy,length=1156>\n##contig=<ID=Un_JTFH01000791v1_decoy,length=1156>\n##contig=<ID=Un_JTFH01000792v1_decoy,length=1154>\n##contig=<ID=Un_JTFH01000793v1_decoy,length=1154>\n##contig=<ID=Un_JTFH01000794v1_decoy,length=1151>\n##contig=<ID=Un_JTFH01000795v1_decoy,length=1151>\n##contig=<ID=Un_JTFH01000796v1_decoy,length=1150>\n##contig=<ID=Un_JTFH01000797v1_decoy,length=1150>\n##contig=<ID=Un_JTFH01000798v1_decoy,length=1147>\n##contig=<ID=Un_JTFH01000799v1_decoy,length=1147>\n##contig=<ID=Un_JTFH01000800v1_decoy,length=1146>\n##contig=<ID=Un_JTFH01000801v1_decoy,length=1144>\n##contig=<ID=Un_JTFH01000802v1_decoy,length=1144>\n##contig=<ID=Un_JTFH01000803v1_decoy,length=1143>\n##contig=<ID=Un_JTFH01000804v1_decoy,length=1142>\n##contig=<ID=Un_JTFH01000805v1_decoy,length=1141>\n##contig=<ID=Un_JTFH01000806v1_decoy,length=1141>\n##contig=<ID=Un_JTFH01000807v1_decoy,length=1140>\n##contig=<ID=Un_JTFH01000808v1_decoy,length=1138>\n##contig=<ID=Un_JTFH01000809v1_decoy,length=1134>\n##contig=<ID=Un_JTFH01000810v1_decoy,length=1134>\n##contig=<ID=Un_JTFH01000811v1_decoy,length=1132>\n##contig=<ID=Un_JTFH01000812v1_decoy,length=1131>\n##contig=<ID=Un_JTFH01000813v1_decoy,length=1131>\n##contig=<ID=Un_JTFH01000814v1_decoy,length=1130>\n##contig=<ID=Un_JTFH01000815v1_decoy,length=1127>\n##contig=<ID=Un_JTFH01000816v1_decoy,length=1126>\n##contig=<ID=Un_JTFH01000817v1_decoy,length=1124>\n##contig=<ID=Un_JTFH01000818v1_decoy,length=1122>\n##contig=<ID=Un_JTFH01000819v1_decoy,length=1122>\n##contig=<ID=Un_JTFH01000820v1_decoy,length=1121>\n##contig=<ID=Un_JTFH01000821v1_decoy,length=1119>\n##contig=<ID=Un_JTFH01000822v1_decoy,length=1119>\n##contig=<ID=Un_JTFH01000823v1_decoy,length=1119>\n##contig=<ID=Un_JTFH01000824v1_decoy,length=1119>\n##contig=<ID=Un_JTFH01000825v1_decoy,length=1118>\n##contig=<ID=Un_JTFH01000826v1_decoy,length=1116>\n##contig=<ID=Un_JTFH01000827v1_decoy,length=1116>\n##contig=<ID=Un_JTFH01000828v1_decoy,length=1115>\n##contig=<ID=Un_JTFH01000829v1_decoy,length=1115>\n##contig=<ID=Un_JTFH01000830v1_decoy,length=1115>\n##contig=<ID=Un_JTFH01000831v1_decoy,length=1114>\n##contig=<ID=Un_JTFH01000832v1_decoy,length=1113>\n##contig=<ID=Un_JTFH01000833v1_decoy,length=1113>\n##contig=<ID=Un_JTFH01000834v1_decoy,length=1110>\n##contig=<ID=Un_JTFH01000835v1_decoy,length=1110>\n##contig=<ID=Un_JTFH01000836v1_decoy,length=1109>\n##contig=<ID=Un_JTFH01000837v1_decoy,length=1108>\n##contig=<ID=Un_JTFH01000838v1_decoy,length=1107>\n##contig=<ID=Un_JTFH01000839v1_decoy,length=1107>\n##contig=<ID=Un_JTFH01000840v1_decoy,length=1107>\n##contig=<ID=Un_JTFH01000841v1_decoy,length=1107>\n##contig=<ID=Un_JTFH01000842v1_decoy,length=1106>\n##contig=<ID=Un_JTFH01000843v1_decoy,length=1103>\n##contig=<ID=Un_JTFH01000844v1_decoy,length=1103>\n##contig=<ID=Un_JTFH01000845v1_decoy,length=1103>\n##contig=<ID=Un_JTFH01000846v1_decoy,length=1100>\n##contig=<ID=Un_JTFH01000847v1_decoy,length=1099>\n##contig=<ID=Un_JTFH01000848v1_decoy,length=1098>\n##contig=<ID=Un_JTFH01000849v1_decoy,length=1097>\n##contig=<ID=Un_JTFH01000850v1_decoy,length=1096>\n##contig=<ID=Un_JTFH01000851v1_decoy,length=1096>\n##contig=<ID=Un_JTFH01000852v1_decoy,length=1094>\n##contig=<ID=Un_JTFH01000853v1_decoy,length=1093>\n##contig=<ID=Un_JTFH01000854v1_decoy,length=1090>\n##contig=<ID=Un_JTFH01000855v1_decoy,length=1088>\n##contig=<ID=Un_JTFH01000856v1_decoy,length=1087>\n##contig=<ID=Un_JTFH01000857v1_decoy,length=1086>\n##contig=<ID=Un_JTFH01000858v1_decoy,length=1085>\n##contig=<ID=Un_JTFH01000859v1_decoy,length=1084>\n##contig=<ID=Un_JTFH01000860v1_decoy,length=1084>\n##contig=<ID=Un_JTFH01000861v1_decoy,length=1084>\n##contig=<ID=Un_JTFH01000862v1_decoy,length=1084>\n##contig=<ID=Un_JTFH01000863v1_decoy,length=1083>\n##contig=<ID=Un_JTFH01000864v1_decoy,length=1083>\n##contig=<ID=Un_JTFH01000865v1_decoy,length=1082>\n##contig=<ID=Un_JTFH01000866v1_decoy,length=1082>\n##contig=<ID=Un_JTFH01000867v1_decoy,length=1081>\n##contig=<ID=Un_JTFH01000868v1_decoy,length=1081>\n##contig=<ID=Un_JTFH01000869v1_decoy,length=1079>\n##contig=<ID=Un_JTFH01000870v1_decoy,length=1076>\n##contig=<ID=Un_JTFH01000871v1_decoy,length=1074>\n##contig=<ID=Un_JTFH01000872v1_decoy,length=1073>\n##contig=<ID=Un_JTFH01000873v1_decoy,length=1073>\n##contig=<ID=Un_JTFH01000874v1_decoy,length=1071>\n##contig=<ID=Un_JTFH01000875v1_decoy,length=1069>\n##contig=<ID=Un_JTFH01000876v1_decoy,length=1067>\n##contig=<ID=Un_JTFH01000877v1_decoy,length=1067>\n##contig=<ID=Un_JTFH01000878v1_decoy,length=1067>\n##contig=<ID=Un_JTFH01000879v1_decoy,length=1066>\n##contig=<ID=Un_JTFH01000880v1_decoy,length=1065>\n##contig=<ID=Un_JTFH01000881v1_decoy,length=1065>\n##contig=<ID=Un_JTFH01000882v1_decoy,length=1065>\n##contig=<ID=Un_JTFH01000883v1_decoy,length=1065>\n##contig=<ID=Un_JTFH01000884v1_decoy,length=1065>\n##contig=<ID=Un_JTFH01000885v1_decoy,length=1064>\n##contig=<ID=Un_JTFH01000886v1_decoy,length=1064>\n##contig=<ID=Un_JTFH01000887v1_decoy,length=1064>\n##contig=<ID=Un_JTFH01000888v1_decoy,length=1063>\n##contig=<ID=Un_JTFH01000889v1_decoy,length=1062>\n##contig=<ID=Un_JTFH01000890v1_decoy,length=1062>\n##contig=<ID=Un_JTFH01000891v1_decoy,length=1062>\n##contig=<ID=Un_JTFH01000892v1_decoy,length=1061>\n##contig=<ID=Un_JTFH01000893v1_decoy,length=1060>\n##contig=<ID=Un_JTFH01000894v1_decoy,length=1057>\n##contig=<ID=Un_JTFH01000895v1_decoy,length=1057>\n##contig=<ID=Un_JTFH01000896v1_decoy,length=1056>\n##contig=<ID=Un_JTFH01000897v1_decoy,length=1055>\n##contig=<ID=Un_JTFH01000898v1_decoy,length=1055>\n##contig=<ID=Un_JTFH01000899v1_decoy,length=1055>\n##contig=<ID=Un_JTFH01000900v1_decoy,length=1055>\n##contig=<ID=Un_JTFH01000901v1_decoy,length=1054>\n##contig=<ID=Un_JTFH01000902v1_decoy,length=1051>\n##contig=<ID=Un_JTFH01000903v1_decoy,length=1050>\n##contig=<ID=Un_JTFH01000904v1_decoy,length=1050>\n##contig=<ID=Un_JTFH01000905v1_decoy,length=1049>\n##contig=<ID=Un_JTFH01000906v1_decoy,length=1048>\n##contig=<ID=Un_JTFH01000907v1_decoy,length=1047>\n##contig=<ID=Un_JTFH01000908v1_decoy,length=1046>\n##contig=<ID=Un_JTFH01000909v1_decoy,length=1046>\n##contig=<ID=Un_JTFH01000910v1_decoy,length=1046>\n##contig=<ID=Un_JTFH01000911v1_decoy,length=1045>\n##contig=<ID=Un_JTFH01000912v1_decoy,length=1045>\n##contig=<ID=Un_JTFH01000913v1_decoy,length=1045>\n##contig=<ID=Un_JTFH01000914v1_decoy,length=1044>\n##contig=<ID=Un_JTFH01000915v1_decoy,length=1042>\n##contig=<ID=Un_JTFH01000916v1_decoy,length=1041>\n##contig=<ID=Un_JTFH01000917v1_decoy,length=1039>\n##contig=<ID=Un_JTFH01000918v1_decoy,length=1039>\n##contig=<ID=Un_JTFH01000919v1_decoy,length=1038>\n##contig=<ID=Un_JTFH01000920v1_decoy,length=1036>\n##contig=<ID=Un_JTFH01000921v1_decoy,length=1036>\n##contig=<ID=Un_JTFH01000922v1_decoy,length=1035>\n##contig=<ID=Un_JTFH01000923v1_decoy,length=1035>\n##contig=<ID=Un_JTFH01000924v1_decoy,length=1033>\n##contig=<ID=Un_JTFH01000925v1_decoy,length=1032>\n##contig=<ID=Un_JTFH01000926v1_decoy,length=1031>\n##contig=<ID=Un_JTFH01000927v1_decoy,length=1031>\n##contig=<ID=Un_JTFH01000928v1_decoy,length=1031>\n##contig=<ID=Un_JTFH01000929v1_decoy,length=1027>\n##contig=<ID=Un_JTFH01000930v1_decoy,length=1027>\n##contig=<ID=Un_JTFH01000931v1_decoy,length=1026>\n##contig=<ID=Un_JTFH01000932v1_decoy,length=1026>\n##contig=<ID=Un_JTFH01000933v1_decoy,length=1024>\n##contig=<ID=Un_JTFH01000934v1_decoy,length=1024>\n##contig=<ID=Un_JTFH01000935v1_decoy,length=1022>\n##contig=<ID=Un_JTFH01000936v1_decoy,length=1022>\n##contig=<ID=Un_JTFH01000937v1_decoy,length=1021>\n##contig=<ID=Un_JTFH01000938v1_decoy,length=1020>\n##contig=<ID=Un_JTFH01000939v1_decoy,length=1019>\n##contig=<ID=Un_JTFH01000940v1_decoy,length=1018>\n##contig=<ID=Un_JTFH01000941v1_decoy,length=1018>\n##contig=<ID=Un_JTFH01000942v1_decoy,length=1018>\n##contig=<ID=Un_JTFH01000943v1_decoy,length=1016>\n##contig=<ID=Un_JTFH01000944v1_decoy,length=1010>\n##contig=<ID=Un_JTFH01000945v1_decoy,length=1010>\n##contig=<ID=Un_JTFH01000946v1_decoy,length=1009>\n##contig=<ID=Un_JTFH01000947v1_decoy,length=1008>\n##contig=<ID=Un_JTFH01000948v1_decoy,length=1007>\n##contig=<ID=Un_JTFH01000949v1_decoy,length=1006>\n##contig=<ID=Un_JTFH01000950v1_decoy,length=1005>\n##contig=<ID=Un_JTFH01000951v1_decoy,length=1005>\n##contig=<ID=Un_JTFH01000952v1_decoy,length=1004>\n##contig=<ID=Un_JTFH01000953v1_decoy,length=1004>\n##contig=<ID=Un_JTFH01000954v1_decoy,length=1003>\n##contig=<ID=Un_JTFH01000955v1_decoy,length=1003>\n##contig=<ID=Un_JTFH01000956v1_decoy,length=1003>\n##contig=<ID=Un_JTFH01000957v1_decoy,length=1003>\n##contig=<ID=Un_JTFH01000958v1_decoy,length=1002>\n##contig=<ID=Un_JTFH01000959v1_decoy,length=1002>\n##contig=<ID=Un_JTFH01000960v1_decoy,length=1000>\n##contig=<ID=Un_JTFH01000961v1_decoy,length=1000>\n##contig=<ID=Un_JTFH01000962v1_decoy,length=8358>\n##contig=<ID=Un_JTFH01000963v1_decoy,length=7932>\n##contig=<ID=Un_JTFH01000964v1_decoy,length=6846>\n##contig=<ID=Un_JTFH01000965v1_decoy,length=4591>\n##contig=<ID=Un_JTFH01000966v1_decoy,length=4041>\n##contig=<ID=Un_JTFH01000967v1_decoy,length=3841>\n##contig=<ID=Un_JTFH01000968v1_decoy,length=3754>\n##contig=<ID=Un_JTFH01000969v1_decoy,length=3743>\n##contig=<ID=Un_JTFH01000970v1_decoy,length=3702>\n##contig=<ID=Un_JTFH01000971v1_decoy,length=3625>\n##contig=<ID=Un_JTFH01000972v1_decoy,length=3529>\n##contig=<ID=Un_JTFH01000973v1_decoy,length=3508>\n##contig=<ID=Un_JTFH01000974v1_decoy,length=3359>\n##contig=<ID=Un_JTFH01000975v1_decoy,length=3320>\n##contig=<ID=Un_JTFH01000976v1_decoy,length=3231>\n##contig=<ID=Un_JTFH01000977v1_decoy,length=3220>\n##contig=<ID=Un_JTFH01000978v1_decoy,length=3212>\n##contig=<ID=Un_JTFH01000979v1_decoy,length=3192>\n##contig=<ID=Un_JTFH01000980v1_decoy,length=3092>\n##contig=<ID=Un_JTFH01000981v1_decoy,length=3087>\n##contig=<ID=Un_JTFH01000982v1_decoy,length=3048>\n##contig=<ID=Un_JTFH01000983v1_decoy,length=3005>\n##contig=<ID=Un_JTFH01000984v1_decoy,length=3004>\n##contig=<ID=Un_JTFH01000985v1_decoy,length=2959>\n##contig=<ID=Un_JTFH01000986v1_decoy,length=2934>\n##contig=<ID=Un_JTFH01000987v1_decoy,length=2933>\n##contig=<ID=Un_JTFH01000988v1_decoy,length=2827>\n##contig=<ID=Un_JTFH01000989v1_decoy,length=2794>\n##contig=<ID=Un_JTFH01000990v1_decoy,length=2749>\n##contig=<ID=Un_JTFH01000991v1_decoy,length=2745>\n##contig=<ID=Un_JTFH01000992v1_decoy,length=2733>\n##contig=<ID=Un_JTFH01000993v1_decoy,length=2698>\n##contig=<ID=Un_JTFH01000994v1_decoy,length=2665>\n##contig=<ID=Un_JTFH01000995v1_decoy,length=2634>\n##contig=<ID=Un_JTFH01000996v1_decoy,length=2492>\n##contig=<ID=Un_JTFH01000997v1_decoy,length=2489>\n##contig=<ID=Un_JTFH01000998v1_decoy,length=2468>\n##contig=<ID=Un_JTFH01000999v1_decoy,length=2414>\n##contig=<ID=Un_JTFH01001000v1_decoy,length=2395>\n##contig=<ID=Un_JTFH01001001v1_decoy,length=2356>\n##contig=<ID=Un_JTFH01001002v1_decoy,length=2339>\n##contig=<ID=Un_JTFH01001003v1_decoy,length=2310>\n##contig=<ID=Un_JTFH01001004v1_decoy,length=2288>\n##contig=<ID=Un_JTFH01001005v1_decoy,length=2285>\n##contig=<ID=Un_JTFH01001006v1_decoy,length=2269>\n##contig=<ID=Un_JTFH01001007v1_decoy,length=2253>\n##contig=<ID=Un_JTFH01001008v1_decoy,length=2203>\n##contig=<ID=Un_JTFH01001009v1_decoy,length=2176>\n##contig=<ID=Un_JTFH01001010v1_decoy,length=2159>\n##contig=<ID=Un_JTFH01001011v1_decoy,length=2155>\n##contig=<ID=Un_JTFH01001012v1_decoy,length=2149>\n##contig=<ID=Un_JTFH01001013v1_decoy,length=2129>\n##contig=<ID=Un_JTFH01001014v1_decoy,length=2116>\n##contig=<ID=Un_JTFH01001015v1_decoy,length=2113>\n##contig=<ID=Un_JTFH01001016v1_decoy,length=2098>\n##contig=<ID=Un_JTFH01001017v1_decoy,length=2066>\n##contig=<ID=Un_JTFH01001018v1_decoy,length=2066>\n##contig=<ID=Un_JTFH01001019v1_decoy,length=2059>\n##contig=<ID=Un_JTFH01001020v1_decoy,length=2047>\n##contig=<ID=Un_JTFH01001021v1_decoy,length=2040>\n##contig=<ID=Un_JTFH01001022v1_decoy,length=2030>\n##contig=<ID=Un_JTFH01001023v1_decoy,length=2024>\n##contig=<ID=Un_JTFH01001024v1_decoy,length=2001>\n##contig=<ID=Un_JTFH01001025v1_decoy,length=1992>\n##contig=<ID=Un_JTFH01001026v1_decoy,length=1981>\n##contig=<ID=Un_JTFH01001027v1_decoy,length=1979>\n##contig=<ID=Un_JTFH01001028v1_decoy,length=1957>\n##contig=<ID=Un_JTFH01001029v1_decoy,length=1953>\n##contig=<ID=Un_JTFH01001030v1_decoy,length=1944>\n##contig=<ID=Un_JTFH01001031v1_decoy,length=1936>\n##contig=<ID=Un_JTFH01001032v1_decoy,length=1932>\n##contig=<ID=Un_JTFH01001033v1_decoy,length=1882>\n##contig=<ID=Un_JTFH01001034v1_decoy,length=1878>\n##contig=<ID=Un_JTFH01001035v1_decoy,length=1870>\n##contig=<ID=Un_JTFH01001036v1_decoy,length=1821>\n##contig=<ID=Un_JTFH01001037v1_decoy,length=1813>\n##contig=<ID=Un_JTFH01001038v1_decoy,length=1809>\n##contig=<ID=Un_JTFH01001039v1_decoy,length=1804>\n##contig=<ID=Un_JTFH01001040v1_decoy,length=1797>\n##contig=<ID=Un_JTFH01001041v1_decoy,length=1791>\n##contig=<ID=Un_JTFH01001042v1_decoy,length=1781>\n##contig=<ID=Un_JTFH01001043v1_decoy,length=1766>\n##contig=<ID=Un_JTFH01001044v1_decoy,length=1764>\n##contig=<ID=Un_JTFH01001045v1_decoy,length=1743>\n##contig=<ID=Un_JTFH01001046v1_decoy,length=1741>\n##contig=<ID=Un_JTFH01001047v1_decoy,length=1709>\n##contig=<ID=Un_JTFH01001048v1_decoy,length=1706>\n##contig=<ID=Un_JTFH01001049v1_decoy,length=1701>\n##contig=<ID=Un_JTFH01001050v1_decoy,length=1689>\n##contig=<ID=Un_JTFH01001051v1_decoy,length=1646>\n##contig=<ID=Un_JTFH01001052v1_decoy,length=1641>\n##contig=<ID=Un_JTFH01001053v1_decoy,length=1639>\n##contig=<ID=Un_JTFH01001054v1_decoy,length=1636>\n##contig=<ID=Un_JTFH01001055v1_decoy,length=1632>\n##contig=<ID=Un_JTFH01001056v1_decoy,length=1629>\n##contig=<ID=Un_JTFH01001057v1_decoy,length=1623>\n##contig=<ID=Un_JTFH01001058v1_decoy,length=1622>\n##contig=<ID=Un_JTFH01001059v1_decoy,length=1622>\n##contig=<ID=Un_JTFH01001060v1_decoy,length=1619>\n##contig=<ID=Un_JTFH01001061v1_decoy,length=1606>\n##contig=<ID=Un_JTFH01001062v1_decoy,length=1593>\n##contig=<ID=Un_JTFH01001063v1_decoy,length=1592>\n##contig=<ID=Un_JTFH01001064v1_decoy,length=1558>\n##contig=<ID=Un_JTFH01001065v1_decoy,length=1545>\n##contig=<ID=Un_JTFH01001066v1_decoy,length=1542>\n##contig=<ID=Un_JTFH01001067v1_decoy,length=1540>\n##contig=<ID=Un_JTFH01001068v1_decoy,length=1529>\n##contig=<ID=Un_JTFH01001069v1_decoy,length=1518>\n##contig=<ID=Un_JTFH01001070v1_decoy,length=1515>\n##contig=<ID=Un_JTFH01001071v1_decoy,length=1513>\n##contig=<ID=Un_JTFH01001072v1_decoy,length=1507>\n##contig=<ID=Un_JTFH01001073v1_decoy,length=1504>\n##contig=<ID=Un_JTFH01001074v1_decoy,length=1499>\n##contig=<ID=Un_JTFH01001075v1_decoy,length=1495>\n##contig=<ID=Un_JTFH01001076v1_decoy,length=1495>\n##contig=<ID=Un_JTFH01001077v1_decoy,length=1492>\n##contig=<ID=Un_JTFH01001078v1_decoy,length=1492>\n##contig=<ID=Un_JTFH01001079v1_decoy,length=1489>\n##contig=<ID=Un_JTFH01001080v1_decoy,length=1485>\n##contig=<ID=Un_JTFH01001081v1_decoy,length=1483>\n##contig=<ID=Un_JTFH01001082v1_decoy,length=1473>\n##contig=<ID=Un_JTFH01001083v1_decoy,length=1470>\n##contig=<ID=Un_JTFH01001084v1_decoy,length=1463>\n##contig=<ID=Un_JTFH01001085v1_decoy,length=1460>\n##contig=<ID=Un_JTFH01001086v1_decoy,length=1458>\n##contig=<ID=Un_JTFH01001087v1_decoy,length=1456>\n##contig=<ID=Un_JTFH01001088v1_decoy,length=1453>\n##contig=<ID=Un_JTFH01001089v1_decoy,length=1443>\n##contig=<ID=Un_JTFH01001090v1_decoy,length=1441>\n##contig=<ID=Un_JTFH01001091v1_decoy,length=1426>\n##contig=<ID=Un_JTFH01001092v1_decoy,length=1425>\n##contig=<ID=Un_JTFH01001093v1_decoy,length=1418>\n##contig=<ID=Un_JTFH01001094v1_decoy,length=1413>\n##contig=<ID=Un_JTFH01001095v1_decoy,length=1413>\n##contig=<ID=Un_JTFH01001096v1_decoy,length=1412>\n##contig=<ID=Un_JTFH01001097v1_decoy,length=1407>\n##contig=<ID=Un_JTFH01001098v1_decoy,length=1406>\n##contig=<ID=Un_JTFH01001099v1_decoy,length=1396>\n##contig=<ID=Un_JTFH01001100v1_decoy,length=1390>\n##contig=<ID=Un_JTFH01001101v1_decoy,length=1382>\n##contig=<ID=Un_JTFH01001102v1_decoy,length=1376>\n##contig=<ID=Un_JTFH01001103v1_decoy,length=1375>\n##contig=<ID=Un_JTFH01001104v1_decoy,length=1371>\n##contig=<ID=Un_JTFH01001105v1_decoy,length=1367>\n##contig=<ID=Un_JTFH01001106v1_decoy,length=1364>\n##contig=<ID=Un_JTFH01001107v1_decoy,length=1356>\n##contig=<ID=Un_JTFH01001108v1_decoy,length=1355>\n##contig=<ID=Un_JTFH01001109v1_decoy,length=1352>\n##contig=<ID=Un_JTFH01001110v1_decoy,length=1350>\n##contig=<ID=Un_JTFH01001111v1_decoy,length=1346>\n##contig=<ID=Un_JTFH01001112v1_decoy,length=1345>\n##contig=<ID=Un_JTFH01001113v1_decoy,length=1340>\n##contig=<ID=Un_JTFH01001114v1_decoy,length=1330>\n##contig=<ID=Un_JTFH01001115v1_decoy,length=1329>\n##contig=<ID=Un_JTFH01001116v1_decoy,length=1324>\n##contig=<ID=Un_JTFH01001117v1_decoy,length=1316>\n##contig=<ID=Un_JTFH01001118v1_decoy,length=1307>\n##contig=<ID=Un_JTFH01001119v1_decoy,length=1304>\n##contig=<ID=Un_JTFH01001120v1_decoy,length=1304>\n##contig=<ID=Un_JTFH01001121v1_decoy,length=1303>\n##contig=<ID=Un_JTFH01001122v1_decoy,length=1301>\n##contig=<ID=Un_JTFH01001123v1_decoy,length=1300>\n##contig=<ID=Un_JTFH01001124v1_decoy,length=1297>\n##contig=<ID=Un_JTFH01001125v1_decoy,length=1296>\n##contig=<ID=Un_JTFH01001126v1_decoy,length=1290>\n##contig=<ID=Un_JTFH01001127v1_decoy,length=1284>\n##contig=<ID=Un_JTFH01001128v1_decoy,length=1282>\n##contig=<ID=Un_JTFH01001129v1_decoy,length=1281>\n##contig=<ID=Un_JTFH01001130v1_decoy,length=1280>\n##contig=<ID=Un_JTFH01001131v1_decoy,length=1279>\n##contig=<ID=Un_JTFH01001132v1_decoy,length=1272>\n##contig=<ID=Un_JTFH01001133v1_decoy,length=1267>\n##contig=<ID=Un_JTFH01001134v1_decoy,length=1267>\n##contig=<ID=Un_JTFH01001135v1_decoy,length=1266>\n##contig=<ID=Un_JTFH01001136v1_decoy,length=1264>\n##contig=<ID=Un_JTFH01001137v1_decoy,length=1264>\n##contig=<ID=Un_JTFH01001138v1_decoy,length=1264>\n##contig=<ID=Un_JTFH01001139v1_decoy,length=1263>\n##contig=<ID=Un_JTFH01001140v1_decoy,length=1249>\n##contig=<ID=Un_JTFH01001141v1_decoy,length=1240>\n##contig=<ID=Un_JTFH01001142v1_decoy,length=1239>\n##contig=<ID=Un_JTFH01001143v1_decoy,length=1235>\n##contig=<ID=Un_JTFH01001144v1_decoy,length=1235>\n##contig=<ID=Un_JTFH01001145v1_decoy,length=1233>\n##contig=<ID=Un_JTFH01001146v1_decoy,length=1232>\n##contig=<ID=Un_JTFH01001147v1_decoy,length=1230>\n##contig=<ID=Un_JTFH01001148v1_decoy,length=1226>\n##contig=<ID=Un_JTFH01001149v1_decoy,length=1223>\n##contig=<ID=Un_JTFH01001150v1_decoy,length=1214>\n##contig=<ID=Un_JTFH01001151v1_decoy,length=1213>\n##contig=<ID=Un_JTFH01001152v1_decoy,length=1211>\n##contig=<ID=Un_JTFH01001153v1_decoy,length=1209>\n##contig=<ID=Un_JTFH01001154v1_decoy,length=1202>\n##contig=<ID=Un_JTFH01001155v1_decoy,length=1199>\n##contig=<ID=Un_JTFH01001156v1_decoy,length=1197>\n##contig=<ID=Un_JTFH01001157v1_decoy,length=1193>\n##contig=<ID=Un_JTFH01001158v1_decoy,length=1191>\n##contig=<ID=Un_JTFH01001159v1_decoy,length=1187>\n##contig=<ID=Un_JTFH01001160v1_decoy,length=1186>\n##contig=<ID=Un_JTFH01001161v1_decoy,length=1184>\n##contig=<ID=Un_JTFH01001162v1_decoy,length=1184>\n##contig=<ID=Un_JTFH01001163v1_decoy,length=1182>\n##contig=<ID=Un_JTFH01001164v1_decoy,length=1179>\n##contig=<ID=Un_JTFH01001165v1_decoy,length=1173>\n##contig=<ID=Un_JTFH01001166v1_decoy,length=1169>\n##contig=<ID=Un_JTFH01001167v1_decoy,length=1167>\n##contig=<ID=Un_JTFH01001168v1_decoy,length=1166>\n##contig=<ID=Un_JTFH01001169v1_decoy,length=1165>\n##contig=<ID=Un_JTFH01001170v1_decoy,length=1164>\n##contig=<ID=Un_JTFH01001171v1_decoy,length=1163>\n##contig=<ID=Un_JTFH01001172v1_decoy,length=1158>\n##contig=<ID=Un_JTFH01001173v1_decoy,length=1158>\n##contig=<ID=Un_JTFH01001174v1_decoy,length=1157>\n##contig=<ID=Un_JTFH01001175v1_decoy,length=1157>\n##contig=<ID=Un_JTFH01001176v1_decoy,length=1157>\n##contig=<ID=Un_JTFH01001177v1_decoy,length=1155>\n##contig=<ID=Un_JTFH01001178v1_decoy,length=1154>\n##contig=<ID=Un_JTFH01001179v1_decoy,length=1149>\n##contig=<ID=Un_JTFH01001180v1_decoy,length=1148>\n##contig=<ID=Un_JTFH01001181v1_decoy,length=1148>\n##contig=<ID=Un_JTFH01001182v1_decoy,length=1146>\n##contig=<ID=Un_JTFH01001183v1_decoy,length=1144>\n##contig=<ID=Un_JTFH01001184v1_decoy,length=1140>\n##contig=<ID=Un_JTFH01001185v1_decoy,length=1136>\n##contig=<ID=Un_JTFH01001186v1_decoy,length=1134>\n##contig=<ID=Un_JTFH01001187v1_decoy,length=1133>\n##contig=<ID=Un_JTFH01001188v1_decoy,length=1129>\n##contig=<ID=Un_JTFH01001189v1_decoy,length=1127>\n##contig=<ID=Un_JTFH01001190v1_decoy,length=1127>\n##contig=<ID=Un_JTFH01001191v1_decoy,length=1118>\n##contig=<ID=Un_JTFH01001192v1_decoy,length=1110>\n##contig=<ID=Un_JTFH01001193v1_decoy,length=1104>\n##contig=<ID=Un_JTFH01001194v1_decoy,length=1104>\n##contig=<ID=Un_JTFH01001195v1_decoy,length=1101>\n##contig=<ID=Un_JTFH01001196v1_decoy,length=1098>\n##contig=<ID=Un_JTFH01001197v1_decoy,length=1096>\n##contig=<ID=Un_JTFH01001198v1_decoy,length=1094>\n##contig=<ID=Un_JTFH01001199v1_decoy,length=1091>\n##contig=<ID=Un_JTFH01001200v1_decoy,length=1089>\n##contig=<ID=Un_JTFH01001201v1_decoy,length=1086>\n##contig=<ID=Un_JTFH01001202v1_decoy,length=1085>\n##contig=<ID=Un_JTFH01001203v1_decoy,length=1084>\n##contig=<ID=Un_JTFH01001204v1_decoy,length=1083>\n##contig=<ID=Un_JTFH01001205v1_decoy,length=1083>\n##contig=<ID=Un_JTFH01001206v1_decoy,length=1079>\n##contig=<ID=Un_JTFH01001207v1_decoy,length=1076>\n##contig=<ID=Un_JTFH01001208v1_decoy,length=1069>\n##contig=<ID=Un_JTFH01001209v1_decoy,length=1068>\n##contig=<ID=Un_JTFH01001210v1_decoy,length=1067>\n##contig=<ID=Un_JTFH01001211v1_decoy,length=1067>\n##contig=<ID=Un_JTFH01001212v1_decoy,length=1067>\n##contig=<ID=Un_JTFH01001213v1_decoy,length=1063>\n##contig=<ID=Un_JTFH01001214v1_decoy,length=1062>\n##contig=<ID=Un_JTFH01001215v1_decoy,length=1059>\n##contig=<ID=Un_JTFH01001216v1_decoy,length=1058>\n##contig=<ID=Un_JTFH01001217v1_decoy,length=1058>\n##contig=<ID=Un_JTFH01001218v1_decoy,length=1055>\n##contig=<ID=Un_JTFH01001219v1_decoy,length=1054>\n##contig=<ID=Un_JTFH01001220v1_decoy,length=1054>\n##contig=<ID=Un_JTFH01001221v1_decoy,length=1053>\n##contig=<ID=Un_JTFH01001222v1_decoy,length=1053>\n##contig=<ID=Un_JTFH01001223v1_decoy,length=1052>\n##contig=<ID=Un_JTFH01001224v1_decoy,length=1051>\n##contig=<ID=Un_JTFH01001225v1_decoy,length=1049>\n##contig=<ID=Un_JTFH01001226v1_decoy,length=1047>\n##contig=<ID=Un_JTFH01001227v1_decoy,length=1044>\n##contig=<ID=Un_JTFH01001228v1_decoy,length=1043>\n##contig=<ID=Un_JTFH01001229v1_decoy,length=1043>\n##contig=<ID=Un_JTFH01001230v1_decoy,length=1042>\n##contig=<ID=Un_JTFH01001231v1_decoy,length=1042>\n##contig=<ID=Un_JTFH01001232v1_decoy,length=1041>\n##contig=<ID=Un_JTFH01001233v1_decoy,length=1040>\n##contig=<ID=Un_JTFH01001234v1_decoy,length=1039>\n##contig=<ID=Un_JTFH01001235v1_decoy,length=1038>\n##contig=<ID=Un_JTFH01001236v1_decoy,length=1037>\n##contig=<ID=Un_JTFH01001237v1_decoy,length=1037>\n##contig=<ID=Un_JTFH01001238v1_decoy,length=1035>\n##contig=<ID=Un_JTFH01001239v1_decoy,length=1027>\n##contig=<ID=Un_JTFH01001240v1_decoy,length=1021>\n##contig=<ID=Un_JTFH01001241v1_decoy,length=1021>\n##contig=<ID=Un_JTFH01001242v1_decoy,length=1019>\n##contig=<ID=Un_JTFH01001243v1_decoy,length=1019>\n##contig=<ID=Un_JTFH01001244v1_decoy,length=1016>\n##contig=<ID=Un_JTFH01001245v1_decoy,length=1014>\n##contig=<ID=Un_JTFH01001246v1_decoy,length=1013>\n##contig=<ID=Un_JTFH01001247v1_decoy,length=1009>\n##contig=<ID=Un_JTFH01001248v1_decoy,length=1008>\n##contig=<ID=Un_JTFH01001249v1_decoy,length=1007>\n##contig=<ID=Un_JTFH01001250v1_decoy,length=1004>\n##contig=<ID=Un_JTFH01001251v1_decoy,length=1004>\n##contig=<ID=Un_JTFH01001252v1_decoy,length=1003>\n##contig=<ID=Un_JTFH01001253v1_decoy,length=1001>\n##contig=<ID=Un_JTFH01001254v1_decoy,length=1000>\n##contig=<ID=Un_JTFH01001255v1_decoy,length=1000>\n##contig=<ID=Un_JTFH01001256v1_decoy,length=1000>\n##contig=<ID=Un_JTFH01001257v1_decoy,length=17929>\n##contig=<ID=Un_JTFH01001258v1_decoy,length=9749>\n##contig=<ID=Un_JTFH01001259v1_decoy,length=8053>\n##contig=<ID=Un_JTFH01001260v1_decoy,length=7826>\n##contig=<ID=Un_JTFH01001261v1_decoy,length=7768>\n##contig=<ID=Un_JTFH01001262v1_decoy,length=5691>\n##contig=<ID=Un_JTFH01001263v1_decoy,length=5444>\n##contig=<ID=Un_JTFH01001264v1_decoy,length=5077>\n##contig=<ID=Un_JTFH01001265v1_decoy,length=4990>\n##contig=<ID=Un_JTFH01001266v1_decoy,length=4545>\n##contig=<ID=Un_JTFH01001267v1_decoy,length=4544>\n##contig=<ID=Un_JTFH01001268v1_decoy,length=4202>\n##contig=<ID=Un_JTFH01001269v1_decoy,length=4195>\n##contig=<ID=Un_JTFH01001270v1_decoy,length=3807>\n##contig=<ID=Un_JTFH01001271v1_decoy,length=3741>\n##contig=<ID=Un_JTFH01001272v1_decoy,length=3699>\n##contig=<ID=Un_JTFH01001273v1_decoy,length=3640>\n##contig=<ID=Un_JTFH01001274v1_decoy,length=3531>\n##contig=<ID=Un_JTFH01001275v1_decoy,length=3455>\n##contig=<ID=Un_JTFH01001276v1_decoy,length=3411>\n##contig=<ID=Un_JTFH01001277v1_decoy,length=3387>\n##contig=<ID=Un_JTFH01001278v1_decoy,length=3358>\n##contig=<ID=Un_JTFH01001279v1_decoy,length=3285>\n##contig=<ID=Un_JTFH01001280v1_decoy,length=3273>\n##contig=<ID=Un_JTFH01001281v1_decoy,length=3262>\n##contig=<ID=Un_JTFH01001282v1_decoy,length=3259>\n##contig=<ID=Un_JTFH01001283v1_decoy,length=3222>\n##contig=<ID=Un_JTFH01001284v1_decoy,length=3127>\n##contig=<ID=Un_JTFH01001285v1_decoy,length=3110>\n##contig=<ID=Un_JTFH01001286v1_decoy,length=3104>\n##contig=<ID=Un_JTFH01001287v1_decoy,length=3071>\n##contig=<ID=Un_JTFH01001288v1_decoy,length=3063>\n##contig=<ID=Un_JTFH01001289v1_decoy,length=3059>\n##contig=<ID=Un_JTFH01001290v1_decoy,length=2990>\n##contig=<ID=Un_JTFH01001291v1_decoy,length=2986>\n##contig=<ID=Un_JTFH01001292v1_decoy,length=2928>\n##contig=<ID=Un_JTFH01001293v1_decoy,length=2922>\n##contig=<ID=Un_JTFH01001294v1_decoy,length=2875>\n##contig=<ID=Un_JTFH01001295v1_decoy,length=2859>\n##contig=<ID=Un_JTFH01001296v1_decoy,length=2850>\n##contig=<ID=Un_JTFH01001297v1_decoy,length=2813>\n##contig=<ID=Un_JTFH01001298v1_decoy,length=2785>\n##contig=<ID=Un_JTFH01001299v1_decoy,length=2736>\n##contig=<ID=Un_JTFH01001300v1_decoy,length=2688>\n##contig=<ID=Un_JTFH01001301v1_decoy,length=2658>\n##contig=<ID=Un_JTFH01001302v1_decoy,length=2643>\n##contig=<ID=Un_JTFH01001303v1_decoy,length=2618>\n##contig=<ID=Un_JTFH01001304v1_decoy,length=2605>\n##contig=<ID=Un_JTFH01001305v1_decoy,length=2583>\n##contig=<ID=Un_JTFH01001306v1_decoy,length=2534>\n##contig=<ID=Un_JTFH01001307v1_decoy,length=2512>\n##contig=<ID=Un_JTFH01001308v1_decoy,length=2500>\n##contig=<ID=Un_JTFH01001309v1_decoy,length=2481>\n##contig=<ID=Un_JTFH01001310v1_decoy,length=2478>\n##contig=<ID=Un_JTFH01001311v1_decoy,length=2473>\n##contig=<ID=Un_JTFH01001312v1_decoy,length=2467>\n##contig=<ID=Un_JTFH01001313v1_decoy,length=2442>\n##contig=<ID=Un_JTFH01001314v1_decoy,length=2430>\n##contig=<ID=Un_JTFH01001315v1_decoy,length=2417>\n##contig=<ID=Un_JTFH01001316v1_decoy,length=2408>\n##contig=<ID=Un_JTFH01001317v1_decoy,length=2395>\n##contig=<ID=Un_JTFH01001318v1_decoy,length=2352>\n##contig=<ID=Un_JTFH01001319v1_decoy,length=2337>\n##contig=<ID=Un_JTFH01001320v1_decoy,length=2322>\n##contig=<ID=Un_JTFH01001321v1_decoy,length=2307>\n##contig=<ID=Un_JTFH01001322v1_decoy,length=2306>\n##contig=<ID=Un_JTFH01001323v1_decoy,length=2292>\n##contig=<ID=Un_JTFH01001324v1_decoy,length=2271>\n##contig=<ID=Un_JTFH01001325v1_decoy,length=2265>\n##contig=<ID=Un_JTFH01001326v1_decoy,length=2260>\n##contig=<ID=Un_JTFH01001327v1_decoy,length=2240>\n##contig=<ID=Un_JTFH01001328v1_decoy,length=2238>\n##contig=<ID=Un_JTFH01001329v1_decoy,length=2228>\n##contig=<ID=Un_JTFH01001330v1_decoy,length=2215>\n##contig=<ID=Un_JTFH01001331v1_decoy,length=2205>\n##contig=<ID=Un_JTFH01001332v1_decoy,length=2191>\n##contig=<ID=Un_JTFH01001333v1_decoy,length=2191>\n##contig=<ID=Un_JTFH01001334v1_decoy,length=2190>\n##contig=<ID=Un_JTFH01001335v1_decoy,length=2184>\n##contig=<ID=Un_JTFH01001336v1_decoy,length=2166>\n##contig=<ID=Un_JTFH01001337v1_decoy,length=2165>\n##contig=<ID=Un_JTFH01001338v1_decoy,length=2162>\n##contig=<ID=Un_JTFH01001339v1_decoy,length=2146>\n##contig=<ID=Un_JTFH01001340v1_decoy,length=2116>\n##contig=<ID=Un_JTFH01001341v1_decoy,length=2112>\n##contig=<ID=Un_JTFH01001342v1_decoy,length=2108>\n##contig=<ID=Un_JTFH01001343v1_decoy,length=2106>\n##contig=<ID=Un_JTFH01001344v1_decoy,length=2106>\n##contig=<ID=Un_JTFH01001345v1_decoy,length=2106>\n##contig=<ID=Un_JTFH01001346v1_decoy,length=2097>\n##contig=<ID=Un_JTFH01001347v1_decoy,length=2081>\n##contig=<ID=Un_JTFH01001348v1_decoy,length=2058>\n##contig=<ID=Un_JTFH01001349v1_decoy,length=2055>\n##contig=<ID=Un_JTFH01001350v1_decoy,length=2054>\n##contig=<ID=Un_JTFH01001351v1_decoy,length=2037>\n##contig=<ID=Un_JTFH01001352v1_decoy,length=2032>\n##contig=<ID=Un_JTFH01001353v1_decoy,length=2032>\n##contig=<ID=Un_JTFH01001354v1_decoy,length=2020>\n##contig=<ID=Un_JTFH01001355v1_decoy,length=2018>\n##contig=<ID=Un_JTFH01001356v1_decoy,length=2014>\n##contig=<ID=Un_JTFH01001357v1_decoy,length=2001>\n##contig=<ID=Un_JTFH01001358v1_decoy,length=2001>\n##contig=<ID=Un_JTFH01001359v1_decoy,length=1991>\n##contig=<ID=Un_JTFH01001360v1_decoy,length=1990>\n##contig=<ID=Un_JTFH01001361v1_decoy,length=1983>\n##contig=<ID=Un_JTFH01001362v1_decoy,length=1981>\n##contig=<ID=Un_JTFH01001363v1_decoy,length=1981>\n##contig=<ID=Un_JTFH01001364v1_decoy,length=1979>\n##contig=<ID=Un_JTFH01001365v1_decoy,length=1963>\n##contig=<ID=Un_JTFH01001366v1_decoy,length=1932>\n##contig=<ID=Un_JTFH01001367v1_decoy,length=1929>\n##contig=<ID=Un_JTFH01001368v1_decoy,length=1881>\n##contig=<ID=Un_JTFH01001369v1_decoy,length=1874>\n##contig=<ID=Un_JTFH01001370v1_decoy,length=1849>\n##contig=<ID=Un_JTFH01001371v1_decoy,length=1849>\n##contig=<ID=Un_JTFH01001372v1_decoy,length=1833>\n##contig=<ID=Un_JTFH01001373v1_decoy,length=1832>\n##contig=<ID=Un_JTFH01001374v1_decoy,length=1826>\n##contig=<ID=Un_JTFH01001375v1_decoy,length=1814>\n##contig=<ID=Un_JTFH01001376v1_decoy,length=1814>\n##contig=<ID=Un_JTFH01001377v1_decoy,length=1791>\n##contig=<ID=Un_JTFH01001378v1_decoy,length=1789>\n##contig=<ID=Un_JTFH01001379v1_decoy,length=1786>\n##contig=<ID=Un_JTFH01001380v1_decoy,length=1778>\n##contig=<ID=Un_JTFH01001381v1_decoy,length=1776>\n##contig=<ID=Un_JTFH01001382v1_decoy,length=1762>\n##contig=<ID=Un_JTFH01001383v1_decoy,length=1758>\n##contig=<ID=Un_JTFH01001384v1_decoy,length=1757>\n##contig=<ID=Un_JTFH01001385v1_decoy,length=1754>\n##contig=<ID=Un_JTFH01001386v1_decoy,length=1752>\n##contig=<ID=Un_JTFH01001387v1_decoy,length=1751>\n##contig=<ID=Un_JTFH01001388v1_decoy,length=1749>\n##contig=<ID=Un_JTFH01001389v1_decoy,length=1738>\n##contig=<ID=Un_JTFH01001390v1_decoy,length=1729>\n##contig=<ID=Un_JTFH01001391v1_decoy,length=1726>\n##contig=<ID=Un_JTFH01001392v1_decoy,length=1716>\n##contig=<ID=Un_JTFH01001393v1_decoy,length=1712>\n##contig=<ID=Un_JTFH01001394v1_decoy,length=1711>\n##contig=<ID=Un_JTFH01001395v1_decoy,length=1703>\n##contig=<ID=Un_JTFH01001396v1_decoy,length=1702>\n##contig=<ID=Un_JTFH01001397v1_decoy,length=1699>\n##contig=<ID=Un_JTFH01001398v1_decoy,length=1686>\n##contig=<ID=Un_JTFH01001399v1_decoy,length=1684>\n##contig=<ID=Un_JTFH01001400v1_decoy,length=1680>\n##contig=<ID=Un_JTFH01001401v1_decoy,length=1678>\n##contig=<ID=Un_JTFH01001402v1_decoy,length=1678>\n##contig=<ID=Un_JTFH01001403v1_decoy,length=1677>\n##contig=<ID=Un_JTFH01001404v1_decoy,length=1676>\n##contig=<ID=Un_JTFH01001405v1_decoy,length=1672>\n##contig=<ID=Un_JTFH01001406v1_decoy,length=1669>\n##contig=<ID=Un_JTFH01001407v1_decoy,length=1668>\n##contig=<ID=Un_JTFH01001408v1_decoy,length=1663>\n##contig=<ID=Un_JTFH01001409v1_decoy,length=1660>\n##contig=<ID=Un_JTFH01001410v1_decoy,length=1660>\n##contig=<ID=Un_JTFH01001411v1_decoy,length=1658>\n##contig=<ID=Un_JTFH01001412v1_decoy,length=1656>\n##contig=<ID=Un_JTFH01001413v1_decoy,length=1656>\n##contig=<ID=Un_JTFH01001414v1_decoy,length=1652>\n##contig=<ID=Un_JTFH01001415v1_decoy,length=1647>\n##contig=<ID=Un_JTFH01001416v1_decoy,length=1645>\n##contig=<ID=Un_JTFH01001417v1_decoy,length=1641>\n##contig=<ID=Un_JTFH01001418v1_decoy,length=1638>\n##contig=<ID=Un_JTFH01001419v1_decoy,length=1633>\n##contig=<ID=Un_JTFH01001420v1_decoy,length=1626>\n##contig=<ID=Un_JTFH01001421v1_decoy,length=1614>\n##contig=<ID=Un_JTFH01001422v1_decoy,length=1612>\n##contig=<ID=Un_JTFH01001423v1_decoy,length=1605>\n##contig=<ID=Un_JTFH01001424v1_decoy,length=1603>\n##contig=<ID=Un_JTFH01001425v1_decoy,length=1599>\n##contig=<ID=Un_JTFH01001426v1_decoy,length=1589>\n##contig=<ID=Un_JTFH01001427v1_decoy,length=1588>\n##contig=<ID=Un_JTFH01001428v1_decoy,length=1585>\n##contig=<ID=Un_JTFH01001429v1_decoy,length=1584>\n##contig=<ID=Un_JTFH01001430v1_decoy,length=1584>\n##contig=<ID=Un_JTFH01001431v1_decoy,length=1580>\n##contig=<ID=Un_JTFH01001432v1_decoy,length=1572>\n##contig=<ID=Un_JTFH01001433v1_decoy,length=1570>\n##contig=<ID=Un_JTFH01001434v1_decoy,length=1569>\n##contig=<ID=Un_JTFH01001435v1_decoy,length=1568>\n##contig=<ID=Un_JTFH01001436v1_decoy,length=1567>\n##contig=<ID=Un_JTFH01001437v1_decoy,length=1565>\n##contig=<ID=Un_JTFH01001438v1_decoy,length=1559>\n##contig=<ID=Un_JTFH01001439v1_decoy,length=1559>\n##contig=<ID=Un_JTFH01001440v1_decoy,length=1556>\n##contig=<ID=Un_JTFH01001441v1_decoy,length=1554>\n##contig=<ID=Un_JTFH01001442v1_decoy,length=1549>\n##contig=<ID=Un_JTFH01001443v1_decoy,length=1542>\n##contig=<ID=Un_JTFH01001444v1_decoy,length=1541>\n##contig=<ID=Un_JTFH01001445v1_decoy,length=1538>\n##contig=<ID=Un_JTFH01001446v1_decoy,length=1537>\n##contig=<ID=Un_JTFH01001447v1_decoy,length=1535>\n##contig=<ID=Un_JTFH01001448v1_decoy,length=1530>\n##contig=<ID=Un_JTFH01001449v1_decoy,length=1528>\n##contig=<ID=Un_JTFH01001450v1_decoy,length=1522>\n##contig=<ID=Un_JTFH01001451v1_decoy,length=1514>\n##contig=<ID=Un_JTFH01001452v1_decoy,length=1509>\n##contig=<ID=Un_JTFH01001453v1_decoy,length=1507>\n##contig=<ID=Un_JTFH01001454v1_decoy,length=1500>\n##contig=<ID=Un_JTFH01001455v1_decoy,length=1499>\n##contig=<ID=Un_JTFH01001456v1_decoy,length=1499>\n##contig=<ID=Un_JTFH01001457v1_decoy,length=1497>\n##contig=<ID=Un_JTFH01001458v1_decoy,length=1496>\n##contig=<ID=Un_JTFH01001459v1_decoy,length=1488>\n##contig=<ID=Un_JTFH01001460v1_decoy,length=1486>\n##contig=<ID=Un_JTFH01001461v1_decoy,length=1485>\n##contig=<ID=Un_JTFH01001462v1_decoy,length=1481>\n##contig=<ID=Un_JTFH01001463v1_decoy,length=1479>\n##contig=<ID=Un_JTFH01001464v1_decoy,length=1472>\n##contig=<ID=Un_JTFH01001465v1_decoy,length=1472>\n##contig=<ID=Un_JTFH01001466v1_decoy,length=1470>\n##contig=<ID=Un_JTFH01001467v1_decoy,length=1466>\n##contig=<ID=Un_JTFH01001468v1_decoy,length=1465>\n##contig=<ID=Un_JTFH01001469v1_decoy,length=1461>\n##contig=<ID=Un_JTFH01001470v1_decoy,length=1458>\n##contig=<ID=Un_JTFH01001471v1_decoy,length=1457>\n##contig=<ID=Un_JTFH01001472v1_decoy,length=1448>\n##contig=<ID=Un_JTFH01001473v1_decoy,length=1447>\n##contig=<ID=Un_JTFH01001474v1_decoy,length=1444>\n##contig=<ID=Un_JTFH01001475v1_decoy,length=1443>\n##contig=<ID=Un_JTFH01001476v1_decoy,length=1443>\n##contig=<ID=Un_JTFH01001477v1_decoy,length=1438>\n##contig=<ID=Un_JTFH01001478v1_decoy,length=1432>\n##contig=<ID=Un_JTFH01001479v1_decoy,length=1430>\n##contig=<ID=Un_JTFH01001480v1_decoy,length=1430>\n##contig=<ID=Un_JTFH01001481v1_decoy,length=1429>\n##contig=<ID=Un_JTFH01001482v1_decoy,length=1429>\n##contig=<ID=Un_JTFH01001483v1_decoy,length=1429>\n##contig=<ID=Un_JTFH01001484v1_decoy,length=1426>\n##contig=<ID=Un_JTFH01001485v1_decoy,length=1426>\n##contig=<ID=Un_JTFH01001486v1_decoy,length=1420>\n##contig=<ID=Un_JTFH01001487v1_decoy,length=1416>\n##contig=<ID=Un_JTFH01001488v1_decoy,length=1416>\n##contig=<ID=Un_JTFH01001489v1_decoy,length=1415>\n##contig=<ID=Un_JTFH01001490v1_decoy,length=1415>\n##contig=<ID=Un_JTFH01001491v1_decoy,length=1414>\n##contig=<ID=Un_JTFH01001492v1_decoy,length=1413>\n##contig=<ID=Un_JTFH01001493v1_decoy,length=1410>\n##contig=<ID=Un_JTFH01001494v1_decoy,length=1405>\n##contig=<ID=Un_JTFH01001495v1_decoy,length=1402>\n##contig=<ID=Un_JTFH01001496v1_decoy,length=1398>\n##contig=<ID=Un_JTFH01001497v1_decoy,length=1397>\n##contig=<ID=Un_JTFH01001498v1_decoy,length=1395>\n##contig=<ID=Un_JTFH01001499v1_decoy,length=1392>\n##contig=<ID=Un_JTFH01001500v1_decoy,length=1388>\n##contig=<ID=Un_JTFH01001501v1_decoy,length=1386>\n##contig=<ID=Un_JTFH01001502v1_decoy,length=1382>\n##contig=<ID=Un_JTFH01001503v1_decoy,length=1381>\n##contig=<ID=Un_JTFH01001504v1_decoy,length=1379>\n##contig=<ID=Un_JTFH01001505v1_decoy,length=1376>\n##contig=<ID=Un_JTFH01001506v1_decoy,length=1374>\n##contig=<ID=Un_JTFH01001507v1_decoy,length=1374>\n##contig=<ID=Un_JTFH01001508v1_decoy,length=1373>\n##contig=<ID=Un_JTFH01001509v1_decoy,length=1373>\n##contig=<ID=Un_JTFH01001510v1_decoy,length=1372>\n##contig=<ID=Un_JTFH01001511v1_decoy,length=1370>\n##contig=<ID=Un_JTFH01001512v1_decoy,length=1367>\n##contig=<ID=Un_JTFH01001513v1_decoy,length=1365>\n##contig=<ID=Un_JTFH01001514v1_decoy,length=1364>\n##contig=<ID=Un_JTFH01001515v1_decoy,length=1361>\n##contig=<ID=Un_JTFH01001516v1_decoy,length=1361>\n##contig=<ID=Un_JTFH01001517v1_decoy,length=1355>\n##contig=<ID=Un_JTFH01001518v1_decoy,length=1355>\n##contig=<ID=Un_JTFH01001519v1_decoy,length=1354>\n##contig=<ID=Un_JTFH01001520v1_decoy,length=1353>\n##contig=<ID=Un_JTFH01001521v1_decoy,length=1349>\n##contig=<ID=Un_JTFH01001522v1_decoy,length=1345>\n##contig=<ID=Un_JTFH01001523v1_decoy,length=1344>\n##contig=<ID=Un_JTFH01001524v1_decoy,length=1343>\n##contig=<ID=Un_JTFH01001525v1_decoy,length=1338>\n##contig=<ID=Un_JTFH01001526v1_decoy,length=1338>\n##contig=<ID=Un_JTFH01001527v1_decoy,length=1338>\n##contig=<ID=Un_JTFH01001528v1_decoy,length=1336>\n##contig=<ID=Un_JTFH01001529v1_decoy,length=1333>\n##contig=<ID=Un_JTFH01001530v1_decoy,length=1333>\n##contig=<ID=Un_JTFH01001531v1_decoy,length=1332>\n##contig=<ID=Un_JTFH01001532v1_decoy,length=1324>\n##contig=<ID=Un_JTFH01001533v1_decoy,length=1323>\n##contig=<ID=Un_JTFH01001534v1_decoy,length=1323>\n##contig=<ID=Un_JTFH01001535v1_decoy,length=1320>\n##contig=<ID=Un_JTFH01001536v1_decoy,length=1320>\n##contig=<ID=Un_JTFH01001537v1_decoy,length=1317>\n##contig=<ID=Un_JTFH01001538v1_decoy,length=1316>\n##contig=<ID=Un_JTFH01001539v1_decoy,length=1304>\n##contig=<ID=Un_JTFH01001540v1_decoy,length=1304>\n##contig=<ID=Un_JTFH01001541v1_decoy,length=1303>\n##contig=<ID=Un_JTFH01001542v1_decoy,length=1302>\n##contig=<ID=Un_JTFH01001543v1_decoy,length=1301>\n##contig=<ID=Un_JTFH01001544v1_decoy,length=1300>\n##contig=<ID=Un_JTFH01001545v1_decoy,length=1298>\n##contig=<ID=Un_JTFH01001546v1_decoy,length=1297>\n##contig=<ID=Un_JTFH01001547v1_decoy,length=1295>\n##contig=<ID=Un_JTFH01001548v1_decoy,length=1284>\n##contig=<ID=Un_JTFH01001549v1_decoy,length=1283>\n##contig=<ID=Un_JTFH01001550v1_decoy,length=1283>\n##contig=<ID=Un_JTFH01001551v1_decoy,length=1279>\n##contig=<ID=Un_JTFH01001552v1_decoy,length=1278>\n##contig=<ID=Un_JTFH01001553v1_decoy,length=1271>\n##contig=<ID=Un_JTFH01001554v1_decoy,length=1271>\n##contig=<ID=Un_JTFH01001555v1_decoy,length=1268>\n##contig=<ID=Un_JTFH01001556v1_decoy,length=1264>\n##contig=<ID=Un_JTFH01001557v1_decoy,length=1263>\n##contig=<ID=Un_JTFH01001558v1_decoy,length=1262>\n##contig=<ID=Un_JTFH01001559v1_decoy,length=1261>\n##contig=<ID=Un_JTFH01001560v1_decoy,length=1260>\n##contig=<ID=Un_JTFH01001561v1_decoy,length=1259>\n##contig=<ID=Un_JTFH01001562v1_decoy,length=1259>\n##contig=<ID=Un_JTFH01001563v1_decoy,length=1258>\n##contig=<ID=Un_JTFH01001564v1_decoy,length=1256>\n##contig=<ID=Un_JTFH01001565v1_decoy,length=1253>\n##contig=<ID=Un_JTFH01001566v1_decoy,length=1248>\n##contig=<ID=Un_JTFH01001567v1_decoy,length=1248>\n##contig=<ID=Un_JTFH01001568v1_decoy,length=1246>\n##contig=<ID=Un_JTFH01001569v1_decoy,length=1246>\n##contig=<ID=Un_JTFH01001570v1_decoy,length=1244>\n##contig=<ID=Un_JTFH01001571v1_decoy,length=1238>\n##contig=<ID=Un_JTFH01001572v1_decoy,length=1238>\n##contig=<ID=Un_JTFH01001573v1_decoy,length=1236>\n##contig=<ID=Un_JTFH01001574v1_decoy,length=1234>\n##contig=<ID=Un_JTFH01001575v1_decoy,length=1234>\n##contig=<ID=Un_JTFH01001576v1_decoy,length=1231>\n##contig=<ID=Un_JTFH01001577v1_decoy,length=1231>\n##contig=<ID=Un_JTFH01001578v1_decoy,length=1230>\n##contig=<ID=Un_JTFH01001579v1_decoy,length=1230>\n##contig=<ID=Un_JTFH01001580v1_decoy,length=1228>\n##contig=<ID=Un_JTFH01001581v1_decoy,length=1227>\n##contig=<ID=Un_JTFH01001582v1_decoy,length=1222>\n##contig=<ID=Un_JTFH01001583v1_decoy,length=1222>\n##contig=<ID=Un_JTFH01001584v1_decoy,length=1221>\n##contig=<ID=Un_JTFH01001585v1_decoy,length=1221>\n##contig=<ID=Un_JTFH01001586v1_decoy,length=1220>\n##contig=<ID=Un_JTFH01001587v1_decoy,length=1218>\n##contig=<ID=Un_JTFH01001588v1_decoy,length=1218>\n##contig=<ID=Un_JTFH01001589v1_decoy,length=1216>\n##contig=<ID=Un_JTFH01001590v1_decoy,length=1216>\n##contig=<ID=Un_JTFH01001591v1_decoy,length=1212>\n##contig=<ID=Un_JTFH01001592v1_decoy,length=1210>\n##contig=<ID=Un_JTFH01001593v1_decoy,length=1209>\n##contig=<ID=Un_JTFH01001594v1_decoy,length=1208>\n##contig=<ID=Un_JTFH01001595v1_decoy,length=1208>\n##contig=<ID=Un_JTFH01001596v1_decoy,length=1206>\n##contig=<ID=Un_JTFH01001597v1_decoy,length=1205>\n##contig=<ID=Un_JTFH01001598v1_decoy,length=1205>\n##contig=<ID=Un_JTFH01001599v1_decoy,length=1202>\n##contig=<ID=Un_JTFH01001600v1_decoy,length=1200>\n##contig=<ID=Un_JTFH01001601v1_decoy,length=1199>\n##contig=<ID=Un_JTFH01001602v1_decoy,length=1198>\n##contig=<ID=Un_JTFH01001603v1_decoy,length=1198>\n##contig=<ID=Un_JTFH01001604v1_decoy,length=1198>\n##contig=<ID=Un_JTFH01001605v1_decoy,length=1195>\n##contig=<ID=Un_JTFH01001606v1_decoy,length=1194>\n##contig=<ID=Un_JTFH01001607v1_decoy,length=1191>\n##contig=<ID=Un_JTFH01001608v1_decoy,length=1189>\n##contig=<ID=Un_JTFH01001609v1_decoy,length=1188>\n##contig=<ID=Un_JTFH01001610v1_decoy,length=1180>\n##contig=<ID=Un_JTFH01001611v1_decoy,length=1180>\n##contig=<ID=Un_JTFH01001612v1_decoy,length=1179>\n##contig=<ID=Un_JTFH01001613v1_decoy,length=1172>\n##contig=<ID=Un_JTFH01001614v1_decoy,length=1168>\n##contig=<ID=Un_JTFH01001615v1_decoy,length=1166>\n##contig=<ID=Un_JTFH01001616v1_decoy,length=1157>\n##contig=<ID=Un_JTFH01001617v1_decoy,length=1156>\n##contig=<ID=Un_JTFH01001618v1_decoy,length=1156>\n##contig=<ID=Un_JTFH01001619v1_decoy,length=1155>\n##contig=<ID=Un_JTFH01001620v1_decoy,length=1154>\n##contig=<ID=Un_JTFH01001621v1_decoy,length=1154>\n##contig=<ID=Un_JTFH01001622v1_decoy,length=1149>\n##contig=<ID=Un_JTFH01001623v1_decoy,length=1143>\n##contig=<ID=Un_JTFH01001624v1_decoy,length=1143>\n##contig=<ID=Un_JTFH01001625v1_decoy,length=1140>\n##contig=<ID=Un_JTFH01001626v1_decoy,length=1137>\n##contig=<ID=Un_JTFH01001627v1_decoy,length=1135>\n##contig=<ID=Un_JTFH01001628v1_decoy,length=1135>\n##contig=<ID=Un_JTFH01001629v1_decoy,length=1135>\n##contig=<ID=Un_JTFH01001630v1_decoy,length=1127>\n##contig=<ID=Un_JTFH01001631v1_decoy,length=1127>\n##contig=<ID=Un_JTFH01001632v1_decoy,length=1126>\n##contig=<ID=Un_JTFH01001633v1_decoy,length=1123>\n##contig=<ID=Un_JTFH01001634v1_decoy,length=1123>\n##contig=<ID=Un_JTFH01001635v1_decoy,length=1123>\n##contig=<ID=Un_JTFH01001636v1_decoy,length=1122>\n##contig=<ID=Un_JTFH01001637v1_decoy,length=1122>\n##contig=<ID=Un_JTFH01001638v1_decoy,length=1121>\n##contig=<ID=Un_JTFH01001639v1_decoy,length=1121>\n##contig=<ID=Un_JTFH01001640v1_decoy,length=1119>\n##contig=<ID=Un_JTFH01001641v1_decoy,length=1119>\n##contig=<ID=Un_JTFH01001642v1_decoy,length=1119>\n##contig=<ID=Un_JTFH01001643v1_decoy,length=1118>\n##contig=<ID=Un_JTFH01001644v1_decoy,length=1115>\n##contig=<ID=Un_JTFH01001645v1_decoy,length=1106>\n##contig=<ID=Un_JTFH01001646v1_decoy,length=1106>\n##contig=<ID=Un_JTFH01001647v1_decoy,length=1104>\n##contig=<ID=Un_JTFH01001648v1_decoy,length=1102>\n##contig=<ID=Un_JTFH01001649v1_decoy,length=1101>\n##contig=<ID=Un_JTFH01001650v1_decoy,length=1098>\n##contig=<ID=Un_JTFH01001651v1_decoy,length=1098>\n##contig=<ID=Un_JTFH01001652v1_decoy,length=1096>\n##contig=<ID=Un_JTFH01001653v1_decoy,length=1096>\n##contig=<ID=Un_JTFH01001654v1_decoy,length=1095>\n##contig=<ID=Un_JTFH01001655v1_decoy,length=1093>\n##contig=<ID=Un_JTFH01001656v1_decoy,length=1090>\n##contig=<ID=Un_JTFH01001657v1_decoy,length=1089>\n##contig=<ID=Un_JTFH01001658v1_decoy,length=1087>\n##contig=<ID=Un_JTFH01001659v1_decoy,length=1087>\n##contig=<ID=Un_JTFH01001660v1_decoy,length=1085>\n##contig=<ID=Un_JTFH01001661v1_decoy,length=1085>\n##contig=<ID=Un_JTFH01001662v1_decoy,length=1085>\n##contig=<ID=Un_JTFH01001663v1_decoy,length=1083>\n##contig=<ID=Un_JTFH01001664v1_decoy,length=1080>\n##contig=<ID=Un_JTFH01001665v1_decoy,length=1080>\n##contig=<ID=Un_JTFH01001666v1_decoy,length=1079>\n##contig=<ID=Un_JTFH01001667v1_decoy,length=1079>\n##contig=<ID=Un_JTFH01001668v1_decoy,length=1079>\n##contig=<ID=Un_JTFH01001669v1_decoy,length=1075>\n##contig=<ID=Un_JTFH01001670v1_decoy,length=1074>\n##contig=<ID=Un_JTFH01001671v1_decoy,length=1073>\n##contig=<ID=Un_JTFH01001672v1_decoy,length=1070>\n##contig=<ID=Un_JTFH01001673v1_decoy,length=1068>\n##contig=<ID=Un_JTFH01001674v1_decoy,length=1067>\n##contig=<ID=Un_JTFH01001675v1_decoy,length=1066>\n##contig=<ID=Un_JTFH01001676v1_decoy,length=1066>\n##contig=<ID=Un_JTFH01001677v1_decoy,length=1066>\n##contig=<ID=Un_JTFH01001678v1_decoy,length=1063>\n##contig=<ID=Un_JTFH01001679v1_decoy,length=1063>\n##contig=<ID=Un_JTFH01001680v1_decoy,length=1063>\n##contig=<ID=Un_JTFH01001681v1_decoy,length=1062>\n##contig=<ID=Un_JTFH01001682v1_decoy,length=1058>\n##contig=<ID=Un_JTFH01001683v1_decoy,length=1056>\n##contig=<ID=Un_JTFH01001684v1_decoy,length=1052>\n##contig=<ID=Un_JTFH01001685v1_decoy,length=1051>\n##contig=<ID=Un_JTFH01001686v1_decoy,length=1051>\n##contig=<ID=Un_JTFH01001687v1_decoy,length=1050>\n##contig=<ID=Un_JTFH01001688v1_decoy,length=1048>\n##contig=<ID=Un_JTFH01001689v1_decoy,length=1046>\n##contig=<ID=Un_JTFH01001690v1_decoy,length=1046>\n##contig=<ID=Un_JTFH01001691v1_decoy,length=1045>\n##contig=<ID=Un_JTFH01001692v1_decoy,length=1043>\n##contig=<ID=Un_JTFH01001693v1_decoy,length=1038>\n##contig=<ID=Un_JTFH01001694v1_decoy,length=1036>\n##contig=<ID=Un_JTFH01001695v1_decoy,length=1035>\n##contig=<ID=Un_JTFH01001696v1_decoy,length=1035>\n##contig=<ID=Un_JTFH01001697v1_decoy,length=1035>\n##contig=<ID=Un_JTFH01001698v1_decoy,length=1033>\n##contig=<ID=Un_JTFH01001699v1_decoy,length=1032>\n##contig=<ID=Un_JTFH01001700v1_decoy,length=1031>\n##contig=<ID=Un_JTFH01001701v1_decoy,length=1026>\n##contig=<ID=Un_JTFH01001702v1_decoy,length=1026>\n##contig=<ID=Un_JTFH01001703v1_decoy,length=1026>\n##contig=<ID=Un_JTFH01001704v1_decoy,length=1023>\n##contig=<ID=Un_JTFH01001705v1_decoy,length=1022>\n##contig=<ID=Un_JTFH01001706v1_decoy,length=1020>\n##contig=<ID=Un_JTFH01001707v1_decoy,length=1020>\n##contig=<ID=Un_JTFH01001708v1_decoy,length=1020>\n##contig=<ID=Un_JTFH01001709v1_decoy,length=1019>\n##contig=<ID=Un_JTFH01001710v1_decoy,length=1018>\n##contig=<ID=Un_JTFH01001711v1_decoy,length=1018>\n##contig=<ID=Un_JTFH01001712v1_decoy,length=1017>\n##contig=<ID=Un_JTFH01001713v1_decoy,length=1015>\n##contig=<ID=Un_JTFH01001714v1_decoy,length=1015>\n##contig=<ID=Un_JTFH01001715v1_decoy,length=1015>\n##contig=<ID=Un_JTFH01001716v1_decoy,length=1014>\n##contig=<ID=Un_JTFH01001717v1_decoy,length=1014>\n##contig=<ID=Un_JTFH01001718v1_decoy,length=1013>\n##contig=<ID=Un_JTFH01001719v1_decoy,length=1013>\n##contig=<ID=Un_JTFH01001720v1_decoy,length=1013>\n##contig=<ID=Un_JTFH01001721v1_decoy,length=1012>\n##contig=<ID=Un_JTFH01001722v1_decoy,length=1011>\n##contig=<ID=Un_JTFH01001723v1_decoy,length=1011>\n##contig=<ID=Un_JTFH01001724v1_decoy,length=1009>\n##contig=<ID=Un_JTFH01001725v1_decoy,length=1008>\n##contig=<ID=Un_JTFH01001726v1_decoy,length=1008>\n##contig=<ID=Un_JTFH01001727v1_decoy,length=1007>\n##contig=<ID=Un_JTFH01001728v1_decoy,length=1007>\n##contig=<ID=Un_JTFH01001729v1_decoy,length=1007>\n##contig=<ID=Un_JTFH01001730v1_decoy,length=1006>\n##contig=<ID=Un_JTFH01001731v1_decoy,length=1005>\n##contig=<ID=Un_JTFH01001732v1_decoy,length=1003>\n##contig=<ID=Un_JTFH01001733v1_decoy,length=1001>\n##contig=<ID=Un_JTFH01001734v1_decoy,length=1000>\n##contig=<ID=Un_JTFH01001735v1_decoy,length=19311>\n##contig=<ID=Un_JTFH01001736v1_decoy,length=11713>\n##contig=<ID=Un_JTFH01001737v1_decoy,length=11263>\n##contig=<ID=Un_JTFH01001738v1_decoy,length=9779>\n##contig=<ID=Un_JTFH01001739v1_decoy,length=9568>\n##contig=<ID=Un_JTFH01001740v1_decoy,length=9344>\n##contig=<ID=Un_JTFH01001741v1_decoy,length=9188>\n##contig=<ID=Un_JTFH01001742v1_decoy,length=9100>\n##contig=<ID=Un_JTFH01001743v1_decoy,length=8771>\n##contig=<ID=Un_JTFH01001744v1_decoy,length=8690>\n##contig=<ID=Un_JTFH01001745v1_decoy,length=8566>\n##contig=<ID=Un_JTFH01001746v1_decoy,length=8058>\n##contig=<ID=Un_JTFH01001747v1_decoy,length=7759>\n##contig=<ID=Un_JTFH01001748v1_decoy,length=7585>\n##contig=<ID=Un_JTFH01001749v1_decoy,length=7471>\n##contig=<ID=Un_JTFH01001750v1_decoy,length=7461>\n##contig=<ID=Un_JTFH01001751v1_decoy,length=7342>\n##contig=<ID=Un_JTFH01001752v1_decoy,length=7223>\n##contig=<ID=Un_JTFH01001753v1_decoy,length=7064>\n##contig=<ID=Un_JTFH01001754v1_decoy,length=6916>\n##contig=<ID=Un_JTFH01001755v1_decoy,length=6897>\n##contig=<ID=Un_JTFH01001756v1_decoy,length=6880>\n##contig=<ID=Un_JTFH01001757v1_decoy,length=6857>\n##contig=<ID=Un_JTFH01001758v1_decoy,length=6840>\n##contig=<ID=Un_JTFH01001759v1_decoy,length=6728>\n##contig=<ID=Un_JTFH01001760v1_decoy,length=6688>\n##contig=<ID=Un_JTFH01001761v1_decoy,length=6553>\n##contig=<ID=Un_JTFH01001762v1_decoy,length=6396>\n##contig=<ID=Un_JTFH01001763v1_decoy,length=6345>\n##contig=<ID=Un_JTFH01001764v1_decoy,length=6295>\n##contig=<ID=Un_JTFH01001765v1_decoy,length=6266>\n##contig=<ID=Un_JTFH01001766v1_decoy,length=6173>\n##contig=<ID=Un_JTFH01001767v1_decoy,length=6171>\n##contig=<ID=Un_JTFH01001768v1_decoy,length=6120>\n##contig=<ID=Un_JTFH01001769v1_decoy,length=6105>\n##contig=<ID=Un_JTFH01001770v1_decoy,length=6099>\n##contig=<ID=Un_JTFH01001771v1_decoy,length=5893>\n##contig=<ID=Un_JTFH01001772v1_decoy,length=5829>\n##contig=<ID=Un_JTFH01001773v1_decoy,length=5793>\n##contig=<ID=Un_JTFH01001774v1_decoy,length=5776>\n##contig=<ID=Un_JTFH01001775v1_decoy,length=5759>\n##contig=<ID=Un_JTFH01001776v1_decoy,length=5716>\n##contig=<ID=Un_JTFH01001777v1_decoy,length=5708>\n##contig=<ID=Un_JTFH01001778v1_decoy,length=5590>\n##contig=<ID=Un_JTFH01001779v1_decoy,length=5566>\n##contig=<ID=Un_JTFH01001780v1_decoy,length=5558>\n##contig=<ID=Un_JTFH01001781v1_decoy,length=5418>\n##contig=<ID=Un_JTFH01001782v1_decoy,length=5375>\n##contig=<ID=Un_JTFH01001783v1_decoy,length=5300>\n##contig=<ID=Un_JTFH01001784v1_decoy,length=5255>\n##contig=<ID=Un_JTFH01001785v1_decoy,length=5157>\n##contig=<ID=Un_JTFH01001786v1_decoy,length=5130>\n##contig=<ID=Un_JTFH01001787v1_decoy,length=4978>\n##contig=<ID=Un_JTFH01001788v1_decoy,length=4957>\n##contig=<ID=Un_JTFH01001789v1_decoy,length=4947>\n##contig=<ID=Un_JTFH01001790v1_decoy,length=4897>\n##contig=<ID=Un_JTFH01001791v1_decoy,length=4867>\n##contig=<ID=Un_JTFH01001792v1_decoy,length=4845>\n##contig=<ID=Un_JTFH01001793v1_decoy,length=4678>\n##contig=<ID=Un_JTFH01001794v1_decoy,length=4641>\n##contig=<ID=Un_JTFH01001795v1_decoy,length=4592>\n##contig=<ID=Un_JTFH01001796v1_decoy,length=4543>\n##contig=<ID=Un_JTFH01001797v1_decoy,length=4532>\n##contig=<ID=Un_JTFH01001798v1_decoy,length=4503>\n##contig=<ID=Un_JTFH01001799v1_decoy,length=4495>\n##contig=<ID=Un_JTFH01001800v1_decoy,length=4444>\n##contig=<ID=Un_JTFH01001801v1_decoy,length=4414>\n##contig=<ID=Un_JTFH01001802v1_decoy,length=4409>\n##contig=<ID=Un_JTFH01001803v1_decoy,length=4302>\n##contig=<ID=Un_JTFH01001804v1_decoy,length=4300>\n##contig=<ID=Un_JTFH01001805v1_decoy,length=4277>\n##contig=<ID=Un_JTFH01001806v1_decoy,length=4173>\n##contig=<ID=Un_JTFH01001807v1_decoy,length=4169>\n##contig=<ID=Un_JTFH01001808v1_decoy,length=4136>\n##contig=<ID=Un_JTFH01001809v1_decoy,length=4101>\n##contig=<ID=Un_JTFH01001810v1_decoy,length=4089>\n##contig=<ID=Un_JTFH01001811v1_decoy,length=4015>\n##contig=<ID=Un_JTFH01001812v1_decoy,length=4000>\n##contig=<ID=Un_JTFH01001813v1_decoy,length=3973>\n##contig=<ID=Un_JTFH01001814v1_decoy,length=3732>\n##contig=<ID=Un_JTFH01001815v1_decoy,length=3709>\n##contig=<ID=Un_JTFH01001816v1_decoy,length=3686>\n##contig=<ID=Un_JTFH01001817v1_decoy,length=3676>\n##contig=<ID=Un_JTFH01001818v1_decoy,length=3673>\n##contig=<ID=Un_JTFH01001819v1_decoy,length=3672>\n##contig=<ID=Un_JTFH01001820v1_decoy,length=3633>\n##contig=<ID=Un_JTFH01001821v1_decoy,length=3633>\n##contig=<ID=Un_JTFH01001822v1_decoy,length=3613>\n##contig=<ID=Un_JTFH01001823v1_decoy,length=3605>\n##contig=<ID=Un_JTFH01001824v1_decoy,length=3592>\n##contig=<ID=Un_JTFH01001825v1_decoy,length=3586>\n##contig=<ID=Un_JTFH01001826v1_decoy,length=3584>\n##contig=<ID=Un_JTFH01001827v1_decoy,length=3577>\n##contig=<ID=Un_JTFH01001828v1_decoy,length=3537>\n##contig=<ID=Un_JTFH01001829v1_decoy,length=3510>\n##contig=<ID=Un_JTFH01001830v1_decoy,length=3509>\n##contig=<ID=Un_JTFH01001831v1_decoy,length=3488>\n##contig=<ID=Un_JTFH01001832v1_decoy,length=3473>\n##contig=<ID=Un_JTFH01001833v1_decoy,length=3445>\n##contig=<ID=Un_JTFH01001834v1_decoy,length=3427>\n##contig=<ID=Un_JTFH01001835v1_decoy,length=3395>\n##contig=<ID=Un_JTFH01001836v1_decoy,length=3367>\n##contig=<ID=Un_JTFH01001837v1_decoy,length=3337>\n##contig=<ID=Un_JTFH01001838v1_decoy,length=3324>\n##contig=<ID=Un_JTFH01001839v1_decoy,length=3315>\n##contig=<ID=Un_JTFH01001840v1_decoy,length=3313>\n##contig=<ID=Un_JTFH01001841v1_decoy,length=3283>\n##contig=<ID=Un_JTFH01001842v1_decoy,length=3250>\n##contig=<ID=Un_JTFH01001843v1_decoy,length=3247>\n##contig=<ID=Un_JTFH01001844v1_decoy,length=3237>\n##contig=<ID=Un_JTFH01001845v1_decoy,length=3235>\n##contig=<ID=Un_JTFH01001846v1_decoy,length=3200>\n##contig=<ID=Un_JTFH01001847v1_decoy,length=3195>\n##contig=<ID=Un_JTFH01001848v1_decoy,length=3175>\n##contig=<ID=Un_JTFH01001849v1_decoy,length=3158>\n##contig=<ID=Un_JTFH01001850v1_decoy,length=3143>\n##contig=<ID=Un_JTFH01001851v1_decoy,length=3139>\n##contig=<ID=Un_JTFH01001852v1_decoy,length=3138>\n##contig=<ID=Un_JTFH01001853v1_decoy,length=3136>\n##contig=<ID=Un_JTFH01001854v1_decoy,length=3132>\n##contig=<ID=Un_JTFH01001855v1_decoy,length=3132>\n##contig=<ID=Un_JTFH01001856v1_decoy,length=3095>\n##contig=<ID=Un_JTFH01001857v1_decoy,length=3094>\n##contig=<ID=Un_JTFH01001858v1_decoy,length=3093>\n##contig=<ID=Un_JTFH01001859v1_decoy,length=3059>\n##contig=<ID=Un_JTFH01001860v1_decoy,length=2985>\n##contig=<ID=Un_JTFH01001861v1_decoy,length=2975>\n##contig=<ID=Un_JTFH01001862v1_decoy,length=2967>\n##contig=<ID=Un_JTFH01001863v1_decoy,length=2961>\n##contig=<ID=Un_JTFH01001864v1_decoy,length=2955>\n##contig=<ID=Un_JTFH01001865v1_decoy,length=2935>\n##contig=<ID=Un_JTFH01001866v1_decoy,length=2933>\n##contig=<ID=Un_JTFH01001867v1_decoy,length=2909>\n##contig=<ID=Un_JTFH01001868v1_decoy,length=2904>\n##contig=<ID=Un_JTFH01001869v1_decoy,length=2892>\n##contig=<ID=Un_JTFH01001870v1_decoy,length=2886>\n##contig=<ID=Un_JTFH01001871v1_decoy,length=2885>\n##contig=<ID=Un_JTFH01001872v1_decoy,length=2878>\n##contig=<ID=Un_JTFH01001873v1_decoy,length=2875>\n##contig=<ID=Un_JTFH01001874v1_decoy,length=2861>\n##contig=<ID=Un_JTFH01001875v1_decoy,length=2856>\n##contig=<ID=Un_JTFH01001876v1_decoy,length=2838>\n##contig=<ID=Un_JTFH01001877v1_decoy,length=2801>\n##contig=<ID=Un_JTFH01001878v1_decoy,length=2797>\n##contig=<ID=Un_JTFH01001879v1_decoy,length=2788>\n##contig=<ID=Un_JTFH01001880v1_decoy,length=2773>\n##contig=<ID=Un_JTFH01001881v1_decoy,length=2755>\n##contig=<ID=Un_JTFH01001882v1_decoy,length=2754>\n##contig=<ID=Un_JTFH01001883v1_decoy,length=2743>\n##contig=<ID=Un_JTFH01001884v1_decoy,length=2725>\n##contig=<ID=Un_JTFH01001885v1_decoy,length=2722>\n##contig=<ID=Un_JTFH01001886v1_decoy,length=2682>\n##contig=<ID=Un_JTFH01001887v1_decoy,length=2669>\n##contig=<ID=Un_JTFH01001888v1_decoy,length=2663>\n##contig=<ID=Un_JTFH01001889v1_decoy,length=2652>\n##contig=<ID=Un_JTFH01001890v1_decoy,length=2647>\n##contig=<ID=Un_JTFH01001891v1_decoy,length=2635>\n##contig=<ID=Un_JTFH01001892v1_decoy,length=2633>\n##contig=<ID=Un_JTFH01001893v1_decoy,length=2629>\n##contig=<ID=Un_JTFH01001894v1_decoy,length=2612>\n##contig=<ID=Un_JTFH01001895v1_decoy,length=2599>\n##contig=<ID=Un_JTFH01001896v1_decoy,length=2566>\n##contig=<ID=Un_JTFH01001897v1_decoy,length=2556>\n##contig=<ID=Un_JTFH01001898v1_decoy,length=2551>\n##contig=<ID=Un_JTFH01001899v1_decoy,length=2551>\n##contig=<ID=Un_JTFH01001900v1_decoy,length=2538>\n##contig=<ID=Un_JTFH01001901v1_decoy,length=2538>\n##contig=<ID=Un_JTFH01001902v1_decoy,length=2525>\n##contig=<ID=Un_JTFH01001903v1_decoy,length=2498>\n##contig=<ID=Un_JTFH01001904v1_decoy,length=2496>\n##contig=<ID=Un_JTFH01001905v1_decoy,length=2483>\n##contig=<ID=Un_JTFH01001906v1_decoy,length=2475>\n##contig=<ID=Un_JTFH01001907v1_decoy,length=2469>\n##contig=<ID=Un_JTFH01001908v1_decoy,length=2455>\n##contig=<ID=Un_JTFH01001909v1_decoy,length=2444>\n##contig=<ID=Un_JTFH01001910v1_decoy,length=2437>\n##contig=<ID=Un_JTFH01001911v1_decoy,length=2435>\n##contig=<ID=Un_JTFH01001912v1_decoy,length=2427>\n##contig=<ID=Un_JTFH01001913v1_decoy,length=2419>\n##contig=<ID=Un_JTFH01001914v1_decoy,length=2413>\n##contig=<ID=Un_JTFH01001915v1_decoy,length=2412>\n##contig=<ID=Un_JTFH01001916v1_decoy,length=2400>\n##contig=<ID=Un_JTFH01001917v1_decoy,length=2399>\n##contig=<ID=Un_JTFH01001918v1_decoy,length=2396>\n##contig=<ID=Un_JTFH01001919v1_decoy,length=2393>\n##contig=<ID=Un_JTFH01001920v1_decoy,length=2386>\n##contig=<ID=Un_JTFH01001921v1_decoy,length=2384>\n##contig=<ID=Un_JTFH01001922v1_decoy,length=2382>\n##contig=<ID=Un_JTFH01001923v1_decoy,length=2382>\n##contig=<ID=Un_JTFH01001924v1_decoy,length=2367>\n##contig=<ID=Un_JTFH01001925v1_decoy,length=2366>\n##contig=<ID=Un_JTFH01001926v1_decoy,length=2362>\n##contig=<ID=Un_JTFH01001927v1_decoy,length=2361>\n##contig=<ID=Un_JTFH01001928v1_decoy,length=2353>\n##contig=<ID=Un_JTFH01001929v1_decoy,length=2349>\n##contig=<ID=Un_JTFH01001930v1_decoy,length=2348>\n##contig=<ID=Un_JTFH01001931v1_decoy,length=2340>\n##contig=<ID=Un_JTFH01001932v1_decoy,length=2339>\n##contig=<ID=Un_JTFH01001933v1_decoy,length=2336>\n##contig=<ID=Un_JTFH01001934v1_decoy,length=2333>\n##contig=<ID=Un_JTFH01001935v1_decoy,length=2330>\n##contig=<ID=Un_JTFH01001936v1_decoy,length=2327>\n##contig=<ID=Un_JTFH01001937v1_decoy,length=2318>\n##contig=<ID=Un_JTFH01001938v1_decoy,length=2293>\n##contig=<ID=Un_JTFH01001939v1_decoy,length=2292>\n##contig=<ID=Un_JTFH01001940v1_decoy,length=2287>\n##contig=<ID=Un_JTFH01001941v1_decoy,length=2274>\n##contig=<ID=Un_JTFH01001942v1_decoy,length=2274>\n##contig=<ID=Un_JTFH01001943v1_decoy,length=2267>\n##contig=<ID=Un_JTFH01001944v1_decoy,length=2260>\n##contig=<ID=Un_JTFH01001945v1_decoy,length=2257>\n##contig=<ID=Un_JTFH01001946v1_decoy,length=2240>\n##contig=<ID=Un_JTFH01001947v1_decoy,length=2239>\n##contig=<ID=Un_JTFH01001948v1_decoy,length=2232>\n##contig=<ID=Un_JTFH01001949v1_decoy,length=2230>\n##contig=<ID=Un_JTFH01001950v1_decoy,length=2230>\n##contig=<ID=Un_JTFH01001951v1_decoy,length=2222>\n##contig=<ID=Un_JTFH01001952v1_decoy,length=2216>\n##contig=<ID=Un_JTFH01001953v1_decoy,length=2214>\n##contig=<ID=Un_JTFH01001954v1_decoy,length=2210>\n##contig=<ID=Un_JTFH01001955v1_decoy,length=2203>\n##contig=<ID=Un_JTFH01001956v1_decoy,length=2197>\n##contig=<ID=Un_JTFH01001957v1_decoy,length=2196>\n##contig=<ID=Un_JTFH01001958v1_decoy,length=2196>\n##contig=<ID=Un_JTFH01001959v1_decoy,length=2179>\n##contig=<ID=Un_JTFH01001960v1_decoy,length=2178>\n##contig=<ID=Un_JTFH01001961v1_decoy,length=2178>\n##contig=<ID=Un_JTFH01001962v1_decoy,length=2172>\n##contig=<ID=Un_JTFH01001963v1_decoy,length=2170>\n##contig=<ID=Un_JTFH01001964v1_decoy,length=2167>\n##contig=<ID=Un_JTFH01001965v1_decoy,length=2167>\n##contig=<ID=Un_JTFH01001966v1_decoy,length=2157>\n##contig=<ID=Un_JTFH01001967v1_decoy,length=2153>\n##contig=<ID=Un_JTFH01001968v1_decoy,length=2151>\n##contig=<ID=Un_JTFH01001969v1_decoy,length=2147>\n##contig=<ID=Un_JTFH01001970v1_decoy,length=2145>\n##contig=<ID=Un_JTFH01001971v1_decoy,length=2142>\n##contig=<ID=Un_JTFH01001972v1_decoy,length=2142>\n##contig=<ID=Un_JTFH01001973v1_decoy,length=2136>\n##contig=<ID=Un_JTFH01001974v1_decoy,length=2130>\n##contig=<ID=Un_JTFH01001975v1_decoy,length=2128>\n##contig=<ID=Un_JTFH01001976v1_decoy,length=2126>\n##contig=<ID=Un_JTFH01001977v1_decoy,length=2126>\n##contig=<ID=Un_JTFH01001978v1_decoy,length=2119>\n##contig=<ID=Un_JTFH01001979v1_decoy,length=2107>\n##contig=<ID=Un_JTFH01001980v1_decoy,length=2091>\n##contig=<ID=Un_JTFH01001981v1_decoy,length=2087>\n##contig=<ID=Un_JTFH01001982v1_decoy,length=2086>\n##contig=<ID=Un_JTFH01001983v1_decoy,length=2083>\n##contig=<ID=Un_JTFH01001984v1_decoy,length=2075>\n##contig=<ID=Un_JTFH01001985v1_decoy,length=2075>\n##contig=<ID=Un_JTFH01001986v1_decoy,length=2072>\n##contig=<ID=Un_JTFH01001987v1_decoy,length=2068>\n##contig=<ID=Un_JTFH01001988v1_decoy,length=2067>\n##contig=<ID=Un_JTFH01001989v1_decoy,length=2055>\n##contig=<ID=Un_JTFH01001990v1_decoy,length=2051>\n##contig=<ID=Un_JTFH01001991v1_decoy,length=2050>\n##contig=<ID=Un_JTFH01001992v1_decoy,length=2033>\n##contig=<ID=Un_JTFH01001993v1_decoy,length=2024>\n##contig=<ID=Un_JTFH01001994v1_decoy,length=2016>\n##contig=<ID=Un_JTFH01001995v1_decoy,length=2011>\n##contig=<ID=Un_JTFH01001996v1_decoy,length=2009>\n##contig=<ID=Un_JTFH01001997v1_decoy,length=2003>\n##contig=<ID=Un_JTFH01001998v1_decoy,length=2001>\n##bcftools_concatVersion=1.9+htslib-1.9\n##bcftools_concatCommand=concat -a -o calls/H021-ZNSUYN.vcf calls/H021-ZNSUYN.freebayes.1.bcf calls/H021-ZNSUYN.freebayes.2.bcf calls/H021-ZNSUYN.freebayes.3.bcf calls/H021-ZNSUYN.freebayes.4.bcf calls/H021-ZNSUYN.freebayes.5.bcf calls/H021-ZNSUYN.freebayes.6.bcf calls/H021-ZNSUYN.freebayes.7.bcf calls/H021-ZNSUYN.freebayes.8.bcf calls/H021-ZNSUYN.freebayes.9.bcf calls/H021-ZNSUYN.freebayes.10.bcf calls/H021-ZNSUYN.freebayes.11.bcf calls/H021-ZNSUYN.freebayes.12.bcf calls/H021-ZNSUYN.freebayes.13.bcf calls/H021-ZNSUYN.freebayes.14.bcf calls/H021-ZNSUYN.freebayes.15.bcf calls/H021-ZNSUYN.freebayes.16.bcf calls/H021-ZNSUYN.freebayes.17.bcf calls/H021-ZNSUYN.freebayes.18.bcf calls/H021-ZNSUYN.freebayes.19.bcf calls/H021-ZNSUYN.freebayes.20.bcf calls/H021-ZNSUYN.freebayes.21.bcf calls/H021-ZNSUYN.freebayes.22.bcf calls/H021-ZNSUYN.freebayes.X.bcf calls/H021-ZNSUYN.freebayes.Y.bcf calls/H021-ZNSUYN.freebayes.M.bcf calls/H021-ZNSUYN.delly.1.bcf calls/H021-ZNSUYN.delly.2.bcf calls/H021-ZNSUYN.delly.3.bcf calls/H021-ZNSUYN.delly.4.bcf calls/H021-ZNSUYN.delly.5.bcf calls/H021-ZNSUYN.delly.6.bcf calls/H021-ZNSUYN.delly.7.bcf calls/H021-ZNSUYN.delly.8.bcf calls/H021-ZNSUYN.delly.9.bcf calls/H021-ZNSUYN.delly.10.bcf calls/H021-ZNSUYN.delly.11.bcf calls/H021-ZNSUYN.delly.12.bcf calls/H021-ZNSUYN.delly.13.bcf calls/H021-ZNSUYN.delly.14.bcf calls/H021-ZNSUYN.delly.15.bcf calls/H021-ZNSUYN.delly.16.bcf calls/H021-ZNSUYN.delly.17.bcf calls/H021-ZNSUYN.delly.18.bcf calls/H021-ZNSUYN.delly.19.bcf calls/H021-ZNSUYN.delly.20.bcf calls/H021-ZNSUYN.delly.21.bcf calls/H021-ZNSUYN.delly.22.bcf calls/H021-ZNSUYN.delly.X.bcf calls/H021-ZNSUYN.delly.Y.bcf calls/H021-ZNSUYN.delly.M.bcf; Date=Wed Sep 18 09:11:53 2019\n##SnpEffVersion=\"4.3t (build 2017-11-24 10:18), by Pablo Cingolani\"\n##SnpEffCmd=\"SnpEff  -stats snpeff/H021-ZNSUYN.html -csvStats snpeff/H021-ZNSUYN.csv GRCh38.86 calls/H021-ZNSUYN.vcf \"\n##INFO=<ID=ANN,Number=.,Type=String,Description=\"Functional annotations: 'Allele | Annotation | Annotation_Impact | Gene_Name | Gene_ID | Feature_Type | Feature_ID | Transcript_BioType | Rank | HGVS.c | HGVS.p | cDNA.pos / cDNA.length | CDS.pos / CDS.length | AA.pos / AA.length | Distance | ERRORS / WARNINGS / INFO'\">\n##INFO=<ID=LOF,Number=.,Type=String,Description=\"Predicted loss of function effects for this variant. Format: 'Gene_Name | Gene_ID | Number_of_transcripts_in_gene | Percent_of_transcripts_affected'\">\n##INFO=<ID=NMD,Number=.,Type=String,Description=\"Predicted nonsense mediated decay effects for this variant. Format: 'Gene_Name | Gene_ID | Number_of_transcripts_in_gene | Percent_of_transcripts_affected'\">\n##SnpSiftVersion=\"SnpSift 4.3t (build 2017-11-24 10:18), by Pablo Cingolani\"\n##SnpSiftCmd=\"SnpSift Filter 'ANN[*].IMPACT = 'MODERATE'' calls/H021-ZNSUYN.annotated.vcf\"\n##FILTER=<ID=SnpSift,Description=\"SnpSift 4.3t (build 2017-11-24 10:18), by Pablo Cingolani, Expression used: ANN[*].IMPACT = 'MODERATE'\">\n##bcftools_concatCommand=concat -a -o merged-calls/H021-ZNSUYN.somatic_medium_high.fdr-controlled.vcf calls/H021-ZNSUYN.SNV.somatic_medium_high.MODERATE.fdr-controlled.bcf calls/H021-ZNSUYN.SNV.somatic_medium_high.HIGH.fdr-controlled.bcf calls/H021-ZNSUYN.INS.somatic_medium_high.MODERATE.fdr-controlled.bcf calls/H021-ZNSUYN.INS.somatic_medium_high.HIGH.fdr-controlled.bcf calls/H021-ZNSUYN.DEL.somatic_medium_high.MODERATE.fdr-controlled.bcf calls/H021-ZNSUYN.DEL.somatic_medium_high.HIGH.fdr-controlled.bcf; Date=Wed Sep 18 09:18:23 2019\n##SnpSiftCmd=\"SnpSift Annotate -name cosmic_ /vol/tiny/ref/cosmic/CosmicCodingMuts_v90.vcf /dev/stdin\"\n##INFO=<ID=cosmic_GENOMIC_ID,Number=1,Type=String,Description=\"Genomic Mutation ID\">\n##INFO=<ID=cosmic_CDS,Number=1,Type=String,Description=\"CDS annotation\">\n##INFO=<ID=cosmic_AA,Number=1,Type=String,Description=\"Peptide annotation\">\n##INFO=<ID=cosmic_GENE,Number=1,Type=String,Description=\"Gene name\">\n##INFO=<ID=cosmic_CNT,Number=1,Type=Integer,Description=\"How many samples have this mutation\">\n##INFO=<ID=cosmic_SNP,Number=0,Type=Flag,Description=\"classified as SNP\">\n##INFO=<ID=cosmic_STRAND,Number=1,Type=String,Description=\"Gene strand\">\n##INFO=<ID=cosmic_LEGACY_ID,Number=1,Type=String,Description=\"Legacy Mutation ID\">\n##SnpSiftCmd=\"SnpSift DbNsfp -f MetaSVM_score,MetaLR_score,M-CAP_score,REVEL_score,MutPred_score,PrimateAI_score,DEOGEN2_score,LRT_score,Uniprot_entry,MutationAssessor_score,Uniprot_acc,Polyphen2_HDIV_score,Polyphen2_HVAR_score,Ensembl_proteinid,FATHMM_score,PROVEAN_score,SIFT_score,Ensembl_transcriptid,VEST4_score,SIFT4G_score,MVP_score,MPC_score,MutationTaster_score merged-calls/H021-ZNSUYN.somatic_medium_high.fdr-controlled.db-annotated.vcf\"\n##INFO=<ID=dbNSFP_PROVEAN_score,Number=.,Type=Float,Description=\"Field 'PROVEAN_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_VEST4_score,Number=.,Type=Float,Description=\"Field 'VEST4_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_DEOGEN2_score,Number=.,Type=Float,Description=\"Field 'DEOGEN2_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_Polyphen2_HVAR_score,Number=.,Type=Float,Description=\"Field 'Polyphen2_HVAR_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_SIFT_score,Number=.,Type=Float,Description=\"Field 'SIFT_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_Ensembl_transcriptid,Number=.,Type=String,Description=\"Field 'Ensembl_transcriptid' from dbNSFP\">\n##INFO=<ID=dbNSFP_MPC_score,Number=.,Type=Float,Description=\"Field 'MPC_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_MetaLR_score,Number=.,Type=Float,Description=\"Field 'MetaLR_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_REVEL_score,Number=.,Type=Float,Description=\"Field 'REVEL_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_MutationAssessor_score,Number=.,Type=Float,Description=\"Field 'MutationAssessor_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_Uniprot_acc,Number=.,Type=String,Description=\"Field 'Uniprot_acc' from dbNSFP\">\n##INFO=<ID=dbNSFP_Polyphen2_HDIV_score,Number=.,Type=Float,Description=\"Field 'Polyphen2_HDIV_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_MutPred_score,Number=.,Type=Float,Description=\"Field 'MutPred_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_MetaSVM_score,Number=.,Type=Float,Description=\"Field 'MetaSVM_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_PrimateAI_score,Number=.,Type=Float,Description=\"Field 'PrimateAI_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_Ensembl_proteinid,Number=.,Type=String,Description=\"Field 'Ensembl_proteinid' from dbNSFP\">\n##INFO=<ID=dbNSFP_FATHMM_score,Number=.,Type=Float,Description=\"Field 'FATHMM_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_MVP_score,Number=.,Type=Float,Description=\"Field 'MVP_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_MutationTaster_score,Number=.,Type=Float,Description=\"Field 'MutationTaster_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_Uniprot_entry,Number=.,Type=String,Description=\"Field 'Uniprot_entry' from dbNSFP\">\n##INFO=<ID=dbNSFP_SIFT4G_score,Number=.,Type=Float,Description=\"Field 'SIFT4G_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_LRT_score,Number=.,Type=Float,Description=\"Field 'LRT_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_M_CAP_score,Number=.,Type=Float,Description=\"Field 'M-CAP_score' from dbNSFP\">\n##INFO=<ID=X,Number=A,Type=String,Description=\"Test\">\n#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tnormal\ttumor\n1\t6086227\t.\tG\tT,C\t.\t.\tSVLEN=.;PROB_SOMATIC_NORMAL=9.96017;PROB_GERMLINE_HET=24.5078;PROB_ARTIFACT=32.4886;PROB_SOMATIC_TUMOR_MEDIUM=8.60169;PROB_SOMATIC_TUMOR_LOW=21.1583;PROB_GERMLINE_HOM=385.486;PROB_ABSENT=67.1313;PROB_SOMATIC_TUMOR_HIGH=1.25327;ANN=T|missense_variant|MODERATE|KCNAB2|ENSG00000069424|transcript|ENST00000472700.6|protein_coding|8/8|c.399G>T|p.Gln133His|401/536|399/486|133/161||WARNING_TRANSCRIPT_NO_START_CODON,T|3_prime_UTR_variant|MODIFIER|KCNAB2|ENSG00000069424|transcript|ENST00000462676.2|protein_coding|3/3|c.*178G>T|||||178|WARNING_TRANSCRIPT_NO_START_CODON,T|downstream_gene_variant|MODIFIER|KCNAB2|ENSG00000069424|transcript|ENST00000435937.5|retained_intron||n.*978G>T|||||978|,T|intron_variant|MODIFIER|KCNAB2|ENSG00000069424|transcript|ENST00000378097.5|protein_coding|7/15|c.326+979G>T||||||,T|intron_variant|MODIFIER|KCNAB2|ENSG00000069424|transcript|ENST00000341524.5|protein_coding|7/15|c.326+979G>T||||||,T|intron_variant|MODIFIER|KCNAB2|ENSG00000069424|transcript|ENST00000352527.5|protein_coding|6/14|c.284+979G>T||||||,T|intron_variant|MODIFIER|KCNAB2|ENSG00000069424|transcript|ENST00000378083.7|protein_coding|6/15|c.425+979G>T||||||,T|intron_variant|MODIFIER|KCNAB2|ENSG00000069424|transcript|ENST00000428161.5|protein_coding|6/11|c.284+979G>T||||||WARNING_TRANSCRIPT_INCOMPLETE,T|intron_variant|MODIFIER|KCNAB2|ENSG00000069424|transcript|ENST00000602612.5|protein_coding|7/14|c.326+979G>T||||||,T|intron_variant|MODIFIER|KCNAB2|ENSG00000069424|transcript|ENST00000164247.5|protein_coding|7/15|c.326+979G>T||||||,T|intron_variant|MODIFIER|KCNAB2|ENSG00000069424|transcript|ENST00000458166.6|protein_coding|5/13|c.125+979G>T||||||,T|intron_variant|MODIFIER|KCNAB2|ENSG00000069424|transcript|ENST00000378111.5|protein_coding|7/7|c.326+979G>T||||||,T|intron_variant|MODIFIER|KCNAB2|ENSG00000069424|transcript|ENST00000378092.5|protein_coding|6/14|c.284+979G>T||||||,T|intron_variant|MODIFIER|KCNAB2|ENSG00000069424|transcript|ENST00000389632.8|protein_coding|7/12|c.326+979G>T||||||WARNING_TRANSCRIPT_INCOMPLETE;X=a,b\tDP:AF:OBS:SB\t8:0:5N+3N-:.\t4:0.5:1N+1V+1N-1V-:.\n"
  },
  {
    "path": "test/test-info-multi-string.vcf",
    "content": "##fileformat=VCFv4.2\n##FILTER=<ID=PASS,Description=\"All filters passed\">\n##INFO=<ID=PROB_GERMLINE_HET,Number=A,Type=Float,Description=\"Posterior probability for event germline_het\">\n##INFO=<ID=PROB_SOMATIC_TUMOR_MEDIUM,Number=A,Type=Float,Description=\"Posterior probability for event somatic_tumor_medium\">\n##INFO=<ID=PROB_ABSENT,Number=A,Type=Float,Description=\"Posterior probability for event absent\">\n##INFO=<ID=PROB_SOMATIC_NORMAL,Number=A,Type=Float,Description=\"Posterior probability for event somatic_normal\">\n##INFO=<ID=PROB_SOMATIC_TUMOR_HIGH,Number=A,Type=Float,Description=\"Posterior probability for event somatic_tumor_high\">\n##INFO=<ID=PROB_SOMATIC_TUMOR_LOW,Number=A,Type=Float,Description=\"Posterior probability for event somatic_tumor_low\">\n##INFO=<ID=PROB_GERMLINE_HOM,Number=A,Type=Float,Description=\"Posterior probability for event germline_hom\">\n##INFO=<ID=PROB_ARTIFACT,Number=A,Type=Float,Description=\"Posterior probability for strand bias artifact\">\n##INFO=<ID=SVLEN,Number=A,Type=Integer,Description=\"Difference in length between REF and ALT alleles\">\n##FORMAT=<ID=DP,Number=A,Type=Integer,Description=\"Expected sequencing depth, while considering mapping uncertainty\">\n##FORMAT=<ID=AF,Number=A,Type=Float,Description=\"Maximum a posteriori probability estimate of allele frequency\">\n##FORMAT=<ID=OBS,Number=A,Type=String,Description=\"Posterior odds for alt allele of each fragment as Kass Raftery scores: N=none, B=barely, P=positive, S=strong, V=very strong (lower case if probability for correct mapping of fragment is <95%)\">\n##FORMAT=<ID=SB,Number=A,Type=String,Description=\"Strand bias estimate: + indicates that ALT allele is associated with forward strand, - indicates that ALT allele is associated with reverse strand, - indicates no strand bias.\">\n##contig=<ID=1,length=248956422>\n##contig=<ID=2,length=242193529>\n##contig=<ID=3,length=198295559>\n##contig=<ID=4,length=190214555>\n##contig=<ID=5,length=181538259>\n##contig=<ID=6,length=170805979>\n##contig=<ID=7,length=159345973>\n##contig=<ID=8,length=145138636>\n##contig=<ID=9,length=138394717>\n##contig=<ID=10,length=133797422>\n##contig=<ID=11,length=135086622>\n##contig=<ID=12,length=133275309>\n##contig=<ID=13,length=114364328>\n##contig=<ID=14,length=107043718>\n##contig=<ID=15,length=101991189>\n##contig=<ID=16,length=90338345>\n##contig=<ID=17,length=83257441>\n##contig=<ID=18,length=80373285>\n##contig=<ID=19,length=58617616>\n##contig=<ID=20,length=64444167>\n##contig=<ID=21,length=46709983>\n##contig=<ID=22,length=50818468>\n##contig=<ID=X,length=156040895>\n##contig=<ID=Y,length=57227415>\n##contig=<ID=M,length=16569>\n##contig=<ID=1_KI270706v1_random,length=175055>\n##contig=<ID=1_KI270707v1_random,length=32032>\n##contig=<ID=1_KI270708v1_random,length=127682>\n##contig=<ID=1_KI270709v1_random,length=66860>\n##contig=<ID=1_KI270710v1_random,length=40176>\n##contig=<ID=1_KI270711v1_random,length=42210>\n##contig=<ID=1_KI270712v1_random,length=176043>\n##contig=<ID=1_KI270713v1_random,length=40745>\n##contig=<ID=1_KI270714v1_random,length=41717>\n##contig=<ID=2_KI270715v1_random,length=161471>\n##contig=<ID=2_KI270716v1_random,length=153799>\n##contig=<ID=3_GL000221v1_random,length=155397>\n##contig=<ID=4_GL000008v2_random,length=209709>\n##contig=<ID=5_GL000208v1_random,length=92689>\n##contig=<ID=9_KI270717v1_random,length=40062>\n##contig=<ID=9_KI270718v1_random,length=38054>\n##contig=<ID=9_KI270719v1_random,length=176845>\n##contig=<ID=9_KI270720v1_random,length=39050>\n##contig=<ID=11_KI270721v1_random,length=100316>\n##contig=<ID=14_GL000009v2_random,length=201709>\n##contig=<ID=14_GL000225v1_random,length=211173>\n##contig=<ID=14_KI270722v1_random,length=194050>\n##contig=<ID=14_GL000194v1_random,length=191469>\n##contig=<ID=14_KI270723v1_random,length=38115>\n##contig=<ID=14_KI270724v1_random,length=39555>\n##contig=<ID=14_KI270725v1_random,length=172810>\n##contig=<ID=14_KI270726v1_random,length=43739>\n##contig=<ID=15_KI270727v1_random,length=448248>\n##contig=<ID=16_KI270728v1_random,length=1872759>\n##contig=<ID=17_GL000205v2_random,length=185591>\n##contig=<ID=17_KI270729v1_random,length=280839>\n##contig=<ID=17_KI270730v1_random,length=112551>\n##contig=<ID=22_KI270731v1_random,length=150754>\n##contig=<ID=22_KI270732v1_random,length=41543>\n##contig=<ID=22_KI270733v1_random,length=179772>\n##contig=<ID=22_KI270734v1_random,length=165050>\n##contig=<ID=22_KI270735v1_random,length=42811>\n##contig=<ID=22_KI270736v1_random,length=181920>\n##contig=<ID=22_KI270737v1_random,length=103838>\n##contig=<ID=22_KI270738v1_random,length=99375>\n##contig=<ID=22_KI270739v1_random,length=73985>\n##contig=<ID=Y_KI270740v1_random,length=37240>\n##contig=<ID=Un_KI270302v1,length=2274>\n##contig=<ID=Un_KI270304v1,length=2165>\n##contig=<ID=Un_KI270303v1,length=1942>\n##contig=<ID=Un_KI270305v1,length=1472>\n##contig=<ID=Un_KI270322v1,length=21476>\n##contig=<ID=Un_KI270320v1,length=4416>\n##contig=<ID=Un_KI270310v1,length=1201>\n##contig=<ID=Un_KI270316v1,length=1444>\n##contig=<ID=Un_KI270315v1,length=2276>\n##contig=<ID=Un_KI270312v1,length=998>\n##contig=<ID=Un_KI270311v1,length=12399>\n##contig=<ID=Un_KI270317v1,length=37690>\n##contig=<ID=Un_KI270412v1,length=1179>\n##contig=<ID=Un_KI270411v1,length=2646>\n##contig=<ID=Un_KI270414v1,length=2489>\n##contig=<ID=Un_KI270419v1,length=1029>\n##contig=<ID=Un_KI270418v1,length=2145>\n##contig=<ID=Un_KI270420v1,length=2321>\n##contig=<ID=Un_KI270424v1,length=2140>\n##contig=<ID=Un_KI270417v1,length=2043>\n##contig=<ID=Un_KI270422v1,length=1445>\n##contig=<ID=Un_KI270423v1,length=981>\n##contig=<ID=Un_KI270425v1,length=1884>\n##contig=<ID=Un_KI270429v1,length=1361>\n##contig=<ID=Un_KI270442v1,length=392061>\n##contig=<ID=Un_KI270466v1,length=1233>\n##contig=<ID=Un_KI270465v1,length=1774>\n##contig=<ID=Un_KI270467v1,length=3920>\n##contig=<ID=Un_KI270435v1,length=92983>\n##contig=<ID=Un_KI270438v1,length=112505>\n##contig=<ID=Un_KI270468v1,length=4055>\n##contig=<ID=Un_KI270510v1,length=2415>\n##contig=<ID=Un_KI270509v1,length=2318>\n##contig=<ID=Un_KI270518v1,length=2186>\n##contig=<ID=Un_KI270508v1,length=1951>\n##contig=<ID=Un_KI270516v1,length=1300>\n##contig=<ID=Un_KI270512v1,length=22689>\n##contig=<ID=Un_KI270519v1,length=138126>\n##contig=<ID=Un_KI270522v1,length=5674>\n##contig=<ID=Un_KI270511v1,length=8127>\n##contig=<ID=Un_KI270515v1,length=6361>\n##contig=<ID=Un_KI270507v1,length=5353>\n##contig=<ID=Un_KI270517v1,length=3253>\n##contig=<ID=Un_KI270529v1,length=1899>\n##contig=<ID=Un_KI270528v1,length=2983>\n##contig=<ID=Un_KI270530v1,length=2168>\n##contig=<ID=Un_KI270539v1,length=993>\n##contig=<ID=Un_KI270538v1,length=91309>\n##contig=<ID=Un_KI270544v1,length=1202>\n##contig=<ID=Un_KI270548v1,length=1599>\n##contig=<ID=Un_KI270583v1,length=1400>\n##contig=<ID=Un_KI270587v1,length=2969>\n##contig=<ID=Un_KI270580v1,length=1553>\n##contig=<ID=Un_KI270581v1,length=7046>\n##contig=<ID=Un_KI270579v1,length=31033>\n##contig=<ID=Un_KI270589v1,length=44474>\n##contig=<ID=Un_KI270590v1,length=4685>\n##contig=<ID=Un_KI270584v1,length=4513>\n##contig=<ID=Un_KI270582v1,length=6504>\n##contig=<ID=Un_KI270588v1,length=6158>\n##contig=<ID=Un_KI270593v1,length=3041>\n##contig=<ID=Un_KI270591v1,length=5796>\n##contig=<ID=Un_KI270330v1,length=1652>\n##contig=<ID=Un_KI270329v1,length=1040>\n##contig=<ID=Un_KI270334v1,length=1368>\n##contig=<ID=Un_KI270333v1,length=2699>\n##contig=<ID=Un_KI270335v1,length=1048>\n##contig=<ID=Un_KI270338v1,length=1428>\n##contig=<ID=Un_KI270340v1,length=1428>\n##contig=<ID=Un_KI270336v1,length=1026>\n##contig=<ID=Un_KI270337v1,length=1121>\n##contig=<ID=Un_KI270363v1,length=1803>\n##contig=<ID=Un_KI270364v1,length=2855>\n##contig=<ID=Un_KI270362v1,length=3530>\n##contig=<ID=Un_KI270366v1,length=8320>\n##contig=<ID=Un_KI270378v1,length=1048>\n##contig=<ID=Un_KI270379v1,length=1045>\n##contig=<ID=Un_KI270389v1,length=1298>\n##contig=<ID=Un_KI270390v1,length=2387>\n##contig=<ID=Un_KI270387v1,length=1537>\n##contig=<ID=Un_KI270395v1,length=1143>\n##contig=<ID=Un_KI270396v1,length=1880>\n##contig=<ID=Un_KI270388v1,length=1216>\n##contig=<ID=Un_KI270394v1,length=970>\n##contig=<ID=Un_KI270386v1,length=1788>\n##contig=<ID=Un_KI270391v1,length=1484>\n##contig=<ID=Un_KI270383v1,length=1750>\n##contig=<ID=Un_KI270393v1,length=1308>\n##contig=<ID=Un_KI270384v1,length=1658>\n##contig=<ID=Un_KI270392v1,length=971>\n##contig=<ID=Un_KI270381v1,length=1930>\n##contig=<ID=Un_KI270385v1,length=990>\n##contig=<ID=Un_KI270382v1,length=4215>\n##contig=<ID=Un_KI270376v1,length=1136>\n##contig=<ID=Un_KI270374v1,length=2656>\n##contig=<ID=Un_KI270372v1,length=1650>\n##contig=<ID=Un_KI270373v1,length=1451>\n##contig=<ID=Un_KI270375v1,length=2378>\n##contig=<ID=Un_KI270371v1,length=2805>\n##contig=<ID=Un_KI270448v1,length=7992>\n##contig=<ID=Un_KI270521v1,length=7642>\n##contig=<ID=Un_GL000195v1,length=182896>\n##contig=<ID=Un_GL000219v1,length=179198>\n##contig=<ID=Un_GL000220v1,length=161802>\n##contig=<ID=Un_GL000224v1,length=179693>\n##contig=<ID=Un_KI270741v1,length=157432>\n##contig=<ID=Un_GL000226v1,length=15008>\n##contig=<ID=Un_GL000213v1,length=164239>\n##contig=<ID=Un_KI270743v1,length=210658>\n##contig=<ID=Un_KI270744v1,length=168472>\n##contig=<ID=Un_KI270745v1,length=41891>\n##contig=<ID=Un_KI270746v1,length=66486>\n##contig=<ID=Un_KI270747v1,length=198735>\n##contig=<ID=Un_KI270748v1,length=93321>\n##contig=<ID=Un_KI270749v1,length=158759>\n##contig=<ID=Un_KI270750v1,length=148850>\n##contig=<ID=Un_KI270751v1,length=150742>\n##contig=<ID=Un_KI270752v1,length=27745>\n##contig=<ID=Un_KI270753v1,length=62944>\n##contig=<ID=Un_KI270754v1,length=40191>\n##contig=<ID=Un_KI270755v1,length=36723>\n##contig=<ID=Un_KI270756v1,length=79590>\n##contig=<ID=Un_KI270757v1,length=71251>\n##contig=<ID=Un_GL000214v1,length=137718>\n##contig=<ID=Un_KI270742v1,length=186739>\n##contig=<ID=Un_GL000216v2,length=176608>\n##contig=<ID=Un_GL000218v1,length=161147>\n##contig=<ID=EBV,length=171823>\n##contig=<ID=Un_KN707606v1_decoy,length=2200>\n##contig=<ID=Un_KN707607v1_decoy,length=3033>\n##contig=<ID=Un_KN707608v1_decoy,length=3112>\n##contig=<ID=Un_KN707609v1_decoy,length=1642>\n##contig=<ID=Un_KN707610v1_decoy,length=1393>\n##contig=<ID=Un_KN707611v1_decoy,length=1103>\n##contig=<ID=Un_KN707612v1_decoy,length=1039>\n##contig=<ID=Un_KN707613v1_decoy,length=1619>\n##contig=<ID=Un_KN707614v1_decoy,length=3122>\n##contig=<ID=Un_KN707615v1_decoy,length=1934>\n##contig=<ID=Un_KN707616v1_decoy,length=3111>\n##contig=<ID=Un_KN707617v1_decoy,length=2545>\n##contig=<ID=Un_KN707618v1_decoy,length=2295>\n##contig=<ID=Un_KN707619v1_decoy,length=1551>\n##contig=<ID=Un_KN707620v1_decoy,length=2046>\n##contig=<ID=Un_KN707621v1_decoy,length=1222>\n##contig=<ID=Un_KN707622v1_decoy,length=1535>\n##contig=<ID=Un_KN707623v1_decoy,length=3784>\n##contig=<ID=Un_KN707624v1_decoy,length=1329>\n##contig=<ID=Un_KN707625v1_decoy,length=1238>\n##contig=<ID=Un_KN707626v1_decoy,length=5623>\n##contig=<ID=Un_KN707627v1_decoy,length=5821>\n##contig=<ID=Un_KN707628v1_decoy,length=2960>\n##contig=<ID=Un_KN707629v1_decoy,length=1848>\n##contig=<ID=Un_KN707630v1_decoy,length=2315>\n##contig=<ID=Un_KN707631v1_decoy,length=1945>\n##contig=<ID=Un_KN707632v1_decoy,length=1424>\n##contig=<ID=Un_KN707633v1_decoy,length=1274>\n##contig=<ID=Un_KN707634v1_decoy,length=1007>\n##contig=<ID=Un_KN707635v1_decoy,length=1414>\n##contig=<ID=Un_KN707636v1_decoy,length=1725>\n##contig=<ID=Un_KN707637v1_decoy,length=5354>\n##contig=<ID=Un_KN707638v1_decoy,length=2189>\n##contig=<ID=Un_KN707639v1_decoy,length=1294>\n##contig=<ID=Un_KN707640v1_decoy,length=1831>\n##contig=<ID=Un_KN707641v1_decoy,length=1647>\n##contig=<ID=Un_KN707642v1_decoy,length=2943>\n##contig=<ID=Un_KN707643v1_decoy,length=2857>\n##contig=<ID=Un_KN707644v1_decoy,length=1030>\n##contig=<ID=Un_KN707645v1_decoy,length=1070>\n##contig=<ID=Un_KN707646v1_decoy,length=1735>\n##contig=<ID=Un_KN707647v1_decoy,length=1982>\n##contig=<ID=Un_KN707648v1_decoy,length=1564>\n##contig=<ID=Un_KN707649v1_decoy,length=1775>\n##contig=<ID=Un_KN707650v1_decoy,length=1540>\n##contig=<ID=Un_KN707651v1_decoy,length=2013>\n##contig=<ID=Un_KN707652v1_decoy,length=1176>\n##contig=<ID=Un_KN707653v1_decoy,length=1890>\n##contig=<ID=Un_KN707654v1_decoy,length=3644>\n##contig=<ID=Un_KN707655v1_decoy,length=2785>\n##contig=<ID=Un_KN707656v1_decoy,length=1017>\n##contig=<ID=Un_KN707657v1_decoy,length=1068>\n##contig=<ID=Un_KN707658v1_decoy,length=1007>\n##contig=<ID=Un_KN707659v1_decoy,length=2605>\n##contig=<ID=Un_KN707660v1_decoy,length=8410>\n##contig=<ID=Un_KN707661v1_decoy,length=5534>\n##contig=<ID=Un_KN707662v1_decoy,length=2173>\n##contig=<ID=Un_KN707663v1_decoy,length=1065>\n##contig=<ID=Un_KN707664v1_decoy,length=8683>\n##contig=<ID=Un_KN707665v1_decoy,length=2670>\n##contig=<ID=Un_KN707666v1_decoy,length=2420>\n##contig=<ID=Un_KN707667v1_decoy,length=2189>\n##contig=<ID=Un_KN707668v1_decoy,length=2093>\n##contig=<ID=Un_KN707669v1_decoy,length=1184>\n##contig=<ID=Un_KN707670v1_decoy,length=1205>\n##contig=<ID=Un_KN707671v1_decoy,length=2786>\n##contig=<ID=Un_KN707672v1_decoy,length=2794>\n##contig=<ID=Un_KN707673v1_decoy,length=19544>\n##contig=<ID=Un_KN707674v1_decoy,length=2848>\n##contig=<ID=Un_KN707675v1_decoy,length=10556>\n##contig=<ID=Un_KN707676v1_decoy,length=9066>\n##contig=<ID=Un_KN707677v1_decoy,length=7267>\n##contig=<ID=Un_KN707678v1_decoy,length=2462>\n##contig=<ID=Un_KN707679v1_decoy,length=1774>\n##contig=<ID=Un_KN707680v1_decoy,length=1297>\n##contig=<ID=Un_KN707681v1_decoy,length=4379>\n##contig=<ID=Un_KN707682v1_decoy,length=4208>\n##contig=<ID=Un_KN707683v1_decoy,length=4068>\n##contig=<ID=Un_KN707684v1_decoy,length=2940>\n##contig=<ID=Un_KN707685v1_decoy,length=3938>\n##contig=<ID=Un_KN707686v1_decoy,length=2072>\n##contig=<ID=Un_KN707687v1_decoy,length=1136>\n##contig=<ID=Un_KN707688v1_decoy,length=4248>\n##contig=<ID=Un_KN707689v1_decoy,length=5823>\n##contig=<ID=Un_KN707690v1_decoy,length=3715>\n##contig=<ID=Un_KN707691v1_decoy,length=4885>\n##contig=<ID=Un_KN707692v1_decoy,length=4813>\n##contig=<ID=Un_KN707693v1_decoy,length=2899>\n##contig=<ID=Un_KN707694v1_decoy,length=1228>\n##contig=<ID=Un_KN707695v1_decoy,length=3119>\n##contig=<ID=Un_KN707696v1_decoy,length=3828>\n##contig=<ID=Un_KN707697v1_decoy,length=1186>\n##contig=<ID=Un_KN707698v1_decoy,length=1908>\n##contig=<ID=Un_KN707699v1_decoy,length=2795>\n##contig=<ID=Un_KN707700v1_decoy,length=3703>\n##contig=<ID=Un_KN707701v1_decoy,length=6722>\n##contig=<ID=Un_KN707702v1_decoy,length=6466>\n##contig=<ID=Un_KN707703v1_decoy,length=2235>\n##contig=<ID=Un_KN707704v1_decoy,length=2871>\n##contig=<ID=Un_KN707705v1_decoy,length=4632>\n##contig=<ID=Un_KN707706v1_decoy,length=4225>\n##contig=<ID=Un_KN707707v1_decoy,length=4339>\n##contig=<ID=Un_KN707708v1_decoy,length=2305>\n##contig=<ID=Un_KN707709v1_decoy,length=3273>\n##contig=<ID=Un_KN707710v1_decoy,length=5701>\n##contig=<ID=Un_KN707711v1_decoy,length=4154>\n##contig=<ID=Un_KN707712v1_decoy,length=1243>\n##contig=<ID=Un_KN707713v1_decoy,length=1308>\n##contig=<ID=Un_KN707714v1_decoy,length=2922>\n##contig=<ID=Un_KN707715v1_decoy,length=3044>\n##contig=<ID=Un_KN707716v1_decoy,length=2888>\n##contig=<ID=Un_KN707717v1_decoy,length=1742>\n##contig=<ID=Un_KN707718v1_decoy,length=4969>\n##contig=<ID=Un_KN707719v1_decoy,length=3270>\n##contig=<ID=Un_KN707720v1_decoy,length=6028>\n##contig=<ID=Un_KN707721v1_decoy,length=1105>\n##contig=<ID=Un_KN707722v1_decoy,length=2884>\n##contig=<ID=Un_KN707723v1_decoy,length=1124>\n##contig=<ID=Un_KN707724v1_decoy,length=1454>\n##contig=<ID=Un_KN707725v1_decoy,length=2565>\n##contig=<ID=Un_KN707726v1_decoy,length=2149>\n##contig=<ID=Un_KN707727v1_decoy,length=2630>\n##contig=<ID=Un_KN707728v1_decoy,length=14625>\n##contig=<ID=Un_KN707729v1_decoy,length=7431>\n##contig=<ID=Un_KN707730v1_decoy,length=5776>\n##contig=<ID=Un_KN707731v1_decoy,length=4820>\n##contig=<ID=Un_KN707732v1_decoy,length=1227>\n##contig=<ID=Un_KN707733v1_decoy,length=7503>\n##contig=<ID=Un_KN707734v1_decoy,length=9652>\n##contig=<ID=Un_KN707735v1_decoy,length=1091>\n##contig=<ID=Un_KN707736v1_decoy,length=2467>\n##contig=<ID=Un_KN707737v1_decoy,length=1270>\n##contig=<ID=Un_KN707738v1_decoy,length=4365>\n##contig=<ID=Un_KN707739v1_decoy,length=4284>\n##contig=<ID=Un_KN707740v1_decoy,length=10282>\n##contig=<ID=Un_KN707741v1_decoy,length=5601>\n##contig=<ID=Un_KN707742v1_decoy,length=4758>\n##contig=<ID=Un_KN707743v1_decoy,length=1624>\n##contig=<ID=Un_KN707744v1_decoy,length=4024>\n##contig=<ID=Un_KN707745v1_decoy,length=1276>\n##contig=<ID=Un_KN707746v1_decoy,length=5083>\n##contig=<ID=Un_KN707747v1_decoy,length=2075>\n##contig=<ID=Un_KN707748v1_decoy,length=3553>\n##contig=<ID=Un_KN707749v1_decoy,length=7010>\n##contig=<ID=Un_KN707750v1_decoy,length=4718>\n##contig=<ID=Un_KN707751v1_decoy,length=3546>\n##contig=<ID=Un_KN707752v1_decoy,length=2873>\n##contig=<ID=Un_KN707753v1_decoy,length=2144>\n##contig=<ID=Un_KN707754v1_decoy,length=2243>\n##contig=<ID=Un_KN707755v1_decoy,length=5343>\n##contig=<ID=Un_KN707756v1_decoy,length=4877>\n##contig=<ID=Un_KN707757v1_decoy,length=3034>\n##contig=<ID=Un_KN707758v1_decoy,length=2826>\n##contig=<ID=Un_KN707759v1_decoy,length=1221>\n##contig=<ID=Un_KN707760v1_decoy,length=1169>\n##contig=<ID=Un_KN707761v1_decoy,length=2319>\n##contig=<ID=Un_KN707762v1_decoy,length=3450>\n##contig=<ID=Un_KN707763v1_decoy,length=2674>\n##contig=<ID=Un_KN707764v1_decoy,length=3912>\n##contig=<ID=Un_KN707765v1_decoy,length=6020>\n##contig=<ID=Un_KN707766v1_decoy,length=2303>\n##contig=<ID=Un_KN707767v1_decoy,length=2552>\n##contig=<ID=Un_KN707768v1_decoy,length=3656>\n##contig=<ID=Un_KN707769v1_decoy,length=1591>\n##contig=<ID=Un_KN707770v1_decoy,length=1209>\n##contig=<ID=Un_KN707771v1_decoy,length=3176>\n##contig=<ID=Un_KN707772v1_decoy,length=8915>\n##contig=<ID=Un_KN707773v1_decoy,length=4902>\n##contig=<ID=Un_KN707774v1_decoy,length=3324>\n##contig=<ID=Un_KN707775v1_decoy,length=5997>\n##contig=<ID=Un_KN707776v1_decoy,length=2618>\n##contig=<ID=Un_KN707777v1_decoy,length=10311>\n##contig=<ID=Un_KN707778v1_decoy,length=2440>\n##contig=<ID=Un_KN707779v1_decoy,length=12444>\n##contig=<ID=Un_KN707780v1_decoy,length=5691>\n##contig=<ID=Un_KN707781v1_decoy,length=2717>\n##contig=<ID=Un_KN707782v1_decoy,length=5277>\n##contig=<ID=Un_KN707783v1_decoy,length=4373>\n##contig=<ID=Un_KN707784v1_decoy,length=3224>\n##contig=<ID=Un_KN707785v1_decoy,length=2631>\n##contig=<ID=Un_KN707786v1_decoy,length=5385>\n##contig=<ID=Un_KN707787v1_decoy,length=3678>\n##contig=<ID=Un_KN707788v1_decoy,length=1412>\n##contig=<ID=Un_KN707789v1_decoy,length=1443>\n##contig=<ID=Un_KN707790v1_decoy,length=1098>\n##contig=<ID=Un_KN707791v1_decoy,length=3240>\n##contig=<ID=Un_KN707792v1_decoy,length=1915>\n##contig=<ID=Un_KN707793v1_decoy,length=4667>\n##contig=<ID=Un_KN707794v1_decoy,length=7219>\n##contig=<ID=Un_KN707795v1_decoy,length=3277>\n##contig=<ID=Un_KN707796v1_decoy,length=3473>\n##contig=<ID=Un_KN707797v1_decoy,length=4243>\n##contig=<ID=Un_KN707798v1_decoy,length=17599>\n##contig=<ID=Un_KN707799v1_decoy,length=5095>\n##contig=<ID=Un_KN707800v1_decoy,length=2237>\n##contig=<ID=Un_KN707801v1_decoy,length=2901>\n##contig=<ID=Un_KN707802v1_decoy,length=2666>\n##contig=<ID=Un_KN707803v1_decoy,length=5336>\n##contig=<ID=Un_KN707804v1_decoy,length=4383>\n##contig=<ID=Un_KN707805v1_decoy,length=5446>\n##contig=<ID=Un_KN707806v1_decoy,length=6252>\n##contig=<ID=Un_KN707807v1_decoy,length=4616>\n##contig=<ID=Un_KN707808v1_decoy,length=3021>\n##contig=<ID=Un_KN707809v1_decoy,length=3667>\n##contig=<ID=Un_KN707810v1_decoy,length=4563>\n##contig=<ID=Un_KN707811v1_decoy,length=1120>\n##contig=<ID=Un_KN707812v1_decoy,length=3845>\n##contig=<ID=Un_KN707813v1_decoy,length=2272>\n##contig=<ID=Un_KN707814v1_decoy,length=4764>\n##contig=<ID=Un_KN707815v1_decoy,length=5410>\n##contig=<ID=Un_KN707816v1_decoy,length=7150>\n##contig=<ID=Un_KN707817v1_decoy,length=1762>\n##contig=<ID=Un_KN707818v1_decoy,length=1207>\n##contig=<ID=Un_KN707819v1_decoy,length=1331>\n##contig=<ID=Un_KN707820v1_decoy,length=8307>\n##contig=<ID=Un_KN707821v1_decoy,length=2276>\n##contig=<ID=Un_KN707822v1_decoy,length=2575>\n##contig=<ID=Un_KN707823v1_decoy,length=3970>\n##contig=<ID=Un_KN707824v1_decoy,length=1352>\n##contig=<ID=Un_KN707825v1_decoy,length=3040>\n##contig=<ID=Un_KN707826v1_decoy,length=2070>\n##contig=<ID=Un_KN707827v1_decoy,length=2913>\n##contig=<ID=Un_KN707828v1_decoy,length=2389>\n##contig=<ID=Un_KN707829v1_decoy,length=1835>\n##contig=<ID=Un_KN707830v1_decoy,length=4807>\n##contig=<ID=Un_KN707831v1_decoy,length=2201>\n##contig=<ID=Un_KN707832v1_decoy,length=1265>\n##contig=<ID=Un_KN707833v1_decoy,length=1961>\n##contig=<ID=Un_KN707834v1_decoy,length=1064>\n##contig=<ID=Un_KN707835v1_decoy,length=1932>\n##contig=<ID=Un_KN707836v1_decoy,length=3213>\n##contig=<ID=Un_KN707837v1_decoy,length=1178>\n##contig=<ID=Un_KN707838v1_decoy,length=2926>\n##contig=<ID=Un_KN707839v1_decoy,length=1038>\n##contig=<ID=Un_KN707840v1_decoy,length=3298>\n##contig=<ID=Un_KN707841v1_decoy,length=8992>\n##contig=<ID=Un_KN707842v1_decoy,length=6698>\n##contig=<ID=Un_KN707843v1_decoy,length=4880>\n##contig=<ID=Un_KN707844v1_decoy,length=1766>\n##contig=<ID=Un_KN707845v1_decoy,length=3532>\n##contig=<ID=Un_KN707846v1_decoy,length=2297>\n##contig=<ID=Un_KN707847v1_decoy,length=1234>\n##contig=<ID=Un_KN707848v1_decoy,length=1205>\n##contig=<ID=Un_KN707849v1_decoy,length=2790>\n##contig=<ID=Un_KN707850v1_decoy,length=2006>\n##contig=<ID=Un_KN707851v1_decoy,length=4593>\n##contig=<ID=Un_KN707852v1_decoy,length=1579>\n##contig=<ID=Un_KN707853v1_decoy,length=9597>\n##contig=<ID=Un_KN707854v1_decoy,length=10451>\n##contig=<ID=Un_KN707855v1_decoy,length=3219>\n##contig=<ID=Un_KN707856v1_decoy,length=2300>\n##contig=<ID=Un_KN707857v1_decoy,length=5985>\n##contig=<ID=Un_KN707858v1_decoy,length=2959>\n##contig=<ID=Un_KN707859v1_decoy,length=1340>\n##contig=<ID=Un_KN707860v1_decoy,length=3148>\n##contig=<ID=Un_KN707861v1_decoy,length=2242>\n##contig=<ID=Un_KN707862v1_decoy,length=16513>\n##contig=<ID=Un_KN707863v1_decoy,length=7821>\n##contig=<ID=Un_KN707864v1_decoy,length=2159>\n##contig=<ID=Un_KN707865v1_decoy,length=2114>\n##contig=<ID=Un_KN707866v1_decoy,length=4109>\n##contig=<ID=Un_KN707867v1_decoy,length=1544>\n##contig=<ID=Un_KN707868v1_decoy,length=1005>\n##contig=<ID=Un_KN707869v1_decoy,length=8632>\n##contig=<ID=Un_KN707870v1_decoy,length=1012>\n##contig=<ID=Un_KN707871v1_decoy,length=4728>\n##contig=<ID=Un_KN707872v1_decoy,length=2165>\n##contig=<ID=Un_KN707873v1_decoy,length=7591>\n##contig=<ID=Un_KN707874v1_decoy,length=5202>\n##contig=<ID=Un_KN707875v1_decoy,length=4241>\n##contig=<ID=Un_KN707876v1_decoy,length=4131>\n##contig=<ID=Un_KN707877v1_decoy,length=2272>\n##contig=<ID=Un_KN707878v1_decoy,length=2085>\n##contig=<ID=Un_KN707879v1_decoy,length=4346>\n##contig=<ID=Un_KN707880v1_decoy,length=1208>\n##contig=<ID=Un_KN707881v1_decoy,length=4543>\n##contig=<ID=Un_KN707882v1_decoy,length=2772>\n##contig=<ID=Un_KN707883v1_decoy,length=2490>\n##contig=<ID=Un_KN707884v1_decoy,length=4568>\n##contig=<ID=Un_KN707885v1_decoy,length=1776>\n##contig=<ID=Un_KN707886v1_decoy,length=2699>\n##contig=<ID=Un_KN707887v1_decoy,length=3534>\n##contig=<ID=Un_KN707888v1_decoy,length=2424>\n##contig=<ID=Un_KN707889v1_decoy,length=1747>\n##contig=<ID=Un_KN707890v1_decoy,length=1088>\n##contig=<ID=Un_KN707891v1_decoy,length=1143>\n##contig=<ID=Un_KN707892v1_decoy,length=2530>\n##contig=<ID=Un_KN707893v1_decoy,length=8049>\n##contig=<ID=Un_KN707894v1_decoy,length=1366>\n##contig=<ID=Un_KN707895v1_decoy,length=4284>\n##contig=<ID=Un_KN707896v1_decoy,length=33125>\n##contig=<ID=Un_KN707897v1_decoy,length=2137>\n##contig=<ID=Un_KN707898v1_decoy,length=3840>\n##contig=<ID=Un_KN707899v1_decoy,length=3087>\n##contig=<ID=Un_KN707900v1_decoy,length=2041>\n##contig=<ID=Un_KN707901v1_decoy,length=3344>\n##contig=<ID=Un_KN707902v1_decoy,length=2921>\n##contig=<ID=Un_KN707903v1_decoy,length=6581>\n##contig=<ID=Un_KN707904v1_decoy,length=3968>\n##contig=<ID=Un_KN707905v1_decoy,length=2339>\n##contig=<ID=Un_KN707906v1_decoy,length=1243>\n##contig=<ID=Un_KN707907v1_decoy,length=7776>\n##contig=<ID=Un_KN707908v1_decoy,length=19837>\n##contig=<ID=Un_KN707909v1_decoy,length=1737>\n##contig=<ID=Un_KN707910v1_decoy,length=1098>\n##contig=<ID=Un_KN707911v1_decoy,length=1893>\n##contig=<ID=Un_KN707912v1_decoy,length=1281>\n##contig=<ID=Un_KN707913v1_decoy,length=1527>\n##contig=<ID=Un_KN707914v1_decoy,length=2055>\n##contig=<ID=Un_KN707915v1_decoy,length=2527>\n##contig=<ID=Un_KN707916v1_decoy,length=3275>\n##contig=<ID=Un_KN707917v1_decoy,length=1265>\n##contig=<ID=Un_KN707918v1_decoy,length=2623>\n##contig=<ID=Un_KN707919v1_decoy,length=4850>\n##contig=<ID=Un_KN707920v1_decoy,length=3584>\n##contig=<ID=Un_KN707921v1_decoy,length=2561>\n##contig=<ID=Un_KN707922v1_decoy,length=3041>\n##contig=<ID=Un_KN707923v1_decoy,length=1409>\n##contig=<ID=Un_KN707924v1_decoy,length=4596>\n##contig=<ID=Un_KN707925v1_decoy,length=11555>\n##contig=<ID=Un_KN707926v1_decoy,length=1266>\n##contig=<ID=Un_KN707927v1_decoy,length=1079>\n##contig=<ID=Un_KN707928v1_decoy,length=1087>\n##contig=<ID=Un_KN707929v1_decoy,length=1226>\n##contig=<ID=Un_KN707930v1_decoy,length=1131>\n##contig=<ID=Un_KN707931v1_decoy,length=1199>\n##contig=<ID=Un_KN707932v1_decoy,length=1084>\n##contig=<ID=Un_KN707933v1_decoy,length=2038>\n##contig=<ID=Un_KN707934v1_decoy,length=1070>\n##contig=<ID=Un_KN707935v1_decoy,length=1312>\n##contig=<ID=Un_KN707936v1_decoy,length=4031>\n##contig=<ID=Un_KN707937v1_decoy,length=7445>\n##contig=<ID=Un_KN707938v1_decoy,length=1770>\n##contig=<ID=Un_KN707939v1_decoy,length=5600>\n##contig=<ID=Un_KN707940v1_decoy,length=1882>\n##contig=<ID=Un_KN707941v1_decoy,length=1170>\n##contig=<ID=Un_KN707942v1_decoy,length=1300>\n##contig=<ID=Un_KN707943v1_decoy,length=5325>\n##contig=<ID=Un_KN707944v1_decoy,length=2043>\n##contig=<ID=Un_KN707945v1_decoy,length=1072>\n##contig=<ID=Un_KN707946v1_decoy,length=2463>\n##contig=<ID=Un_KN707947v1_decoy,length=1010>\n##contig=<ID=Un_KN707948v1_decoy,length=1432>\n##contig=<ID=Un_KN707949v1_decoy,length=1162>\n##contig=<ID=Un_KN707950v1_decoy,length=1095>\n##contig=<ID=Un_KN707951v1_decoy,length=1118>\n##contig=<ID=Un_KN707952v1_decoy,length=1383>\n##contig=<ID=Un_KN707953v1_decoy,length=2289>\n##contig=<ID=Un_KN707954v1_decoy,length=1648>\n##contig=<ID=Un_KN707955v1_decoy,length=2203>\n##contig=<ID=Un_KN707956v1_decoy,length=3270>\n##contig=<ID=Un_KN707957v1_decoy,length=11499>\n##contig=<ID=Un_KN707958v1_decoy,length=2474>\n##contig=<ID=Un_KN707959v1_decoy,length=2294>\n##contig=<ID=Un_KN707960v1_decoy,length=1238>\n##contig=<ID=Un_KN707961v1_decoy,length=3410>\n##contig=<ID=Un_KN707962v1_decoy,length=1523>\n##contig=<ID=Un_KN707963v1_decoy,length=62955>\n##contig=<ID=Un_KN707964v1_decoy,length=6282>\n##contig=<ID=Un_KN707965v1_decoy,length=3836>\n##contig=<ID=Un_KN707966v1_decoy,length=6486>\n##contig=<ID=Un_KN707967v1_decoy,length=15368>\n##contig=<ID=Un_KN707968v1_decoy,length=9572>\n##contig=<ID=Un_KN707969v1_decoy,length=6413>\n##contig=<ID=Un_KN707970v1_decoy,length=4104>\n##contig=<ID=Un_KN707971v1_decoy,length=12943>\n##contig=<ID=Un_KN707972v1_decoy,length=4650>\n##contig=<ID=Un_KN707973v1_decoy,length=3080>\n##contig=<ID=Un_KN707974v1_decoy,length=3134>\n##contig=<ID=Un_KN707975v1_decoy,length=6211>\n##contig=<ID=Un_KN707976v1_decoy,length=1126>\n##contig=<ID=Un_KN707977v1_decoy,length=1101>\n##contig=<ID=Un_KN707978v1_decoy,length=1101>\n##contig=<ID=Un_KN707979v1_decoy,length=2648>\n##contig=<ID=Un_KN707980v1_decoy,length=2973>\n##contig=<ID=Un_KN707981v1_decoy,length=2520>\n##contig=<ID=Un_KN707982v1_decoy,length=2318>\n##contig=<ID=Un_KN707983v1_decoy,length=2606>\n##contig=<ID=Un_KN707984v1_decoy,length=2205>\n##contig=<ID=Un_KN707985v1_decoy,length=2929>\n##contig=<ID=Un_KN707986v1_decoy,length=3869>\n##contig=<ID=Un_KN707987v1_decoy,length=1117>\n##contig=<ID=Un_KN707988v1_decoy,length=2960>\n##contig=<ID=Un_KN707989v1_decoy,length=1009>\n##contig=<ID=Un_KN707990v1_decoy,length=4048>\n##contig=<ID=Un_KN707991v1_decoy,length=2193>\n##contig=<ID=Un_KN707992v1_decoy,length=1830>\n##contig=<ID=Un_JTFH01000001v1_decoy,length=25139>\n##contig=<ID=Un_JTFH01000002v1_decoy,length=18532>\n##contig=<ID=Un_JTFH01000003v1_decoy,length=15240>\n##contig=<ID=Un_JTFH01000004v1_decoy,length=13739>\n##contig=<ID=Un_JTFH01000005v1_decoy,length=11297>\n##contig=<ID=Un_JTFH01000006v1_decoy,length=10074>\n##contig=<ID=Un_JTFH01000007v1_decoy,length=9891>\n##contig=<ID=Un_JTFH01000008v1_decoy,length=9774>\n##contig=<ID=Un_JTFH01000009v1_decoy,length=9727>\n##contig=<ID=Un_JTFH01000010v1_decoy,length=9358>\n##contig=<ID=Un_JTFH01000011v1_decoy,length=8920>\n##contig=<ID=Un_JTFH01000012v1_decoy,length=8479>\n##contig=<ID=Un_JTFH01000013v1_decoy,length=8312>\n##contig=<ID=Un_JTFH01000014v1_decoy,length=8261>\n##contig=<ID=Un_JTFH01000015v1_decoy,length=8131>\n##contig=<ID=Un_JTFH01000016v1_decoy,length=8051>\n##contig=<ID=Un_JTFH01000017v1_decoy,length=7832>\n##contig=<ID=Un_JTFH01000018v1_decoy,length=7710>\n##contig=<ID=Un_JTFH01000019v1_decoy,length=7702>\n##contig=<ID=Un_JTFH01000020v1_decoy,length=7479>\n##contig=<ID=Un_JTFH01000021v1_decoy,length=7368>\n##contig=<ID=Un_JTFH01000022v1_decoy,length=7162>\n##contig=<ID=Un_JTFH01000023v1_decoy,length=7065>\n##contig=<ID=Un_JTFH01000024v1_decoy,length=7019>\n##contig=<ID=Un_JTFH01000025v1_decoy,length=6997>\n##contig=<ID=Un_JTFH01000026v1_decoy,length=6994>\n##contig=<ID=Un_JTFH01000027v1_decoy,length=6979>\n##contig=<ID=Un_JTFH01000028v1_decoy,length=6797>\n##contig=<ID=Un_JTFH01000029v1_decoy,length=6525>\n##contig=<ID=Un_JTFH01000030v1_decoy,length=6246>\n##contig=<ID=Un_JTFH01000031v1_decoy,length=5926>\n##contig=<ID=Un_JTFH01000032v1_decoy,length=5914>\n##contig=<ID=Un_JTFH01000033v1_decoy,length=5898>\n##contig=<ID=Un_JTFH01000034v1_decoy,length=5879>\n##contig=<ID=Un_JTFH01000035v1_decoy,length=5834>\n##contig=<ID=Un_JTFH01000036v1_decoy,length=5743>\n##contig=<ID=Un_JTFH01000037v1_decoy,length=5577>\n##contig=<ID=Un_JTFH01000038v1_decoy,length=5413>\n##contig=<ID=Un_JTFH01000039v1_decoy,length=5250>\n##contig=<ID=Un_JTFH01000040v1_decoy,length=5246>\n##contig=<ID=Un_JTFH01000041v1_decoy,length=5118>\n##contig=<ID=Un_JTFH01000042v1_decoy,length=5058>\n##contig=<ID=Un_JTFH01000043v1_decoy,length=4959>\n##contig=<ID=Un_JTFH01000044v1_decoy,length=4853>\n##contig=<ID=Un_JTFH01000045v1_decoy,length=4828>\n##contig=<ID=Un_JTFH01000046v1_decoy,length=4819>\n##contig=<ID=Un_JTFH01000047v1_decoy,length=4809>\n##contig=<ID=Un_JTFH01000048v1_decoy,length=4710>\n##contig=<ID=Un_JTFH01000049v1_decoy,length=4680>\n##contig=<ID=Un_JTFH01000050v1_decoy,length=4645>\n##contig=<ID=Un_JTFH01000051v1_decoy,length=4514>\n##contig=<ID=Un_JTFH01000052v1_decoy,length=4439>\n##contig=<ID=Un_JTFH01000053v1_decoy,length=4416>\n##contig=<ID=Un_JTFH01000054v1_decoy,length=4409>\n##contig=<ID=Un_JTFH01000055v1_decoy,length=4392>\n##contig=<ID=Un_JTFH01000056v1_decoy,length=4359>\n##contig=<ID=Un_JTFH01000057v1_decoy,length=4319>\n##contig=<ID=Un_JTFH01000058v1_decoy,length=4290>\n##contig=<ID=Un_JTFH01000059v1_decoy,length=4242>\n##contig=<ID=Un_JTFH01000060v1_decoy,length=4228>\n##contig=<ID=Un_JTFH01000061v1_decoy,length=4222>\n##contig=<ID=Un_JTFH01000062v1_decoy,length=4216>\n##contig=<ID=Un_JTFH01000063v1_decoy,length=4210>\n##contig=<ID=Un_JTFH01000064v1_decoy,length=4206>\n##contig=<ID=Un_JTFH01000065v1_decoy,length=4102>\n##contig=<ID=Un_JTFH01000066v1_decoy,length=4101>\n##contig=<ID=Un_JTFH01000067v1_decoy,length=4083>\n##contig=<ID=Un_JTFH01000068v1_decoy,length=3967>\n##contig=<ID=Un_JTFH01000069v1_decoy,length=3955>\n##contig=<ID=Un_JTFH01000070v1_decoy,length=3945>\n##contig=<ID=Un_JTFH01000071v1_decoy,length=3930>\n##contig=<ID=Un_JTFH01000072v1_decoy,length=3929>\n##contig=<ID=Un_JTFH01000073v1_decoy,length=3924>\n##contig=<ID=Un_JTFH01000074v1_decoy,length=3919>\n##contig=<ID=Un_JTFH01000075v1_decoy,length=3908>\n##contig=<ID=Un_JTFH01000076v1_decoy,length=3892>\n##contig=<ID=Un_JTFH01000077v1_decoy,length=3890>\n##contig=<ID=Un_JTFH01000078v1_decoy,length=3859>\n##contig=<ID=Un_JTFH01000079v1_decoy,length=3846>\n##contig=<ID=Un_JTFH01000080v1_decoy,length=3835>\n##contig=<ID=Un_JTFH01000081v1_decoy,length=3830>\n##contig=<ID=Un_JTFH01000082v1_decoy,length=3828>\n##contig=<ID=Un_JTFH01000083v1_decoy,length=3825>\n##contig=<ID=Un_JTFH01000084v1_decoy,length=3821>\n##contig=<ID=Un_JTFH01000085v1_decoy,length=3809>\n##contig=<ID=Un_JTFH01000086v1_decoy,length=3801>\n##contig=<ID=Un_JTFH01000087v1_decoy,length=3799>\n##contig=<ID=Un_JTFH01000088v1_decoy,length=3737>\n##contig=<ID=Un_JTFH01000089v1_decoy,length=3701>\n##contig=<ID=Un_JTFH01000090v1_decoy,length=3698>\n##contig=<ID=Un_JTFH01000091v1_decoy,length=3692>\n##contig=<ID=Un_JTFH01000092v1_decoy,length=3686>\n##contig=<ID=Un_JTFH01000093v1_decoy,length=3677>\n##contig=<ID=Un_JTFH01000094v1_decoy,length=3664>\n##contig=<ID=Un_JTFH01000095v1_decoy,length=3613>\n##contig=<ID=Un_JTFH01000096v1_decoy,length=3611>\n##contig=<ID=Un_JTFH01000097v1_decoy,length=3606>\n##contig=<ID=Un_JTFH01000098v1_decoy,length=3584>\n##contig=<ID=Un_JTFH01000099v1_decoy,length=3581>\n##contig=<ID=Un_JTFH01000100v1_decoy,length=3543>\n##contig=<ID=Un_JTFH01000101v1_decoy,length=3528>\n##contig=<ID=Un_JTFH01000102v1_decoy,length=3527>\n##contig=<ID=Un_JTFH01000103v1_decoy,length=3496>\n##contig=<ID=Un_JTFH01000104v1_decoy,length=3493>\n##contig=<ID=Un_JTFH01000105v1_decoy,length=3484>\n##contig=<ID=Un_JTFH01000106v1_decoy,length=3435>\n##contig=<ID=Un_JTFH01000107v1_decoy,length=3391>\n##contig=<ID=Un_JTFH01000108v1_decoy,length=3374>\n##contig=<ID=Un_JTFH01000109v1_decoy,length=3371>\n##contig=<ID=Un_JTFH01000110v1_decoy,length=3361>\n##contig=<ID=Un_JTFH01000111v1_decoy,length=3351>\n##contig=<ID=Un_JTFH01000112v1_decoy,length=3340>\n##contig=<ID=Un_JTFH01000113v1_decoy,length=3320>\n##contig=<ID=Un_JTFH01000114v1_decoy,length=3282>\n##contig=<ID=Un_JTFH01000115v1_decoy,length=3278>\n##contig=<ID=Un_JTFH01000116v1_decoy,length=3260>\n##contig=<ID=Un_JTFH01000117v1_decoy,length=3258>\n##contig=<ID=Un_JTFH01000118v1_decoy,length=3253>\n##contig=<ID=Un_JTFH01000119v1_decoy,length=3247>\n##contig=<ID=Un_JTFH01000120v1_decoy,length=3230>\n##contig=<ID=Un_JTFH01000121v1_decoy,length=3224>\n##contig=<ID=Un_JTFH01000122v1_decoy,length=3216>\n##contig=<ID=Un_JTFH01000123v1_decoy,length=3212>\n##contig=<ID=Un_JTFH01000124v1_decoy,length=3194>\n##contig=<ID=Un_JTFH01000125v1_decoy,length=3189>\n##contig=<ID=Un_JTFH01000126v1_decoy,length=3177>\n##contig=<ID=Un_JTFH01000127v1_decoy,length=3176>\n##contig=<ID=Un_JTFH01000128v1_decoy,length=3173>\n##contig=<ID=Un_JTFH01000129v1_decoy,length=3170>\n##contig=<ID=Un_JTFH01000130v1_decoy,length=3166>\n##contig=<ID=Un_JTFH01000131v1_decoy,length=3163>\n##contig=<ID=Un_JTFH01000132v1_decoy,length=3143>\n##contig=<ID=Un_JTFH01000133v1_decoy,length=3137>\n##contig=<ID=Un_JTFH01000134v1_decoy,length=3116>\n##contig=<ID=Un_JTFH01000135v1_decoy,length=3106>\n##contig=<ID=Un_JTFH01000136v1_decoy,length=3093>\n##contig=<ID=Un_JTFH01000137v1_decoy,length=3079>\n##contig=<ID=Un_JTFH01000138v1_decoy,length=3053>\n##contig=<ID=Un_JTFH01000139v1_decoy,length=3051>\n##contig=<ID=Un_JTFH01000140v1_decoy,length=3015>\n##contig=<ID=Un_JTFH01000141v1_decoy,length=3012>\n##contig=<ID=Un_JTFH01000142v1_decoy,length=3009>\n##contig=<ID=Un_JTFH01000143v1_decoy,length=2997>\n##contig=<ID=Un_JTFH01000144v1_decoy,length=2997>\n##contig=<ID=Un_JTFH01000145v1_decoy,length=2983>\n##contig=<ID=Un_JTFH01000146v1_decoy,length=2979>\n##contig=<ID=Un_JTFH01000147v1_decoy,length=2967>\n##contig=<ID=Un_JTFH01000148v1_decoy,length=2967>\n##contig=<ID=Un_JTFH01000149v1_decoy,length=2966>\n##contig=<ID=Un_JTFH01000150v1_decoy,length=2954>\n##contig=<ID=Un_JTFH01000151v1_decoy,length=2952>\n##contig=<ID=Un_JTFH01000152v1_decoy,length=2934>\n##contig=<ID=Un_JTFH01000153v1_decoy,length=2918>\n##contig=<ID=Un_JTFH01000154v1_decoy,length=2895>\n##contig=<ID=Un_JTFH01000155v1_decoy,length=2887>\n##contig=<ID=Un_JTFH01000156v1_decoy,length=2879>\n##contig=<ID=Un_JTFH01000157v1_decoy,length=2878>\n##contig=<ID=Un_JTFH01000158v1_decoy,length=2872>\n##contig=<ID=Un_JTFH01000159v1_decoy,length=2868>\n##contig=<ID=Un_JTFH01000160v1_decoy,length=2866>\n##contig=<ID=Un_JTFH01000161v1_decoy,length=2865>\n##contig=<ID=Un_JTFH01000162v1_decoy,length=2864>\n##contig=<ID=Un_JTFH01000163v1_decoy,length=2859>\n##contig=<ID=Un_JTFH01000164v1_decoy,length=2854>\n##contig=<ID=Un_JTFH01000165v1_decoy,length=2830>\n##contig=<ID=Un_JTFH01000166v1_decoy,length=2828>\n##contig=<ID=Un_JTFH01000167v1_decoy,length=2824>\n##contig=<ID=Un_JTFH01000168v1_decoy,length=2819>\n##contig=<ID=Un_JTFH01000169v1_decoy,length=2813>\n##contig=<ID=Un_JTFH01000170v1_decoy,length=2809>\n##contig=<ID=Un_JTFH01000171v1_decoy,length=2802>\n##contig=<ID=Un_JTFH01000172v1_decoy,length=2791>\n##contig=<ID=Un_JTFH01000173v1_decoy,length=2783>\n##contig=<ID=Un_JTFH01000174v1_decoy,length=2778>\n##contig=<ID=Un_JTFH01000175v1_decoy,length=2777>\n##contig=<ID=Un_JTFH01000176v1_decoy,length=2770>\n##contig=<ID=Un_JTFH01000177v1_decoy,length=2769>\n##contig=<ID=Un_JTFH01000178v1_decoy,length=2767>\n##contig=<ID=Un_JTFH01000179v1_decoy,length=2763>\n##contig=<ID=Un_JTFH01000180v1_decoy,length=2745>\n##contig=<ID=Un_JTFH01000181v1_decoy,length=2742>\n##contig=<ID=Un_JTFH01000182v1_decoy,length=2736>\n##contig=<ID=Un_JTFH01000183v1_decoy,length=2729>\n##contig=<ID=Un_JTFH01000184v1_decoy,length=2726>\n##contig=<ID=Un_JTFH01000185v1_decoy,length=2719>\n##contig=<ID=Un_JTFH01000186v1_decoy,length=2715>\n##contig=<ID=Un_JTFH01000187v1_decoy,length=2708>\n##contig=<ID=Un_JTFH01000188v1_decoy,length=2704>\n##contig=<ID=Un_JTFH01000189v1_decoy,length=2692>\n##contig=<ID=Un_JTFH01000190v1_decoy,length=2691>\n##contig=<ID=Un_JTFH01000191v1_decoy,length=2690>\n##contig=<ID=Un_JTFH01000192v1_decoy,length=2687>\n##contig=<ID=Un_JTFH01000193v1_decoy,length=2677>\n##contig=<ID=Un_JTFH01000194v1_decoy,length=2668>\n##contig=<ID=Un_JTFH01000195v1_decoy,length=2668>\n##contig=<ID=Un_JTFH01000196v1_decoy,length=2663>\n##contig=<ID=Un_JTFH01000197v1_decoy,length=2655>\n##contig=<ID=Un_JTFH01000198v1_decoy,length=2644>\n##contig=<ID=Un_JTFH01000199v1_decoy,length=2642>\n##contig=<ID=Un_JTFH01000200v1_decoy,length=2632>\n##contig=<ID=Un_JTFH01000201v1_decoy,length=2632>\n##contig=<ID=Un_JTFH01000202v1_decoy,length=2628>\n##contig=<ID=Un_JTFH01000203v1_decoy,length=2623>\n##contig=<ID=Un_JTFH01000204v1_decoy,length=2622>\n##contig=<ID=Un_JTFH01000205v1_decoy,length=2619>\n##contig=<ID=Un_JTFH01000206v1_decoy,length=2605>\n##contig=<ID=Un_JTFH01000207v1_decoy,length=2603>\n##contig=<ID=Un_JTFH01000208v1_decoy,length=2601>\n##contig=<ID=Un_JTFH01000209v1_decoy,length=2598>\n##contig=<ID=Un_JTFH01000210v1_decoy,length=2597>\n##contig=<ID=Un_JTFH01000211v1_decoy,length=2596>\n##contig=<ID=Un_JTFH01000212v1_decoy,length=2594>\n##contig=<ID=Un_JTFH01000213v1_decoy,length=2586>\n##contig=<ID=Un_JTFH01000214v1_decoy,length=2585>\n##contig=<ID=Un_JTFH01000215v1_decoy,length=2583>\n##contig=<ID=Un_JTFH01000216v1_decoy,length=2578>\n##contig=<ID=Un_JTFH01000217v1_decoy,length=2569>\n##contig=<ID=Un_JTFH01000218v1_decoy,length=2569>\n##contig=<ID=Un_JTFH01000219v1_decoy,length=2551>\n##contig=<ID=Un_JTFH01000220v1_decoy,length=2548>\n##contig=<ID=Un_JTFH01000221v1_decoy,length=2548>\n##contig=<ID=Un_JTFH01000222v1_decoy,length=2546>\n##contig=<ID=Un_JTFH01000223v1_decoy,length=2545>\n##contig=<ID=Un_JTFH01000224v1_decoy,length=2534>\n##contig=<ID=Un_JTFH01000225v1_decoy,length=2533>\n##contig=<ID=Un_JTFH01000226v1_decoy,length=2522>\n##contig=<ID=Un_JTFH01000227v1_decoy,length=2522>\n##contig=<ID=Un_JTFH01000228v1_decoy,length=2515>\n##contig=<ID=Un_JTFH01000229v1_decoy,length=2513>\n##contig=<ID=Un_JTFH01000230v1_decoy,length=2507>\n##contig=<ID=Un_JTFH01000231v1_decoy,length=2504>\n##contig=<ID=Un_JTFH01000232v1_decoy,length=2497>\n##contig=<ID=Un_JTFH01000233v1_decoy,length=2471>\n##contig=<ID=Un_JTFH01000234v1_decoy,length=2465>\n##contig=<ID=Un_JTFH01000235v1_decoy,length=2464>\n##contig=<ID=Un_JTFH01000236v1_decoy,length=2459>\n##contig=<ID=Un_JTFH01000237v1_decoy,length=2457>\n##contig=<ID=Un_JTFH01000238v1_decoy,length=2450>\n##contig=<ID=Un_JTFH01000239v1_decoy,length=2435>\n##contig=<ID=Un_JTFH01000240v1_decoy,length=2434>\n##contig=<ID=Un_JTFH01000241v1_decoy,length=2432>\n##contig=<ID=Un_JTFH01000242v1_decoy,length=2427>\n##contig=<ID=Un_JTFH01000243v1_decoy,length=2421>\n##contig=<ID=Un_JTFH01000244v1_decoy,length=2420>\n##contig=<ID=Un_JTFH01000245v1_decoy,length=2414>\n##contig=<ID=Un_JTFH01000246v1_decoy,length=2404>\n##contig=<ID=Un_JTFH01000247v1_decoy,length=2403>\n##contig=<ID=Un_JTFH01000248v1_decoy,length=2402>\n##contig=<ID=Un_JTFH01000249v1_decoy,length=2397>\n##contig=<ID=Un_JTFH01000250v1_decoy,length=2395>\n##contig=<ID=Un_JTFH01000251v1_decoy,length=2394>\n##contig=<ID=Un_JTFH01000252v1_decoy,length=2388>\n##contig=<ID=Un_JTFH01000253v1_decoy,length=2382>\n##contig=<ID=Un_JTFH01000254v1_decoy,length=2381>\n##contig=<ID=Un_JTFH01000255v1_decoy,length=2380>\n##contig=<ID=Un_JTFH01000256v1_decoy,length=2368>\n##contig=<ID=Un_JTFH01000257v1_decoy,length=2364>\n##contig=<ID=Un_JTFH01000258v1_decoy,length=2363>\n##contig=<ID=Un_JTFH01000259v1_decoy,length=2348>\n##contig=<ID=Un_JTFH01000260v1_decoy,length=2339>\n##contig=<ID=Un_JTFH01000261v1_decoy,length=2335>\n##contig=<ID=Un_JTFH01000262v1_decoy,length=2332>\n##contig=<ID=Un_JTFH01000263v1_decoy,length=2331>\n##contig=<ID=Un_JTFH01000264v1_decoy,length=2330>\n##contig=<ID=Un_JTFH01000265v1_decoy,length=2323>\n##contig=<ID=Un_JTFH01000266v1_decoy,length=2319>\n##contig=<ID=Un_JTFH01000267v1_decoy,length=2314>\n##contig=<ID=Un_JTFH01000268v1_decoy,length=2308>\n##contig=<ID=Un_JTFH01000269v1_decoy,length=2306>\n##contig=<ID=Un_JTFH01000270v1_decoy,length=2296>\n##contig=<ID=Un_JTFH01000271v1_decoy,length=2287>\n##contig=<ID=Un_JTFH01000272v1_decoy,length=2279>\n##contig=<ID=Un_JTFH01000273v1_decoy,length=2276>\n##contig=<ID=Un_JTFH01000274v1_decoy,length=2273>\n##contig=<ID=Un_JTFH01000275v1_decoy,length=2262>\n##contig=<ID=Un_JTFH01000276v1_decoy,length=2254>\n##contig=<ID=Un_JTFH01000277v1_decoy,length=2252>\n##contig=<ID=Un_JTFH01000278v1_decoy,length=2245>\n##contig=<ID=Un_JTFH01000279v1_decoy,length=2239>\n##contig=<ID=Un_JTFH01000280v1_decoy,length=2223>\n##contig=<ID=Un_JTFH01000281v1_decoy,length=2220>\n##contig=<ID=Un_JTFH01000282v1_decoy,length=2218>\n##contig=<ID=Un_JTFH01000283v1_decoy,length=2215>\n##contig=<ID=Un_JTFH01000284v1_decoy,length=2213>\n##contig=<ID=Un_JTFH01000285v1_decoy,length=2203>\n##contig=<ID=Un_JTFH01000286v1_decoy,length=2200>\n##contig=<ID=Un_JTFH01000287v1_decoy,length=2197>\n##contig=<ID=Un_JTFH01000288v1_decoy,length=2194>\n##contig=<ID=Un_JTFH01000289v1_decoy,length=2183>\n##contig=<ID=Un_JTFH01000290v1_decoy,length=2179>\n##contig=<ID=Un_JTFH01000291v1_decoy,length=2177>\n##contig=<ID=Un_JTFH01000292v1_decoy,length=2177>\n##contig=<ID=Un_JTFH01000293v1_decoy,length=2177>\n##contig=<ID=Un_JTFH01000294v1_decoy,length=2168>\n##contig=<ID=Un_JTFH01000295v1_decoy,length=2160>\n##contig=<ID=Un_JTFH01000296v1_decoy,length=2155>\n##contig=<ID=Un_JTFH01000297v1_decoy,length=2144>\n##contig=<ID=Un_JTFH01000298v1_decoy,length=2143>\n##contig=<ID=Un_JTFH01000299v1_decoy,length=2136>\n##contig=<ID=Un_JTFH01000300v1_decoy,length=2134>\n##contig=<ID=Un_JTFH01000301v1_decoy,length=2129>\n##contig=<ID=Un_JTFH01000302v1_decoy,length=2128>\n##contig=<ID=Un_JTFH01000303v1_decoy,length=2125>\n##contig=<ID=Un_JTFH01000304v1_decoy,length=2125>\n##contig=<ID=Un_JTFH01000305v1_decoy,length=2122>\n##contig=<ID=Un_JTFH01000306v1_decoy,length=2111>\n##contig=<ID=Un_JTFH01000307v1_decoy,length=2106>\n##contig=<ID=Un_JTFH01000308v1_decoy,length=2094>\n##contig=<ID=Un_JTFH01000309v1_decoy,length=2093>\n##contig=<ID=Un_JTFH01000310v1_decoy,length=2088>\n##contig=<ID=Un_JTFH01000311v1_decoy,length=2086>\n##contig=<ID=Un_JTFH01000312v1_decoy,length=2086>\n##contig=<ID=Un_JTFH01000313v1_decoy,length=2084>\n##contig=<ID=Un_JTFH01000314v1_decoy,length=2080>\n##contig=<ID=Un_JTFH01000315v1_decoy,length=2079>\n##contig=<ID=Un_JTFH01000316v1_decoy,length=2076>\n##contig=<ID=Un_JTFH01000317v1_decoy,length=2071>\n##contig=<ID=Un_JTFH01000318v1_decoy,length=2066>\n##contig=<ID=Un_JTFH01000319v1_decoy,length=2061>\n##contig=<ID=Un_JTFH01000320v1_decoy,length=2055>\n##contig=<ID=Un_JTFH01000321v1_decoy,length=2053>\n##contig=<ID=Un_JTFH01000322v1_decoy,length=2040>\n##contig=<ID=Un_JTFH01000323v1_decoy,length=2036>\n##contig=<ID=Un_JTFH01000324v1_decoy,length=2035>\n##contig=<ID=Un_JTFH01000325v1_decoy,length=2034>\n##contig=<ID=Un_JTFH01000326v1_decoy,length=2032>\n##contig=<ID=Un_JTFH01000327v1_decoy,length=2029>\n##contig=<ID=Un_JTFH01000328v1_decoy,length=2025>\n##contig=<ID=Un_JTFH01000329v1_decoy,length=2021>\n##contig=<ID=Un_JTFH01000330v1_decoy,length=2018>\n##contig=<ID=Un_JTFH01000331v1_decoy,length=2015>\n##contig=<ID=Un_JTFH01000332v1_decoy,length=2009>\n##contig=<ID=Un_JTFH01000333v1_decoy,length=2007>\n##contig=<ID=Un_JTFH01000334v1_decoy,length=2005>\n##contig=<ID=Un_JTFH01000335v1_decoy,length=2003>\n##contig=<ID=Un_JTFH01000336v1_decoy,length=2001>\n##contig=<ID=Un_JTFH01000337v1_decoy,length=2001>\n##contig=<ID=Un_JTFH01000338v1_decoy,length=2000>\n##contig=<ID=Un_JTFH01000339v1_decoy,length=1996>\n##contig=<ID=Un_JTFH01000340v1_decoy,length=1992>\n##contig=<ID=Un_JTFH01000341v1_decoy,length=1985>\n##contig=<ID=Un_JTFH01000342v1_decoy,length=1981>\n##contig=<ID=Un_JTFH01000343v1_decoy,length=1977>\n##contig=<ID=Un_JTFH01000344v1_decoy,length=1971>\n##contig=<ID=Un_JTFH01000345v1_decoy,length=1968>\n##contig=<ID=Un_JTFH01000346v1_decoy,length=1962>\n##contig=<ID=Un_JTFH01000347v1_decoy,length=1961>\n##contig=<ID=Un_JTFH01000348v1_decoy,length=1960>\n##contig=<ID=Un_JTFH01000349v1_decoy,length=1960>\n##contig=<ID=Un_JTFH01000350v1_decoy,length=1954>\n##contig=<ID=Un_JTFH01000351v1_decoy,length=1952>\n##contig=<ID=Un_JTFH01000352v1_decoy,length=1947>\n##contig=<ID=Un_JTFH01000353v1_decoy,length=1944>\n##contig=<ID=Un_JTFH01000354v1_decoy,length=1943>\n##contig=<ID=Un_JTFH01000355v1_decoy,length=1941>\n##contig=<ID=Un_JTFH01000356v1_decoy,length=1937>\n##contig=<ID=Un_JTFH01000357v1_decoy,length=1934>\n##contig=<ID=Un_JTFH01000358v1_decoy,length=1929>\n##contig=<ID=Un_JTFH01000359v1_decoy,length=1924>\n##contig=<ID=Un_JTFH01000360v1_decoy,length=1924>\n##contig=<ID=Un_JTFH01000361v1_decoy,length=1923>\n##contig=<ID=Un_JTFH01000362v1_decoy,length=1921>\n##contig=<ID=Un_JTFH01000363v1_decoy,length=1918>\n##contig=<ID=Un_JTFH01000364v1_decoy,length=1915>\n##contig=<ID=Un_JTFH01000365v1_decoy,length=1915>\n##contig=<ID=Un_JTFH01000366v1_decoy,length=1914>\n##contig=<ID=Un_JTFH01000367v1_decoy,length=1912>\n##contig=<ID=Un_JTFH01000368v1_decoy,length=1910>\n##contig=<ID=Un_JTFH01000369v1_decoy,length=1907>\n##contig=<ID=Un_JTFH01000370v1_decoy,length=1904>\n##contig=<ID=Un_JTFH01000371v1_decoy,length=1897>\n##contig=<ID=Un_JTFH01000372v1_decoy,length=1891>\n##contig=<ID=Un_JTFH01000373v1_decoy,length=1890>\n##contig=<ID=Un_JTFH01000374v1_decoy,length=1888>\n##contig=<ID=Un_JTFH01000375v1_decoy,length=1888>\n##contig=<ID=Un_JTFH01000376v1_decoy,length=1885>\n##contig=<ID=Un_JTFH01000377v1_decoy,length=1881>\n##contig=<ID=Un_JTFH01000378v1_decoy,length=1879>\n##contig=<ID=Un_JTFH01000379v1_decoy,length=1877>\n##contig=<ID=Un_JTFH01000380v1_decoy,length=1876>\n##contig=<ID=Un_JTFH01000381v1_decoy,length=1876>\n##contig=<ID=Un_JTFH01000382v1_decoy,length=1874>\n##contig=<ID=Un_JTFH01000383v1_decoy,length=1872>\n##contig=<ID=Un_JTFH01000384v1_decoy,length=1869>\n##contig=<ID=Un_JTFH01000385v1_decoy,length=1866>\n##contig=<ID=Un_JTFH01000386v1_decoy,length=1865>\n##contig=<ID=Un_JTFH01000387v1_decoy,length=1865>\n##contig=<ID=Un_JTFH01000388v1_decoy,length=1865>\n##contig=<ID=Un_JTFH01000389v1_decoy,length=1862>\n##contig=<ID=Un_JTFH01000390v1_decoy,length=1862>\n##contig=<ID=Un_JTFH01000391v1_decoy,length=1859>\n##contig=<ID=Un_JTFH01000392v1_decoy,length=1856>\n##contig=<ID=Un_JTFH01000393v1_decoy,length=1856>\n##contig=<ID=Un_JTFH01000394v1_decoy,length=1854>\n##contig=<ID=Un_JTFH01000395v1_decoy,length=1850>\n##contig=<ID=Un_JTFH01000396v1_decoy,length=1849>\n##contig=<ID=Un_JTFH01000397v1_decoy,length=1849>\n##contig=<ID=Un_JTFH01000398v1_decoy,length=1847>\n##contig=<ID=Un_JTFH01000399v1_decoy,length=1839>\n##contig=<ID=Un_JTFH01000400v1_decoy,length=1834>\n##contig=<ID=Un_JTFH01000401v1_decoy,length=1821>\n##contig=<ID=Un_JTFH01000402v1_decoy,length=1815>\n##contig=<ID=Un_JTFH01000403v1_decoy,length=1811>\n##contig=<ID=Un_JTFH01000404v1_decoy,length=1808>\n##contig=<ID=Un_JTFH01000405v1_decoy,length=1808>\n##contig=<ID=Un_JTFH01000406v1_decoy,length=1807>\n##contig=<ID=Un_JTFH01000407v1_decoy,length=1807>\n##contig=<ID=Un_JTFH01000408v1_decoy,length=1802>\n##contig=<ID=Un_JTFH01000409v1_decoy,length=1801>\n##contig=<ID=Un_JTFH01000410v1_decoy,length=1800>\n##contig=<ID=Un_JTFH01000411v1_decoy,length=1795>\n##contig=<ID=Un_JTFH01000412v1_decoy,length=1794>\n##contig=<ID=Un_JTFH01000413v1_decoy,length=1792>\n##contig=<ID=Un_JTFH01000414v1_decoy,length=1788>\n##contig=<ID=Un_JTFH01000415v1_decoy,length=1786>\n##contig=<ID=Un_JTFH01000416v1_decoy,length=1782>\n##contig=<ID=Un_JTFH01000417v1_decoy,length=1782>\n##contig=<ID=Un_JTFH01000418v1_decoy,length=1781>\n##contig=<ID=Un_JTFH01000419v1_decoy,length=1781>\n##contig=<ID=Un_JTFH01000420v1_decoy,length=1779>\n##contig=<ID=Un_JTFH01000421v1_decoy,length=1777>\n##contig=<ID=Un_JTFH01000422v1_decoy,length=1764>\n##contig=<ID=Un_JTFH01000423v1_decoy,length=1762>\n##contig=<ID=Un_JTFH01000424v1_decoy,length=1755>\n##contig=<ID=Un_JTFH01000425v1_decoy,length=1749>\n##contig=<ID=Un_JTFH01000426v1_decoy,length=1747>\n##contig=<ID=Un_JTFH01000427v1_decoy,length=1746>\n##contig=<ID=Un_JTFH01000428v1_decoy,length=1745>\n##contig=<ID=Un_JTFH01000429v1_decoy,length=1744>\n##contig=<ID=Un_JTFH01000430v1_decoy,length=1742>\n##contig=<ID=Un_JTFH01000431v1_decoy,length=1740>\n##contig=<ID=Un_JTFH01000432v1_decoy,length=1740>\n##contig=<ID=Un_JTFH01000433v1_decoy,length=1736>\n##contig=<ID=Un_JTFH01000434v1_decoy,length=1735>\n##contig=<ID=Un_JTFH01000435v1_decoy,length=1732>\n##contig=<ID=Un_JTFH01000436v1_decoy,length=1732>\n##contig=<ID=Un_JTFH01000437v1_decoy,length=1730>\n##contig=<ID=Un_JTFH01000438v1_decoy,length=1727>\n##contig=<ID=Un_JTFH01000439v1_decoy,length=1722>\n##contig=<ID=Un_JTFH01000440v1_decoy,length=1718>\n##contig=<ID=Un_JTFH01000441v1_decoy,length=1716>\n##contig=<ID=Un_JTFH01000442v1_decoy,length=1710>\n##contig=<ID=Un_JTFH01000443v1_decoy,length=1708>\n##contig=<ID=Un_JTFH01000444v1_decoy,length=1707>\n##contig=<ID=Un_JTFH01000445v1_decoy,length=1706>\n##contig=<ID=Un_JTFH01000446v1_decoy,length=1705>\n##contig=<ID=Un_JTFH01000447v1_decoy,length=1704>\n##contig=<ID=Un_JTFH01000448v1_decoy,length=1699>\n##contig=<ID=Un_JTFH01000449v1_decoy,length=1698>\n##contig=<ID=Un_JTFH01000450v1_decoy,length=1697>\n##contig=<ID=Un_JTFH01000451v1_decoy,length=1697>\n##contig=<ID=Un_JTFH01000452v1_decoy,length=1695>\n##contig=<ID=Un_JTFH01000453v1_decoy,length=1695>\n##contig=<ID=Un_JTFH01000454v1_decoy,length=1693>\n##contig=<ID=Un_JTFH01000455v1_decoy,length=1687>\n##contig=<ID=Un_JTFH01000456v1_decoy,length=1686>\n##contig=<ID=Un_JTFH01000457v1_decoy,length=1680>\n##contig=<ID=Un_JTFH01000458v1_decoy,length=1679>\n##contig=<ID=Un_JTFH01000459v1_decoy,length=1679>\n##contig=<ID=Un_JTFH01000460v1_decoy,length=1678>\n##contig=<ID=Un_JTFH01000461v1_decoy,length=1674>\n##contig=<ID=Un_JTFH01000462v1_decoy,length=1674>\n##contig=<ID=Un_JTFH01000463v1_decoy,length=1671>\n##contig=<ID=Un_JTFH01000464v1_decoy,length=1669>\n##contig=<ID=Un_JTFH01000465v1_decoy,length=1665>\n##contig=<ID=Un_JTFH01000466v1_decoy,length=1663>\n##contig=<ID=Un_JTFH01000467v1_decoy,length=1657>\n##contig=<ID=Un_JTFH01000468v1_decoy,length=1653>\n##contig=<ID=Un_JTFH01000469v1_decoy,length=1652>\n##contig=<ID=Un_JTFH01000470v1_decoy,length=1650>\n##contig=<ID=Un_JTFH01000471v1_decoy,length=1649>\n##contig=<ID=Un_JTFH01000472v1_decoy,length=1649>\n##contig=<ID=Un_JTFH01000473v1_decoy,length=1640>\n##contig=<ID=Un_JTFH01000474v1_decoy,length=1638>\n##contig=<ID=Un_JTFH01000475v1_decoy,length=1636>\n##contig=<ID=Un_JTFH01000476v1_decoy,length=1632>\n##contig=<ID=Un_JTFH01000477v1_decoy,length=1631>\n##contig=<ID=Un_JTFH01000478v1_decoy,length=1630>\n##contig=<ID=Un_JTFH01000479v1_decoy,length=1627>\n##contig=<ID=Un_JTFH01000480v1_decoy,length=1624>\n##contig=<ID=Un_JTFH01000481v1_decoy,length=1617>\n##contig=<ID=Un_JTFH01000482v1_decoy,length=1616>\n##contig=<ID=Un_JTFH01000483v1_decoy,length=1615>\n##contig=<ID=Un_JTFH01000484v1_decoy,length=1611>\n##contig=<ID=Un_JTFH01000485v1_decoy,length=1611>\n##contig=<ID=Un_JTFH01000486v1_decoy,length=1606>\n##contig=<ID=Un_JTFH01000487v1_decoy,length=1605>\n##contig=<ID=Un_JTFH01000488v1_decoy,length=1605>\n##contig=<ID=Un_JTFH01000489v1_decoy,length=1600>\n##contig=<ID=Un_JTFH01000490v1_decoy,length=1598>\n##contig=<ID=Un_JTFH01000491v1_decoy,length=1598>\n##contig=<ID=Un_JTFH01000492v1_decoy,length=1597>\n##contig=<ID=Un_JTFH01000493v1_decoy,length=1596>\n##contig=<ID=Un_JTFH01000494v1_decoy,length=1595>\n##contig=<ID=Un_JTFH01000495v1_decoy,length=1592>\n##contig=<ID=Un_JTFH01000496v1_decoy,length=1589>\n##contig=<ID=Un_JTFH01000497v1_decoy,length=1585>\n##contig=<ID=Un_JTFH01000498v1_decoy,length=1579>\n##contig=<ID=Un_JTFH01000499v1_decoy,length=1578>\n##contig=<ID=Un_JTFH01000500v1_decoy,length=1577>\n##contig=<ID=Un_JTFH01000501v1_decoy,length=1577>\n##contig=<ID=Un_JTFH01000502v1_decoy,length=1577>\n##contig=<ID=Un_JTFH01000503v1_decoy,length=1576>\n##contig=<ID=Un_JTFH01000504v1_decoy,length=1575>\n##contig=<ID=Un_JTFH01000505v1_decoy,length=1574>\n##contig=<ID=Un_JTFH01000506v1_decoy,length=1572>\n##contig=<ID=Un_JTFH01000507v1_decoy,length=1571>\n##contig=<ID=Un_JTFH01000508v1_decoy,length=1563>\n##contig=<ID=Un_JTFH01000509v1_decoy,length=1561>\n##contig=<ID=Un_JTFH01000510v1_decoy,length=1561>\n##contig=<ID=Un_JTFH01000511v1_decoy,length=1560>\n##contig=<ID=Un_JTFH01000512v1_decoy,length=1560>\n##contig=<ID=Un_JTFH01000513v1_decoy,length=1554>\n##contig=<ID=Un_JTFH01000514v1_decoy,length=1552>\n##contig=<ID=Un_JTFH01000515v1_decoy,length=1548>\n##contig=<ID=Un_JTFH01000516v1_decoy,length=1546>\n##contig=<ID=Un_JTFH01000517v1_decoy,length=1541>\n##contig=<ID=Un_JTFH01000518v1_decoy,length=1536>\n##contig=<ID=Un_JTFH01000519v1_decoy,length=1533>\n##contig=<ID=Un_JTFH01000520v1_decoy,length=1532>\n##contig=<ID=Un_JTFH01000521v1_decoy,length=1532>\n##contig=<ID=Un_JTFH01000522v1_decoy,length=1530>\n##contig=<ID=Un_JTFH01000523v1_decoy,length=1527>\n##contig=<ID=Un_JTFH01000524v1_decoy,length=1526>\n##contig=<ID=Un_JTFH01000525v1_decoy,length=1524>\n##contig=<ID=Un_JTFH01000526v1_decoy,length=1523>\n##contig=<ID=Un_JTFH01000527v1_decoy,length=1523>\n##contig=<ID=Un_JTFH01000528v1_decoy,length=1522>\n##contig=<ID=Un_JTFH01000529v1_decoy,length=1522>\n##contig=<ID=Un_JTFH01000530v1_decoy,length=1519>\n##contig=<ID=Un_JTFH01000531v1_decoy,length=1513>\n##contig=<ID=Un_JTFH01000532v1_decoy,length=1508>\n##contig=<ID=Un_JTFH01000533v1_decoy,length=1508>\n##contig=<ID=Un_JTFH01000534v1_decoy,length=1505>\n##contig=<ID=Un_JTFH01000535v1_decoy,length=1503>\n##contig=<ID=Un_JTFH01000536v1_decoy,length=1496>\n##contig=<ID=Un_JTFH01000537v1_decoy,length=1491>\n##contig=<ID=Un_JTFH01000538v1_decoy,length=1490>\n##contig=<ID=Un_JTFH01000539v1_decoy,length=1490>\n##contig=<ID=Un_JTFH01000540v1_decoy,length=1487>\n##contig=<ID=Un_JTFH01000541v1_decoy,length=1486>\n##contig=<ID=Un_JTFH01000542v1_decoy,length=1485>\n##contig=<ID=Un_JTFH01000543v1_decoy,length=1484>\n##contig=<ID=Un_JTFH01000544v1_decoy,length=1483>\n##contig=<ID=Un_JTFH01000545v1_decoy,length=1479>\n##contig=<ID=Un_JTFH01000546v1_decoy,length=1479>\n##contig=<ID=Un_JTFH01000547v1_decoy,length=1476>\n##contig=<ID=Un_JTFH01000548v1_decoy,length=1475>\n##contig=<ID=Un_JTFH01000549v1_decoy,length=1472>\n##contig=<ID=Un_JTFH01000550v1_decoy,length=1469>\n##contig=<ID=Un_JTFH01000551v1_decoy,length=1468>\n##contig=<ID=Un_JTFH01000552v1_decoy,length=1467>\n##contig=<ID=Un_JTFH01000553v1_decoy,length=1465>\n##contig=<ID=Un_JTFH01000554v1_decoy,length=1464>\n##contig=<ID=Un_JTFH01000555v1_decoy,length=1463>\n##contig=<ID=Un_JTFH01000556v1_decoy,length=1463>\n##contig=<ID=Un_JTFH01000557v1_decoy,length=1459>\n##contig=<ID=Un_JTFH01000558v1_decoy,length=1459>\n##contig=<ID=Un_JTFH01000559v1_decoy,length=1458>\n##contig=<ID=Un_JTFH01000560v1_decoy,length=1458>\n##contig=<ID=Un_JTFH01000561v1_decoy,length=1454>\n##contig=<ID=Un_JTFH01000562v1_decoy,length=1449>\n##contig=<ID=Un_JTFH01000563v1_decoy,length=1449>\n##contig=<ID=Un_JTFH01000564v1_decoy,length=1448>\n##contig=<ID=Un_JTFH01000565v1_decoy,length=1446>\n##contig=<ID=Un_JTFH01000566v1_decoy,length=1442>\n##contig=<ID=Un_JTFH01000567v1_decoy,length=1441>\n##contig=<ID=Un_JTFH01000568v1_decoy,length=1440>\n##contig=<ID=Un_JTFH01000569v1_decoy,length=1439>\n##contig=<ID=Un_JTFH01000570v1_decoy,length=1437>\n##contig=<ID=Un_JTFH01000571v1_decoy,length=1436>\n##contig=<ID=Un_JTFH01000572v1_decoy,length=1429>\n##contig=<ID=Un_JTFH01000573v1_decoy,length=1429>\n##contig=<ID=Un_JTFH01000574v1_decoy,length=1427>\n##contig=<ID=Un_JTFH01000575v1_decoy,length=1426>\n##contig=<ID=Un_JTFH01000576v1_decoy,length=1425>\n##contig=<ID=Un_JTFH01000577v1_decoy,length=1424>\n##contig=<ID=Un_JTFH01000578v1_decoy,length=1424>\n##contig=<ID=Un_JTFH01000579v1_decoy,length=1423>\n##contig=<ID=Un_JTFH01000580v1_decoy,length=1423>\n##contig=<ID=Un_JTFH01000581v1_decoy,length=1423>\n##contig=<ID=Un_JTFH01000582v1_decoy,length=1414>\n##contig=<ID=Un_JTFH01000583v1_decoy,length=1414>\n##contig=<ID=Un_JTFH01000584v1_decoy,length=1413>\n##contig=<ID=Un_JTFH01000585v1_decoy,length=1413>\n##contig=<ID=Un_JTFH01000586v1_decoy,length=1410>\n##contig=<ID=Un_JTFH01000587v1_decoy,length=1409>\n##contig=<ID=Un_JTFH01000588v1_decoy,length=1409>\n##contig=<ID=Un_JTFH01000589v1_decoy,length=1406>\n##contig=<ID=Un_JTFH01000590v1_decoy,length=1405>\n##contig=<ID=Un_JTFH01000591v1_decoy,length=1405>\n##contig=<ID=Un_JTFH01000592v1_decoy,length=1404>\n##contig=<ID=Un_JTFH01000593v1_decoy,length=1404>\n##contig=<ID=Un_JTFH01000594v1_decoy,length=1402>\n##contig=<ID=Un_JTFH01000595v1_decoy,length=1402>\n##contig=<ID=Un_JTFH01000596v1_decoy,length=1402>\n##contig=<ID=Un_JTFH01000597v1_decoy,length=1402>\n##contig=<ID=Un_JTFH01000598v1_decoy,length=1400>\n##contig=<ID=Un_JTFH01000599v1_decoy,length=1398>\n##contig=<ID=Un_JTFH01000600v1_decoy,length=1396>\n##contig=<ID=Un_JTFH01000601v1_decoy,length=1395>\n##contig=<ID=Un_JTFH01000602v1_decoy,length=1394>\n##contig=<ID=Un_JTFH01000603v1_decoy,length=1393>\n##contig=<ID=Un_JTFH01000604v1_decoy,length=1391>\n##contig=<ID=Un_JTFH01000605v1_decoy,length=1389>\n##contig=<ID=Un_JTFH01000606v1_decoy,length=1389>\n##contig=<ID=Un_JTFH01000607v1_decoy,length=1388>\n##contig=<ID=Un_JTFH01000608v1_decoy,length=1387>\n##contig=<ID=Un_JTFH01000609v1_decoy,length=1384>\n##contig=<ID=Un_JTFH01000610v1_decoy,length=1381>\n##contig=<ID=Un_JTFH01000611v1_decoy,length=1381>\n##contig=<ID=Un_JTFH01000612v1_decoy,length=1379>\n##contig=<ID=Un_JTFH01000613v1_decoy,length=1377>\n##contig=<ID=Un_JTFH01000614v1_decoy,length=1376>\n##contig=<ID=Un_JTFH01000615v1_decoy,length=1376>\n##contig=<ID=Un_JTFH01000616v1_decoy,length=1375>\n##contig=<ID=Un_JTFH01000617v1_decoy,length=1374>\n##contig=<ID=Un_JTFH01000618v1_decoy,length=1372>\n##contig=<ID=Un_JTFH01000619v1_decoy,length=1371>\n##contig=<ID=Un_JTFH01000620v1_decoy,length=1370>\n##contig=<ID=Un_JTFH01000621v1_decoy,length=1370>\n##contig=<ID=Un_JTFH01000622v1_decoy,length=1366>\n##contig=<ID=Un_JTFH01000623v1_decoy,length=1363>\n##contig=<ID=Un_JTFH01000624v1_decoy,length=1360>\n##contig=<ID=Un_JTFH01000625v1_decoy,length=1356>\n##contig=<ID=Un_JTFH01000626v1_decoy,length=1355>\n##contig=<ID=Un_JTFH01000627v1_decoy,length=1355>\n##contig=<ID=Un_JTFH01000628v1_decoy,length=1352>\n##contig=<ID=Un_JTFH01000629v1_decoy,length=1345>\n##contig=<ID=Un_JTFH01000630v1_decoy,length=1344>\n##contig=<ID=Un_JTFH01000631v1_decoy,length=1344>\n##contig=<ID=Un_JTFH01000632v1_decoy,length=1342>\n##contig=<ID=Un_JTFH01000633v1_decoy,length=1342>\n##contig=<ID=Un_JTFH01000634v1_decoy,length=1336>\n##contig=<ID=Un_JTFH01000635v1_decoy,length=1334>\n##contig=<ID=Un_JTFH01000636v1_decoy,length=1334>\n##contig=<ID=Un_JTFH01000637v1_decoy,length=1333>\n##contig=<ID=Un_JTFH01000638v1_decoy,length=1332>\n##contig=<ID=Un_JTFH01000639v1_decoy,length=1328>\n##contig=<ID=Un_JTFH01000640v1_decoy,length=1328>\n##contig=<ID=Un_JTFH01000641v1_decoy,length=1328>\n##contig=<ID=Un_JTFH01000642v1_decoy,length=1327>\n##contig=<ID=Un_JTFH01000643v1_decoy,length=1325>\n##contig=<ID=Un_JTFH01000644v1_decoy,length=1322>\n##contig=<ID=Un_JTFH01000645v1_decoy,length=1320>\n##contig=<ID=Un_JTFH01000646v1_decoy,length=1319>\n##contig=<ID=Un_JTFH01000647v1_decoy,length=1318>\n##contig=<ID=Un_JTFH01000648v1_decoy,length=1315>\n##contig=<ID=Un_JTFH01000649v1_decoy,length=1314>\n##contig=<ID=Un_JTFH01000650v1_decoy,length=1313>\n##contig=<ID=Un_JTFH01000651v1_decoy,length=1313>\n##contig=<ID=Un_JTFH01000652v1_decoy,length=1312>\n##contig=<ID=Un_JTFH01000653v1_decoy,length=1310>\n##contig=<ID=Un_JTFH01000654v1_decoy,length=1309>\n##contig=<ID=Un_JTFH01000655v1_decoy,length=1309>\n##contig=<ID=Un_JTFH01000656v1_decoy,length=1307>\n##contig=<ID=Un_JTFH01000657v1_decoy,length=1307>\n##contig=<ID=Un_JTFH01000658v1_decoy,length=1305>\n##contig=<ID=Un_JTFH01000659v1_decoy,length=1304>\n##contig=<ID=Un_JTFH01000660v1_decoy,length=1303>\n##contig=<ID=Un_JTFH01000661v1_decoy,length=1302>\n##contig=<ID=Un_JTFH01000662v1_decoy,length=1302>\n##contig=<ID=Un_JTFH01000663v1_decoy,length=1301>\n##contig=<ID=Un_JTFH01000664v1_decoy,length=1301>\n##contig=<ID=Un_JTFH01000665v1_decoy,length=1300>\n##contig=<ID=Un_JTFH01000666v1_decoy,length=1299>\n##contig=<ID=Un_JTFH01000667v1_decoy,length=1297>\n##contig=<ID=Un_JTFH01000668v1_decoy,length=1295>\n##contig=<ID=Un_JTFH01000669v1_decoy,length=1294>\n##contig=<ID=Un_JTFH01000670v1_decoy,length=1293>\n##contig=<ID=Un_JTFH01000671v1_decoy,length=1291>\n##contig=<ID=Un_JTFH01000672v1_decoy,length=1291>\n##contig=<ID=Un_JTFH01000673v1_decoy,length=1289>\n##contig=<ID=Un_JTFH01000674v1_decoy,length=1288>\n##contig=<ID=Un_JTFH01000675v1_decoy,length=1288>\n##contig=<ID=Un_JTFH01000676v1_decoy,length=1287>\n##contig=<ID=Un_JTFH01000677v1_decoy,length=1287>\n##contig=<ID=Un_JTFH01000678v1_decoy,length=1287>\n##contig=<ID=Un_JTFH01000679v1_decoy,length=1286>\n##contig=<ID=Un_JTFH01000680v1_decoy,length=1283>\n##contig=<ID=Un_JTFH01000681v1_decoy,length=1281>\n##contig=<ID=Un_JTFH01000682v1_decoy,length=1277>\n##contig=<ID=Un_JTFH01000683v1_decoy,length=1274>\n##contig=<ID=Un_JTFH01000684v1_decoy,length=1270>\n##contig=<ID=Un_JTFH01000685v1_decoy,length=1267>\n##contig=<ID=Un_JTFH01000686v1_decoy,length=1266>\n##contig=<ID=Un_JTFH01000687v1_decoy,length=1260>\n##contig=<ID=Un_JTFH01000688v1_decoy,length=1259>\n##contig=<ID=Un_JTFH01000689v1_decoy,length=1258>\n##contig=<ID=Un_JTFH01000690v1_decoy,length=1258>\n##contig=<ID=Un_JTFH01000691v1_decoy,length=1258>\n##contig=<ID=Un_JTFH01000692v1_decoy,length=1256>\n##contig=<ID=Un_JTFH01000693v1_decoy,length=1255>\n##contig=<ID=Un_JTFH01000694v1_decoy,length=1254>\n##contig=<ID=Un_JTFH01000695v1_decoy,length=1254>\n##contig=<ID=Un_JTFH01000696v1_decoy,length=1253>\n##contig=<ID=Un_JTFH01000697v1_decoy,length=1250>\n##contig=<ID=Un_JTFH01000698v1_decoy,length=1249>\n##contig=<ID=Un_JTFH01000699v1_decoy,length=1248>\n##contig=<ID=Un_JTFH01000700v1_decoy,length=1248>\n##contig=<ID=Un_JTFH01000701v1_decoy,length=1247>\n##contig=<ID=Un_JTFH01000702v1_decoy,length=1242>\n##contig=<ID=Un_JTFH01000703v1_decoy,length=1242>\n##contig=<ID=Un_JTFH01000704v1_decoy,length=1241>\n##contig=<ID=Un_JTFH01000705v1_decoy,length=1241>\n##contig=<ID=Un_JTFH01000706v1_decoy,length=1241>\n##contig=<ID=Un_JTFH01000707v1_decoy,length=1239>\n##contig=<ID=Un_JTFH01000708v1_decoy,length=1238>\n##contig=<ID=Un_JTFH01000709v1_decoy,length=1237>\n##contig=<ID=Un_JTFH01000710v1_decoy,length=1236>\n##contig=<ID=Un_JTFH01000711v1_decoy,length=1235>\n##contig=<ID=Un_JTFH01000712v1_decoy,length=1234>\n##contig=<ID=Un_JTFH01000713v1_decoy,length=1234>\n##contig=<ID=Un_JTFH01000714v1_decoy,length=1234>\n##contig=<ID=Un_JTFH01000715v1_decoy,length=1233>\n##contig=<ID=Un_JTFH01000716v1_decoy,length=1232>\n##contig=<ID=Un_JTFH01000717v1_decoy,length=1232>\n##contig=<ID=Un_JTFH01000718v1_decoy,length=1231>\n##contig=<ID=Un_JTFH01000719v1_decoy,length=1230>\n##contig=<ID=Un_JTFH01000720v1_decoy,length=1228>\n##contig=<ID=Un_JTFH01000721v1_decoy,length=1227>\n##contig=<ID=Un_JTFH01000722v1_decoy,length=1227>\n##contig=<ID=Un_JTFH01000723v1_decoy,length=1226>\n##contig=<ID=Un_JTFH01000724v1_decoy,length=1224>\n##contig=<ID=Un_JTFH01000725v1_decoy,length=1224>\n##contig=<ID=Un_JTFH01000726v1_decoy,length=1220>\n##contig=<ID=Un_JTFH01000727v1_decoy,length=1220>\n##contig=<ID=Un_JTFH01000728v1_decoy,length=1219>\n##contig=<ID=Un_JTFH01000729v1_decoy,length=1217>\n##contig=<ID=Un_JTFH01000730v1_decoy,length=1216>\n##contig=<ID=Un_JTFH01000731v1_decoy,length=1215>\n##contig=<ID=Un_JTFH01000732v1_decoy,length=1214>\n##contig=<ID=Un_JTFH01000733v1_decoy,length=1214>\n##contig=<ID=Un_JTFH01000734v1_decoy,length=1214>\n##contig=<ID=Un_JTFH01000735v1_decoy,length=1213>\n##contig=<ID=Un_JTFH01000736v1_decoy,length=1212>\n##contig=<ID=Un_JTFH01000737v1_decoy,length=1209>\n##contig=<ID=Un_JTFH01000738v1_decoy,length=1208>\n##contig=<ID=Un_JTFH01000739v1_decoy,length=1207>\n##contig=<ID=Un_JTFH01000740v1_decoy,length=1207>\n##contig=<ID=Un_JTFH01000741v1_decoy,length=1207>\n##contig=<ID=Un_JTFH01000742v1_decoy,length=1206>\n##contig=<ID=Un_JTFH01000743v1_decoy,length=1206>\n##contig=<ID=Un_JTFH01000744v1_decoy,length=1205>\n##contig=<ID=Un_JTFH01000745v1_decoy,length=1205>\n##contig=<ID=Un_JTFH01000746v1_decoy,length=1204>\n##contig=<ID=Un_JTFH01000747v1_decoy,length=1204>\n##contig=<ID=Un_JTFH01000748v1_decoy,length=1204>\n##contig=<ID=Un_JTFH01000749v1_decoy,length=1203>\n##contig=<ID=Un_JTFH01000750v1_decoy,length=1201>\n##contig=<ID=Un_JTFH01000751v1_decoy,length=1201>\n##contig=<ID=Un_JTFH01000752v1_decoy,length=1200>\n##contig=<ID=Un_JTFH01000753v1_decoy,length=1200>\n##contig=<ID=Un_JTFH01000754v1_decoy,length=1199>\n##contig=<ID=Un_JTFH01000755v1_decoy,length=1198>\n##contig=<ID=Un_JTFH01000756v1_decoy,length=1197>\n##contig=<ID=Un_JTFH01000757v1_decoy,length=1196>\n##contig=<ID=Un_JTFH01000758v1_decoy,length=1195>\n##contig=<ID=Un_JTFH01000759v1_decoy,length=1194>\n##contig=<ID=Un_JTFH01000760v1_decoy,length=1194>\n##contig=<ID=Un_JTFH01000761v1_decoy,length=1191>\n##contig=<ID=Un_JTFH01000762v1_decoy,length=1189>\n##contig=<ID=Un_JTFH01000763v1_decoy,length=1186>\n##contig=<ID=Un_JTFH01000764v1_decoy,length=1186>\n##contig=<ID=Un_JTFH01000765v1_decoy,length=1184>\n##contig=<ID=Un_JTFH01000766v1_decoy,length=1183>\n##contig=<ID=Un_JTFH01000767v1_decoy,length=1183>\n##contig=<ID=Un_JTFH01000768v1_decoy,length=1182>\n##contig=<ID=Un_JTFH01000769v1_decoy,length=1181>\n##contig=<ID=Un_JTFH01000770v1_decoy,length=1181>\n##contig=<ID=Un_JTFH01000771v1_decoy,length=1181>\n##contig=<ID=Un_JTFH01000772v1_decoy,length=1181>\n##contig=<ID=Un_JTFH01000773v1_decoy,length=1179>\n##contig=<ID=Un_JTFH01000774v1_decoy,length=1178>\n##contig=<ID=Un_JTFH01000775v1_decoy,length=1178>\n##contig=<ID=Un_JTFH01000776v1_decoy,length=1177>\n##contig=<ID=Un_JTFH01000777v1_decoy,length=1177>\n##contig=<ID=Un_JTFH01000778v1_decoy,length=1171>\n##contig=<ID=Un_JTFH01000779v1_decoy,length=1171>\n##contig=<ID=Un_JTFH01000780v1_decoy,length=1171>\n##contig=<ID=Un_JTFH01000781v1_decoy,length=1170>\n##contig=<ID=Un_JTFH01000782v1_decoy,length=1170>\n##contig=<ID=Un_JTFH01000783v1_decoy,length=1167>\n##contig=<ID=Un_JTFH01000784v1_decoy,length=1167>\n##contig=<ID=Un_JTFH01000785v1_decoy,length=1167>\n##contig=<ID=Un_JTFH01000786v1_decoy,length=1165>\n##contig=<ID=Un_JTFH01000787v1_decoy,length=1165>\n##contig=<ID=Un_JTFH01000788v1_decoy,length=1162>\n##contig=<ID=Un_JTFH01000789v1_decoy,length=1157>\n##contig=<ID=Un_JTFH01000790v1_decoy,length=1156>\n##contig=<ID=Un_JTFH01000791v1_decoy,length=1156>\n##contig=<ID=Un_JTFH01000792v1_decoy,length=1154>\n##contig=<ID=Un_JTFH01000793v1_decoy,length=1154>\n##contig=<ID=Un_JTFH01000794v1_decoy,length=1151>\n##contig=<ID=Un_JTFH01000795v1_decoy,length=1151>\n##contig=<ID=Un_JTFH01000796v1_decoy,length=1150>\n##contig=<ID=Un_JTFH01000797v1_decoy,length=1150>\n##contig=<ID=Un_JTFH01000798v1_decoy,length=1147>\n##contig=<ID=Un_JTFH01000799v1_decoy,length=1147>\n##contig=<ID=Un_JTFH01000800v1_decoy,length=1146>\n##contig=<ID=Un_JTFH01000801v1_decoy,length=1144>\n##contig=<ID=Un_JTFH01000802v1_decoy,length=1144>\n##contig=<ID=Un_JTFH01000803v1_decoy,length=1143>\n##contig=<ID=Un_JTFH01000804v1_decoy,length=1142>\n##contig=<ID=Un_JTFH01000805v1_decoy,length=1141>\n##contig=<ID=Un_JTFH01000806v1_decoy,length=1141>\n##contig=<ID=Un_JTFH01000807v1_decoy,length=1140>\n##contig=<ID=Un_JTFH01000808v1_decoy,length=1138>\n##contig=<ID=Un_JTFH01000809v1_decoy,length=1134>\n##contig=<ID=Un_JTFH01000810v1_decoy,length=1134>\n##contig=<ID=Un_JTFH01000811v1_decoy,length=1132>\n##contig=<ID=Un_JTFH01000812v1_decoy,length=1131>\n##contig=<ID=Un_JTFH01000813v1_decoy,length=1131>\n##contig=<ID=Un_JTFH01000814v1_decoy,length=1130>\n##contig=<ID=Un_JTFH01000815v1_decoy,length=1127>\n##contig=<ID=Un_JTFH01000816v1_decoy,length=1126>\n##contig=<ID=Un_JTFH01000817v1_decoy,length=1124>\n##contig=<ID=Un_JTFH01000818v1_decoy,length=1122>\n##contig=<ID=Un_JTFH01000819v1_decoy,length=1122>\n##contig=<ID=Un_JTFH01000820v1_decoy,length=1121>\n##contig=<ID=Un_JTFH01000821v1_decoy,length=1119>\n##contig=<ID=Un_JTFH01000822v1_decoy,length=1119>\n##contig=<ID=Un_JTFH01000823v1_decoy,length=1119>\n##contig=<ID=Un_JTFH01000824v1_decoy,length=1119>\n##contig=<ID=Un_JTFH01000825v1_decoy,length=1118>\n##contig=<ID=Un_JTFH01000826v1_decoy,length=1116>\n##contig=<ID=Un_JTFH01000827v1_decoy,length=1116>\n##contig=<ID=Un_JTFH01000828v1_decoy,length=1115>\n##contig=<ID=Un_JTFH01000829v1_decoy,length=1115>\n##contig=<ID=Un_JTFH01000830v1_decoy,length=1115>\n##contig=<ID=Un_JTFH01000831v1_decoy,length=1114>\n##contig=<ID=Un_JTFH01000832v1_decoy,length=1113>\n##contig=<ID=Un_JTFH01000833v1_decoy,length=1113>\n##contig=<ID=Un_JTFH01000834v1_decoy,length=1110>\n##contig=<ID=Un_JTFH01000835v1_decoy,length=1110>\n##contig=<ID=Un_JTFH01000836v1_decoy,length=1109>\n##contig=<ID=Un_JTFH01000837v1_decoy,length=1108>\n##contig=<ID=Un_JTFH01000838v1_decoy,length=1107>\n##contig=<ID=Un_JTFH01000839v1_decoy,length=1107>\n##contig=<ID=Un_JTFH01000840v1_decoy,length=1107>\n##contig=<ID=Un_JTFH01000841v1_decoy,length=1107>\n##contig=<ID=Un_JTFH01000842v1_decoy,length=1106>\n##contig=<ID=Un_JTFH01000843v1_decoy,length=1103>\n##contig=<ID=Un_JTFH01000844v1_decoy,length=1103>\n##contig=<ID=Un_JTFH01000845v1_decoy,length=1103>\n##contig=<ID=Un_JTFH01000846v1_decoy,length=1100>\n##contig=<ID=Un_JTFH01000847v1_decoy,length=1099>\n##contig=<ID=Un_JTFH01000848v1_decoy,length=1098>\n##contig=<ID=Un_JTFH01000849v1_decoy,length=1097>\n##contig=<ID=Un_JTFH01000850v1_decoy,length=1096>\n##contig=<ID=Un_JTFH01000851v1_decoy,length=1096>\n##contig=<ID=Un_JTFH01000852v1_decoy,length=1094>\n##contig=<ID=Un_JTFH01000853v1_decoy,length=1093>\n##contig=<ID=Un_JTFH01000854v1_decoy,length=1090>\n##contig=<ID=Un_JTFH01000855v1_decoy,length=1088>\n##contig=<ID=Un_JTFH01000856v1_decoy,length=1087>\n##contig=<ID=Un_JTFH01000857v1_decoy,length=1086>\n##contig=<ID=Un_JTFH01000858v1_decoy,length=1085>\n##contig=<ID=Un_JTFH01000859v1_decoy,length=1084>\n##contig=<ID=Un_JTFH01000860v1_decoy,length=1084>\n##contig=<ID=Un_JTFH01000861v1_decoy,length=1084>\n##contig=<ID=Un_JTFH01000862v1_decoy,length=1084>\n##contig=<ID=Un_JTFH01000863v1_decoy,length=1083>\n##contig=<ID=Un_JTFH01000864v1_decoy,length=1083>\n##contig=<ID=Un_JTFH01000865v1_decoy,length=1082>\n##contig=<ID=Un_JTFH01000866v1_decoy,length=1082>\n##contig=<ID=Un_JTFH01000867v1_decoy,length=1081>\n##contig=<ID=Un_JTFH01000868v1_decoy,length=1081>\n##contig=<ID=Un_JTFH01000869v1_decoy,length=1079>\n##contig=<ID=Un_JTFH01000870v1_decoy,length=1076>\n##contig=<ID=Un_JTFH01000871v1_decoy,length=1074>\n##contig=<ID=Un_JTFH01000872v1_decoy,length=1073>\n##contig=<ID=Un_JTFH01000873v1_decoy,length=1073>\n##contig=<ID=Un_JTFH01000874v1_decoy,length=1071>\n##contig=<ID=Un_JTFH01000875v1_decoy,length=1069>\n##contig=<ID=Un_JTFH01000876v1_decoy,length=1067>\n##contig=<ID=Un_JTFH01000877v1_decoy,length=1067>\n##contig=<ID=Un_JTFH01000878v1_decoy,length=1067>\n##contig=<ID=Un_JTFH01000879v1_decoy,length=1066>\n##contig=<ID=Un_JTFH01000880v1_decoy,length=1065>\n##contig=<ID=Un_JTFH01000881v1_decoy,length=1065>\n##contig=<ID=Un_JTFH01000882v1_decoy,length=1065>\n##contig=<ID=Un_JTFH01000883v1_decoy,length=1065>\n##contig=<ID=Un_JTFH01000884v1_decoy,length=1065>\n##contig=<ID=Un_JTFH01000885v1_decoy,length=1064>\n##contig=<ID=Un_JTFH01000886v1_decoy,length=1064>\n##contig=<ID=Un_JTFH01000887v1_decoy,length=1064>\n##contig=<ID=Un_JTFH01000888v1_decoy,length=1063>\n##contig=<ID=Un_JTFH01000889v1_decoy,length=1062>\n##contig=<ID=Un_JTFH01000890v1_decoy,length=1062>\n##contig=<ID=Un_JTFH01000891v1_decoy,length=1062>\n##contig=<ID=Un_JTFH01000892v1_decoy,length=1061>\n##contig=<ID=Un_JTFH01000893v1_decoy,length=1060>\n##contig=<ID=Un_JTFH01000894v1_decoy,length=1057>\n##contig=<ID=Un_JTFH01000895v1_decoy,length=1057>\n##contig=<ID=Un_JTFH01000896v1_decoy,length=1056>\n##contig=<ID=Un_JTFH01000897v1_decoy,length=1055>\n##contig=<ID=Un_JTFH01000898v1_decoy,length=1055>\n##contig=<ID=Un_JTFH01000899v1_decoy,length=1055>\n##contig=<ID=Un_JTFH01000900v1_decoy,length=1055>\n##contig=<ID=Un_JTFH01000901v1_decoy,length=1054>\n##contig=<ID=Un_JTFH01000902v1_decoy,length=1051>\n##contig=<ID=Un_JTFH01000903v1_decoy,length=1050>\n##contig=<ID=Un_JTFH01000904v1_decoy,length=1050>\n##contig=<ID=Un_JTFH01000905v1_decoy,length=1049>\n##contig=<ID=Un_JTFH01000906v1_decoy,length=1048>\n##contig=<ID=Un_JTFH01000907v1_decoy,length=1047>\n##contig=<ID=Un_JTFH01000908v1_decoy,length=1046>\n##contig=<ID=Un_JTFH01000909v1_decoy,length=1046>\n##contig=<ID=Un_JTFH01000910v1_decoy,length=1046>\n##contig=<ID=Un_JTFH01000911v1_decoy,length=1045>\n##contig=<ID=Un_JTFH01000912v1_decoy,length=1045>\n##contig=<ID=Un_JTFH01000913v1_decoy,length=1045>\n##contig=<ID=Un_JTFH01000914v1_decoy,length=1044>\n##contig=<ID=Un_JTFH01000915v1_decoy,length=1042>\n##contig=<ID=Un_JTFH01000916v1_decoy,length=1041>\n##contig=<ID=Un_JTFH01000917v1_decoy,length=1039>\n##contig=<ID=Un_JTFH01000918v1_decoy,length=1039>\n##contig=<ID=Un_JTFH01000919v1_decoy,length=1038>\n##contig=<ID=Un_JTFH01000920v1_decoy,length=1036>\n##contig=<ID=Un_JTFH01000921v1_decoy,length=1036>\n##contig=<ID=Un_JTFH01000922v1_decoy,length=1035>\n##contig=<ID=Un_JTFH01000923v1_decoy,length=1035>\n##contig=<ID=Un_JTFH01000924v1_decoy,length=1033>\n##contig=<ID=Un_JTFH01000925v1_decoy,length=1032>\n##contig=<ID=Un_JTFH01000926v1_decoy,length=1031>\n##contig=<ID=Un_JTFH01000927v1_decoy,length=1031>\n##contig=<ID=Un_JTFH01000928v1_decoy,length=1031>\n##contig=<ID=Un_JTFH01000929v1_decoy,length=1027>\n##contig=<ID=Un_JTFH01000930v1_decoy,length=1027>\n##contig=<ID=Un_JTFH01000931v1_decoy,length=1026>\n##contig=<ID=Un_JTFH01000932v1_decoy,length=1026>\n##contig=<ID=Un_JTFH01000933v1_decoy,length=1024>\n##contig=<ID=Un_JTFH01000934v1_decoy,length=1024>\n##contig=<ID=Un_JTFH01000935v1_decoy,length=1022>\n##contig=<ID=Un_JTFH01000936v1_decoy,length=1022>\n##contig=<ID=Un_JTFH01000937v1_decoy,length=1021>\n##contig=<ID=Un_JTFH01000938v1_decoy,length=1020>\n##contig=<ID=Un_JTFH01000939v1_decoy,length=1019>\n##contig=<ID=Un_JTFH01000940v1_decoy,length=1018>\n##contig=<ID=Un_JTFH01000941v1_decoy,length=1018>\n##contig=<ID=Un_JTFH01000942v1_decoy,length=1018>\n##contig=<ID=Un_JTFH01000943v1_decoy,length=1016>\n##contig=<ID=Un_JTFH01000944v1_decoy,length=1010>\n##contig=<ID=Un_JTFH01000945v1_decoy,length=1010>\n##contig=<ID=Un_JTFH01000946v1_decoy,length=1009>\n##contig=<ID=Un_JTFH01000947v1_decoy,length=1008>\n##contig=<ID=Un_JTFH01000948v1_decoy,length=1007>\n##contig=<ID=Un_JTFH01000949v1_decoy,length=1006>\n##contig=<ID=Un_JTFH01000950v1_decoy,length=1005>\n##contig=<ID=Un_JTFH01000951v1_decoy,length=1005>\n##contig=<ID=Un_JTFH01000952v1_decoy,length=1004>\n##contig=<ID=Un_JTFH01000953v1_decoy,length=1004>\n##contig=<ID=Un_JTFH01000954v1_decoy,length=1003>\n##contig=<ID=Un_JTFH01000955v1_decoy,length=1003>\n##contig=<ID=Un_JTFH01000956v1_decoy,length=1003>\n##contig=<ID=Un_JTFH01000957v1_decoy,length=1003>\n##contig=<ID=Un_JTFH01000958v1_decoy,length=1002>\n##contig=<ID=Un_JTFH01000959v1_decoy,length=1002>\n##contig=<ID=Un_JTFH01000960v1_decoy,length=1000>\n##contig=<ID=Un_JTFH01000961v1_decoy,length=1000>\n##contig=<ID=Un_JTFH01000962v1_decoy,length=8358>\n##contig=<ID=Un_JTFH01000963v1_decoy,length=7932>\n##contig=<ID=Un_JTFH01000964v1_decoy,length=6846>\n##contig=<ID=Un_JTFH01000965v1_decoy,length=4591>\n##contig=<ID=Un_JTFH01000966v1_decoy,length=4041>\n##contig=<ID=Un_JTFH01000967v1_decoy,length=3841>\n##contig=<ID=Un_JTFH01000968v1_decoy,length=3754>\n##contig=<ID=Un_JTFH01000969v1_decoy,length=3743>\n##contig=<ID=Un_JTFH01000970v1_decoy,length=3702>\n##contig=<ID=Un_JTFH01000971v1_decoy,length=3625>\n##contig=<ID=Un_JTFH01000972v1_decoy,length=3529>\n##contig=<ID=Un_JTFH01000973v1_decoy,length=3508>\n##contig=<ID=Un_JTFH01000974v1_decoy,length=3359>\n##contig=<ID=Un_JTFH01000975v1_decoy,length=3320>\n##contig=<ID=Un_JTFH01000976v1_decoy,length=3231>\n##contig=<ID=Un_JTFH01000977v1_decoy,length=3220>\n##contig=<ID=Un_JTFH01000978v1_decoy,length=3212>\n##contig=<ID=Un_JTFH01000979v1_decoy,length=3192>\n##contig=<ID=Un_JTFH01000980v1_decoy,length=3092>\n##contig=<ID=Un_JTFH01000981v1_decoy,length=3087>\n##contig=<ID=Un_JTFH01000982v1_decoy,length=3048>\n##contig=<ID=Un_JTFH01000983v1_decoy,length=3005>\n##contig=<ID=Un_JTFH01000984v1_decoy,length=3004>\n##contig=<ID=Un_JTFH01000985v1_decoy,length=2959>\n##contig=<ID=Un_JTFH01000986v1_decoy,length=2934>\n##contig=<ID=Un_JTFH01000987v1_decoy,length=2933>\n##contig=<ID=Un_JTFH01000988v1_decoy,length=2827>\n##contig=<ID=Un_JTFH01000989v1_decoy,length=2794>\n##contig=<ID=Un_JTFH01000990v1_decoy,length=2749>\n##contig=<ID=Un_JTFH01000991v1_decoy,length=2745>\n##contig=<ID=Un_JTFH01000992v1_decoy,length=2733>\n##contig=<ID=Un_JTFH01000993v1_decoy,length=2698>\n##contig=<ID=Un_JTFH01000994v1_decoy,length=2665>\n##contig=<ID=Un_JTFH01000995v1_decoy,length=2634>\n##contig=<ID=Un_JTFH01000996v1_decoy,length=2492>\n##contig=<ID=Un_JTFH01000997v1_decoy,length=2489>\n##contig=<ID=Un_JTFH01000998v1_decoy,length=2468>\n##contig=<ID=Un_JTFH01000999v1_decoy,length=2414>\n##contig=<ID=Un_JTFH01001000v1_decoy,length=2395>\n##contig=<ID=Un_JTFH01001001v1_decoy,length=2356>\n##contig=<ID=Un_JTFH01001002v1_decoy,length=2339>\n##contig=<ID=Un_JTFH01001003v1_decoy,length=2310>\n##contig=<ID=Un_JTFH01001004v1_decoy,length=2288>\n##contig=<ID=Un_JTFH01001005v1_decoy,length=2285>\n##contig=<ID=Un_JTFH01001006v1_decoy,length=2269>\n##contig=<ID=Un_JTFH01001007v1_decoy,length=2253>\n##contig=<ID=Un_JTFH01001008v1_decoy,length=2203>\n##contig=<ID=Un_JTFH01001009v1_decoy,length=2176>\n##contig=<ID=Un_JTFH01001010v1_decoy,length=2159>\n##contig=<ID=Un_JTFH01001011v1_decoy,length=2155>\n##contig=<ID=Un_JTFH01001012v1_decoy,length=2149>\n##contig=<ID=Un_JTFH01001013v1_decoy,length=2129>\n##contig=<ID=Un_JTFH01001014v1_decoy,length=2116>\n##contig=<ID=Un_JTFH01001015v1_decoy,length=2113>\n##contig=<ID=Un_JTFH01001016v1_decoy,length=2098>\n##contig=<ID=Un_JTFH01001017v1_decoy,length=2066>\n##contig=<ID=Un_JTFH01001018v1_decoy,length=2066>\n##contig=<ID=Un_JTFH01001019v1_decoy,length=2059>\n##contig=<ID=Un_JTFH01001020v1_decoy,length=2047>\n##contig=<ID=Un_JTFH01001021v1_decoy,length=2040>\n##contig=<ID=Un_JTFH01001022v1_decoy,length=2030>\n##contig=<ID=Un_JTFH01001023v1_decoy,length=2024>\n##contig=<ID=Un_JTFH01001024v1_decoy,length=2001>\n##contig=<ID=Un_JTFH01001025v1_decoy,length=1992>\n##contig=<ID=Un_JTFH01001026v1_decoy,length=1981>\n##contig=<ID=Un_JTFH01001027v1_decoy,length=1979>\n##contig=<ID=Un_JTFH01001028v1_decoy,length=1957>\n##contig=<ID=Un_JTFH01001029v1_decoy,length=1953>\n##contig=<ID=Un_JTFH01001030v1_decoy,length=1944>\n##contig=<ID=Un_JTFH01001031v1_decoy,length=1936>\n##contig=<ID=Un_JTFH01001032v1_decoy,length=1932>\n##contig=<ID=Un_JTFH01001033v1_decoy,length=1882>\n##contig=<ID=Un_JTFH01001034v1_decoy,length=1878>\n##contig=<ID=Un_JTFH01001035v1_decoy,length=1870>\n##contig=<ID=Un_JTFH01001036v1_decoy,length=1821>\n##contig=<ID=Un_JTFH01001037v1_decoy,length=1813>\n##contig=<ID=Un_JTFH01001038v1_decoy,length=1809>\n##contig=<ID=Un_JTFH01001039v1_decoy,length=1804>\n##contig=<ID=Un_JTFH01001040v1_decoy,length=1797>\n##contig=<ID=Un_JTFH01001041v1_decoy,length=1791>\n##contig=<ID=Un_JTFH01001042v1_decoy,length=1781>\n##contig=<ID=Un_JTFH01001043v1_decoy,length=1766>\n##contig=<ID=Un_JTFH01001044v1_decoy,length=1764>\n##contig=<ID=Un_JTFH01001045v1_decoy,length=1743>\n##contig=<ID=Un_JTFH01001046v1_decoy,length=1741>\n##contig=<ID=Un_JTFH01001047v1_decoy,length=1709>\n##contig=<ID=Un_JTFH01001048v1_decoy,length=1706>\n##contig=<ID=Un_JTFH01001049v1_decoy,length=1701>\n##contig=<ID=Un_JTFH01001050v1_decoy,length=1689>\n##contig=<ID=Un_JTFH01001051v1_decoy,length=1646>\n##contig=<ID=Un_JTFH01001052v1_decoy,length=1641>\n##contig=<ID=Un_JTFH01001053v1_decoy,length=1639>\n##contig=<ID=Un_JTFH01001054v1_decoy,length=1636>\n##contig=<ID=Un_JTFH01001055v1_decoy,length=1632>\n##contig=<ID=Un_JTFH01001056v1_decoy,length=1629>\n##contig=<ID=Un_JTFH01001057v1_decoy,length=1623>\n##contig=<ID=Un_JTFH01001058v1_decoy,length=1622>\n##contig=<ID=Un_JTFH01001059v1_decoy,length=1622>\n##contig=<ID=Un_JTFH01001060v1_decoy,length=1619>\n##contig=<ID=Un_JTFH01001061v1_decoy,length=1606>\n##contig=<ID=Un_JTFH01001062v1_decoy,length=1593>\n##contig=<ID=Un_JTFH01001063v1_decoy,length=1592>\n##contig=<ID=Un_JTFH01001064v1_decoy,length=1558>\n##contig=<ID=Un_JTFH01001065v1_decoy,length=1545>\n##contig=<ID=Un_JTFH01001066v1_decoy,length=1542>\n##contig=<ID=Un_JTFH01001067v1_decoy,length=1540>\n##contig=<ID=Un_JTFH01001068v1_decoy,length=1529>\n##contig=<ID=Un_JTFH01001069v1_decoy,length=1518>\n##contig=<ID=Un_JTFH01001070v1_decoy,length=1515>\n##contig=<ID=Un_JTFH01001071v1_decoy,length=1513>\n##contig=<ID=Un_JTFH01001072v1_decoy,length=1507>\n##contig=<ID=Un_JTFH01001073v1_decoy,length=1504>\n##contig=<ID=Un_JTFH01001074v1_decoy,length=1499>\n##contig=<ID=Un_JTFH01001075v1_decoy,length=1495>\n##contig=<ID=Un_JTFH01001076v1_decoy,length=1495>\n##contig=<ID=Un_JTFH01001077v1_decoy,length=1492>\n##contig=<ID=Un_JTFH01001078v1_decoy,length=1492>\n##contig=<ID=Un_JTFH01001079v1_decoy,length=1489>\n##contig=<ID=Un_JTFH01001080v1_decoy,length=1485>\n##contig=<ID=Un_JTFH01001081v1_decoy,length=1483>\n##contig=<ID=Un_JTFH01001082v1_decoy,length=1473>\n##contig=<ID=Un_JTFH01001083v1_decoy,length=1470>\n##contig=<ID=Un_JTFH01001084v1_decoy,length=1463>\n##contig=<ID=Un_JTFH01001085v1_decoy,length=1460>\n##contig=<ID=Un_JTFH01001086v1_decoy,length=1458>\n##contig=<ID=Un_JTFH01001087v1_decoy,length=1456>\n##contig=<ID=Un_JTFH01001088v1_decoy,length=1453>\n##contig=<ID=Un_JTFH01001089v1_decoy,length=1443>\n##contig=<ID=Un_JTFH01001090v1_decoy,length=1441>\n##contig=<ID=Un_JTFH01001091v1_decoy,length=1426>\n##contig=<ID=Un_JTFH01001092v1_decoy,length=1425>\n##contig=<ID=Un_JTFH01001093v1_decoy,length=1418>\n##contig=<ID=Un_JTFH01001094v1_decoy,length=1413>\n##contig=<ID=Un_JTFH01001095v1_decoy,length=1413>\n##contig=<ID=Un_JTFH01001096v1_decoy,length=1412>\n##contig=<ID=Un_JTFH01001097v1_decoy,length=1407>\n##contig=<ID=Un_JTFH01001098v1_decoy,length=1406>\n##contig=<ID=Un_JTFH01001099v1_decoy,length=1396>\n##contig=<ID=Un_JTFH01001100v1_decoy,length=1390>\n##contig=<ID=Un_JTFH01001101v1_decoy,length=1382>\n##contig=<ID=Un_JTFH01001102v1_decoy,length=1376>\n##contig=<ID=Un_JTFH01001103v1_decoy,length=1375>\n##contig=<ID=Un_JTFH01001104v1_decoy,length=1371>\n##contig=<ID=Un_JTFH01001105v1_decoy,length=1367>\n##contig=<ID=Un_JTFH01001106v1_decoy,length=1364>\n##contig=<ID=Un_JTFH01001107v1_decoy,length=1356>\n##contig=<ID=Un_JTFH01001108v1_decoy,length=1355>\n##contig=<ID=Un_JTFH01001109v1_decoy,length=1352>\n##contig=<ID=Un_JTFH01001110v1_decoy,length=1350>\n##contig=<ID=Un_JTFH01001111v1_decoy,length=1346>\n##contig=<ID=Un_JTFH01001112v1_decoy,length=1345>\n##contig=<ID=Un_JTFH01001113v1_decoy,length=1340>\n##contig=<ID=Un_JTFH01001114v1_decoy,length=1330>\n##contig=<ID=Un_JTFH01001115v1_decoy,length=1329>\n##contig=<ID=Un_JTFH01001116v1_decoy,length=1324>\n##contig=<ID=Un_JTFH01001117v1_decoy,length=1316>\n##contig=<ID=Un_JTFH01001118v1_decoy,length=1307>\n##contig=<ID=Un_JTFH01001119v1_decoy,length=1304>\n##contig=<ID=Un_JTFH01001120v1_decoy,length=1304>\n##contig=<ID=Un_JTFH01001121v1_decoy,length=1303>\n##contig=<ID=Un_JTFH01001122v1_decoy,length=1301>\n##contig=<ID=Un_JTFH01001123v1_decoy,length=1300>\n##contig=<ID=Un_JTFH01001124v1_decoy,length=1297>\n##contig=<ID=Un_JTFH01001125v1_decoy,length=1296>\n##contig=<ID=Un_JTFH01001126v1_decoy,length=1290>\n##contig=<ID=Un_JTFH01001127v1_decoy,length=1284>\n##contig=<ID=Un_JTFH01001128v1_decoy,length=1282>\n##contig=<ID=Un_JTFH01001129v1_decoy,length=1281>\n##contig=<ID=Un_JTFH01001130v1_decoy,length=1280>\n##contig=<ID=Un_JTFH01001131v1_decoy,length=1279>\n##contig=<ID=Un_JTFH01001132v1_decoy,length=1272>\n##contig=<ID=Un_JTFH01001133v1_decoy,length=1267>\n##contig=<ID=Un_JTFH01001134v1_decoy,length=1267>\n##contig=<ID=Un_JTFH01001135v1_decoy,length=1266>\n##contig=<ID=Un_JTFH01001136v1_decoy,length=1264>\n##contig=<ID=Un_JTFH01001137v1_decoy,length=1264>\n##contig=<ID=Un_JTFH01001138v1_decoy,length=1264>\n##contig=<ID=Un_JTFH01001139v1_decoy,length=1263>\n##contig=<ID=Un_JTFH01001140v1_decoy,length=1249>\n##contig=<ID=Un_JTFH01001141v1_decoy,length=1240>\n##contig=<ID=Un_JTFH01001142v1_decoy,length=1239>\n##contig=<ID=Un_JTFH01001143v1_decoy,length=1235>\n##contig=<ID=Un_JTFH01001144v1_decoy,length=1235>\n##contig=<ID=Un_JTFH01001145v1_decoy,length=1233>\n##contig=<ID=Un_JTFH01001146v1_decoy,length=1232>\n##contig=<ID=Un_JTFH01001147v1_decoy,length=1230>\n##contig=<ID=Un_JTFH01001148v1_decoy,length=1226>\n##contig=<ID=Un_JTFH01001149v1_decoy,length=1223>\n##contig=<ID=Un_JTFH01001150v1_decoy,length=1214>\n##contig=<ID=Un_JTFH01001151v1_decoy,length=1213>\n##contig=<ID=Un_JTFH01001152v1_decoy,length=1211>\n##contig=<ID=Un_JTFH01001153v1_decoy,length=1209>\n##contig=<ID=Un_JTFH01001154v1_decoy,length=1202>\n##contig=<ID=Un_JTFH01001155v1_decoy,length=1199>\n##contig=<ID=Un_JTFH01001156v1_decoy,length=1197>\n##contig=<ID=Un_JTFH01001157v1_decoy,length=1193>\n##contig=<ID=Un_JTFH01001158v1_decoy,length=1191>\n##contig=<ID=Un_JTFH01001159v1_decoy,length=1187>\n##contig=<ID=Un_JTFH01001160v1_decoy,length=1186>\n##contig=<ID=Un_JTFH01001161v1_decoy,length=1184>\n##contig=<ID=Un_JTFH01001162v1_decoy,length=1184>\n##contig=<ID=Un_JTFH01001163v1_decoy,length=1182>\n##contig=<ID=Un_JTFH01001164v1_decoy,length=1179>\n##contig=<ID=Un_JTFH01001165v1_decoy,length=1173>\n##contig=<ID=Un_JTFH01001166v1_decoy,length=1169>\n##contig=<ID=Un_JTFH01001167v1_decoy,length=1167>\n##contig=<ID=Un_JTFH01001168v1_decoy,length=1166>\n##contig=<ID=Un_JTFH01001169v1_decoy,length=1165>\n##contig=<ID=Un_JTFH01001170v1_decoy,length=1164>\n##contig=<ID=Un_JTFH01001171v1_decoy,length=1163>\n##contig=<ID=Un_JTFH01001172v1_decoy,length=1158>\n##contig=<ID=Un_JTFH01001173v1_decoy,length=1158>\n##contig=<ID=Un_JTFH01001174v1_decoy,length=1157>\n##contig=<ID=Un_JTFH01001175v1_decoy,length=1157>\n##contig=<ID=Un_JTFH01001176v1_decoy,length=1157>\n##contig=<ID=Un_JTFH01001177v1_decoy,length=1155>\n##contig=<ID=Un_JTFH01001178v1_decoy,length=1154>\n##contig=<ID=Un_JTFH01001179v1_decoy,length=1149>\n##contig=<ID=Un_JTFH01001180v1_decoy,length=1148>\n##contig=<ID=Un_JTFH01001181v1_decoy,length=1148>\n##contig=<ID=Un_JTFH01001182v1_decoy,length=1146>\n##contig=<ID=Un_JTFH01001183v1_decoy,length=1144>\n##contig=<ID=Un_JTFH01001184v1_decoy,length=1140>\n##contig=<ID=Un_JTFH01001185v1_decoy,length=1136>\n##contig=<ID=Un_JTFH01001186v1_decoy,length=1134>\n##contig=<ID=Un_JTFH01001187v1_decoy,length=1133>\n##contig=<ID=Un_JTFH01001188v1_decoy,length=1129>\n##contig=<ID=Un_JTFH01001189v1_decoy,length=1127>\n##contig=<ID=Un_JTFH01001190v1_decoy,length=1127>\n##contig=<ID=Un_JTFH01001191v1_decoy,length=1118>\n##contig=<ID=Un_JTFH01001192v1_decoy,length=1110>\n##contig=<ID=Un_JTFH01001193v1_decoy,length=1104>\n##contig=<ID=Un_JTFH01001194v1_decoy,length=1104>\n##contig=<ID=Un_JTFH01001195v1_decoy,length=1101>\n##contig=<ID=Un_JTFH01001196v1_decoy,length=1098>\n##contig=<ID=Un_JTFH01001197v1_decoy,length=1096>\n##contig=<ID=Un_JTFH01001198v1_decoy,length=1094>\n##contig=<ID=Un_JTFH01001199v1_decoy,length=1091>\n##contig=<ID=Un_JTFH01001200v1_decoy,length=1089>\n##contig=<ID=Un_JTFH01001201v1_decoy,length=1086>\n##contig=<ID=Un_JTFH01001202v1_decoy,length=1085>\n##contig=<ID=Un_JTFH01001203v1_decoy,length=1084>\n##contig=<ID=Un_JTFH01001204v1_decoy,length=1083>\n##contig=<ID=Un_JTFH01001205v1_decoy,length=1083>\n##contig=<ID=Un_JTFH01001206v1_decoy,length=1079>\n##contig=<ID=Un_JTFH01001207v1_decoy,length=1076>\n##contig=<ID=Un_JTFH01001208v1_decoy,length=1069>\n##contig=<ID=Un_JTFH01001209v1_decoy,length=1068>\n##contig=<ID=Un_JTFH01001210v1_decoy,length=1067>\n##contig=<ID=Un_JTFH01001211v1_decoy,length=1067>\n##contig=<ID=Un_JTFH01001212v1_decoy,length=1067>\n##contig=<ID=Un_JTFH01001213v1_decoy,length=1063>\n##contig=<ID=Un_JTFH01001214v1_decoy,length=1062>\n##contig=<ID=Un_JTFH01001215v1_decoy,length=1059>\n##contig=<ID=Un_JTFH01001216v1_decoy,length=1058>\n##contig=<ID=Un_JTFH01001217v1_decoy,length=1058>\n##contig=<ID=Un_JTFH01001218v1_decoy,length=1055>\n##contig=<ID=Un_JTFH01001219v1_decoy,length=1054>\n##contig=<ID=Un_JTFH01001220v1_decoy,length=1054>\n##contig=<ID=Un_JTFH01001221v1_decoy,length=1053>\n##contig=<ID=Un_JTFH01001222v1_decoy,length=1053>\n##contig=<ID=Un_JTFH01001223v1_decoy,length=1052>\n##contig=<ID=Un_JTFH01001224v1_decoy,length=1051>\n##contig=<ID=Un_JTFH01001225v1_decoy,length=1049>\n##contig=<ID=Un_JTFH01001226v1_decoy,length=1047>\n##contig=<ID=Un_JTFH01001227v1_decoy,length=1044>\n##contig=<ID=Un_JTFH01001228v1_decoy,length=1043>\n##contig=<ID=Un_JTFH01001229v1_decoy,length=1043>\n##contig=<ID=Un_JTFH01001230v1_decoy,length=1042>\n##contig=<ID=Un_JTFH01001231v1_decoy,length=1042>\n##contig=<ID=Un_JTFH01001232v1_decoy,length=1041>\n##contig=<ID=Un_JTFH01001233v1_decoy,length=1040>\n##contig=<ID=Un_JTFH01001234v1_decoy,length=1039>\n##contig=<ID=Un_JTFH01001235v1_decoy,length=1038>\n##contig=<ID=Un_JTFH01001236v1_decoy,length=1037>\n##contig=<ID=Un_JTFH01001237v1_decoy,length=1037>\n##contig=<ID=Un_JTFH01001238v1_decoy,length=1035>\n##contig=<ID=Un_JTFH01001239v1_decoy,length=1027>\n##contig=<ID=Un_JTFH01001240v1_decoy,length=1021>\n##contig=<ID=Un_JTFH01001241v1_decoy,length=1021>\n##contig=<ID=Un_JTFH01001242v1_decoy,length=1019>\n##contig=<ID=Un_JTFH01001243v1_decoy,length=1019>\n##contig=<ID=Un_JTFH01001244v1_decoy,length=1016>\n##contig=<ID=Un_JTFH01001245v1_decoy,length=1014>\n##contig=<ID=Un_JTFH01001246v1_decoy,length=1013>\n##contig=<ID=Un_JTFH01001247v1_decoy,length=1009>\n##contig=<ID=Un_JTFH01001248v1_decoy,length=1008>\n##contig=<ID=Un_JTFH01001249v1_decoy,length=1007>\n##contig=<ID=Un_JTFH01001250v1_decoy,length=1004>\n##contig=<ID=Un_JTFH01001251v1_decoy,length=1004>\n##contig=<ID=Un_JTFH01001252v1_decoy,length=1003>\n##contig=<ID=Un_JTFH01001253v1_decoy,length=1001>\n##contig=<ID=Un_JTFH01001254v1_decoy,length=1000>\n##contig=<ID=Un_JTFH01001255v1_decoy,length=1000>\n##contig=<ID=Un_JTFH01001256v1_decoy,length=1000>\n##contig=<ID=Un_JTFH01001257v1_decoy,length=17929>\n##contig=<ID=Un_JTFH01001258v1_decoy,length=9749>\n##contig=<ID=Un_JTFH01001259v1_decoy,length=8053>\n##contig=<ID=Un_JTFH01001260v1_decoy,length=7826>\n##contig=<ID=Un_JTFH01001261v1_decoy,length=7768>\n##contig=<ID=Un_JTFH01001262v1_decoy,length=5691>\n##contig=<ID=Un_JTFH01001263v1_decoy,length=5444>\n##contig=<ID=Un_JTFH01001264v1_decoy,length=5077>\n##contig=<ID=Un_JTFH01001265v1_decoy,length=4990>\n##contig=<ID=Un_JTFH01001266v1_decoy,length=4545>\n##contig=<ID=Un_JTFH01001267v1_decoy,length=4544>\n##contig=<ID=Un_JTFH01001268v1_decoy,length=4202>\n##contig=<ID=Un_JTFH01001269v1_decoy,length=4195>\n##contig=<ID=Un_JTFH01001270v1_decoy,length=3807>\n##contig=<ID=Un_JTFH01001271v1_decoy,length=3741>\n##contig=<ID=Un_JTFH01001272v1_decoy,length=3699>\n##contig=<ID=Un_JTFH01001273v1_decoy,length=3640>\n##contig=<ID=Un_JTFH01001274v1_decoy,length=3531>\n##contig=<ID=Un_JTFH01001275v1_decoy,length=3455>\n##contig=<ID=Un_JTFH01001276v1_decoy,length=3411>\n##contig=<ID=Un_JTFH01001277v1_decoy,length=3387>\n##contig=<ID=Un_JTFH01001278v1_decoy,length=3358>\n##contig=<ID=Un_JTFH01001279v1_decoy,length=3285>\n##contig=<ID=Un_JTFH01001280v1_decoy,length=3273>\n##contig=<ID=Un_JTFH01001281v1_decoy,length=3262>\n##contig=<ID=Un_JTFH01001282v1_decoy,length=3259>\n##contig=<ID=Un_JTFH01001283v1_decoy,length=3222>\n##contig=<ID=Un_JTFH01001284v1_decoy,length=3127>\n##contig=<ID=Un_JTFH01001285v1_decoy,length=3110>\n##contig=<ID=Un_JTFH01001286v1_decoy,length=3104>\n##contig=<ID=Un_JTFH01001287v1_decoy,length=3071>\n##contig=<ID=Un_JTFH01001288v1_decoy,length=3063>\n##contig=<ID=Un_JTFH01001289v1_decoy,length=3059>\n##contig=<ID=Un_JTFH01001290v1_decoy,length=2990>\n##contig=<ID=Un_JTFH01001291v1_decoy,length=2986>\n##contig=<ID=Un_JTFH01001292v1_decoy,length=2928>\n##contig=<ID=Un_JTFH01001293v1_decoy,length=2922>\n##contig=<ID=Un_JTFH01001294v1_decoy,length=2875>\n##contig=<ID=Un_JTFH01001295v1_decoy,length=2859>\n##contig=<ID=Un_JTFH01001296v1_decoy,length=2850>\n##contig=<ID=Un_JTFH01001297v1_decoy,length=2813>\n##contig=<ID=Un_JTFH01001298v1_decoy,length=2785>\n##contig=<ID=Un_JTFH01001299v1_decoy,length=2736>\n##contig=<ID=Un_JTFH01001300v1_decoy,length=2688>\n##contig=<ID=Un_JTFH01001301v1_decoy,length=2658>\n##contig=<ID=Un_JTFH01001302v1_decoy,length=2643>\n##contig=<ID=Un_JTFH01001303v1_decoy,length=2618>\n##contig=<ID=Un_JTFH01001304v1_decoy,length=2605>\n##contig=<ID=Un_JTFH01001305v1_decoy,length=2583>\n##contig=<ID=Un_JTFH01001306v1_decoy,length=2534>\n##contig=<ID=Un_JTFH01001307v1_decoy,length=2512>\n##contig=<ID=Un_JTFH01001308v1_decoy,length=2500>\n##contig=<ID=Un_JTFH01001309v1_decoy,length=2481>\n##contig=<ID=Un_JTFH01001310v1_decoy,length=2478>\n##contig=<ID=Un_JTFH01001311v1_decoy,length=2473>\n##contig=<ID=Un_JTFH01001312v1_decoy,length=2467>\n##contig=<ID=Un_JTFH01001313v1_decoy,length=2442>\n##contig=<ID=Un_JTFH01001314v1_decoy,length=2430>\n##contig=<ID=Un_JTFH01001315v1_decoy,length=2417>\n##contig=<ID=Un_JTFH01001316v1_decoy,length=2408>\n##contig=<ID=Un_JTFH01001317v1_decoy,length=2395>\n##contig=<ID=Un_JTFH01001318v1_decoy,length=2352>\n##contig=<ID=Un_JTFH01001319v1_decoy,length=2337>\n##contig=<ID=Un_JTFH01001320v1_decoy,length=2322>\n##contig=<ID=Un_JTFH01001321v1_decoy,length=2307>\n##contig=<ID=Un_JTFH01001322v1_decoy,length=2306>\n##contig=<ID=Un_JTFH01001323v1_decoy,length=2292>\n##contig=<ID=Un_JTFH01001324v1_decoy,length=2271>\n##contig=<ID=Un_JTFH01001325v1_decoy,length=2265>\n##contig=<ID=Un_JTFH01001326v1_decoy,length=2260>\n##contig=<ID=Un_JTFH01001327v1_decoy,length=2240>\n##contig=<ID=Un_JTFH01001328v1_decoy,length=2238>\n##contig=<ID=Un_JTFH01001329v1_decoy,length=2228>\n##contig=<ID=Un_JTFH01001330v1_decoy,length=2215>\n##contig=<ID=Un_JTFH01001331v1_decoy,length=2205>\n##contig=<ID=Un_JTFH01001332v1_decoy,length=2191>\n##contig=<ID=Un_JTFH01001333v1_decoy,length=2191>\n##contig=<ID=Un_JTFH01001334v1_decoy,length=2190>\n##contig=<ID=Un_JTFH01001335v1_decoy,length=2184>\n##contig=<ID=Un_JTFH01001336v1_decoy,length=2166>\n##contig=<ID=Un_JTFH01001337v1_decoy,length=2165>\n##contig=<ID=Un_JTFH01001338v1_decoy,length=2162>\n##contig=<ID=Un_JTFH01001339v1_decoy,length=2146>\n##contig=<ID=Un_JTFH01001340v1_decoy,length=2116>\n##contig=<ID=Un_JTFH01001341v1_decoy,length=2112>\n##contig=<ID=Un_JTFH01001342v1_decoy,length=2108>\n##contig=<ID=Un_JTFH01001343v1_decoy,length=2106>\n##contig=<ID=Un_JTFH01001344v1_decoy,length=2106>\n##contig=<ID=Un_JTFH01001345v1_decoy,length=2106>\n##contig=<ID=Un_JTFH01001346v1_decoy,length=2097>\n##contig=<ID=Un_JTFH01001347v1_decoy,length=2081>\n##contig=<ID=Un_JTFH01001348v1_decoy,length=2058>\n##contig=<ID=Un_JTFH01001349v1_decoy,length=2055>\n##contig=<ID=Un_JTFH01001350v1_decoy,length=2054>\n##contig=<ID=Un_JTFH01001351v1_decoy,length=2037>\n##contig=<ID=Un_JTFH01001352v1_decoy,length=2032>\n##contig=<ID=Un_JTFH01001353v1_decoy,length=2032>\n##contig=<ID=Un_JTFH01001354v1_decoy,length=2020>\n##contig=<ID=Un_JTFH01001355v1_decoy,length=2018>\n##contig=<ID=Un_JTFH01001356v1_decoy,length=2014>\n##contig=<ID=Un_JTFH01001357v1_decoy,length=2001>\n##contig=<ID=Un_JTFH01001358v1_decoy,length=2001>\n##contig=<ID=Un_JTFH01001359v1_decoy,length=1991>\n##contig=<ID=Un_JTFH01001360v1_decoy,length=1990>\n##contig=<ID=Un_JTFH01001361v1_decoy,length=1983>\n##contig=<ID=Un_JTFH01001362v1_decoy,length=1981>\n##contig=<ID=Un_JTFH01001363v1_decoy,length=1981>\n##contig=<ID=Un_JTFH01001364v1_decoy,length=1979>\n##contig=<ID=Un_JTFH01001365v1_decoy,length=1963>\n##contig=<ID=Un_JTFH01001366v1_decoy,length=1932>\n##contig=<ID=Un_JTFH01001367v1_decoy,length=1929>\n##contig=<ID=Un_JTFH01001368v1_decoy,length=1881>\n##contig=<ID=Un_JTFH01001369v1_decoy,length=1874>\n##contig=<ID=Un_JTFH01001370v1_decoy,length=1849>\n##contig=<ID=Un_JTFH01001371v1_decoy,length=1849>\n##contig=<ID=Un_JTFH01001372v1_decoy,length=1833>\n##contig=<ID=Un_JTFH01001373v1_decoy,length=1832>\n##contig=<ID=Un_JTFH01001374v1_decoy,length=1826>\n##contig=<ID=Un_JTFH01001375v1_decoy,length=1814>\n##contig=<ID=Un_JTFH01001376v1_decoy,length=1814>\n##contig=<ID=Un_JTFH01001377v1_decoy,length=1791>\n##contig=<ID=Un_JTFH01001378v1_decoy,length=1789>\n##contig=<ID=Un_JTFH01001379v1_decoy,length=1786>\n##contig=<ID=Un_JTFH01001380v1_decoy,length=1778>\n##contig=<ID=Un_JTFH01001381v1_decoy,length=1776>\n##contig=<ID=Un_JTFH01001382v1_decoy,length=1762>\n##contig=<ID=Un_JTFH01001383v1_decoy,length=1758>\n##contig=<ID=Un_JTFH01001384v1_decoy,length=1757>\n##contig=<ID=Un_JTFH01001385v1_decoy,length=1754>\n##contig=<ID=Un_JTFH01001386v1_decoy,length=1752>\n##contig=<ID=Un_JTFH01001387v1_decoy,length=1751>\n##contig=<ID=Un_JTFH01001388v1_decoy,length=1749>\n##contig=<ID=Un_JTFH01001389v1_decoy,length=1738>\n##contig=<ID=Un_JTFH01001390v1_decoy,length=1729>\n##contig=<ID=Un_JTFH01001391v1_decoy,length=1726>\n##contig=<ID=Un_JTFH01001392v1_decoy,length=1716>\n##contig=<ID=Un_JTFH01001393v1_decoy,length=1712>\n##contig=<ID=Un_JTFH01001394v1_decoy,length=1711>\n##contig=<ID=Un_JTFH01001395v1_decoy,length=1703>\n##contig=<ID=Un_JTFH01001396v1_decoy,length=1702>\n##contig=<ID=Un_JTFH01001397v1_decoy,length=1699>\n##contig=<ID=Un_JTFH01001398v1_decoy,length=1686>\n##contig=<ID=Un_JTFH01001399v1_decoy,length=1684>\n##contig=<ID=Un_JTFH01001400v1_decoy,length=1680>\n##contig=<ID=Un_JTFH01001401v1_decoy,length=1678>\n##contig=<ID=Un_JTFH01001402v1_decoy,length=1678>\n##contig=<ID=Un_JTFH01001403v1_decoy,length=1677>\n##contig=<ID=Un_JTFH01001404v1_decoy,length=1676>\n##contig=<ID=Un_JTFH01001405v1_decoy,length=1672>\n##contig=<ID=Un_JTFH01001406v1_decoy,length=1669>\n##contig=<ID=Un_JTFH01001407v1_decoy,length=1668>\n##contig=<ID=Un_JTFH01001408v1_decoy,length=1663>\n##contig=<ID=Un_JTFH01001409v1_decoy,length=1660>\n##contig=<ID=Un_JTFH01001410v1_decoy,length=1660>\n##contig=<ID=Un_JTFH01001411v1_decoy,length=1658>\n##contig=<ID=Un_JTFH01001412v1_decoy,length=1656>\n##contig=<ID=Un_JTFH01001413v1_decoy,length=1656>\n##contig=<ID=Un_JTFH01001414v1_decoy,length=1652>\n##contig=<ID=Un_JTFH01001415v1_decoy,length=1647>\n##contig=<ID=Un_JTFH01001416v1_decoy,length=1645>\n##contig=<ID=Un_JTFH01001417v1_decoy,length=1641>\n##contig=<ID=Un_JTFH01001418v1_decoy,length=1638>\n##contig=<ID=Un_JTFH01001419v1_decoy,length=1633>\n##contig=<ID=Un_JTFH01001420v1_decoy,length=1626>\n##contig=<ID=Un_JTFH01001421v1_decoy,length=1614>\n##contig=<ID=Un_JTFH01001422v1_decoy,length=1612>\n##contig=<ID=Un_JTFH01001423v1_decoy,length=1605>\n##contig=<ID=Un_JTFH01001424v1_decoy,length=1603>\n##contig=<ID=Un_JTFH01001425v1_decoy,length=1599>\n##contig=<ID=Un_JTFH01001426v1_decoy,length=1589>\n##contig=<ID=Un_JTFH01001427v1_decoy,length=1588>\n##contig=<ID=Un_JTFH01001428v1_decoy,length=1585>\n##contig=<ID=Un_JTFH01001429v1_decoy,length=1584>\n##contig=<ID=Un_JTFH01001430v1_decoy,length=1584>\n##contig=<ID=Un_JTFH01001431v1_decoy,length=1580>\n##contig=<ID=Un_JTFH01001432v1_decoy,length=1572>\n##contig=<ID=Un_JTFH01001433v1_decoy,length=1570>\n##contig=<ID=Un_JTFH01001434v1_decoy,length=1569>\n##contig=<ID=Un_JTFH01001435v1_decoy,length=1568>\n##contig=<ID=Un_JTFH01001436v1_decoy,length=1567>\n##contig=<ID=Un_JTFH01001437v1_decoy,length=1565>\n##contig=<ID=Un_JTFH01001438v1_decoy,length=1559>\n##contig=<ID=Un_JTFH01001439v1_decoy,length=1559>\n##contig=<ID=Un_JTFH01001440v1_decoy,length=1556>\n##contig=<ID=Un_JTFH01001441v1_decoy,length=1554>\n##contig=<ID=Un_JTFH01001442v1_decoy,length=1549>\n##contig=<ID=Un_JTFH01001443v1_decoy,length=1542>\n##contig=<ID=Un_JTFH01001444v1_decoy,length=1541>\n##contig=<ID=Un_JTFH01001445v1_decoy,length=1538>\n##contig=<ID=Un_JTFH01001446v1_decoy,length=1537>\n##contig=<ID=Un_JTFH01001447v1_decoy,length=1535>\n##contig=<ID=Un_JTFH01001448v1_decoy,length=1530>\n##contig=<ID=Un_JTFH01001449v1_decoy,length=1528>\n##contig=<ID=Un_JTFH01001450v1_decoy,length=1522>\n##contig=<ID=Un_JTFH01001451v1_decoy,length=1514>\n##contig=<ID=Un_JTFH01001452v1_decoy,length=1509>\n##contig=<ID=Un_JTFH01001453v1_decoy,length=1507>\n##contig=<ID=Un_JTFH01001454v1_decoy,length=1500>\n##contig=<ID=Un_JTFH01001455v1_decoy,length=1499>\n##contig=<ID=Un_JTFH01001456v1_decoy,length=1499>\n##contig=<ID=Un_JTFH01001457v1_decoy,length=1497>\n##contig=<ID=Un_JTFH01001458v1_decoy,length=1496>\n##contig=<ID=Un_JTFH01001459v1_decoy,length=1488>\n##contig=<ID=Un_JTFH01001460v1_decoy,length=1486>\n##contig=<ID=Un_JTFH01001461v1_decoy,length=1485>\n##contig=<ID=Un_JTFH01001462v1_decoy,length=1481>\n##contig=<ID=Un_JTFH01001463v1_decoy,length=1479>\n##contig=<ID=Un_JTFH01001464v1_decoy,length=1472>\n##contig=<ID=Un_JTFH01001465v1_decoy,length=1472>\n##contig=<ID=Un_JTFH01001466v1_decoy,length=1470>\n##contig=<ID=Un_JTFH01001467v1_decoy,length=1466>\n##contig=<ID=Un_JTFH01001468v1_decoy,length=1465>\n##contig=<ID=Un_JTFH01001469v1_decoy,length=1461>\n##contig=<ID=Un_JTFH01001470v1_decoy,length=1458>\n##contig=<ID=Un_JTFH01001471v1_decoy,length=1457>\n##contig=<ID=Un_JTFH01001472v1_decoy,length=1448>\n##contig=<ID=Un_JTFH01001473v1_decoy,length=1447>\n##contig=<ID=Un_JTFH01001474v1_decoy,length=1444>\n##contig=<ID=Un_JTFH01001475v1_decoy,length=1443>\n##contig=<ID=Un_JTFH01001476v1_decoy,length=1443>\n##contig=<ID=Un_JTFH01001477v1_decoy,length=1438>\n##contig=<ID=Un_JTFH01001478v1_decoy,length=1432>\n##contig=<ID=Un_JTFH01001479v1_decoy,length=1430>\n##contig=<ID=Un_JTFH01001480v1_decoy,length=1430>\n##contig=<ID=Un_JTFH01001481v1_decoy,length=1429>\n##contig=<ID=Un_JTFH01001482v1_decoy,length=1429>\n##contig=<ID=Un_JTFH01001483v1_decoy,length=1429>\n##contig=<ID=Un_JTFH01001484v1_decoy,length=1426>\n##contig=<ID=Un_JTFH01001485v1_decoy,length=1426>\n##contig=<ID=Un_JTFH01001486v1_decoy,length=1420>\n##contig=<ID=Un_JTFH01001487v1_decoy,length=1416>\n##contig=<ID=Un_JTFH01001488v1_decoy,length=1416>\n##contig=<ID=Un_JTFH01001489v1_decoy,length=1415>\n##contig=<ID=Un_JTFH01001490v1_decoy,length=1415>\n##contig=<ID=Un_JTFH01001491v1_decoy,length=1414>\n##contig=<ID=Un_JTFH01001492v1_decoy,length=1413>\n##contig=<ID=Un_JTFH01001493v1_decoy,length=1410>\n##contig=<ID=Un_JTFH01001494v1_decoy,length=1405>\n##contig=<ID=Un_JTFH01001495v1_decoy,length=1402>\n##contig=<ID=Un_JTFH01001496v1_decoy,length=1398>\n##contig=<ID=Un_JTFH01001497v1_decoy,length=1397>\n##contig=<ID=Un_JTFH01001498v1_decoy,length=1395>\n##contig=<ID=Un_JTFH01001499v1_decoy,length=1392>\n##contig=<ID=Un_JTFH01001500v1_decoy,length=1388>\n##contig=<ID=Un_JTFH01001501v1_decoy,length=1386>\n##contig=<ID=Un_JTFH01001502v1_decoy,length=1382>\n##contig=<ID=Un_JTFH01001503v1_decoy,length=1381>\n##contig=<ID=Un_JTFH01001504v1_decoy,length=1379>\n##contig=<ID=Un_JTFH01001505v1_decoy,length=1376>\n##contig=<ID=Un_JTFH01001506v1_decoy,length=1374>\n##contig=<ID=Un_JTFH01001507v1_decoy,length=1374>\n##contig=<ID=Un_JTFH01001508v1_decoy,length=1373>\n##contig=<ID=Un_JTFH01001509v1_decoy,length=1373>\n##contig=<ID=Un_JTFH01001510v1_decoy,length=1372>\n##contig=<ID=Un_JTFH01001511v1_decoy,length=1370>\n##contig=<ID=Un_JTFH01001512v1_decoy,length=1367>\n##contig=<ID=Un_JTFH01001513v1_decoy,length=1365>\n##contig=<ID=Un_JTFH01001514v1_decoy,length=1364>\n##contig=<ID=Un_JTFH01001515v1_decoy,length=1361>\n##contig=<ID=Un_JTFH01001516v1_decoy,length=1361>\n##contig=<ID=Un_JTFH01001517v1_decoy,length=1355>\n##contig=<ID=Un_JTFH01001518v1_decoy,length=1355>\n##contig=<ID=Un_JTFH01001519v1_decoy,length=1354>\n##contig=<ID=Un_JTFH01001520v1_decoy,length=1353>\n##contig=<ID=Un_JTFH01001521v1_decoy,length=1349>\n##contig=<ID=Un_JTFH01001522v1_decoy,length=1345>\n##contig=<ID=Un_JTFH01001523v1_decoy,length=1344>\n##contig=<ID=Un_JTFH01001524v1_decoy,length=1343>\n##contig=<ID=Un_JTFH01001525v1_decoy,length=1338>\n##contig=<ID=Un_JTFH01001526v1_decoy,length=1338>\n##contig=<ID=Un_JTFH01001527v1_decoy,length=1338>\n##contig=<ID=Un_JTFH01001528v1_decoy,length=1336>\n##contig=<ID=Un_JTFH01001529v1_decoy,length=1333>\n##contig=<ID=Un_JTFH01001530v1_decoy,length=1333>\n##contig=<ID=Un_JTFH01001531v1_decoy,length=1332>\n##contig=<ID=Un_JTFH01001532v1_decoy,length=1324>\n##contig=<ID=Un_JTFH01001533v1_decoy,length=1323>\n##contig=<ID=Un_JTFH01001534v1_decoy,length=1323>\n##contig=<ID=Un_JTFH01001535v1_decoy,length=1320>\n##contig=<ID=Un_JTFH01001536v1_decoy,length=1320>\n##contig=<ID=Un_JTFH01001537v1_decoy,length=1317>\n##contig=<ID=Un_JTFH01001538v1_decoy,length=1316>\n##contig=<ID=Un_JTFH01001539v1_decoy,length=1304>\n##contig=<ID=Un_JTFH01001540v1_decoy,length=1304>\n##contig=<ID=Un_JTFH01001541v1_decoy,length=1303>\n##contig=<ID=Un_JTFH01001542v1_decoy,length=1302>\n##contig=<ID=Un_JTFH01001543v1_decoy,length=1301>\n##contig=<ID=Un_JTFH01001544v1_decoy,length=1300>\n##contig=<ID=Un_JTFH01001545v1_decoy,length=1298>\n##contig=<ID=Un_JTFH01001546v1_decoy,length=1297>\n##contig=<ID=Un_JTFH01001547v1_decoy,length=1295>\n##contig=<ID=Un_JTFH01001548v1_decoy,length=1284>\n##contig=<ID=Un_JTFH01001549v1_decoy,length=1283>\n##contig=<ID=Un_JTFH01001550v1_decoy,length=1283>\n##contig=<ID=Un_JTFH01001551v1_decoy,length=1279>\n##contig=<ID=Un_JTFH01001552v1_decoy,length=1278>\n##contig=<ID=Un_JTFH01001553v1_decoy,length=1271>\n##contig=<ID=Un_JTFH01001554v1_decoy,length=1271>\n##contig=<ID=Un_JTFH01001555v1_decoy,length=1268>\n##contig=<ID=Un_JTFH01001556v1_decoy,length=1264>\n##contig=<ID=Un_JTFH01001557v1_decoy,length=1263>\n##contig=<ID=Un_JTFH01001558v1_decoy,length=1262>\n##contig=<ID=Un_JTFH01001559v1_decoy,length=1261>\n##contig=<ID=Un_JTFH01001560v1_decoy,length=1260>\n##contig=<ID=Un_JTFH01001561v1_decoy,length=1259>\n##contig=<ID=Un_JTFH01001562v1_decoy,length=1259>\n##contig=<ID=Un_JTFH01001563v1_decoy,length=1258>\n##contig=<ID=Un_JTFH01001564v1_decoy,length=1256>\n##contig=<ID=Un_JTFH01001565v1_decoy,length=1253>\n##contig=<ID=Un_JTFH01001566v1_decoy,length=1248>\n##contig=<ID=Un_JTFH01001567v1_decoy,length=1248>\n##contig=<ID=Un_JTFH01001568v1_decoy,length=1246>\n##contig=<ID=Un_JTFH01001569v1_decoy,length=1246>\n##contig=<ID=Un_JTFH01001570v1_decoy,length=1244>\n##contig=<ID=Un_JTFH01001571v1_decoy,length=1238>\n##contig=<ID=Un_JTFH01001572v1_decoy,length=1238>\n##contig=<ID=Un_JTFH01001573v1_decoy,length=1236>\n##contig=<ID=Un_JTFH01001574v1_decoy,length=1234>\n##contig=<ID=Un_JTFH01001575v1_decoy,length=1234>\n##contig=<ID=Un_JTFH01001576v1_decoy,length=1231>\n##contig=<ID=Un_JTFH01001577v1_decoy,length=1231>\n##contig=<ID=Un_JTFH01001578v1_decoy,length=1230>\n##contig=<ID=Un_JTFH01001579v1_decoy,length=1230>\n##contig=<ID=Un_JTFH01001580v1_decoy,length=1228>\n##contig=<ID=Un_JTFH01001581v1_decoy,length=1227>\n##contig=<ID=Un_JTFH01001582v1_decoy,length=1222>\n##contig=<ID=Un_JTFH01001583v1_decoy,length=1222>\n##contig=<ID=Un_JTFH01001584v1_decoy,length=1221>\n##contig=<ID=Un_JTFH01001585v1_decoy,length=1221>\n##contig=<ID=Un_JTFH01001586v1_decoy,length=1220>\n##contig=<ID=Un_JTFH01001587v1_decoy,length=1218>\n##contig=<ID=Un_JTFH01001588v1_decoy,length=1218>\n##contig=<ID=Un_JTFH01001589v1_decoy,length=1216>\n##contig=<ID=Un_JTFH01001590v1_decoy,length=1216>\n##contig=<ID=Un_JTFH01001591v1_decoy,length=1212>\n##contig=<ID=Un_JTFH01001592v1_decoy,length=1210>\n##contig=<ID=Un_JTFH01001593v1_decoy,length=1209>\n##contig=<ID=Un_JTFH01001594v1_decoy,length=1208>\n##contig=<ID=Un_JTFH01001595v1_decoy,length=1208>\n##contig=<ID=Un_JTFH01001596v1_decoy,length=1206>\n##contig=<ID=Un_JTFH01001597v1_decoy,length=1205>\n##contig=<ID=Un_JTFH01001598v1_decoy,length=1205>\n##contig=<ID=Un_JTFH01001599v1_decoy,length=1202>\n##contig=<ID=Un_JTFH01001600v1_decoy,length=1200>\n##contig=<ID=Un_JTFH01001601v1_decoy,length=1199>\n##contig=<ID=Un_JTFH01001602v1_decoy,length=1198>\n##contig=<ID=Un_JTFH01001603v1_decoy,length=1198>\n##contig=<ID=Un_JTFH01001604v1_decoy,length=1198>\n##contig=<ID=Un_JTFH01001605v1_decoy,length=1195>\n##contig=<ID=Un_JTFH01001606v1_decoy,length=1194>\n##contig=<ID=Un_JTFH01001607v1_decoy,length=1191>\n##contig=<ID=Un_JTFH01001608v1_decoy,length=1189>\n##contig=<ID=Un_JTFH01001609v1_decoy,length=1188>\n##contig=<ID=Un_JTFH01001610v1_decoy,length=1180>\n##contig=<ID=Un_JTFH01001611v1_decoy,length=1180>\n##contig=<ID=Un_JTFH01001612v1_decoy,length=1179>\n##contig=<ID=Un_JTFH01001613v1_decoy,length=1172>\n##contig=<ID=Un_JTFH01001614v1_decoy,length=1168>\n##contig=<ID=Un_JTFH01001615v1_decoy,length=1166>\n##contig=<ID=Un_JTFH01001616v1_decoy,length=1157>\n##contig=<ID=Un_JTFH01001617v1_decoy,length=1156>\n##contig=<ID=Un_JTFH01001618v1_decoy,length=1156>\n##contig=<ID=Un_JTFH01001619v1_decoy,length=1155>\n##contig=<ID=Un_JTFH01001620v1_decoy,length=1154>\n##contig=<ID=Un_JTFH01001621v1_decoy,length=1154>\n##contig=<ID=Un_JTFH01001622v1_decoy,length=1149>\n##contig=<ID=Un_JTFH01001623v1_decoy,length=1143>\n##contig=<ID=Un_JTFH01001624v1_decoy,length=1143>\n##contig=<ID=Un_JTFH01001625v1_decoy,length=1140>\n##contig=<ID=Un_JTFH01001626v1_decoy,length=1137>\n##contig=<ID=Un_JTFH01001627v1_decoy,length=1135>\n##contig=<ID=Un_JTFH01001628v1_decoy,length=1135>\n##contig=<ID=Un_JTFH01001629v1_decoy,length=1135>\n##contig=<ID=Un_JTFH01001630v1_decoy,length=1127>\n##contig=<ID=Un_JTFH01001631v1_decoy,length=1127>\n##contig=<ID=Un_JTFH01001632v1_decoy,length=1126>\n##contig=<ID=Un_JTFH01001633v1_decoy,length=1123>\n##contig=<ID=Un_JTFH01001634v1_decoy,length=1123>\n##contig=<ID=Un_JTFH01001635v1_decoy,length=1123>\n##contig=<ID=Un_JTFH01001636v1_decoy,length=1122>\n##contig=<ID=Un_JTFH01001637v1_decoy,length=1122>\n##contig=<ID=Un_JTFH01001638v1_decoy,length=1121>\n##contig=<ID=Un_JTFH01001639v1_decoy,length=1121>\n##contig=<ID=Un_JTFH01001640v1_decoy,length=1119>\n##contig=<ID=Un_JTFH01001641v1_decoy,length=1119>\n##contig=<ID=Un_JTFH01001642v1_decoy,length=1119>\n##contig=<ID=Un_JTFH01001643v1_decoy,length=1118>\n##contig=<ID=Un_JTFH01001644v1_decoy,length=1115>\n##contig=<ID=Un_JTFH01001645v1_decoy,length=1106>\n##contig=<ID=Un_JTFH01001646v1_decoy,length=1106>\n##contig=<ID=Un_JTFH01001647v1_decoy,length=1104>\n##contig=<ID=Un_JTFH01001648v1_decoy,length=1102>\n##contig=<ID=Un_JTFH01001649v1_decoy,length=1101>\n##contig=<ID=Un_JTFH01001650v1_decoy,length=1098>\n##contig=<ID=Un_JTFH01001651v1_decoy,length=1098>\n##contig=<ID=Un_JTFH01001652v1_decoy,length=1096>\n##contig=<ID=Un_JTFH01001653v1_decoy,length=1096>\n##contig=<ID=Un_JTFH01001654v1_decoy,length=1095>\n##contig=<ID=Un_JTFH01001655v1_decoy,length=1093>\n##contig=<ID=Un_JTFH01001656v1_decoy,length=1090>\n##contig=<ID=Un_JTFH01001657v1_decoy,length=1089>\n##contig=<ID=Un_JTFH01001658v1_decoy,length=1087>\n##contig=<ID=Un_JTFH01001659v1_decoy,length=1087>\n##contig=<ID=Un_JTFH01001660v1_decoy,length=1085>\n##contig=<ID=Un_JTFH01001661v1_decoy,length=1085>\n##contig=<ID=Un_JTFH01001662v1_decoy,length=1085>\n##contig=<ID=Un_JTFH01001663v1_decoy,length=1083>\n##contig=<ID=Un_JTFH01001664v1_decoy,length=1080>\n##contig=<ID=Un_JTFH01001665v1_decoy,length=1080>\n##contig=<ID=Un_JTFH01001666v1_decoy,length=1079>\n##contig=<ID=Un_JTFH01001667v1_decoy,length=1079>\n##contig=<ID=Un_JTFH01001668v1_decoy,length=1079>\n##contig=<ID=Un_JTFH01001669v1_decoy,length=1075>\n##contig=<ID=Un_JTFH01001670v1_decoy,length=1074>\n##contig=<ID=Un_JTFH01001671v1_decoy,length=1073>\n##contig=<ID=Un_JTFH01001672v1_decoy,length=1070>\n##contig=<ID=Un_JTFH01001673v1_decoy,length=1068>\n##contig=<ID=Un_JTFH01001674v1_decoy,length=1067>\n##contig=<ID=Un_JTFH01001675v1_decoy,length=1066>\n##contig=<ID=Un_JTFH01001676v1_decoy,length=1066>\n##contig=<ID=Un_JTFH01001677v1_decoy,length=1066>\n##contig=<ID=Un_JTFH01001678v1_decoy,length=1063>\n##contig=<ID=Un_JTFH01001679v1_decoy,length=1063>\n##contig=<ID=Un_JTFH01001680v1_decoy,length=1063>\n##contig=<ID=Un_JTFH01001681v1_decoy,length=1062>\n##contig=<ID=Un_JTFH01001682v1_decoy,length=1058>\n##contig=<ID=Un_JTFH01001683v1_decoy,length=1056>\n##contig=<ID=Un_JTFH01001684v1_decoy,length=1052>\n##contig=<ID=Un_JTFH01001685v1_decoy,length=1051>\n##contig=<ID=Un_JTFH01001686v1_decoy,length=1051>\n##contig=<ID=Un_JTFH01001687v1_decoy,length=1050>\n##contig=<ID=Un_JTFH01001688v1_decoy,length=1048>\n##contig=<ID=Un_JTFH01001689v1_decoy,length=1046>\n##contig=<ID=Un_JTFH01001690v1_decoy,length=1046>\n##contig=<ID=Un_JTFH01001691v1_decoy,length=1045>\n##contig=<ID=Un_JTFH01001692v1_decoy,length=1043>\n##contig=<ID=Un_JTFH01001693v1_decoy,length=1038>\n##contig=<ID=Un_JTFH01001694v1_decoy,length=1036>\n##contig=<ID=Un_JTFH01001695v1_decoy,length=1035>\n##contig=<ID=Un_JTFH01001696v1_decoy,length=1035>\n##contig=<ID=Un_JTFH01001697v1_decoy,length=1035>\n##contig=<ID=Un_JTFH01001698v1_decoy,length=1033>\n##contig=<ID=Un_JTFH01001699v1_decoy,length=1032>\n##contig=<ID=Un_JTFH01001700v1_decoy,length=1031>\n##contig=<ID=Un_JTFH01001701v1_decoy,length=1026>\n##contig=<ID=Un_JTFH01001702v1_decoy,length=1026>\n##contig=<ID=Un_JTFH01001703v1_decoy,length=1026>\n##contig=<ID=Un_JTFH01001704v1_decoy,length=1023>\n##contig=<ID=Un_JTFH01001705v1_decoy,length=1022>\n##contig=<ID=Un_JTFH01001706v1_decoy,length=1020>\n##contig=<ID=Un_JTFH01001707v1_decoy,length=1020>\n##contig=<ID=Un_JTFH01001708v1_decoy,length=1020>\n##contig=<ID=Un_JTFH01001709v1_decoy,length=1019>\n##contig=<ID=Un_JTFH01001710v1_decoy,length=1018>\n##contig=<ID=Un_JTFH01001711v1_decoy,length=1018>\n##contig=<ID=Un_JTFH01001712v1_decoy,length=1017>\n##contig=<ID=Un_JTFH01001713v1_decoy,length=1015>\n##contig=<ID=Un_JTFH01001714v1_decoy,length=1015>\n##contig=<ID=Un_JTFH01001715v1_decoy,length=1015>\n##contig=<ID=Un_JTFH01001716v1_decoy,length=1014>\n##contig=<ID=Un_JTFH01001717v1_decoy,length=1014>\n##contig=<ID=Un_JTFH01001718v1_decoy,length=1013>\n##contig=<ID=Un_JTFH01001719v1_decoy,length=1013>\n##contig=<ID=Un_JTFH01001720v1_decoy,length=1013>\n##contig=<ID=Un_JTFH01001721v1_decoy,length=1012>\n##contig=<ID=Un_JTFH01001722v1_decoy,length=1011>\n##contig=<ID=Un_JTFH01001723v1_decoy,length=1011>\n##contig=<ID=Un_JTFH01001724v1_decoy,length=1009>\n##contig=<ID=Un_JTFH01001725v1_decoy,length=1008>\n##contig=<ID=Un_JTFH01001726v1_decoy,length=1008>\n##contig=<ID=Un_JTFH01001727v1_decoy,length=1007>\n##contig=<ID=Un_JTFH01001728v1_decoy,length=1007>\n##contig=<ID=Un_JTFH01001729v1_decoy,length=1007>\n##contig=<ID=Un_JTFH01001730v1_decoy,length=1006>\n##contig=<ID=Un_JTFH01001731v1_decoy,length=1005>\n##contig=<ID=Un_JTFH01001732v1_decoy,length=1003>\n##contig=<ID=Un_JTFH01001733v1_decoy,length=1001>\n##contig=<ID=Un_JTFH01001734v1_decoy,length=1000>\n##contig=<ID=Un_JTFH01001735v1_decoy,length=19311>\n##contig=<ID=Un_JTFH01001736v1_decoy,length=11713>\n##contig=<ID=Un_JTFH01001737v1_decoy,length=11263>\n##contig=<ID=Un_JTFH01001738v1_decoy,length=9779>\n##contig=<ID=Un_JTFH01001739v1_decoy,length=9568>\n##contig=<ID=Un_JTFH01001740v1_decoy,length=9344>\n##contig=<ID=Un_JTFH01001741v1_decoy,length=9188>\n##contig=<ID=Un_JTFH01001742v1_decoy,length=9100>\n##contig=<ID=Un_JTFH01001743v1_decoy,length=8771>\n##contig=<ID=Un_JTFH01001744v1_decoy,length=8690>\n##contig=<ID=Un_JTFH01001745v1_decoy,length=8566>\n##contig=<ID=Un_JTFH01001746v1_decoy,length=8058>\n##contig=<ID=Un_JTFH01001747v1_decoy,length=7759>\n##contig=<ID=Un_JTFH01001748v1_decoy,length=7585>\n##contig=<ID=Un_JTFH01001749v1_decoy,length=7471>\n##contig=<ID=Un_JTFH01001750v1_decoy,length=7461>\n##contig=<ID=Un_JTFH01001751v1_decoy,length=7342>\n##contig=<ID=Un_JTFH01001752v1_decoy,length=7223>\n##contig=<ID=Un_JTFH01001753v1_decoy,length=7064>\n##contig=<ID=Un_JTFH01001754v1_decoy,length=6916>\n##contig=<ID=Un_JTFH01001755v1_decoy,length=6897>\n##contig=<ID=Un_JTFH01001756v1_decoy,length=6880>\n##contig=<ID=Un_JTFH01001757v1_decoy,length=6857>\n##contig=<ID=Un_JTFH01001758v1_decoy,length=6840>\n##contig=<ID=Un_JTFH01001759v1_decoy,length=6728>\n##contig=<ID=Un_JTFH01001760v1_decoy,length=6688>\n##contig=<ID=Un_JTFH01001761v1_decoy,length=6553>\n##contig=<ID=Un_JTFH01001762v1_decoy,length=6396>\n##contig=<ID=Un_JTFH01001763v1_decoy,length=6345>\n##contig=<ID=Un_JTFH01001764v1_decoy,length=6295>\n##contig=<ID=Un_JTFH01001765v1_decoy,length=6266>\n##contig=<ID=Un_JTFH01001766v1_decoy,length=6173>\n##contig=<ID=Un_JTFH01001767v1_decoy,length=6171>\n##contig=<ID=Un_JTFH01001768v1_decoy,length=6120>\n##contig=<ID=Un_JTFH01001769v1_decoy,length=6105>\n##contig=<ID=Un_JTFH01001770v1_decoy,length=6099>\n##contig=<ID=Un_JTFH01001771v1_decoy,length=5893>\n##contig=<ID=Un_JTFH01001772v1_decoy,length=5829>\n##contig=<ID=Un_JTFH01001773v1_decoy,length=5793>\n##contig=<ID=Un_JTFH01001774v1_decoy,length=5776>\n##contig=<ID=Un_JTFH01001775v1_decoy,length=5759>\n##contig=<ID=Un_JTFH01001776v1_decoy,length=5716>\n##contig=<ID=Un_JTFH01001777v1_decoy,length=5708>\n##contig=<ID=Un_JTFH01001778v1_decoy,length=5590>\n##contig=<ID=Un_JTFH01001779v1_decoy,length=5566>\n##contig=<ID=Un_JTFH01001780v1_decoy,length=5558>\n##contig=<ID=Un_JTFH01001781v1_decoy,length=5418>\n##contig=<ID=Un_JTFH01001782v1_decoy,length=5375>\n##contig=<ID=Un_JTFH01001783v1_decoy,length=5300>\n##contig=<ID=Un_JTFH01001784v1_decoy,length=5255>\n##contig=<ID=Un_JTFH01001785v1_decoy,length=5157>\n##contig=<ID=Un_JTFH01001786v1_decoy,length=5130>\n##contig=<ID=Un_JTFH01001787v1_decoy,length=4978>\n##contig=<ID=Un_JTFH01001788v1_decoy,length=4957>\n##contig=<ID=Un_JTFH01001789v1_decoy,length=4947>\n##contig=<ID=Un_JTFH01001790v1_decoy,length=4897>\n##contig=<ID=Un_JTFH01001791v1_decoy,length=4867>\n##contig=<ID=Un_JTFH01001792v1_decoy,length=4845>\n##contig=<ID=Un_JTFH01001793v1_decoy,length=4678>\n##contig=<ID=Un_JTFH01001794v1_decoy,length=4641>\n##contig=<ID=Un_JTFH01001795v1_decoy,length=4592>\n##contig=<ID=Un_JTFH01001796v1_decoy,length=4543>\n##contig=<ID=Un_JTFH01001797v1_decoy,length=4532>\n##contig=<ID=Un_JTFH01001798v1_decoy,length=4503>\n##contig=<ID=Un_JTFH01001799v1_decoy,length=4495>\n##contig=<ID=Un_JTFH01001800v1_decoy,length=4444>\n##contig=<ID=Un_JTFH01001801v1_decoy,length=4414>\n##contig=<ID=Un_JTFH01001802v1_decoy,length=4409>\n##contig=<ID=Un_JTFH01001803v1_decoy,length=4302>\n##contig=<ID=Un_JTFH01001804v1_decoy,length=4300>\n##contig=<ID=Un_JTFH01001805v1_decoy,length=4277>\n##contig=<ID=Un_JTFH01001806v1_decoy,length=4173>\n##contig=<ID=Un_JTFH01001807v1_decoy,length=4169>\n##contig=<ID=Un_JTFH01001808v1_decoy,length=4136>\n##contig=<ID=Un_JTFH01001809v1_decoy,length=4101>\n##contig=<ID=Un_JTFH01001810v1_decoy,length=4089>\n##contig=<ID=Un_JTFH01001811v1_decoy,length=4015>\n##contig=<ID=Un_JTFH01001812v1_decoy,length=4000>\n##contig=<ID=Un_JTFH01001813v1_decoy,length=3973>\n##contig=<ID=Un_JTFH01001814v1_decoy,length=3732>\n##contig=<ID=Un_JTFH01001815v1_decoy,length=3709>\n##contig=<ID=Un_JTFH01001816v1_decoy,length=3686>\n##contig=<ID=Un_JTFH01001817v1_decoy,length=3676>\n##contig=<ID=Un_JTFH01001818v1_decoy,length=3673>\n##contig=<ID=Un_JTFH01001819v1_decoy,length=3672>\n##contig=<ID=Un_JTFH01001820v1_decoy,length=3633>\n##contig=<ID=Un_JTFH01001821v1_decoy,length=3633>\n##contig=<ID=Un_JTFH01001822v1_decoy,length=3613>\n##contig=<ID=Un_JTFH01001823v1_decoy,length=3605>\n##contig=<ID=Un_JTFH01001824v1_decoy,length=3592>\n##contig=<ID=Un_JTFH01001825v1_decoy,length=3586>\n##contig=<ID=Un_JTFH01001826v1_decoy,length=3584>\n##contig=<ID=Un_JTFH01001827v1_decoy,length=3577>\n##contig=<ID=Un_JTFH01001828v1_decoy,length=3537>\n##contig=<ID=Un_JTFH01001829v1_decoy,length=3510>\n##contig=<ID=Un_JTFH01001830v1_decoy,length=3509>\n##contig=<ID=Un_JTFH01001831v1_decoy,length=3488>\n##contig=<ID=Un_JTFH01001832v1_decoy,length=3473>\n##contig=<ID=Un_JTFH01001833v1_decoy,length=3445>\n##contig=<ID=Un_JTFH01001834v1_decoy,length=3427>\n##contig=<ID=Un_JTFH01001835v1_decoy,length=3395>\n##contig=<ID=Un_JTFH01001836v1_decoy,length=3367>\n##contig=<ID=Un_JTFH01001837v1_decoy,length=3337>\n##contig=<ID=Un_JTFH01001838v1_decoy,length=3324>\n##contig=<ID=Un_JTFH01001839v1_decoy,length=3315>\n##contig=<ID=Un_JTFH01001840v1_decoy,length=3313>\n##contig=<ID=Un_JTFH01001841v1_decoy,length=3283>\n##contig=<ID=Un_JTFH01001842v1_decoy,length=3250>\n##contig=<ID=Un_JTFH01001843v1_decoy,length=3247>\n##contig=<ID=Un_JTFH01001844v1_decoy,length=3237>\n##contig=<ID=Un_JTFH01001845v1_decoy,length=3235>\n##contig=<ID=Un_JTFH01001846v1_decoy,length=3200>\n##contig=<ID=Un_JTFH01001847v1_decoy,length=3195>\n##contig=<ID=Un_JTFH01001848v1_decoy,length=3175>\n##contig=<ID=Un_JTFH01001849v1_decoy,length=3158>\n##contig=<ID=Un_JTFH01001850v1_decoy,length=3143>\n##contig=<ID=Un_JTFH01001851v1_decoy,length=3139>\n##contig=<ID=Un_JTFH01001852v1_decoy,length=3138>\n##contig=<ID=Un_JTFH01001853v1_decoy,length=3136>\n##contig=<ID=Un_JTFH01001854v1_decoy,length=3132>\n##contig=<ID=Un_JTFH01001855v1_decoy,length=3132>\n##contig=<ID=Un_JTFH01001856v1_decoy,length=3095>\n##contig=<ID=Un_JTFH01001857v1_decoy,length=3094>\n##contig=<ID=Un_JTFH01001858v1_decoy,length=3093>\n##contig=<ID=Un_JTFH01001859v1_decoy,length=3059>\n##contig=<ID=Un_JTFH01001860v1_decoy,length=2985>\n##contig=<ID=Un_JTFH01001861v1_decoy,length=2975>\n##contig=<ID=Un_JTFH01001862v1_decoy,length=2967>\n##contig=<ID=Un_JTFH01001863v1_decoy,length=2961>\n##contig=<ID=Un_JTFH01001864v1_decoy,length=2955>\n##contig=<ID=Un_JTFH01001865v1_decoy,length=2935>\n##contig=<ID=Un_JTFH01001866v1_decoy,length=2933>\n##contig=<ID=Un_JTFH01001867v1_decoy,length=2909>\n##contig=<ID=Un_JTFH01001868v1_decoy,length=2904>\n##contig=<ID=Un_JTFH01001869v1_decoy,length=2892>\n##contig=<ID=Un_JTFH01001870v1_decoy,length=2886>\n##contig=<ID=Un_JTFH01001871v1_decoy,length=2885>\n##contig=<ID=Un_JTFH01001872v1_decoy,length=2878>\n##contig=<ID=Un_JTFH01001873v1_decoy,length=2875>\n##contig=<ID=Un_JTFH01001874v1_decoy,length=2861>\n##contig=<ID=Un_JTFH01001875v1_decoy,length=2856>\n##contig=<ID=Un_JTFH01001876v1_decoy,length=2838>\n##contig=<ID=Un_JTFH01001877v1_decoy,length=2801>\n##contig=<ID=Un_JTFH01001878v1_decoy,length=2797>\n##contig=<ID=Un_JTFH01001879v1_decoy,length=2788>\n##contig=<ID=Un_JTFH01001880v1_decoy,length=2773>\n##contig=<ID=Un_JTFH01001881v1_decoy,length=2755>\n##contig=<ID=Un_JTFH01001882v1_decoy,length=2754>\n##contig=<ID=Un_JTFH01001883v1_decoy,length=2743>\n##contig=<ID=Un_JTFH01001884v1_decoy,length=2725>\n##contig=<ID=Un_JTFH01001885v1_decoy,length=2722>\n##contig=<ID=Un_JTFH01001886v1_decoy,length=2682>\n##contig=<ID=Un_JTFH01001887v1_decoy,length=2669>\n##contig=<ID=Un_JTFH01001888v1_decoy,length=2663>\n##contig=<ID=Un_JTFH01001889v1_decoy,length=2652>\n##contig=<ID=Un_JTFH01001890v1_decoy,length=2647>\n##contig=<ID=Un_JTFH01001891v1_decoy,length=2635>\n##contig=<ID=Un_JTFH01001892v1_decoy,length=2633>\n##contig=<ID=Un_JTFH01001893v1_decoy,length=2629>\n##contig=<ID=Un_JTFH01001894v1_decoy,length=2612>\n##contig=<ID=Un_JTFH01001895v1_decoy,length=2599>\n##contig=<ID=Un_JTFH01001896v1_decoy,length=2566>\n##contig=<ID=Un_JTFH01001897v1_decoy,length=2556>\n##contig=<ID=Un_JTFH01001898v1_decoy,length=2551>\n##contig=<ID=Un_JTFH01001899v1_decoy,length=2551>\n##contig=<ID=Un_JTFH01001900v1_decoy,length=2538>\n##contig=<ID=Un_JTFH01001901v1_decoy,length=2538>\n##contig=<ID=Un_JTFH01001902v1_decoy,length=2525>\n##contig=<ID=Un_JTFH01001903v1_decoy,length=2498>\n##contig=<ID=Un_JTFH01001904v1_decoy,length=2496>\n##contig=<ID=Un_JTFH01001905v1_decoy,length=2483>\n##contig=<ID=Un_JTFH01001906v1_decoy,length=2475>\n##contig=<ID=Un_JTFH01001907v1_decoy,length=2469>\n##contig=<ID=Un_JTFH01001908v1_decoy,length=2455>\n##contig=<ID=Un_JTFH01001909v1_decoy,length=2444>\n##contig=<ID=Un_JTFH01001910v1_decoy,length=2437>\n##contig=<ID=Un_JTFH01001911v1_decoy,length=2435>\n##contig=<ID=Un_JTFH01001912v1_decoy,length=2427>\n##contig=<ID=Un_JTFH01001913v1_decoy,length=2419>\n##contig=<ID=Un_JTFH01001914v1_decoy,length=2413>\n##contig=<ID=Un_JTFH01001915v1_decoy,length=2412>\n##contig=<ID=Un_JTFH01001916v1_decoy,length=2400>\n##contig=<ID=Un_JTFH01001917v1_decoy,length=2399>\n##contig=<ID=Un_JTFH01001918v1_decoy,length=2396>\n##contig=<ID=Un_JTFH01001919v1_decoy,length=2393>\n##contig=<ID=Un_JTFH01001920v1_decoy,length=2386>\n##contig=<ID=Un_JTFH01001921v1_decoy,length=2384>\n##contig=<ID=Un_JTFH01001922v1_decoy,length=2382>\n##contig=<ID=Un_JTFH01001923v1_decoy,length=2382>\n##contig=<ID=Un_JTFH01001924v1_decoy,length=2367>\n##contig=<ID=Un_JTFH01001925v1_decoy,length=2366>\n##contig=<ID=Un_JTFH01001926v1_decoy,length=2362>\n##contig=<ID=Un_JTFH01001927v1_decoy,length=2361>\n##contig=<ID=Un_JTFH01001928v1_decoy,length=2353>\n##contig=<ID=Un_JTFH01001929v1_decoy,length=2349>\n##contig=<ID=Un_JTFH01001930v1_decoy,length=2348>\n##contig=<ID=Un_JTFH01001931v1_decoy,length=2340>\n##contig=<ID=Un_JTFH01001932v1_decoy,length=2339>\n##contig=<ID=Un_JTFH01001933v1_decoy,length=2336>\n##contig=<ID=Un_JTFH01001934v1_decoy,length=2333>\n##contig=<ID=Un_JTFH01001935v1_decoy,length=2330>\n##contig=<ID=Un_JTFH01001936v1_decoy,length=2327>\n##contig=<ID=Un_JTFH01001937v1_decoy,length=2318>\n##contig=<ID=Un_JTFH01001938v1_decoy,length=2293>\n##contig=<ID=Un_JTFH01001939v1_decoy,length=2292>\n##contig=<ID=Un_JTFH01001940v1_decoy,length=2287>\n##contig=<ID=Un_JTFH01001941v1_decoy,length=2274>\n##contig=<ID=Un_JTFH01001942v1_decoy,length=2274>\n##contig=<ID=Un_JTFH01001943v1_decoy,length=2267>\n##contig=<ID=Un_JTFH01001944v1_decoy,length=2260>\n##contig=<ID=Un_JTFH01001945v1_decoy,length=2257>\n##contig=<ID=Un_JTFH01001946v1_decoy,length=2240>\n##contig=<ID=Un_JTFH01001947v1_decoy,length=2239>\n##contig=<ID=Un_JTFH01001948v1_decoy,length=2232>\n##contig=<ID=Un_JTFH01001949v1_decoy,length=2230>\n##contig=<ID=Un_JTFH01001950v1_decoy,length=2230>\n##contig=<ID=Un_JTFH01001951v1_decoy,length=2222>\n##contig=<ID=Un_JTFH01001952v1_decoy,length=2216>\n##contig=<ID=Un_JTFH01001953v1_decoy,length=2214>\n##contig=<ID=Un_JTFH01001954v1_decoy,length=2210>\n##contig=<ID=Un_JTFH01001955v1_decoy,length=2203>\n##contig=<ID=Un_JTFH01001956v1_decoy,length=2197>\n##contig=<ID=Un_JTFH01001957v1_decoy,length=2196>\n##contig=<ID=Un_JTFH01001958v1_decoy,length=2196>\n##contig=<ID=Un_JTFH01001959v1_decoy,length=2179>\n##contig=<ID=Un_JTFH01001960v1_decoy,length=2178>\n##contig=<ID=Un_JTFH01001961v1_decoy,length=2178>\n##contig=<ID=Un_JTFH01001962v1_decoy,length=2172>\n##contig=<ID=Un_JTFH01001963v1_decoy,length=2170>\n##contig=<ID=Un_JTFH01001964v1_decoy,length=2167>\n##contig=<ID=Un_JTFH01001965v1_decoy,length=2167>\n##contig=<ID=Un_JTFH01001966v1_decoy,length=2157>\n##contig=<ID=Un_JTFH01001967v1_decoy,length=2153>\n##contig=<ID=Un_JTFH01001968v1_decoy,length=2151>\n##contig=<ID=Un_JTFH01001969v1_decoy,length=2147>\n##contig=<ID=Un_JTFH01001970v1_decoy,length=2145>\n##contig=<ID=Un_JTFH01001971v1_decoy,length=2142>\n##contig=<ID=Un_JTFH01001972v1_decoy,length=2142>\n##contig=<ID=Un_JTFH01001973v1_decoy,length=2136>\n##contig=<ID=Un_JTFH01001974v1_decoy,length=2130>\n##contig=<ID=Un_JTFH01001975v1_decoy,length=2128>\n##contig=<ID=Un_JTFH01001976v1_decoy,length=2126>\n##contig=<ID=Un_JTFH01001977v1_decoy,length=2126>\n##contig=<ID=Un_JTFH01001978v1_decoy,length=2119>\n##contig=<ID=Un_JTFH01001979v1_decoy,length=2107>\n##contig=<ID=Un_JTFH01001980v1_decoy,length=2091>\n##contig=<ID=Un_JTFH01001981v1_decoy,length=2087>\n##contig=<ID=Un_JTFH01001982v1_decoy,length=2086>\n##contig=<ID=Un_JTFH01001983v1_decoy,length=2083>\n##contig=<ID=Un_JTFH01001984v1_decoy,length=2075>\n##contig=<ID=Un_JTFH01001985v1_decoy,length=2075>\n##contig=<ID=Un_JTFH01001986v1_decoy,length=2072>\n##contig=<ID=Un_JTFH01001987v1_decoy,length=2068>\n##contig=<ID=Un_JTFH01001988v1_decoy,length=2067>\n##contig=<ID=Un_JTFH01001989v1_decoy,length=2055>\n##contig=<ID=Un_JTFH01001990v1_decoy,length=2051>\n##contig=<ID=Un_JTFH01001991v1_decoy,length=2050>\n##contig=<ID=Un_JTFH01001992v1_decoy,length=2033>\n##contig=<ID=Un_JTFH01001993v1_decoy,length=2024>\n##contig=<ID=Un_JTFH01001994v1_decoy,length=2016>\n##contig=<ID=Un_JTFH01001995v1_decoy,length=2011>\n##contig=<ID=Un_JTFH01001996v1_decoy,length=2009>\n##contig=<ID=Un_JTFH01001997v1_decoy,length=2003>\n##contig=<ID=Un_JTFH01001998v1_decoy,length=2001>\n##bcftools_concatVersion=1.9+htslib-1.9\n##bcftools_concatCommand=concat -a -o calls/H021-ZNSUYN.vcf calls/H021-ZNSUYN.freebayes.1.bcf calls/H021-ZNSUYN.freebayes.2.bcf calls/H021-ZNSUYN.freebayes.3.bcf calls/H021-ZNSUYN.freebayes.4.bcf calls/H021-ZNSUYN.freebayes.5.bcf calls/H021-ZNSUYN.freebayes.6.bcf calls/H021-ZNSUYN.freebayes.7.bcf calls/H021-ZNSUYN.freebayes.8.bcf calls/H021-ZNSUYN.freebayes.9.bcf calls/H021-ZNSUYN.freebayes.10.bcf calls/H021-ZNSUYN.freebayes.11.bcf calls/H021-ZNSUYN.freebayes.12.bcf calls/H021-ZNSUYN.freebayes.13.bcf calls/H021-ZNSUYN.freebayes.14.bcf calls/H021-ZNSUYN.freebayes.15.bcf calls/H021-ZNSUYN.freebayes.16.bcf calls/H021-ZNSUYN.freebayes.17.bcf calls/H021-ZNSUYN.freebayes.18.bcf calls/H021-ZNSUYN.freebayes.19.bcf calls/H021-ZNSUYN.freebayes.20.bcf calls/H021-ZNSUYN.freebayes.21.bcf calls/H021-ZNSUYN.freebayes.22.bcf calls/H021-ZNSUYN.freebayes.X.bcf calls/H021-ZNSUYN.freebayes.Y.bcf calls/H021-ZNSUYN.freebayes.M.bcf calls/H021-ZNSUYN.delly.1.bcf calls/H021-ZNSUYN.delly.2.bcf calls/H021-ZNSUYN.delly.3.bcf calls/H021-ZNSUYN.delly.4.bcf calls/H021-ZNSUYN.delly.5.bcf calls/H021-ZNSUYN.delly.6.bcf calls/H021-ZNSUYN.delly.7.bcf calls/H021-ZNSUYN.delly.8.bcf calls/H021-ZNSUYN.delly.9.bcf calls/H021-ZNSUYN.delly.10.bcf calls/H021-ZNSUYN.delly.11.bcf calls/H021-ZNSUYN.delly.12.bcf calls/H021-ZNSUYN.delly.13.bcf calls/H021-ZNSUYN.delly.14.bcf calls/H021-ZNSUYN.delly.15.bcf calls/H021-ZNSUYN.delly.16.bcf calls/H021-ZNSUYN.delly.17.bcf calls/H021-ZNSUYN.delly.18.bcf calls/H021-ZNSUYN.delly.19.bcf calls/H021-ZNSUYN.delly.20.bcf calls/H021-ZNSUYN.delly.21.bcf calls/H021-ZNSUYN.delly.22.bcf calls/H021-ZNSUYN.delly.X.bcf calls/H021-ZNSUYN.delly.Y.bcf calls/H021-ZNSUYN.delly.M.bcf; Date=Wed Sep 18 09:11:53 2019\n##SnpEffVersion=\"4.3t (build 2017-11-24 10:18), by Pablo Cingolani\"\n##SnpEffCmd=\"SnpEff  -stats snpeff/H021-ZNSUYN.html -csvStats snpeff/H021-ZNSUYN.csv GRCh38.86 calls/H021-ZNSUYN.vcf \"\n##INFO=<ID=ANN,Number=.,Type=String,Description=\"Functional annotations: 'Allele | Annotation | Annotation_Impact | Gene_Name | Gene_ID | Feature_Type | Feature_ID | Transcript_BioType | Rank | HGVS.c | HGVS.p | cDNA.pos / cDNA.length | CDS.pos / CDS.length | AA.pos / AA.length | Distance | ERRORS / WARNINGS / INFO'\">\n##INFO=<ID=LOF,Number=.,Type=String,Description=\"Predicted loss of function effects for this variant. Format: 'Gene_Name | Gene_ID | Number_of_transcripts_in_gene | Percent_of_transcripts_affected'\">\n##INFO=<ID=NMD,Number=.,Type=String,Description=\"Predicted nonsense mediated decay effects for this variant. Format: 'Gene_Name | Gene_ID | Number_of_transcripts_in_gene | Percent_of_transcripts_affected'\">\n##SnpSiftVersion=\"SnpSift 4.3t (build 2017-11-24 10:18), by Pablo Cingolani\"\n##SnpSiftCmd=\"SnpSift Filter 'ANN[*].IMPACT = 'MODERATE'' calls/H021-ZNSUYN.annotated.vcf\"\n##FILTER=<ID=SnpSift,Description=\"SnpSift 4.3t (build 2017-11-24 10:18), by Pablo Cingolani, Expression used: ANN[*].IMPACT = 'MODERATE'\">\n##bcftools_concatCommand=concat -a -o merged-calls/H021-ZNSUYN.somatic_medium_high.fdr-controlled.vcf calls/H021-ZNSUYN.SNV.somatic_medium_high.MODERATE.fdr-controlled.bcf calls/H021-ZNSUYN.SNV.somatic_medium_high.HIGH.fdr-controlled.bcf calls/H021-ZNSUYN.INS.somatic_medium_high.MODERATE.fdr-controlled.bcf calls/H021-ZNSUYN.INS.somatic_medium_high.HIGH.fdr-controlled.bcf calls/H021-ZNSUYN.DEL.somatic_medium_high.MODERATE.fdr-controlled.bcf calls/H021-ZNSUYN.DEL.somatic_medium_high.HIGH.fdr-controlled.bcf; Date=Wed Sep 18 09:18:23 2019\n##SnpSiftCmd=\"SnpSift Annotate -name cosmic_ /vol/tiny/ref/cosmic/CosmicCodingMuts_v90.vcf /dev/stdin\"\n##INFO=<ID=cosmic_GENOMIC_ID,Number=1,Type=String,Description=\"Genomic Mutation ID\">\n##INFO=<ID=cosmic_CDS,Number=1,Type=String,Description=\"CDS annotation\">\n##INFO=<ID=cosmic_AA,Number=1,Type=String,Description=\"Peptide annotation\">\n##INFO=<ID=cosmic_GENE,Number=1,Type=String,Description=\"Gene name\">\n##INFO=<ID=cosmic_CNT,Number=1,Type=Integer,Description=\"How many samples have this mutation\">\n##INFO=<ID=cosmic_SNP,Number=0,Type=Flag,Description=\"classified as SNP\">\n##INFO=<ID=cosmic_STRAND,Number=1,Type=String,Description=\"Gene strand\">\n##INFO=<ID=cosmic_LEGACY_ID,Number=1,Type=String,Description=\"Legacy Mutation ID\">\n##SnpSiftCmd=\"SnpSift DbNsfp -f MetaSVM_score,MetaLR_score,M-CAP_score,REVEL_score,MutPred_score,PrimateAI_score,DEOGEN2_score,LRT_score,Uniprot_entry,MutationAssessor_score,Uniprot_acc,Polyphen2_HDIV_score,Polyphen2_HVAR_score,Ensembl_proteinid,FATHMM_score,PROVEAN_score,SIFT_score,Ensembl_transcriptid,VEST4_score,SIFT4G_score,MVP_score,MPC_score,MutationTaster_score merged-calls/H021-ZNSUYN.somatic_medium_high.fdr-controlled.db-annotated.vcf\"\n##INFO=<ID=dbNSFP_PROVEAN_score,Number=.,Type=Float,Description=\"Field 'PROVEAN_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_VEST4_score,Number=.,Type=Float,Description=\"Field 'VEST4_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_DEOGEN2_score,Number=.,Type=Float,Description=\"Field 'DEOGEN2_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_Polyphen2_HVAR_score,Number=.,Type=Float,Description=\"Field 'Polyphen2_HVAR_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_SIFT_score,Number=.,Type=Float,Description=\"Field 'SIFT_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_Ensembl_transcriptid,Number=.,Type=String,Description=\"Field 'Ensembl_transcriptid' from dbNSFP\">\n##INFO=<ID=dbNSFP_MPC_score,Number=.,Type=Float,Description=\"Field 'MPC_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_MetaLR_score,Number=.,Type=Float,Description=\"Field 'MetaLR_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_REVEL_score,Number=.,Type=Float,Description=\"Field 'REVEL_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_MutationAssessor_score,Number=.,Type=Float,Description=\"Field 'MutationAssessor_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_Uniprot_acc,Number=.,Type=String,Description=\"Field 'Uniprot_acc' from dbNSFP\">\n##INFO=<ID=dbNSFP_Polyphen2_HDIV_score,Number=.,Type=Float,Description=\"Field 'Polyphen2_HDIV_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_MutPred_score,Number=.,Type=Float,Description=\"Field 'MutPred_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_MetaSVM_score,Number=.,Type=Float,Description=\"Field 'MetaSVM_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_PrimateAI_score,Number=.,Type=Float,Description=\"Field 'PrimateAI_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_Ensembl_proteinid,Number=.,Type=String,Description=\"Field 'Ensembl_proteinid' from dbNSFP\">\n##INFO=<ID=dbNSFP_FATHMM_score,Number=.,Type=Float,Description=\"Field 'FATHMM_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_MVP_score,Number=.,Type=Float,Description=\"Field 'MVP_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_MutationTaster_score,Number=.,Type=Float,Description=\"Field 'MutationTaster_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_Uniprot_entry,Number=.,Type=String,Description=\"Field 'Uniprot_entry' from dbNSFP\">\n##INFO=<ID=dbNSFP_SIFT4G_score,Number=.,Type=Float,Description=\"Field 'SIFT4G_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_LRT_score,Number=.,Type=Float,Description=\"Field 'LRT_score' from dbNSFP\">\n##INFO=<ID=dbNSFP_M_CAP_score,Number=.,Type=Float,Description=\"Field 'M-CAP_score' from dbNSFP\">\n#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tnormal\ttumor\n1\t6086227\t.\tG\tT\t.\t.\tSVLEN=.;PROB_SOMATIC_NORMAL=9.96017;PROB_GERMLINE_HET=24.5078;PROB_ARTIFACT=32.4886;PROB_SOMATIC_TUMOR_MEDIUM=8.60169;PROB_SOMATIC_TUMOR_LOW=21.1583;PROB_GERMLINE_HOM=385.486;PROB_ABSENT=67.1313;PROB_SOMATIC_TUMOR_HIGH=1.25327;ANN=T|missense_variant|MODERATE|KCNAB2|ENSG00000069424|transcript|ENST00000472700.6|protein_coding|8/8|c.399G>T|p.Gln133His|401/536|399/486|133/161||WARNING_TRANSCRIPT_NO_START_CODON,T|3_prime_UTR_variant|MODIFIER|KCNAB2|ENSG00000069424|transcript|ENST00000462676.2|protein_coding|3/3|c.*178G>T|||||178|WARNING_TRANSCRIPT_NO_START_CODON,T|downstream_gene_variant|MODIFIER|KCNAB2|ENSG00000069424|transcript|ENST00000435937.5|retained_intron||n.*978G>T|||||978|,T|intron_variant|MODIFIER|KCNAB2|ENSG00000069424|transcript|ENST00000378097.5|protein_coding|7/15|c.326+979G>T||||||,T|intron_variant|MODIFIER|KCNAB2|ENSG00000069424|transcript|ENST00000341524.5|protein_coding|7/15|c.326+979G>T||||||,T|intron_variant|MODIFIER|KCNAB2|ENSG00000069424|transcript|ENST00000352527.5|protein_coding|6/14|c.284+979G>T||||||,T|intron_variant|MODIFIER|KCNAB2|ENSG00000069424|transcript|ENST00000378083.7|protein_coding|6/15|c.425+979G>T||||||,T|intron_variant|MODIFIER|KCNAB2|ENSG00000069424|transcript|ENST00000428161.5|protein_coding|6/11|c.284+979G>T||||||WARNING_TRANSCRIPT_INCOMPLETE,T|intron_variant|MODIFIER|KCNAB2|ENSG00000069424|transcript|ENST00000602612.5|protein_coding|7/14|c.326+979G>T||||||,T|intron_variant|MODIFIER|KCNAB2|ENSG00000069424|transcript|ENST00000164247.5|protein_coding|7/15|c.326+979G>T||||||,T|intron_variant|MODIFIER|KCNAB2|ENSG00000069424|transcript|ENST00000458166.6|protein_coding|5/13|c.125+979G>T||||||,T|intron_variant|MODIFIER|KCNAB2|ENSG00000069424|transcript|ENST00000378111.5|protein_coding|7/7|c.326+979G>T||||||,T|intron_variant|MODIFIER|KCNAB2|ENSG00000069424|transcript|ENST00000378092.5|protein_coding|6/14|c.284+979G>T||||||,T|intron_variant|MODIFIER|KCNAB2|ENSG00000069424|transcript|ENST00000389632.8|protein_coding|7/12|c.326+979G>T||||||WARNING_TRANSCRIPT_INCOMPLETE\tDP:AF:OBS:SB\t8:0:5N+3N-:.\t4:0.5:1N+1V+1N-1V-:.\n"
  },
  {
    "path": "test/test_cram.fa",
    "content": ">chr1\nGGGCACAGCCTCACCCAGGAAAGCAGCTGGGGGTCCACTGGGCTCAGGGAAGACCCCCTG\nCCAGGGAGACCCCAGGCGCCTGAATGGCCACGGGAAGGAAAACCTACCAGCCCCTCCGTG\n>chr2\nAAGAAATAACTGCTAATTTAAAATTGAAGACTTCTGCTCTGCAAAAGACATTGTTAAGAT\nAATGAAAAGACAAGCCAAAGACTTGTAGAAAGTATTTGAAAAATAATCTCTGATAAATGG\n>chr3\nCCAACAAGCATTGGTGTGGCATTTCAGTGGAGAAGGAAACTTGGGGGGAAAAAGCCCATC\nAAGGTTGTAAGAAGACTCCCAATTTAACTGTCCCTTTCCCTATTTATCCACCATCCAAGA\n"
  },
  {
    "path": "test/test_cram.fa.fai",
    "content": "chr1\t120\t6\t60\t61\nchr2\t120\t134\t60\t61\nchr3\t120\t262\t60\t61\n"
  },
  {
    "path": "test/test_cram.sam",
    "content": "@HD\tVN:1.5\tSO:coordinate\n@SQ\tSN:chr1\tLN:120\tM5:20a9a0fb770814e6c5e49946750f9724\tUR:/stornext/snfs5/next-gen/scratch/farek/pkg/github/forks/rust-htslib/test/test_cram.fa\n@SQ\tSN:chr2\tLN:120\tM5:7a2006ccca94ea92b6dae5997e1b0d70\tUR:/stornext/snfs5/next-gen/scratch/farek/pkg/github/forks/rust-htslib/test/test_cram.fa\n@SQ\tSN:chr3\tLN:120\tM5:a66b336bfe3ee8801c744c9545c87e24\tUR:/stornext/snfs5/next-gen/scratch/farek/pkg/github/forks/rust-htslib/test/test_cram.fa\nchr1.1\t163\tchr1\t5\t0\t20M\t=\t35\t50\tACAGCCTCACCCAGGAAAGC\tFFFFFFFFFFFFFFFFFFF:\tMD:Z:20\tNM:i:0\nchr1.2\t83\tchr1\t35\t0\t20M\t=\t5\t-50\tCCACTGGGCTCAGGGAAGAC\tFFFFFFFFFFFFFFFFFF::\tMD:Z:20\tNM:i:0\nchr2.1\t99\tchr2\t15\t0\t20M\t=\t45\t50\tAATTTAAAATTGAAGACTTC\tFFFFFFFFFFFFFFFFFFF:\tMD:Z:20\tNM:i:0\nchr2.2\t147\tchr2\t45\t0\t15M1D5M\t=\t15\t-50\tAAGACATTGTTAAGAAATGA\tFFFFFFFFFFFFFFFFFF::\tMD:Z:15^T5\tNM:i:1\nchr3.1\t163\tchr3\t25\t0\t20M\t=\t55\t50\tCAGTGGAGAAGGAAACTTGG\tFFFFFFFFFFFFFFFFFFF:\tMD:Z:20\tNM:i:0\nchr3.2\t83\tchr3\t55\t0\t15M1I4M\t=\t25\t-50\tCCCATCAAGGTTGTATAGAA\tFFFFFFFFFFFFFFFFFF::\tMD:Z:19\tNM:i:1\n"
  },
  {
    "path": "test/test_headers.out.vcf",
    "content": "##fileformat=VCFv4.1\n##FILTER=<ID=PASS,Description=\"All filters passed\">\n##FILTER=<ID=FILTER1,Description=\"should stay\">\n##INFO=<ID=INFO1,Number=1,Type=String,Description=\"should stay\">\n##FORMAT=<ID=FORMAT1,Number=1,Type=String,Description=\"should stay\">\n##contig=<ID=contig1,length=59128983>\n##SOME=<ID=Foo1,Bar=Baz>\n##Bar1=something\n#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tone\ttwo\n"
  },
  {
    "path": "test/test_headers.vcf",
    "content": "##fileformat=VCFv4.1\n##FILTER=<ID=PASS,Description=\"All filters passed\">\n##FILTER=<ID=FILTER1,Description=\"should stay\">\n##FILTER=<ID=FILTER2,Description=\"should go\">\n##INFO=<ID=INFO1,Number=1,Type=String,Description=\"should stay\">\n##INFO=<ID=INFO2,Number=1,Type=Integer,Description=\"should go\">\n##FORMAT=<ID=FORMAT1,Number=1,Type=String,Description=\"should stay\">\n##contig=<ID=contig1,length=59128983>\n##contig=<ID=contig2,length=59128983>\n##SOME=<ID=Foo1,Bar=Baz>\n##SOME=<ID=Foo2,Bar=Baz>\n##Bar1=something\n##Bar2=something else\n#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tone\ttwo\n"
  },
  {
    "path": "test/test_left.vcf",
    "content": "##fileformat=VCFv4.1\n##FORMAT=<ID=GT,Number=1,Type=String,Description=\"Genotype\">\n#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tone\ttwo\n1\t100\t.\tC\tA\t.\t.\t.\tGT\t0/1\t.\n1\t101\t.\tT\tG\t.\t.\t.\tGT\t0/1\t.\n"
  },
  {
    "path": "test/test_missing.vcf",
    "content": "##fileformat=VCFv4.1\n##INFO=<ID=S1,Number=1,Type=String,Description=\"Single INFO string\">\n##INFO=<ID=N1,Number=1,Type=Integer,Description=\"Single INFO integer\">\n##INFO=<ID=F1,Number=1,Type=Float,Description=\"Single INFO float\">\n##FORMAT=<ID=GT,Number=1,Type=String,Description=\"Genotype\">\n##FORMAT=<ID=FS1,Number=1,Type=String,Description=\"Single FORMAT string\">\n##FORMAT=<ID=FN4,Number=4,Type=Integer,Description=\"Multiple FORMAT integer\">\n##FORMAT=<ID=FF4,Number=4,Type=Float,Description=\"Multiple FORMAT integer\">\n#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tone\ttwo\n19\t3114951\trs1234\tA\tAG\t.\tPASS\tS1=string1;N1=1;F1=1.0\tGT:FS1:FN4:FF4\t1/1:fourall:1,2,3,4:0.0,0.0,0.0,0.0\t1/1:fourmissall:.,.,.,.:.,.,.,.\n19\t3114952\trs1234\tA\tAG\t.\tPASS\tS1=string1;N1=1;F1=.\tGT:FS1:FN4:FF4\t1/1:fourall:1,2,3,4:0.0,0.0,0.0,0.0\t1/1:fourmiss:.:.\n"
  },
  {
    "path": "test/test_non_diploid.vcf",
    "content": "##fileformat=VCFv4.1\n##FORMAT=<ID=GT,Number=1,Type=String,Description=\"Genotype\">\n##contig=<ID=1,length=1000>\n#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tone\ttwo\n1\t100\t.\tC\tA\t.\t.\t.\tGT\t0\t1\n1\t101\t.\tT\tG\t.\t.\t.\tGT\t0/1\t1/1\n1\t102\t.\tA\tG\t.\t.\t.\tGT\t1|0\t1/1|0\n"
  },
  {
    "path": "test/test_nonstandard_orientation.sam",
    "content": "@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\tSN:13\tLN:114364328\n@SQ\tSN:14\tLN:107043718\n@SQ\tSN:15\tLN:101991189\n@SQ\tSN:16\tLN:90338345\n@SQ\tSN:17\tLN:83257441\n@SQ\tSN:18\tLN:80373285\n@SQ\tSN:19\tLN:58617616\n@SQ\tSN:2\tLN:242193529\n@SQ\tSN:20\tLN:64444167\n@SQ\tSN:21\tLN:46709983\n@SQ\tSN:22\tLN:50818468\n@SQ\tSN:3\tLN:198295559\n@SQ\tSN:4\tLN:190214555\n@SQ\tSN:5\tLN:181538259\n@SQ\tSN:6\tLN:170805979\n@SQ\tSN:7\tLN:159345973\n@SQ\tSN:8\tLN:145138636\n@SQ\tSN:9\tLN:138394717\n@SQ\tSN:MT\tLN:16569\n@SQ\tSN:X\tLN:156040895\n@SQ\tSN:Y\tLN:57227415\n@SQ\tSN:KI270728.1\tLN:1872759\n@SQ\tSN:KI270727.1\tLN:448248\n@SQ\tSN:KI270442.1\tLN:392061\n@SQ\tSN:KI270729.1\tLN:280839\n@SQ\tSN:GL000225.1\tLN:211173\n@SQ\tSN:KI270743.1\tLN:210658\n@SQ\tSN:GL000008.2\tLN:209709\n@SQ\tSN:GL000009.2\tLN:201709\n@SQ\tSN:KI270747.1\tLN:198735\n@SQ\tSN:KI270722.1\tLN:194050\n@SQ\tSN:GL000194.1\tLN:191469\n@SQ\tSN:KI270742.1\tLN:186739\n@SQ\tSN:GL000205.2\tLN:185591\n@SQ\tSN:GL000195.1\tLN:182896\n@SQ\tSN:KI270736.1\tLN:181920\n@SQ\tSN:KI270733.1\tLN:179772\n@SQ\tSN:GL000224.1\tLN:179693\n@SQ\tSN:GL000219.1\tLN:179198\n@SQ\tSN:KI270719.1\tLN:176845\n@SQ\tSN:GL000216.2\tLN:176608\n@SQ\tSN:KI270712.1\tLN:176043\n@SQ\tSN:KI270706.1\tLN:175055\n@SQ\tSN:KI270725.1\tLN:172810\n@SQ\tSN:KI270744.1\tLN:168472\n@SQ\tSN:KI270734.1\tLN:165050\n@SQ\tSN:GL000213.1\tLN:164239\n@SQ\tSN:GL000220.1\tLN:161802\n@SQ\tSN:KI270715.1\tLN:161471\n@SQ\tSN:GL000218.1\tLN:161147\n@SQ\tSN:KI270749.1\tLN:158759\n@SQ\tSN:KI270741.1\tLN:157432\n@SQ\tSN:GL000221.1\tLN:155397\n@SQ\tSN:KI270716.1\tLN:153799\n@SQ\tSN:KI270731.1\tLN:150754\n@SQ\tSN:KI270751.1\tLN:150742\n@SQ\tSN:KI270750.1\tLN:148850\n@SQ\tSN:KI270519.1\tLN:138126\n@SQ\tSN:GL000214.1\tLN:137718\n@SQ\tSN:KI270708.1\tLN:127682\n@SQ\tSN:KI270730.1\tLN:112551\n@SQ\tSN:KI270438.1\tLN:112505\n@SQ\tSN:KI270737.1\tLN:103838\n@SQ\tSN:KI270721.1\tLN:100316\n@SQ\tSN:KI270738.1\tLN:99375\n@SQ\tSN:KI270748.1\tLN:93321\n@SQ\tSN:KI270435.1\tLN:92983\n@SQ\tSN:GL000208.1\tLN:92689\n@SQ\tSN:KI270538.1\tLN:91309\n@SQ\tSN:KI270756.1\tLN:79590\n@SQ\tSN:KI270739.1\tLN:73985\n@SQ\tSN:KI270757.1\tLN:71251\n@SQ\tSN:KI270709.1\tLN:66860\n@SQ\tSN:KI270746.1\tLN:66486\n@SQ\tSN:KI270753.1\tLN:62944\n@SQ\tSN:KI270589.1\tLN:44474\n@SQ\tSN:KI270726.1\tLN:43739\n@SQ\tSN:KI270735.1\tLN:42811\n@SQ\tSN:KI270711.1\tLN:42210\n@SQ\tSN:KI270745.1\tLN:41891\n@SQ\tSN:KI270714.1\tLN:41717\n@SQ\tSN:KI270732.1\tLN:41543\n@SQ\tSN:KI270713.1\tLN:40745\n@SQ\tSN:KI270754.1\tLN:40191\n@SQ\tSN:KI270710.1\tLN:40176\n@SQ\tSN:KI270717.1\tLN:40062\n@SQ\tSN:KI270724.1\tLN:39555\n@SQ\tSN:KI270720.1\tLN:39050\n@SQ\tSN:KI270723.1\tLN:38115\n@SQ\tSN:KI270718.1\tLN:38054\n@SQ\tSN:KI270317.1\tLN:37690\n@SQ\tSN:KI270740.1\tLN:37240\n@SQ\tSN:KI270755.1\tLN:36723\n@SQ\tSN:KI270707.1\tLN:32032\n@SQ\tSN:KI270579.1\tLN:31033\n@SQ\tSN:KI270752.1\tLN:27745\n@SQ\tSN:KI270512.1\tLN:22689\n@SQ\tSN:KI270322.1\tLN:21476\n@SQ\tSN:GL000226.1\tLN:15008\n@SQ\tSN:KI270311.1\tLN:12399\n@SQ\tSN:KI270366.1\tLN:8320\n@SQ\tSN:KI270511.1\tLN:8127\n@SQ\tSN:KI270448.1\tLN:7992\n@SQ\tSN:KI270521.1\tLN:7642\n@SQ\tSN:KI270581.1\tLN:7046\n@SQ\tSN:KI270582.1\tLN:6504\n@SQ\tSN:KI270515.1\tLN:6361\n@SQ\tSN:KI270588.1\tLN:6158\n@SQ\tSN:KI270591.1\tLN:5796\n@SQ\tSN:KI270522.1\tLN:5674\n@SQ\tSN:KI270507.1\tLN:5353\n@SQ\tSN:KI270590.1\tLN:4685\n@SQ\tSN:KI270584.1\tLN:4513\n@SQ\tSN:KI270320.1\tLN:4416\n@SQ\tSN:KI270382.1\tLN:4215\n@SQ\tSN:KI270468.1\tLN:4055\n@SQ\tSN:KI270467.1\tLN:3920\n@SQ\tSN:KI270362.1\tLN:3530\n@SQ\tSN:KI270517.1\tLN:3253\n@SQ\tSN:KI270593.1\tLN:3041\n@SQ\tSN:KI270528.1\tLN:2983\n@SQ\tSN:KI270587.1\tLN:2969\n@SQ\tSN:KI270364.1\tLN:2855\n@SQ\tSN:KI270371.1\tLN:2805\n@SQ\tSN:KI270333.1\tLN:2699\n@SQ\tSN:KI270374.1\tLN:2656\n@SQ\tSN:KI270411.1\tLN:2646\n@SQ\tSN:KI270414.1\tLN:2489\n@SQ\tSN:KI270510.1\tLN:2415\n@SQ\tSN:KI270390.1\tLN:2387\n@SQ\tSN:KI270375.1\tLN:2378\n@SQ\tSN:KI270420.1\tLN:2321\n@SQ\tSN:KI270509.1\tLN:2318\n@SQ\tSN:KI270315.1\tLN:2276\n@SQ\tSN:KI270302.1\tLN:2274\n@SQ\tSN:KI270518.1\tLN:2186\n@SQ\tSN:KI270530.1\tLN:2168\n@SQ\tSN:KI270304.1\tLN:2165\n@SQ\tSN:KI270418.1\tLN:2145\n@SQ\tSN:KI270424.1\tLN:2140\n@SQ\tSN:KI270417.1\tLN:2043\n@SQ\tSN:KI270508.1\tLN:1951\n@SQ\tSN:KI270303.1\tLN:1942\n@SQ\tSN:KI270381.1\tLN:1930\n@SQ\tSN:KI270529.1\tLN:1899\n@SQ\tSN:KI270425.1\tLN:1884\n@SQ\tSN:KI270396.1\tLN:1880\n@SQ\tSN:KI270363.1\tLN:1803\n@SQ\tSN:KI270386.1\tLN:1788\n@SQ\tSN:KI270465.1\tLN:1774\n@SQ\tSN:KI270383.1\tLN:1750\n@SQ\tSN:KI270384.1\tLN:1658\n@SQ\tSN:KI270330.1\tLN:1652\n@SQ\tSN:KI270372.1\tLN:1650\n@SQ\tSN:KI270548.1\tLN:1599\n@SQ\tSN:KI270580.1\tLN:1553\n@SQ\tSN:KI270387.1\tLN:1537\n@SQ\tSN:KI270391.1\tLN:1484\n@SQ\tSN:KI270305.1\tLN:1472\n@SQ\tSN:KI270373.1\tLN:1451\n@SQ\tSN:KI270422.1\tLN:1445\n@SQ\tSN:KI270316.1\tLN:1444\n@SQ\tSN:KI270340.1\tLN:1428\n@SQ\tSN:KI270338.1\tLN:1428\n@SQ\tSN:KI270583.1\tLN:1400\n@SQ\tSN:KI270334.1\tLN:1368\n@SQ\tSN:KI270429.1\tLN:1361\n@SQ\tSN:KI270393.1\tLN:1308\n@SQ\tSN:KI270516.1\tLN:1300\n@SQ\tSN:KI270389.1\tLN:1298\n@SQ\tSN:KI270466.1\tLN:1233\n@SQ\tSN:KI270388.1\tLN:1216\n@SQ\tSN:KI270544.1\tLN:1202\n@SQ\tSN:KI270310.1\tLN:1201\n@SQ\tSN:KI270412.1\tLN:1179\n@SQ\tSN:KI270395.1\tLN:1143\n@SQ\tSN:KI270376.1\tLN:1136\n@SQ\tSN:KI270337.1\tLN:1121\n@SQ\tSN:KI270335.1\tLN:1048\n@SQ\tSN:KI270378.1\tLN:1048\n@SQ\tSN:KI270379.1\tLN:1045\n@SQ\tSN:KI270329.1\tLN:1040\n@SQ\tSN:KI270419.1\tLN:1029\n@SQ\tSN:KI270336.1\tLN:1026\n@SQ\tSN:KI270312.1\tLN:998\n@SQ\tSN:KI270539.1\tLN:993\n@SQ\tSN:KI270385.1\tLN:990\n@SQ\tSN:KI270423.1\tLN:981\n@SQ\tSN:KI270392.1\tLN:971\n@SQ\tSN:KI270394.1\tLN:970\n@RG\tID:chm\tSM:chm\tPL:ILLUMINA\n@PG\tID:bwa\tPN:bwa\tVN:0.7.17-r1188\tCL:bwa mem -t 8 -R @RG\\tID:chm\\tSM:chm\\tPL:ILLUMINA resources/genome.fasta results/merged/chm_R1.fastq.gz results/merged/chm_R2.fastq.gz\n@PG\tID:GATK ApplyBQSR\tVN:4.1.4.1\tCL:ApplyBQSR  --output results/recal/chm.sorted.bam --bqsr-recal-file /tmp/tmpuhppums6/recal_table.grp --input results/mapped/chm.sorted.bam --reference resources/genome.fasta  --preserve-qscores-less-than 6 --use-original-qualities false --quantize-quals 0 --round-down-quantized false --emit-original-quals false --global-qscore-prior -1.0 --interval-set-rule UNION --interval-padding 0 --interval-exclusion-padding 0 --interval-merging-rule ALL --read-validation-stringency SILENT --seconds-between-progress-updates 10.0 --disable-sequence-dictionary-validation false --create-output-bam-index true --create-output-bam-md5 false --create-output-variant-index true --create-output-variant-md5 false --lenient false --add-output-sam-program-record true --add-output-vcf-command-line true --cloud-prefetch-buffer 40 --cloud-index-prefetch-buffer -1 --disable-bam-index-caching false --sites-only-vcf-output false --help false --version false --showHidden false --verbosity INFO --QUIET false --use-jdk-deflater false --use-jdk-inflater false --gcs-max-retries 20 --gcs-project-for-requester-pays  --disable-tool-default-read-filters false\tPN:GATK ApplyBQSR\n@PG\tID:samtools\tPN:samtools\tPP:GATK ApplyBQSR\tVN:1.20\tCL:samtools view -H chm.bam\n@PG\tID:samtools.1\tPN:samtools\tPP:samtools\tVN:1.20\tCL:samtools view -b nonstandard_orientation.sam\n@PG\tID:samtools.2\tPN:samtools\tPP:samtools.1\tVN:1.20\tCL:samtools view -h test_nonstandard_orientation.bam\nHK35WCCXX160124:1:2117:25885:46859\t163\t1\t231\t46\t113M38S\t=\t351\t271\tCAACCTCAGTTGACTTGGGGGACAAGGCAGCAGGAGCACCAGACCCCTGCACCACCTCCTTCTGGGTGGGAGATGAGGCAGCAGGAGCACCAGGGCCCTTCACGACCTCTTTCCAGGTGGGGGGGGAGGGAGCAGGGGCAGGAGAGCGCGT\t=BB?BCBCABD@C@?D@AAABD@CB?B@C@ACABCAAC@BDAC@BCCCBBD@CD@CDCCCEC;BCCCBCCE?CCCBCDCECCECDDCCEA(.<BAADDBFCEA%C=DECEEFB</=C@#################################\tXA:Z:1,+26345079,15S108M28S,3;1,+26344930,19S102M30S,2;\tMC:Z:151M\tMD:Z:90A0G11A9\tRG:Z:chm\tNM:i:3\tAS:i:98\tXS:i:93\nHK35WCCXX160124:1:2117:25885:46859\t83\t1\t351\t49\t151M\t=\t231\t-271\tGGGATGAGGTAGCAGCGGCACCAGGGCCCTTCACAACCTCTTTTGAGGTGGGGGACGAGGCAGCAGGAGCACCAGACCCCTGCACCACCTCCTTCTGGGTGGGAGATGAGGCAGCAGGAGCACCAGGGCCCTTCACGACCTCTTTCCAGGT\t##########################DA4ADCDCFDDCE;/BB.(10@DCB<CCC/1DCBBCBBDCCDBBCCB>:BBCBBDAABBABBACCADCBCBB?CBBA1BABAAA@@B@AABBAAACB?9BBABA@DDAC2BBBBCBCDBCCFA=?\tXA:Z:1,-26345048,17S134M,8;\tMC:Z:113M38S\tMD:Z:1C7C5G0A28G5T4A46G32A14\tRG:Z:chm\tNM:i:9\tAS:i:109\tXS:i:94\n"
  },
  {
    "path": "test/test_orientation_supplementary.sam",
    "content": "@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:114142980\n@SQ\tSN:chr14\tLN:106368585\n@SQ\tSN:chr15\tLN:100338915\n@SQ\tSN:chr16\tLN:88827254\n@SQ\tSN:chr17\tLN:78774742\n@SQ\tSN:chr18\tLN:76117153\n@SQ\tSN:chr19\tLN:63811651\n@SQ\tSN:chr1\tLN:247249719\n@SQ\tSN:chr20\tLN:62435964\n@SQ\tSN:chr21\tLN:46944323\n@SQ\tSN:chr22\tLN:49691432\n@SQ\tSN:chr2\tLN:242951149\n@SQ\tSN:chr3\tLN:199501827\n@SQ\tSN:chr4\tLN:191273063\n@SQ\tSN:chr5\tLN:180857866\n@SQ\tSN:chr6\tLN:170899992\n@SQ\tSN:chr7\tLN:158821424\n@SQ\tSN:chr8\tLN:146274826\n@SQ\tSN:chr9\tLN:140273252\n@SQ\tSN:chrM\tLN:16571\n@SQ\tSN:chrX\tLN:154913754\n@SQ\tSN:chrY\tLN:57772954\n@RG\tID:tumor\tSM:tumor\n@PG\tID:bwa\tPN:bwa\tVN:0.7.16a-r1187-dirty\tCL:resources/bwa mem -t 8 -Y -R @RG\\tID:tumor\\tSM:tumor index/hg18/genome reads/simulated.tumor.1.fastq reads/simulated.tumor.2.fastq\n@PG\tID:samtools\tPN:samtools\tPP:bwa\tVN:1.20\tCL:samtools sort -n -o tests/resources/testcases/test16/tumor.bam.namesorted.bam tests/resources/testcases/test16/tumor.bam\n@PG\tID:samtools.1\tPN:samtools\tPP:samtools\tVN:1.20\tCL:samtools fixmate tests/resources/testcases/test16/tumor.bam.namesorted.bam tests/resources/testcases/test16/tumor.bam.fixed.bam\n@PG\tID:samtools.2\tPN:samtools\tPP:samtools.1\tVN:1.20\tCL:samtools sort -o tests/resources/testcases/test16/tumor.bam tests/resources/testcases/test16/tumor.bam.fixed.bam\n@PG\tID:samtools.3\tPN:samtools\tPP:samtools.2\tVN:1.20\tCL:samtools view -H tumor.bam\nsim_Som2-5-1_chr1_1_1b5889\t163\tchr1\t938\t60\t100M\t=\t1143\t264\tCACTATACCACTTGAATGCTCAGAAGAAAAAAAAAAGAATTCAGAATATGTGTATTAAAATGGGTACAATAATGAGTAAAAAACTTGAAAGAAGCTGGAG\tGFGDECGFE?AA>FGADEEF)BDC>FDEC5EEBFEEB?D@BGDCAB:FBGGDE;DF-CBDDCD+>:ED@#?=?#>EADE,B#?A#FFC;CC@#:5DBA##\tNM:i:1\tMD:Z:69A30\tAS:i:95\tXS:i:23\tZT:Z:95,1,72,72,0,0,69,0,1,0,0,0,1379,0\tRG:Z:tumor\tMQ:i:60\tMC:Z:59M41S\nsim_Som2-5-1_chr1_1_1b5889\t83\tchr1\t1143\t60\t59M41S\t=\t938\t-264\tATCTTTCCTTTATCAACTATTGGTGTTAACCTTTGATTATATTTTTGCATAAGCATACAAAATATTGATCTTTAATTATACTAAGGAATCAATAGCCAAA\tF:##.##D#DFDA5D#*#:D?E7B?.>?GA>6?=CE:EEBEDAE=AF:5GF:G#ABGDGGAGEG=DAE?FF?GG7AGEG-BDEGDAGEDDEDF=>F5E*@\tNM:i:2\tMD:Z:2G13A42\tAS:i:51\tXS:i:20\tSA:Z:chr1,73497948,-,58S42M,60,1;\tZT:Z:51,2,31,11,0,0,42,0,3,0,0,0,419,0\tRG:Z:tumor\tMQ:i:60\tMC:Z:100M\nsim_Som2-5-1_chr1_1_1b5889\t2131\tchr1\t1263\t60\t58S42M\t=\t938\t-367\tATCTTTCCTTTATCAACTATTGGTGTTAACCTTTGATTATATTTTTGCATAAGCATACAAAATATTGATCTTTAATTATACTAAGGAATCAATAGCCAAA\tF:##.##D#DFDA5D#*#:D?E7B?.>?GA>6?=CE:EEBEDAE=AF:5GF:G#ABGDGGAGEG=DAE?FF?GG7AGEG-BDEGDAGEDDEDF=>F5E*@\tNM:i:1\tMD:Z:40C1\tMC:Z:100M\tAS:i:40\tXS:i:0\tSA:Z:chr1,73497828,-,59M41S,60,2;\tZT:Z:40,1,40,40,0,0,40,0,0,0,0,0,400,0\tRG:Z:tumor\n"
  },
  {
    "path": "test/test_paired.sam",
    "content": "@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\t1\t10M\t=\t11\t20\tAAAAAAAAAA\t**********\na1\t147\txx\t11\t1\t10M\t=\t1\t-20\tTTTTTTTTTT\t**********\nb1\t147\txx\t11\t1\t10M\t=\t1\t-20\tTTTTTTTTTT\t**********\nc1\t147\txx\t11\t1\t10M\t=\t1\t-20\tTTTTTTTTTT\t**********\n"
  },
  {
    "path": "test/test_right.vcf",
    "content": "##fileformat=VCFv4.1\n##FORMAT=<ID=GT,Number=1,Type=String,Description=\"Genotype\">\n#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tthree\tfour\n1\t100\t.\tC\tA\t.\t.\t.\tGT\t1/1\t.\n1\t102\t.\tC\tG\t.\t.\t.\tGT\t0/1\t.\n"
  },
  {
    "path": "test/test_string.vcf",
    "content": "##fileformat=VCFv4.1\n##INFO=<ID=S1,Number=1,Type=String,Description=\"Single INFO string\">\n##INFO=<ID=N1,Number=1,Type=Integer,Description=\"Single INFO integer\">\n##INFO=<ID=F1,Number=1,Type=Float,Description=\"Single INFO float\">\n##FORMAT=<ID=GT,Number=1,Type=String,Description=\"Genotype\">\n##FORMAT=<ID=FS1,Number=1,Type=String,Description=\"Single FORMAT string\">\n##FORMAT=<ID=FN1,Number=1,Type=Integer,Description=\"Single FORMAT integer\">\n##FORMAT=<ID=FF1,Number=1,Type=Float,Description=\"Single FORMAT float\">\n##contig=<ID=19,length=59128983>\n#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tone\ttwo\n19\t3111939\trs1234\tA\tAG\t.\tPASS\tS1=string1;N1=1;F1=1.0\tGT:FS1:FN1\t./1:LongString1:1\t1/1:ss1:2\n19\t3113255\trs2345\tG\tGC\t.\tPASS\tS1=string2;N1=2;F1=2.0\tGT:FS1:FN1\t1|1:LongString2:1\t1/1:ss2:2\n19\t3113259\trs2345\tG\tGC\t.\tPASS\tS1=string3;N1=3;F1=3.0\tGT:FS1:FN1\t0/1:.:1\t1/1:ss3:2\n19\t3113262\trs2345\tG\tGC\t.\tPASS\tS1=string4;N1=4;F1=4.0\tGT:FS1:FN1\t0|1:LongString4:1\t1/1:.:2\n19\t3113268\trs2345\tG\tGC\t.\tPASS\tS1=string5;N1=5;F1=5.0\tGT:FS1:FN1\t1|.:evenlength:1\t1/1:veenlength:2\n19\t3113272\trs2345\tG\tGC\t.\tPASS\tS1=string6;N1=6;F1=6.0\tGT:FS1:FN1\t1/1:ss6:1\t1/1:longstring6:2\n"
  },
  {
    "path": "test/test_svlen.vcf",
    "content": "##fileformat=VCFv4.1\n##FILTER=<ID=PASS,Description=\"All filters passed\">\n##fileDate=20181110\n##source=GenerateSVCandidates 1.3.0\n##reference=file:///vol/tiny/prosic/data/Homo_sapiens.GRCh38.dna.primary_assembly.fa\n##contig=<ID=1,length=248956422>\n##contig=<ID=10,length=133797422>\n##contig=<ID=11,length=135086622>\n##contig=<ID=12,length=133275309>\n##contig=<ID=13,length=114364328>\n##contig=<ID=14,length=107043718>\n##contig=<ID=15,length=101991189>\n##contig=<ID=16,length=90338345>\n##contig=<ID=17,length=83257441>\n##contig=<ID=18,length=80373285>\n##contig=<ID=19,length=58617616>\n##contig=<ID=2,length=242193529>\n##contig=<ID=20,length=64444167>\n##contig=<ID=21,length=46709983>\n##contig=<ID=22,length=50818468>\n##contig=<ID=3,length=198295559>\n##contig=<ID=4,length=190214555>\n##contig=<ID=5,length=181538259>\n##contig=<ID=6,length=170805979>\n##contig=<ID=7,length=159345973>\n##contig=<ID=8,length=145138636>\n##contig=<ID=9,length=138394717>\n##contig=<ID=MT,length=16569>\n##contig=<ID=X,length=156040895>\n##contig=<ID=Y,length=57227415>\n##contig=<ID=KI270728.1,length=1872759>\n##contig=<ID=KI270727.1,length=448248>\n##contig=<ID=KI270442.1,length=392061>\n##contig=<ID=KI270729.1,length=280839>\n##contig=<ID=GL000225.1,length=211173>\n##contig=<ID=KI270743.1,length=210658>\n##contig=<ID=GL000008.2,length=209709>\n##contig=<ID=GL000009.2,length=201709>\n##contig=<ID=KI270747.1,length=198735>\n##contig=<ID=KI270722.1,length=194050>\n##contig=<ID=GL000194.1,length=191469>\n##contig=<ID=KI270742.1,length=186739>\n##contig=<ID=GL000205.2,length=185591>\n##contig=<ID=GL000195.1,length=182896>\n##contig=<ID=KI270736.1,length=181920>\n##contig=<ID=KI270733.1,length=179772>\n##contig=<ID=GL000224.1,length=179693>\n##contig=<ID=GL000219.1,length=179198>\n##contig=<ID=KI270719.1,length=176845>\n##contig=<ID=GL000216.2,length=176608>\n##contig=<ID=KI270712.1,length=176043>\n##contig=<ID=KI270706.1,length=175055>\n##contig=<ID=KI270725.1,length=172810>\n##contig=<ID=KI270744.1,length=168472>\n##contig=<ID=KI270734.1,length=165050>\n##contig=<ID=GL000213.1,length=164239>\n##contig=<ID=GL000220.1,length=161802>\n##contig=<ID=KI270715.1,length=161471>\n##contig=<ID=GL000218.1,length=161147>\n##contig=<ID=KI270749.1,length=158759>\n##contig=<ID=KI270741.1,length=157432>\n##contig=<ID=GL000221.1,length=155397>\n##contig=<ID=KI270716.1,length=153799>\n##contig=<ID=KI270731.1,length=150754>\n##contig=<ID=KI270751.1,length=150742>\n##contig=<ID=KI270750.1,length=148850>\n##contig=<ID=KI270519.1,length=138126>\n##contig=<ID=GL000214.1,length=137718>\n##contig=<ID=KI270708.1,length=127682>\n##contig=<ID=KI270730.1,length=112551>\n##contig=<ID=KI270438.1,length=112505>\n##contig=<ID=KI270737.1,length=103838>\n##contig=<ID=KI270721.1,length=100316>\n##contig=<ID=KI270738.1,length=99375>\n##contig=<ID=KI270748.1,length=93321>\n##contig=<ID=KI270435.1,length=92983>\n##contig=<ID=GL000208.1,length=92689>\n##contig=<ID=KI270538.1,length=91309>\n##contig=<ID=KI270756.1,length=79590>\n##contig=<ID=KI270739.1,length=73985>\n##contig=<ID=KI270757.1,length=71251>\n##contig=<ID=KI270709.1,length=66860>\n##contig=<ID=KI270746.1,length=66486>\n##contig=<ID=KI270753.1,length=62944>\n##contig=<ID=KI270589.1,length=44474>\n##contig=<ID=KI270726.1,length=43739>\n##contig=<ID=KI270735.1,length=42811>\n##contig=<ID=KI270711.1,length=42210>\n##contig=<ID=KI270745.1,length=41891>\n##contig=<ID=KI270714.1,length=41717>\n##contig=<ID=KI270732.1,length=41543>\n##contig=<ID=KI270713.1,length=40745>\n##contig=<ID=KI270754.1,length=40191>\n##contig=<ID=KI270710.1,length=40176>\n##contig=<ID=KI270717.1,length=40062>\n##contig=<ID=KI270724.1,length=39555>\n##contig=<ID=KI270720.1,length=39050>\n##contig=<ID=KI270723.1,length=38115>\n##contig=<ID=KI270718.1,length=38054>\n##contig=<ID=KI270317.1,length=37690>\n##contig=<ID=KI270740.1,length=37240>\n##contig=<ID=KI270755.1,length=36723>\n##contig=<ID=KI270707.1,length=32032>\n##contig=<ID=KI270579.1,length=31033>\n##contig=<ID=KI270752.1,length=27745>\n##contig=<ID=KI270512.1,length=22689>\n##contig=<ID=KI270322.1,length=21476>\n##contig=<ID=GL000226.1,length=15008>\n##contig=<ID=KI270311.1,length=12399>\n##contig=<ID=KI270366.1,length=8320>\n##contig=<ID=KI270511.1,length=8127>\n##contig=<ID=KI270448.1,length=7992>\n##contig=<ID=KI270521.1,length=7642>\n##contig=<ID=KI270581.1,length=7046>\n##contig=<ID=KI270582.1,length=6504>\n##contig=<ID=KI270515.1,length=6361>\n##contig=<ID=KI270588.1,length=6158>\n##contig=<ID=KI270591.1,length=5796>\n##contig=<ID=KI270522.1,length=5674>\n##contig=<ID=KI270507.1,length=5353>\n##contig=<ID=KI270590.1,length=4685>\n##contig=<ID=KI270584.1,length=4513>\n##contig=<ID=KI270320.1,length=4416>\n##contig=<ID=KI270382.1,length=4215>\n##contig=<ID=KI270468.1,length=4055>\n##contig=<ID=KI270467.1,length=3920>\n##contig=<ID=KI270362.1,length=3530>\n##contig=<ID=KI270517.1,length=3253>\n##contig=<ID=KI270593.1,length=3041>\n##contig=<ID=KI270528.1,length=2983>\n##contig=<ID=KI270587.1,length=2969>\n##contig=<ID=KI270364.1,length=2855>\n##contig=<ID=KI270371.1,length=2805>\n##contig=<ID=KI270333.1,length=2699>\n##contig=<ID=KI270374.1,length=2656>\n##contig=<ID=KI270411.1,length=2646>\n##contig=<ID=KI270414.1,length=2489>\n##contig=<ID=KI270510.1,length=2415>\n##contig=<ID=KI270390.1,length=2387>\n##contig=<ID=KI270375.1,length=2378>\n##contig=<ID=KI270420.1,length=2321>\n##contig=<ID=KI270509.1,length=2318>\n##contig=<ID=KI270315.1,length=2276>\n##contig=<ID=KI270302.1,length=2274>\n##contig=<ID=KI270518.1,length=2186>\n##contig=<ID=KI270530.1,length=2168>\n##contig=<ID=KI270304.1,length=2165>\n##contig=<ID=KI270418.1,length=2145>\n##contig=<ID=KI270424.1,length=2140>\n##contig=<ID=KI270417.1,length=2043>\n##contig=<ID=KI270508.1,length=1951>\n##contig=<ID=KI270303.1,length=1942>\n##contig=<ID=KI270381.1,length=1930>\n##contig=<ID=KI270529.1,length=1899>\n##contig=<ID=KI270425.1,length=1884>\n##contig=<ID=KI270396.1,length=1880>\n##contig=<ID=KI270363.1,length=1803>\n##contig=<ID=KI270386.1,length=1788>\n##contig=<ID=KI270465.1,length=1774>\n##contig=<ID=KI270383.1,length=1750>\n##contig=<ID=KI270384.1,length=1658>\n##contig=<ID=KI270330.1,length=1652>\n##contig=<ID=KI270372.1,length=1650>\n##contig=<ID=KI270548.1,length=1599>\n##contig=<ID=KI270580.1,length=1553>\n##contig=<ID=KI270387.1,length=1537>\n##contig=<ID=KI270391.1,length=1484>\n##contig=<ID=KI270305.1,length=1472>\n##contig=<ID=KI270373.1,length=1451>\n##contig=<ID=KI270422.1,length=1445>\n##contig=<ID=KI270316.1,length=1444>\n##contig=<ID=KI270340.1,length=1428>\n##contig=<ID=KI270338.1,length=1428>\n##contig=<ID=KI270583.1,length=1400>\n##contig=<ID=KI270334.1,length=1368>\n##contig=<ID=KI270429.1,length=1361>\n##contig=<ID=KI270393.1,length=1308>\n##contig=<ID=KI270516.1,length=1300>\n##contig=<ID=KI270389.1,length=1298>\n##contig=<ID=KI270466.1,length=1233>\n##contig=<ID=KI270388.1,length=1216>\n##contig=<ID=KI270544.1,length=1202>\n##contig=<ID=KI270310.1,length=1201>\n##contig=<ID=KI270412.1,length=1179>\n##contig=<ID=KI270395.1,length=1143>\n##contig=<ID=KI270376.1,length=1136>\n##contig=<ID=KI270337.1,length=1121>\n##contig=<ID=KI270335.1,length=1048>\n##contig=<ID=KI270378.1,length=1048>\n##contig=<ID=KI270379.1,length=1045>\n##contig=<ID=KI270329.1,length=1040>\n##contig=<ID=KI270419.1,length=1029>\n##contig=<ID=KI270336.1,length=1026>\n##contig=<ID=KI270312.1,length=998>\n##contig=<ID=KI270539.1,length=993>\n##contig=<ID=KI270385.1,length=990>\n##contig=<ID=KI270423.1,length=981>\n##contig=<ID=KI270392.1,length=971>\n##contig=<ID=KI270394.1,length=970>\n##INFO=<ID=IMPRECISE,Number=0,Type=Flag,Description=\"Imprecise structural variation\">\n##INFO=<ID=SVTYPE,Number=1,Type=String,Description=\"Type of structural variant\">\n##INFO=<ID=SVLEN,Number=.,Type=Integer,Description=\"Difference in length between REF and ALT alleles\">\n##INFO=<ID=END,Number=1,Type=Integer,Description=\"End position of the variant described in this record\">\n##INFO=<ID=CIPOS,Number=2,Type=Integer,Description=\"Confidence interval around POS\">\n##INFO=<ID=CIEND,Number=2,Type=Integer,Description=\"Confidence interval around END\">\n##INFO=<ID=CIGAR,Number=A,Type=String,Description=\"CIGAR alignment for each alternate indel allele\">\n##INFO=<ID=MATEID,Number=.,Type=String,Description=\"ID of mate breakend\">\n##INFO=<ID=EVENT,Number=1,Type=String,Description=\"ID of event associated to breakend\">\n##INFO=<ID=HOMLEN,Number=.,Type=Integer,Description=\"Length of base pair identical homology at event breakpoints\">\n##INFO=<ID=HOMSEQ,Number=.,Type=String,Description=\"Sequence of base pair identical homology at event breakpoints\">\n##INFO=<ID=SVINSLEN,Number=.,Type=Integer,Description=\"Length of insertion\">\n##INFO=<ID=SVINSSEQ,Number=.,Type=String,Description=\"Sequence of insertion\">\n##INFO=<ID=LEFT_SVINSSEQ,Number=.,Type=String,Description=\"Known left side of insertion for an insertion of unknown length\">\n##INFO=<ID=RIGHT_SVINSSEQ,Number=.,Type=String,Description=\"Known right side of insertion for an insertion of unknown length\">\n##INFO=<ID=INV3,Number=0,Type=Flag,Description=\"Inversion breakends open 3' of reported location\">\n##INFO=<ID=INV5,Number=0,Type=Flag,Description=\"Inversion breakends open 5' of reported location\">\n##INFO=<ID=PAIR_COUNT,Number=1,Type=Integer,Description=\"Read pairs supporting this variant where both reads are confidently mapped\">\n##INFO=<ID=BND_PAIR_COUNT,Number=1,Type=Integer,Description=\"Confidently mapped reads supporting this variant at this breakend (mapping may not be confident at remote breakend)\">\n##INFO=<ID=UPSTREAM_PAIR_COUNT,Number=1,Type=Integer,Description=\"Confidently mapped reads supporting this variant at the upstream breakend (mapping may not be confident at downstream breakend)\">\n##INFO=<ID=DOWNSTREAM_PAIR_COUNT,Number=1,Type=Integer,Description=\"Confidently mapped reads supporting this variant at this downstream breakend (mapping may not be confident at upstream breakend)\">\n##ALT=<ID=BND,Description=\"Translocation Breakend\">\n##ALT=<ID=INV,Description=\"Inversion\">\n##ALT=<ID=DEL,Description=\"Deletion\">\n##ALT=<ID=INS,Description=\"Insertion\">\n##ALT=<ID=DUP:TANDEM,Description=\"Tandem Duplication\">\n##cmdline=/vol/tiny/prosic/prosic-evaluation/.snakemake/conda/b4da40e3/bin/configManta.py --tumorBam mapped-bwa/COLO_829-Ill.tumor.hg38.sorted.bam --normalBam mapped-bwa/COLO_829-Ill.normal.hg38.sorted.bam --referenceFasta ../data/Homo_sapiens.GRCh38.dna.primary_assembly.fa --runDir manta/COLO_829-Ill\n##bcftools_viewVersion=1.5+htslib-1.5\n##bcftools_viewCommand=view -Ob -o manta/COLO_829-Ill.all.bcf manta/COLO_829-Ill/results/variants/candidateSV.vcf.gz; Date=Sun Nov 11 02:13:49 2018\n##bcftools_viewVersion=1.9+htslib-1.9\n##bcftools_viewCommand=view -h manta/COLO_829-Ill.all.bcf; Date=Mon Mar  4 11:55:14 2019\n#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\n1\t231589485\tMantaDEL:0:55805:55805:0:0:0\tCAAACAAATCTAATTGGTCAAGGTATTCCTAAACGTTTTTGCATTCAGAGGCTCTTTCATCAATCATCTCCACCCCCCAACCCTGGCTTTACTGAAGTATGATTGACAAATAAAAATTGTACACATTT\tC\t.\t.\tEND=231589612;SVTYPE=DEL;SVLEN=-127;CIGAR=1M127D;UPSTREAM_PAIR_COUNT=0;DOWNSTREAM_PAIR_COUNT=0;PAIR_COUNT=0\n"
  },
  {
    "path": "test/test_trailing_omitted_format.vcf",
    "content": "##fileformat=VCFv4.3\n##contig=<ID=chr1,length=10000>\n##INFO=<ID=FOO,Number=1,Type=Integer,Description=\"Some field\">\n##FORMAT=<ID=GT,Number=1,Type=String,Description=\"Genotype\">\n##FORMAT=<ID=STR,Number=1,Type=String,Description=\"Some string field\">\n##FORMAT=<ID=INT,Number=1,Type=Integer,Description=\"Some integer field\">\n##FORMAT=<ID=FLT,Number=1,Type=Float,Description=\"Some float field\">\n#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tSAMPLE1\nchr1\t1234\t.\tt\ta\t.\t.\tFOO=1\tGT:STR:FLT:INT\t.\n"
  },
  {
    "path": "test/test_various.out.vcf",
    "content": "##fileformat=VCFv4.1\n##FILTER=<ID=PASS,Description=\"All filters passed\">\n##FILTER=<ID=q10,Description=\"Quality below 10\">\n##FILTER=<ID=s50,Description=\"Less than 50% of samples have data\">\n##INFO=<ID=S1,Number=1,Type=String,Description=\"Single INFO string\">\n##INFO=<ID=N1,Number=1,Type=Integer,Description=\"Single INFO integer\">\n##INFO=<ID=F1,Number=1,Type=Float,Description=\"Single INFO float\">\n##INFO=<ID=X1,Number=0,Type=Flag,Description=\"INFO FLAG\">\n##FORMAT=<ID=GT,Number=1,Type=String,Description=\"Genotype\">\n##FORMAT=<ID=FS1,Number=1,Type=String,Description=\"Single FORMAT string\">\n##FORMAT=<ID=FN1,Number=1,Type=Integer,Description=\"Single FORMAT integer\">\n##FORMAT=<ID=FF1,Number=1,Type=Float,Description=\"Single FORMAT float\">\n##FORMAT=<ID=CH1,Number=1,Type=Character,Description=\"Single FORMAT char\">\n##contig=<ID=19,length=59128983>\n#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tone\ttwo\n19\t13\tfirst_id;second_id\tC\tT,G\t10\ts50;q10\tN1=32;F1=33;S1=fourtytwo;X1\tGT:FS1:FF1:FN1:CH1\t0/1:yes:43:42:A\t1|1:no:11:10:B\n"
  },
  {
    "path": "test/test_various.vcf",
    "content": "##fileformat=VCFv4.1\n##FILTER=<ID=q10,Description=\"Quality below 10\">\n##FILTER=<ID=s50,Description=\"Less than 50% of samples have data\">\n##INFO=<ID=S1,Number=1,Type=String,Description=\"Single INFO string\">\n##INFO=<ID=N1,Number=1,Type=Integer,Description=\"Single INFO integer\">\n##INFO=<ID=F1,Number=1,Type=Float,Description=\"Single INFO float\">\n##INFO=<ID=X1,Number=0,Type=Flag,Description=\"INFO FLAG\">\n##FORMAT=<ID=GT,Number=1,Type=String,Description=\"Genotype\">\n##FORMAT=<ID=FS1,Number=1,Type=String,Description=\"Single FORMAT string\">\n##FORMAT=<ID=FN1,Number=1,Type=Integer,Description=\"Single FORMAT integer\">\n##FORMAT=<ID=FF1,Number=1,Type=Float,Description=\"Single FORMAT float\">\n##FORMAT=<ID=CH1,Number=1,Type=Character,Description=\"Single FORMAT char\">\n##contig=<ID=19,length=59128983>\n#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tone\ttwo\n"
  }
]