---
author:
- contributor_roles: []
  family: Edmunds
  given: Scott
  url: https://orcid.org/0000-0001-6444-1436
blog:
  authors: null
  community_id: 52db0518-e228-4260-8c54-c4e323b2569d
  created: 1675555200
  current_feed_url: null
  description: Data driven blogging from the GigaScience editors
  doi: https://doi.org/10.59350/gigablog
  favicon: https://rogue-scholar.org/api/communities/52db0518-e228-4260-8c54-c4e323b2569d/logo
  feed_format: application/atom+xml
  feed_url: http://gigasciencejournal.com/blog/feed/atom/
  filter: null
  generator: Other
  home_page_url: https://gigasciencejournal.com/blog
  issn: null
  language: eng
  license: https://creativecommons.org/licenses/by/4.0/legalcode
  prefix: '10.59350'
  relative_url: null
  secure: false
  slug: gigablog
  status: archived
  subfield: '1311'
  title: GigaBlog
  updated: null
  use_api: null
container: GigaBlog
date: '2021-02-17T00:00:00+00:00'
date_updated: '2025-12-06T10:18:48+00:00'
guid: http://gigasciencejournal.com/blog/?p=3761
identifier: https://doi.org/10.59350/56qqm-9mv21
image: http://gigasciencejournal.com/blog/wp-content/uploads/2021/02/Screenshot-2021-02-17-at-11.24.18-AM-1024x660.png
images:
- alt: SAMtools paper
  height: '495'
  sizes: '(max-width: 768px) 100vw, 768px'
  src: http://gigasciencejournal.com/blog/wp-content/uploads/2021/02/Screenshot-2021-02-17-at-11.24.18-AM-1024x660.png
  srcset: http://gigasciencejournal.com/blog/wp-content/uploads/2021/02/Screenshot-2021-02-17-at-11.24.18-AM-1024x660.png,
    http://gigasciencejournal.com/blog/wp-content/uploads/2021/02/Screenshot-2021-02-17-at-11.24.18-AM-300x193.png,
    http://gigasciencejournal.com/blog/wp-content/uploads/2021/02/Screenshot-2021-02-17-at-11.24.18-AM-768x495.png,
    http://gigasciencejournal.com/blog/wp-content/uploads/2021/02/Screenshot-2021-02-17-at-11.24.18-AM-1536x989.png,
    http://gigasciencejournal.com/blog/wp-content/uploads/2021/02/Screenshot-2021-02-17-at-11.24.18-AM.png
  width: '768'
- alt: SAMtools
  height: '311'
  sizes: '(max-width: 768px) 100vw, 768px'
  src: http://gigasciencejournal.com/blog/wp-content/uploads/2021/02/Screenshot-2021-02-17-at-11.02.50-AM-1024x414.png
  srcset: http://gigasciencejournal.com/blog/wp-content/uploads/2021/02/Screenshot-2021-02-17-at-11.02.50-AM-1024x414.png,
    http://gigasciencejournal.com/blog/wp-content/uploads/2021/02/Screenshot-2021-02-17-at-11.02.50-AM-300x121.png,
    http://gigasciencejournal.com/blog/wp-content/uploads/2021/02/Screenshot-2021-02-17-at-11.02.50-AM-768x311.png,
    http://gigasciencejournal.com/blog/wp-content/uploads/2021/02/Screenshot-2021-02-17-at-11.02.50-AM.png
  width: '768'
- src: http://gigasciencejournal.com/blog/wp-content/uploads/2021/02/Screenshot-2021-02-17-at-11.24.18-AM-1024x660.png
- alt: 'BCF is a faster binary representation of the VCF format,

    with BCFtools designed for the reading and writing of these

    files.'
  src: http://gigasciencejournal.com/blog/wp-content/uploads/2021/02/Screenshot-2021-02-17-at-11.02.50-AM-1024x414.png
issn: null
keywords:
- Technology
- Genome Assembly
- Genomics
- Open Source
- Q&A
lang: en
license: https://creativecommons.org/licenses/by/4.0/legalcode
rid: fehvg-6vm40
rights: https://creativecommons.org/licenses/by/4.0/legalcode
summary: <em> The SAMtools suite of tools for manipulating sequencing data one of
  the most ubiquitous tools in bioinformatics, as the "glue" holding together much
  of bioinformatics we see it used in pretty much every genomics pipeline we are submitted.
  </em>
