Are you using the latest version of samtools and HTSlib? If not, please specify.
(run samtools --version)
conda run -n ngs_samples samtools --version
samtools 1.20
Using htslib 1.20
Copyright (C) 2024 Genome Research Ltd.
Samtools compilation details:
Features: build=configure curses=yes
CC: /opt/conda/conda-bld/samtools_1713212794896/_build_env/bin/x86_64-conda-linux-gnu-cc
CPPFLAGS: -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/wesuser/miniconda3/envs/ngs_samples/include
CFLAGS: -Wall -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/wesuser/miniconda3/envs/ngs_samples/include -fdebug-prefix-map=/opt/conda/conda-bld/samtools_1713212794896/work=/usr/local/src/conda/samtools-1.20 -fdebug-prefix-map=/home/wesuser/miniconda3/envs/ngs_samples=/usr/local/src/conda-prefix
LDFLAGS: -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,--allow-shlib-undefined -Wl,-rpath,/home/wesuser/miniconda3/envs/ngs_samples/lib -Wl,-rpath-link,/home/wesuser/miniconda3/envs/ngs_samples/lib -L/home/wesuser/miniconda3/envs/ngs_samples/lib
HTSDIR:
LIBS:
CURSES_LIB: -ltinfow -lncursesw
HTSlib compilation details:
Features: build=configure libcurl=yes S3=yes GCS=yes libdeflate=yes lzma=yes bzip2=yes plugins=yes plugin-path=/home/wesuser/miniconda3/envs/ngs_samples/libexec/htslib htscodecs=1.6.0
CC: /opt/conda/conda-bld/htslib_1717532443764/_build_env/bin/x86_64-conda-linux-gnu-cc
CPPFLAGS: -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/wesuser/miniconda3/envs/ngs_samples/include
CFLAGS: -Wall -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/wesuser/miniconda3/envs/ngs_samples/include -fdebug-prefix-map=/opt/conda/conda-bld/htslib_1717532443764/work=/usr/local/src/conda/htslib-1.20 -fdebug-prefix-map=/home/wesuser/miniconda3/envs/ngs_samples=/usr/local/src/conda-prefix -fvisibility=hidden
LDFLAGS: -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,--allow-shlib-undefined -Wl,-rpath,/home/wesuser/miniconda3/envs/ngs_samples/lib -Wl,-rpath-link,/home/wesuser/miniconda3/envs/ngs_samples/lib -L/home/wesuser/miniconda3/envs/ngs_samples/lib -fvisibility=hidden -rdynamic
HTSlib URL scheme handlers present:
built-in: preload, data, file
libcurl: imaps, pop3, gophers, http, smb, gopher, sftp, ftps, imap, smtp, smtps, rtsp, scp, ftp, telnet, mqtt, https, smbs, tftp, pop3s, dict
Google Cloud Storage: gs+http, gs+https, gs
Amazon S3: s3+https, s3+http, s3
S3 Multipart Upload: s3w, s3w+https, s3w+http
crypt4gh-needed: crypt4gh
mem: mem
Please describe your environment.
- OS (Linux 4.15.0-142-generic : ubuntu)
- machine architecture (x86_64)
- compiler (5.4.0 20160609)
Please specify the steps taken to generate the issue, the command you are running and the relevant output.
Starting from an indexed BAM file generated by BWA/picard/GATK pipeline, we run :
samtools view -b -T $REF -L $BED -o $OUT -@4 $INDIR/$INFILE
The resulting BAM file is missing data for HALF of one of the specified regions (see figure_IGV.png). Top sample: $INFILE, bottom sample $OUT.

We noticed that the BED file was not sorted. However, release 1.19.2 mentioned that it fixed issue due to unsorted bed files. So this seems to be another issue.
Minimal reproducible files:
Archive.zip
Are you using the latest version of samtools and HTSlib? If not, please specify.
(run
samtools --version)conda run -n ngs_samples samtools --version
samtools 1.20
Using htslib 1.20
Copyright (C) 2024 Genome Research Ltd.
Samtools compilation details:
Features: build=configure curses=yes
CC: /opt/conda/conda-bld/samtools_1713212794896/_build_env/bin/x86_64-conda-linux-gnu-cc
CPPFLAGS: -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/wesuser/miniconda3/envs/ngs_samples/include
CFLAGS: -Wall -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/wesuser/miniconda3/envs/ngs_samples/include -fdebug-prefix-map=/opt/conda/conda-bld/samtools_1713212794896/work=/usr/local/src/conda/samtools-1.20 -fdebug-prefix-map=/home/wesuser/miniconda3/envs/ngs_samples=/usr/local/src/conda-prefix
LDFLAGS: -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,--allow-shlib-undefined -Wl,-rpath,/home/wesuser/miniconda3/envs/ngs_samples/lib -Wl,-rpath-link,/home/wesuser/miniconda3/envs/ngs_samples/lib -L/home/wesuser/miniconda3/envs/ngs_samples/lib
HTSDIR:
LIBS:
CURSES_LIB: -ltinfow -lncursesw
HTSlib compilation details:
Features: build=configure libcurl=yes S3=yes GCS=yes libdeflate=yes lzma=yes bzip2=yes plugins=yes plugin-path=/home/wesuser/miniconda3/envs/ngs_samples/libexec/htslib htscodecs=1.6.0
CC: /opt/conda/conda-bld/htslib_1717532443764/_build_env/bin/x86_64-conda-linux-gnu-cc
CPPFLAGS: -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/wesuser/miniconda3/envs/ngs_samples/include
CFLAGS: -Wall -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/wesuser/miniconda3/envs/ngs_samples/include -fdebug-prefix-map=/opt/conda/conda-bld/htslib_1717532443764/work=/usr/local/src/conda/htslib-1.20 -fdebug-prefix-map=/home/wesuser/miniconda3/envs/ngs_samples=/usr/local/src/conda-prefix -fvisibility=hidden
LDFLAGS: -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,--allow-shlib-undefined -Wl,-rpath,/home/wesuser/miniconda3/envs/ngs_samples/lib -Wl,-rpath-link,/home/wesuser/miniconda3/envs/ngs_samples/lib -L/home/wesuser/miniconda3/envs/ngs_samples/lib -fvisibility=hidden -rdynamic
HTSlib URL scheme handlers present:
built-in: preload, data, file
libcurl: imaps, pop3, gophers, http, smb, gopher, sftp, ftps, imap, smtp, smtps, rtsp, scp, ftp, telnet, mqtt, https, smbs, tftp, pop3s, dict
Google Cloud Storage: gs+http, gs+https, gs
Amazon S3: s3+https, s3+http, s3
S3 Multipart Upload: s3w, s3w+https, s3w+http
crypt4gh-needed: crypt4gh
mem: mem
Please describe your environment.
Please specify the steps taken to generate the issue, the command you are running and the relevant output.
Starting from an indexed BAM file generated by BWA/picard/GATK pipeline, we run :
samtools view -b -T $REF -L $BED -o $OUT -@4 $INDIR/$INFILEThe resulting BAM file is missing data for HALF of one of the specified regions (see figure_IGV.png). Top sample: $INFILE, bottom sample $OUT.
We noticed that the BED file was not sorted. However, release 1.19.2 mentioned that it fixed issue due to unsorted bed files. So this seems to be another issue.
Minimal reproducible files:
Archive.zip