GitHub

1.24

Download the source code here: samtools-1.24.tar.bz2.(The "Source code" downloads are generated by GitHub and are incomplete as they don't bundle HTSlib and are missing some generated files.)


New work and changes:

  • NEW. Contribution guidelines, Including sections on complexity, completeness, signing and our AI policy. (PR #2335)

  • CHANGE. The default seed for samtools view --subsample is now based on the input file header and not zero. This means that repeated subsampling of the same file will work as expected. The previous behaviour can be replicated by setting the seed to zero. (PR #2320, fixes #1201. Thanks to Tim Fennell. Reported by Stathis)

  • Add --move-umi-to-tag option to samtools markdup to extract UMI from QNAME and add to RX tag. (PR #2316, fixes #2181. Thanks to Matthias De Smet)

  • Ensure indirect function calls have the correct type. This uses the new HTSlib interface introduced in samtools/htslib#1994. (PR #2322)

  • Changes to make checksum merging compatible with biobambam2 checksums. (PR #2329, fixes #2323. Reported by Keith James)

  • Speed improvement for samtools stats. (PR #2326)

  • Changed --customized-index-file to --customized-index in samtools stats to match other subcommands. As this option had never worked (see #2315) this should not cause any compatibility problems. (PR #2334, fixes #2333. Thanks to Alexis Lucattini)

  • Fill in mate information on supplementary alignments in samtools fixmate. Takes mate information from the primary and adds it to the supplementary alignment. Does not affect secondary alignments. (PR #2347. Thanks to Nils Homer)

Bug fixes:

  • Various option fixes. Removed the mistaken required argument from --customized-index-file in stats. Also removed some unused and undocumented options from bam_plcmd.c. (PR #2317, fixes #2315. Reported by Alexis Lucattini)

  • For samtools stats check before and after region with --target-regions. Previously doing only one or the other. (PR #2328, fixes #2303. Reported by Yuan Tian)

Non user-visible changes and build improvements:

  • Add Github actions builds for Linux and Mac OS. This replaces the Cirrus CI tests that were discontinued. (PR #2330)

  • Ensure PACKAGE_VERSION is set in the Makefile. (PR #2342, fixes #2337. Reported by James Ferguson)

  • Make version.sh work when .git is present but the git executable is not. (PR #2345)

  • Adjust tail commands so they work on Solaris. (PR #2346)


Download the source code here: samtools-1.24.tar.bz2.(The "Source code" downloads are generated by GitHub and are incomplete as they don't bundle HTSlib and are missing some generated files.)

1.23.2

Download the source code here: samtools-1.23.2.tar.bz2.(The "Source code" downloads are generated by GitHub and are incomplete as they don't bundle HTSlib and are missing some generated files.)


This release bundles HTSlib 1.23.2, which includes many important bug fixes. There are no changes to SAMtools. Please see htslib/NEWS for details.

1.22.3

Download the source code here: samtools-1.22.3.tar.bz2.(The "Source code" downloads are generated by GitHub and are incomplete as they don't bundle HTSlib and are missing some generated files.)


This release bundles HTSlib 1.22.3, which includes many important bug fixes. There are no changes to SAMtools. Please see htslib/NEWS for details.

1.21.2

Download the source code here: samtools-1.21.2.tar.bz2.(The "Source code" downloads are generated by GitHub and are incomplete as they don't bundle HTSlib and are missing some generated files.)


This release bundles HTSlib 1.21.2, which includes many important bug fixes. There are no changes to SAMtools. Please see htslib/NEWS for details.

1.23.1

Download the source code here: samtools-1.23.1.tar.bz2.(The "Source code" downloads are generated by GitHub and are incomplete as they don't bundle HTSlib and are missing some generated files.)


Bug fixes:

  • This release bundles HTSlib 1.23.1, which includes many important bug fixes. Please see htslib/NEWS for details.

  • Fix incorrect variable expansion in seq_cache_populate.py (PR #2291. Thanks to Ruben Vorderman)

  • Don't try to write out empty strings in threaded consensus pileup mode. (PR #2305)

  • Wrap ctype.h functions to avoid array subscript warnings, and add casts to prevent sign extension where arrays are indexed with char values. (PR #2306)

  • Make samtools cram-size exit cleanly instead of crashing if it reads an invalid CRAM header. (CVE-2026-31973) (PR #2313)

Build changes:

  • Reordered options for grep commands in tests so the input file is at the end. (PR #2311)

  • Limit memory used by samtools sort in tests. (PR #2312)


Download the source code here: samtools-1.23.1.tar.bz2.(The "Source code" downloads are generated by GitHub and are incomplete as they don't bundle HTSlib and are missing some generated files.)

1.22.2

Download the source code here: samtools-1.22.2.tar.bz2.(The "Source code" downloads are generated by GitHub and are incomplete as they don't bundle HTSlib and are missing some generated files.)


Bug fixes:

  • This release bundles HTSlib 1.22.2, which includes many important bug fixes. Please see htslib/NEWS for details.

  • Prevent samtools coverage from printing a coverage table on failure. (PR #2247, fixes #2242. Reported by Georges Kanaan)

  • Remove deprecated line style commands from plot-bamstats. (PR #2251, fixes #2243. Reported by Suhas Srinivasan)

  • Check for file close errors in samtools addreplacerg. (PR #2254. Thanks to Martin Pollard)

  • Add missing sam_global_args_free calls to address memory leaks. (PR #2274)

  • Don't try to write out empty strings in threaded consensus pileup mode. (PR #2305)

  • Wrap ctype.h functions to avoid array subscript warnings, and add casts to prevent sign extension where arrays are indexed with char values. (PR #2306)

  • Make samtools cram-size exit cleanly instead of crashing if it reads an invalid CRAM header. (CVE-2026-31973) (PR #2313)

Build changes:

  • Ensure test files are cleaned up. (PR #2241. Thanks to John Marshall)

  • Reordered options for grep commands in tests so the input file is at the end. (PR #2311)


Download the source code here: samtools-1.22.2.tar.bz2.(The "Source code" downloads are generated by GitHub and are incomplete as they don't bundle HTSlib and are missing some generated files.)

1.21.1

Download the source code here: samtools-1.21.1.tar.bz2.(The "Source code" downloads are generated by GitHub and are incomplete as they don't bundle HTSlib and are missing some generated files.)


Bug fixes:

  • This release bundles HTSlib 1.21.1, which includes many important bug fixes. Please see htslib/NEWS for details.

  • Fix use-after-free bug in samtools mpileup -a due to reference sequences being discarded too early. This could happen when the -a option was used, and all the alignments for one of the references started at the same position. This caused mpileup to try to load the next reference before it had finished writing data for the previous one out. (CVE-2026-31972) (PR #2229, fixes #2227. Reported by Pouya Kheradpour)

  • Fix samtools fastq -i to force CRAM aux tag decoding. (PR #2155, fixes #2154. Reported by Alex Leonard)

  • Improve plot-bamstats quality plots. (PR #2143 combined with PR #2116. Thanks to James Gilbert)

  • Fix depth counts when overlap removal is enabled. (PR #2171, fixes #2170. Reported by Yangqi Su)

  • Protect against merging CRAM files with different headers. (PR#2220, fixes #2218. Reported by Kevin Lewis)

  • Prevent samtools coverage from printing a coverage table on failure. (PR #2247, fixes #2242. Reported by Georges Kanaan)

  • Remove deprecated line style commands from plot-bamstats. (PR #2251, fixes #2243. Reported by Suhas Srinivasan)

  • Check for file close errors in samtools addreplacerg. (PR #2254. Thanks to Martin Pollard)

  • Add missing sam_global_args_free calls to address memory leaks. (PR #2274)

  • Wrap ctype.h functions to avoid array subscript warnings, and add casts to prevent sign extension where arrays are indexed with char values. (PR #2306)

  • Make samtools cram-size exit cleanly instead of crashing if it reads an invalid CRAM header. (CVE-2026-31973) (PR #2313)
    Build changes:

  • Fix broken tests due to MSYS2 changes. Due to changes in how MSYS2 perl reported the identity of the OS it was built for, our tests were failing to adapt to the Windows style file locations. (PR #2196)

  • Added settings to limit memory used by samtools sort when running tests. (PR #2226)

  • Ensure test files are cleaned up. (PR #2241. Thanks to John Marshall)

  • Reordered options for grep commands in tests so the input file is at the end. (PR #2311)


Download the source code here: samtools-1.21.1.tar.bz2.(The "Source code" downloads are generated by GitHub and are incomplete as they don't bundle HTSlib and are missing some generated files.)

1.23

Download the source code here: samtools-1.23.tar.bz2.(The "Source code" downloads are generated by GitHub and are incomplete as they don't bundle HTSlib and are missing some generated files.)


New work and changes:

  • New reference stats in samtools stats. First line in RFS section gives the total sequence count, count of regions, average GC, min, max, average and total counts. Second line onwards gives regions, lengths, GC and unknown base count. (PR #2224, implements #2139. Requested by Filipe G. Vieira)

  • New, faster Python version of seq_cache_populate to create and update REF_CACHE. (PR #2231. Thanks to Ruben Vorderman)

  • Add a minimum depth (--min-depth) option to samtools coverage. (PR #2235, implements #1563. Requested by Charles Foster)

  • Add an option to exclude reads (--exclude-no-read-group) that have no read group from samtools view when the -r (or -R) options are used. (PR #2271, fixes #2265. Reported by Matt Sexton)

  • Add UMI support to samtools fastq and samtools import. See samtools/htslib#1960. (PR #2270, fixes #2259 amd #2262. Requested by Poshi)

  • Optionally trim soft clips from reads in samtools fastq output. (PR #2233, fixes #1275. Requested by Torsten Seemann)

  • If sam file is sorted by tag, samtools split will output data sequentially to avoid having simultaneous open files. (PR #2281, fixes #2276. Requested by Clint Valentine)

Documentation:

  • In the command help output add a link to the global options in the samtools.1 page on the HTSlib site. (PR #2258, addresses #2236. Reported by Chris Saunders)

  • Add a support section to README.md. This mentions the GitHub issue tracker and an email address for security issues. (PR #2267)

Bug fixes:

  • Prevent samtools coverage from printing a coverage table on failure. (PR #2247, fixes #2242. Reported by Georges Kanaan)

  • Remove deprecated line style commands from plot-bamstats. (PR #2251, fixes #2243. Reported by Suhas Srinivasan)

  • Add missing sam_global_args_free() calls to address (harmless) memory leaks. (PR #2274)

  • Fix samtools consensus crash when used with threads and iterators. See also samtools/htslib#1959 (PR #2269)

Non user-visible changes and build improvements:

  • Ignore and testclean test/stat/*.fa.fai (PR #2241. Thanks to John Marshall)

  • Remove use of C variables starting in _ from bam_consensus.c. (PR #2250, fixes #2248. Reported by Ghanji125)

  • Add Replace RG check exit and add some comments to bam_addrprg.c. (PR #2254. Thanks to Martin Pollard)


Download the source code here: samtools-1.23.tar.bz2.(The "Source code" downloads are generated by GitHub and are incomplete as they don't bundle HTSlib and are missing some generated files.)

1.22.1

Download the source code here: samtools-1.22.1.tar.bz2.(The "Source code" downloads are generated by GitHub and are incomplete as they don't bundle HTSlib and are missing some generated files.)

Bug fixes:

  • SECURITY: Fix use-after-free bug in samtools mpileup -a due to reference sequences being discarded too early. This could happen when the -a option was used, and all the alignments for one of the references started at the same position. This caused mpileup to try to load the next reference before it had finished writing data for the previous one out. (PR #2229, fixes #2227. Reported by Pouya Kheradpour)

  • This release bundles htslib-1.22.1 and htscodecs v1.6.4. Fixes a possible buffer overflow on some invalid CRAM inputs; and a failure when trying to save data with very long alignment records with sequence '*' as CRAM version 3.1.
    See the HTSlib and htscodecs NEWS files for details.

Documentation:

  • Clarify that -@ starts additional threads in samtools index help, and fix formatting issues in the samtools reset manual page. (PR #2225)

Build changes:

  • Added settings to limit memory used by samtools sort when running tests. (PR #2226)

Download the source code here: samtools-1.22.1.tar.bz2.(The "Source code" downloads are generated by GitHub and are incomplete as they don't bundle HTSlib and are missing some generated files.)

1.22

Download the source code here: samtools-1.22.tar.bz2.(The "Source code" downloads are generated by GitHub and are incomplete as they don't bundle HTSlib and are missing some generated files.)

Note this release changes the default output CRAM version from 3.0 to 3.1. HTSlib and SAMtools have been able to read CRAM 3.1 since version 1.12, however other tools may not yet be able to cope. We know Noodles reads CRAM3.1 and htsjdk has a draft implementation, but not yet released.
HTSlib has options for modifying the output formats, which are exposed in SAMtools. When specifying an output format you can explicitly change the version via e.g. samtools view -O cram,version=3.0 ....
Further documentation on this change can be found at https://www.htslib.org/benchmarks/CRAM.html

HTSlib no longer fetches CRAM reference data from EBI's server by default. Your organisation may wish to set up local infrastructure to supply reference sequences, e.g., using the new ref-cache tool included in this HTSlib release. See the REF_CACHE and REF_PATH environment variables documented in https://www.htslib.org/doc/reference_seqs.html and the SAMtools manpage for details.

New work and changes:

  • New samtools checksum command. This checksums sequence, name, quality and barcode tags in an order and orientation agnostic manner, to facilitate validation of no data loss between raw fastq (or unmapped crams) through alignment, duplication marking, sorting, and other processing operations to get to the final aligned bam/cram. (PR #2122)

  • Extend samtools sort -M to distinguish between mapped and unmapped files. (PR #2110, fixes #2105. Reported by Armin Töpfer)

  • Allow the samtools sort "merging from..." message to be silenced. Setting the verbosity to 0 or 1 will now silence this message. (PR #2197, resolves #2185. Requested by Alex Predeus)

  • Add --save-counts option to samtools view. Adds an option to store counts of records processed, accepted and rejected by filtering to a file. (PR #2120, resolves #2038. Requested by Chang Y)

  • samtools fasta and fastq can now make faidx/fqidx indexes while writing using the --write-index option. (PR #2125, resolves #2118. Requested by Filipe G. Vieira)

  • Add a warning for samtools fastq on coordinate sorted data. (PR #2176, fixes #2169 and #2161. Reported by wook2014)

  • samtools tview add -i to hide inserts. (PR #2123. Thanks to Benjamin Bræstrup Sayoc)

  • Show optional headers with samtools bedcov -H. (PR #2140, fixes #2126. Reported by biounix)

  • samtools consensus now supports proper multi-threading. Previously this was restricted to decompression only, but it should now scale better. (PR #2174, supersedes PR #2141)

  • Add samtools consensus -T ref.fa functionality. This reports the reference value if a consensus value cannot be calculated. (PR #2153, fixes an additional request in #1915)

  • In samtools consensus, do not use consensus N for "*" (absent) calls that are masked due to insufficient depth. (PR #2204, fixes #2167. Reported by sanschiffre)

  • Improve plot-bamstats quality plots. (PR #2143 combined with PR #2116 (thanks to James Gilbert))

  • Make reheader -h use /tmp and honour TMPDIR. (PR #2168, related to #2165. Reported by Zhang Yuanfeng)

  • Set sort order header tag to unsorted when ordering is lost during samtools merge. (PR #2173, fixes #2159. Reported by Filipe G. Vieira)

  • Protect against merging CRAM files with different headers. (PR #2220, fixes #2218. Reported by Kevin Lewis)

  • samtools stats bug-fix to checksum calculation for quality values. This corrects the checksums but in turn makes the calculated value different to that reported by previous samtools versions. (PR #2193, fixes #2187)

  • Clarification for samtools stats when used on files with different sort orders. (PR #2198, fixes #2177. Reported by Filipe G. Vieira)

  • In samtools stats, dovetailed (completely overlapping) read pairs are now always counted as inward-oriented. Previously they could have been inwards or outwards depending on read ordering. (PR #2216, resolves #2210. Requested by Pontus Hüer)

Documentation:

  • Correct the example for 1:1 samtools consensus coords. (PR #2113, fixes #2111. Reported by schorlton-bugseq)

  • Documents the fastq format options used in SAMtools and HTSlib. (PR #2123, fixes #2121)

  • Remove mention of threads from samtools cat man page. (PR #2162, fixes #2160. Reported by Brandon Pickett)

  • Update samtools merge man page to include --template-coordinate. (PR #2164. Thanks to Nils Homer)

  • Revised CRAM reference sequence documentation in the samtools man page. (PR #2178)

  • Added fish shell completion and renamed completion for bash shell. These files can be copied to appropriate directories by the user. For full functionality it requires Python3.5+ and installed samtools manpages. (PR #2203. Thanks to LunarEclipse363)

  • Fix URL printed by the seq_cache_populate.pl script. (PR #2222. Thanks to Charles Plessy)
    Bug fixes:

  • samtools consensus previously could give different results for BAM and CRAM files with the same content. This was because MD/NM tag generation was disabled in CRAM, but the decode_md=0 option did nothing with BAM. Note with --no-adj-MQ both BAM and CRAM gave identical results. Now use --input-fmt-option decode_md=0 to get the old CRAM behaviour. Otherwise, both BAM and CRAM will be utilising MD/NM to locally modify mapping quality. (PR #2156)

  • samtools consensus without -a previously still padded with leading Ns in some cases. It now consistently removes both leading and trailing Ns. Use "-a" if you want all reference bases displayed. (Part of PR #2174 above)

  • Change how markdup looks for single reads. Due to changes to fixmate in 1.21 markdup no longer recognised single reads that would have normally have been part of a pair. (PR #2117, fixes #2117. Reported by Kristy Horan)

  • Fix samtools merge crash on BAM files with malformed headers. (PR #2128, fixes #2127. Reported by Frostb1te)

  • Fix faidx --write-index invalid free. (PR #2147, fixes 2142. Reported by Alex Leonard)

  • Fix samtools fastq -i to force CRAM aux tag decoding. (PR #2155, fixes #2155. Reported by Alex Leonard)
    Non user-visible changes and build improvements:

  • Improve htslib#PRnum support for Cirrus-CI and GitHub Actions. (PR #2115)

  • Fix broken tests due to MSYS2 changes. Due to changes in how MSYS2 perl reported the identity of the OS it was built for, our tests were failing to adapt to the Windows style file locations. (PR #2196)

  • Upgrade to _XOPEN_SOURCE=700, to match HTSlib. Also replace usleep() with nanosleep(). (PR #2221)


Download the source code here: samtools-1.22.tar.bz2.(The "Source code" downloads are generated by GitHub and are incomplete as they don't bundle HTSlib and are missing some generated files.)

Read the original on github.com ↗