title: Play it again, SAMtools. Q&A with the SAMtools team on 12 years of providing
  bioinformatics "glue"
url: https://wayback.archive-it.org/22098/2025-05-01T17:13:42Z/http://gigasciencejournal.com/blog/play-it-again-samtools
version: v1
---

*The [SAMtools suite](https://www.htslib.org/) of tools for manipulating
sequencing data one of the most ubiquitous tools in bioinformatics, as
the \"glue\" holding together much of bioinformatics we see it used in
pretty much every genomics pipeline we are submitted. Originally
published by Heng Li and colleagues in the 1000 Genome Project Data
Processing Subgrou*p\*, the project is now maintained by a [team at the
Wellcome Sanger
Institute](https://www.sanger.ac.uk/tool/samtools-bcftools-htslib/) that
includes Andrew Whitwham, Petr Danecek, James  Bonfield, Jennifer
Liddle, John Marshall, Valeriu Ohan, Martin O Pollard, Thomas Keane,
Shane McCarthy, and Robert Davies, alongside contributors to the open
codebase from across the world. Despite the\* *\>1M downloads, *\>2,200
commits* to the code, and many changes, there hasn\'t been a paper
describing these updates since Heng Li\'s [original 2009
publication](https://doi.org/10.1093/bioinformatics/btp352).*

*Today in GigaScience we publish the first update in 12 years, with two
papers on what\'s [new in
SAMtools,](https://academic.oup.com/gigascience/article/10/2/giab008/6137722?searchresult=1)
and describing for the first time the associated BCFtools and [HTSlib
software
library](https://academic.oup.com/gigascience/article/10/2/giab007/6139334?searchresult=1).
Providing some under-the-hood insight for users, as well as citeable
credit for the authors.* *As recent signatories of the new Software
Citation Guide [published in
F1000Research](https://doi.org/10.12688/f1000research.26932.2) we\'ve
used these papers as an example of how to provide this type of credit
according to best practice.  And as fans of under-hood-insight we
provide one in our long running series of [author
Q&A\'s](http://gigasciencejournal.com/blog/tag/qa/) with the team behind
the paper. Andrew Whitwham from Sanger wrangling the comments from the
team below.*

::: {.wp-block-image}
<figure class="aligncenter size-large is-resized">
<img
src="http://gigasciencejournal.com/blog/wp-content/uploads/2021/02/Screenshot-2021-02-17-at-11.24.18-AM-1024x660.png"
class="wp-image-3764" decoding="async"
srcset="http://gigasciencejournal.com/blog/wp-content/uploads/2021/02/Screenshot-2021-02-17-at-11.24.18-AM-1024x660.png 1024w, http://gigasciencejournal.com/blog/wp-content/uploads/2021/02/Screenshot-2021-02-17-at-11.24.18-AM-300x193.png 300w, http://gigasciencejournal.com/blog/wp-content/uploads/2021/02/Screenshot-2021-02-17-at-11.24.18-AM-768x495.png 768w, http://gigasciencejournal.com/blog/wp-content/uploads/2021/02/Screenshot-2021-02-17-at-11.24.18-AM-1536x989.png 1536w, http://gigasciencejournal.com/blog/wp-content/uploads/2021/02/Screenshot-2021-02-17-at-11.24.18-AM.png 1748w"
sizes="(max-width: 768px) 100vw, 768px" width="768" height="495"
alt="SAMtools paper" />
</figure>
:::

**How did Sequence Alignment/Map (SAM) format files and SAMtools come
into being?**

This started when the 1000 Genomes Project wanted to move away from the
MAQ mapper format. Someone suggested designing a new format during a
conference call which immediately gained traction. The overall
TAB-delimited flavor of SAM came from an earlier format inspired by
BLAT\'s PSL format. The name of SAM came from Gabor Marth. His group had
a format under the same name but with a completely different syntax
(more like the standard BLAST output).

The tags in SAM were proposed by Bob Handsaker and either Richard Durbin
or Bob proposed the headers. The text-binary dual SAM-BAM format idea
came from MAQ. MAQ uses generic gzip compression. Jue Ruan developed a
library for random access in generic gzip. When Heng Li suggested that
he would like to use the same binary and indexing for a binary SAM, Jue
said he had a better idea, which was RAZF. Bob didn\'t like RAZF because
RAZF has to use low-level zlib functions not available in other
languages. Then during a conference call, Gerton Lunter said gzip blocks
can be concatenated. This and RAZF motivated Bob to develop BGZF.  Heng
proposed the binning index, learned from UCSC, and Bob proposed the
linear index.

The CIGAR string, which is used to represent details of the alignment
once a read is mapped, was adapted from Exonerate developed by Guy
Slater. Exonerate only had M, I and D operations, Heng added the rest
and called the SAM CIGAR as extended CIGAR at the time. Commands like
sort, merge and rmdup came from MAQ, while tview was inspired by James
Bonfield\'s text alignment viewer.

An early history of the format is given in [Heng\'s old blog
post](http://lh3.github.io/2015/01/27/the-early-history-of-the-sambam-format).

**Publishing a lot of genomics papers we see SAMtools near ubiquitously
used in these, so what has made it such a crucial and fundamental tool
in bioinformatics?**

The 1000 Genomes Project published all of its alignment data in SAM/BAM
format. Numerous aligners and other programs were written that produced
and analyzed them, so the formats rapidly gained momentum. SAMtools was
immediately available as a way of working with the formats, so it also
rapidly became popular. The program was written in a very compact way,
it was fast, easy to install and easy to use. Its permissive license
enabled its code to be reused in any way, no questions asked. All these
points probably contributed to its long lasting popularity.

**How did BCFtools and HTSlib evolve and where do they fit in the
SAMtools family?**

Both BCFtools and HTSlib projects were originally just parts of the
SAMtools codebase. However, as people started reusing the code and
putting fragments of the code into their own projects, it became
apparent that we needed a clear separation of the application code from
the application programming interfaces (API) for parsing the formats, to
guarantee long-term stability and to make it easier to interface with
other programs. So, in 2013 the decision was made to separate the API
from the command line tools and HTSlib was born. The earliest releases
of SAMtools included the BCFtools variant caller. When HTSlib was split
off, BCFtools was moved into its own package to focus on the processing
and analysis of variant data.

<figure class="wp-block-image size-large is-resized">
<img
src="http://gigasciencejournal.com/blog/wp-content/uploads/2021/02/Screenshot-2021-02-17-at-11.02.50-AM-1024x414.png"
class="wp-image-3765" loading="lazy" decoding="async"
srcset="http://gigasciencejournal.com/blog/wp-content/uploads/2021/02/Screenshot-2021-02-17-at-11.02.50-AM-1024x414.png 1024w, http://gigasciencejournal.com/blog/wp-content/uploads/2021/02/Screenshot-2021-02-17-at-11.02.50-AM-300x121.png 300w, http://gigasciencejournal.com/blog/wp-content/uploads/2021/02/Screenshot-2021-02-17-at-11.02.50-AM-768x311.png 768w, http://gigasciencejournal.com/blog/wp-content/uploads/2021/02/Screenshot-2021-02-17-at-11.02.50-AM.png 1340w"
sizes="(max-width: 768px) 100vw, 768px" width="768" height="311"
alt="SAMtools" />
<figcaption>BCF is a faster binary representation of the VCF format,
with BCFtools designed for the reading and writing of these
files.</figcaption>
</figure>

**Since the original Sequence Alignment/Map format and SAMtools paper
was [published in 2009](https://doi.org/10.1093/bioinformatics/btp352)
this is the first update. What has changed in that time, and what are
the most crucial things you\'ve tried to get across in these new
papers?**

A lot has changed as described in the papers!

Two key changes in the field over the lifetime have been the enormous
growth in sequencing data and the need for more advanced analyses. This
has directly led to an emphasis on performance and adding new functions
and features, including new file formats,
[CRAM](https://www.sanger.ac.uk/news_item/2014-08-15-samtools-crams-in-support-for-improved-compression-formats/)
and BCFv2. This has been coupled with improved robustness and security
as we have seen the rise of inclusion of the software in web services.

The software can do much more than it could when the first paper came
out.  BCFtools in particular has gained an enormous collection of new
functionality for analysing variant data.

**A project lasting 12 years in the fast-paced world of bioinformatics
is amazing, so how have you maintained longevity, stability and
backwards compatibility? How many people have been involved in these
efforts over the years?**

We have, where possible, tried to make changes in a backwards-compatible
way.  While that means we occasionally have to jump through some hoops
to get the results we want, it makes upgrading to the latest version
much easier for our users.

The governance of the file formats have moved from being purely an
internal 1000 Genomes format to an international standard within
[GA4GH\'s
remit](https://github.com/ga4gh/large-scale-genomics-wiki/wiki). This
has given safety and longevity to the format, which in turn has aided
the implementations.

The main people behind the projects are included as authors on these
papers, however there have been many more collectively improving the
software. To date there are 146 people listed in the git history across
the 3 projects, and we are indebted to the many, many others who have
helped to improve the software by reporting bugs, asking questions and
making suggestions.

**As developers and maintainers of software working under-the-hood to
power so many other people\'s research these efforts may sometimes be
taken for granted. We\'ve been involved in the development and
[promotion of new
guidelines](https://f1000research.com/articles/9-1257/v2) for citing and
crediting software. Do you find it difficult to get credit for this
work, and how important and useful is it for software developers to get
credit in this way?**

The huge number of downloads and the active community is a form of
recognition.  However papers are the generally recognised way of
tracking credit, via citations, and can directly impact on grant
funding.  Without a DOI it can be hard to track use of software and the
impact it has.

We are very fortunate that the Wellcome Sanger Institute funds this work
as part of its core infrastructure, but we have witnessed funding
elsewhere of some software projects drying up due to lack of recognition
of their impact to the scientific community.  Receiving appropriate
credit can therefore be vital for software developers everywhere.

This is an issue not only for software developers, but for those
actively involved in maintaining the GA4GH file format specifications
too.

**Further Reading**\
Li et al., The Sequence Alignment/Map format and SAMtools,
*Bioinformatics*, Volume 25, Issue 16, 15 August 2009, Pages 2078--2079,
[https://doi.org/10.1093/bioinformatics/btp352](https://doi.org/10.1093/bioinformatics/btp352%20)

Danecek et al., Twelve years of SAMtools and BCFtools, *GigaScience*,
Volume 10, Issue 2, February 2021, giab008,
[https://doi.org/10.1093/gigascience/giab008](https://academic.oup.com/gigascience/article/10/2/giab008/6137722?searchresult=1)

Bonfield et al., HTSlib: C library for reading/writing high-throughput
sequencing data, *GigaScience*, Volume 10, Issue 2, February 2021,
giab007,
[https://doi.org/10.1093/gigascience/giab007](https://academic.oup.com/gigascience/article/10/2/giab007/6139334?searchresult=1)

SAMtools developers (2020). SAMtools (Version 1.11)
<https://www.htslib.org/>

***For more on using these resources, Simon Cockell has a [useful online
tutorial](https://youtu.be/Llaxuzr6EkA) on using SAMtools.***

<figure
class="wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio">
<div class="wp-block-embed__wrapper">
<div class="iframe">
<div id="player">

</div>
<div class="player-unavailable">
<h1 id="ein-fehler-ist-aufgetreten." class="message">Ein Fehler ist
aufgetreten.</h1>
<div class="submessage">
<a href="https://www.youtube.com/watch?v=Llaxuzr6EkA"
target="_blank">Sieh dir dieses Video auf www.youtube.com an</a> oder
aktiviere JavaScript, falls es in deinem Browser deaktiviert sein
sollte.
</div>
</div>
</div>
</div>
</figure>

The post [Play it again, SAMtools. Q&A with the SAMtools team on 12
years of providing bioinformatics
\"glue\"](http://gigasciencejournal.com/blog/play-it-again-samtools/){rel="nofollow"}
appeared first on
[GigaBlog](http://gigasciencejournal.com/blog){rel="nofollow"}.