Skip to content

Commit

Permalink
Merge tag '1.3' into debian/unstable
Browse files Browse the repository at this point in the history
Samtools release 1.3: many improvements, fixes, new commands

* The obsolete "samtools sort in.bam out.prefix" usage has been removed.
  If you are still using -f, -o, or out.prefix, convert to use -T PREFIX
  and/or -o FILE instead.  (samtools#295, samtools#349, samtools#356, samtools#418, PR samtools#441; see also
  discussions in samtools#171, samtools#213.)

* The "bamshuf" command has been renamed to "collate" (hence the term
  bamshuf no longer appears in the documentation, though it still works
  on the command line for compatibility with existing scripts).

* The mpileup command now outputs the unseen allele in VCF/BCF as <*>
  rather than X or <X> as previously, and now has AD, ADF, ADR, INFO/AD,
  INFO/ADF, INFO/ADR --output-tags annotations that largely supersede
  the existing DV, DP4, DPR annotations.

* The mpileup command now applies BAQ calculations at all base positions,
  regardless of which -l or -r options are used (previously with -l it was
  not applied to the first few tens of bases of each chromosome, leading
  to different mpileup results with -l vs. -r; samtools#79, samtools#125, samtools#286, samtools#407).

* Samtools now has a configure script which checks your build environment
  and facilitates choosing which HTSlib to build against.  See INSTALL
  for details.

* Samtools's Makefile now fully supports the standard convention of
  allowing CC/CPPFLAGS/CFLAGS/LDFLAGS/LIBS to be overridden as needed.
  Previously it listened to $(LDLIBS) instead; if you were overriding
  that, you should now override LIBS rather than LDLIBS.

* A new addreplacerg command that adds or alters @rg headers and RG:Z
  record tags has been added.

* The rmdup command no longer immediately aborts (previously it always
  aborted with "bam_get_library() not yet implemented"), but remains
  not recommended for most use (samtools#159, samtools#252, samtools#291, samtools#393).

* Merging files with millions of headers now completes in a reasonable
  amount of time (samtools#337, samtools#373, samtools#419, samtools#453; thanks to Nathan Weeks,
  Chris Smowton, Martin Pollard, Rob Davies).

* Samtools index's optional index output path argument works again (samtools#199).

* Fixed calmd, targetcut, and potential mpileup segfaults when given broken
  alignments with POS far beyond the end of their reference sequences.

* If you have source code using bam_md.c's bam_fillmd1_core(), bam_cap_mapQ(),
  or bam_prob_realn_core() functions, note that these now take an additional
  ref_len parameter.  (The versions named without "_core" are unchanged.)

* The tview command's colour scheme has been altered to be more suitable
  for users with colour blindness (samtools#457).

* Samtools depad command now handles CIGAR N operators and accepts
  CRAM files (samtools#201, samtools#404).

* Samtools stats now outputs separate "N" and "other" columns in the
  ACGT content per cycle section (samtools#376).

* Added -a option to samtools depth to show all locations, including
  zero depth sites (samtools#374).

* New samtools dict command, which creates a sequence dictionary
  (as used by Picard) from a FASTA reference file.

* Samtools stats --target-regions option works again.

* Added legacy API sam.h functions sam_index_load() and samfetch() providing
  bam_fetch()-style iteration over either BAM or CRAM files.  (In general
  we recommend recoding against the htslib API directly, but this addition
  may help existing libbam-using programs to be CRAM-enabled easily.)

* Fixed legacy API's samopen() to write headers only with "wh" when writing
  SAM files.  Plain "w" suppresses headers for SAM file output, but this
  was broken in 1.2.

* "samtools fixmate - -" works in pipelines again; with 1.0 to 1.2,
  this failed with "[bam_mating] cannot determine output format".

* Restored previous "samtools calmd -u" behaviour of writing compression
  level 0 BAM files.  Samtools 1.0 to 1.2 incorrectly wrote raw non-BGZF
  BAM files, which cannot be read by most other tools.  (Samtools commands
  other than calmd were unaffected by this bug.)

* Restored bam_nt16_nt4_table[] to legacy API header bam.h.

* Fixed bugs samtools#269, samtools#305, samtools#320, samtools#328, samtools#346, samtools#353, samtools#365, samtools#392, samtools#410, samtools#445,
  samtools#462, samtools#475, and samtools#495.
  • Loading branch information
charles-plessy committed Dec 24, 2015
2 parents 4a5274b + ed3191b commit 95c561d
Show file tree
Hide file tree
Showing 196 changed files with 34,863 additions and 21,375 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Expand Up @@ -6,5 +6,5 @@

# Omit these files from release tarballs.
.git* export-ignore
/.travis.yml export-ignore
.travis* export-ignore
README.md export-ignore
9 changes: 9 additions & 0 deletions .gitignore
Expand Up @@ -3,6 +3,15 @@
*~
/version.h

aclocal.m4
autom4te.cache
config.cache
config.h
config.log
config.mk
config.status
configure

lib*.a

/bgzip
Expand Down
14 changes: 12 additions & 2 deletions .travis.yml
@@ -1,5 +1,9 @@
# Control file for continuous integration testing at http://travis-ci.org/

os:
- linux
- osx

language: c
compiler:
- clang
Expand All @@ -11,8 +15,14 @@ matrix:
- compiler: gcc
env: CFLAGS="-std=gnu99 -O0"

env:
global:
- HTSDIR=./htslib

before_script:
- git clone --depth=5 --branch=develop git://github.com/samtools/htslib.git
- export HTSDIR=./htslib
# Clone samtools/htslib (or another repository, as specified by a Travis CI
# repository $HTSREPO setting) and check out a corresponding branch with the
# same name, if any, or otherwise the default branch.
- .travis/clone ${HTSREPO:-git://github.com/samtools/htslib.git} $HTSDIR $TRAVIS_BRANCH

script: make -e && make -e test
14 changes: 14 additions & 0 deletions .travis/clone
@@ -0,0 +1,14 @@
#!/bin/sh
# Usage: .travis/clone REPOSITORY [DIR] [BRANCH]
#
# Creates a shallow clone, checking out the specified branch. If BRANCH is
# omitted or if there is no branch with that name, checks out origin/HEAD.

repository=$1
localdir=$2
branch=$3

[ -n "$branch" ] && ref=$(git ls-remote --heads $repository $branch)

set -x
git clone --depth=1 ${ref:+--branch=$branch} $repository $localdir
144 changes: 109 additions & 35 deletions INSTALL
@@ -1,49 +1,123 @@
Basic Installation
==================

To build and install Samtools, 'cd' to the samtools-1.x directory containing
the package's source and type the following commands:

./configure
make
make install

The './configure' command checks your build environment and allows various
optional functionality to be enabled (see Configuration below). If you
don't want to select any optional functionality, you may wish to omit
configure and just type 'make; make install' as for previous versions
of samtools. However if the build fails you should run './configure'
as it can diagnose the common reasons for build failures.

The 'make' command builds samtools and various miscellaneous utilities.
If compilation fails you should run './configure' as it can diagnose
problems with your build environment that cause build failures.

(The bgzip, htsfile, and tabix utilities are provided by HTSlib. If you are
not also compiling HTSlib separately, you may wish to compile these utilities
in the associated copy of HTSlib. Type 'make all all-htslib' to do this.)

The 'make install' command installs the samtools executable and various
scripts and executables from misc/ and a manual page to /usr/local.
The installation location can be changed by configuring with --prefix=DIR
or via 'make prefix=DIR install' (see Installation Locations below).

(If you have not also installed HTSlib separately, you may wish to install
the bgzip, htsfile, and tabix utilities from the associated copy of HTSlib.
Type 'make install install-htslib' to do this.)

Typically you will want to enable HTSlib's HTTPS/etc plugin etc.
See README for recipes for typical installation.


System Requirements
===================

Samtools and HTSlib depend on the zlib library <http://zlib.net>. Building
them requires zlib development files to be installed on the build machine;
you may need to ensure a package such as zlib1g-dev (on Debian or Ubuntu Linux)
or zlib-devel (on RPM/yum-based distributions) is installed.
Samtools requires the zlib library <http://zlib.net> and (optionally) a
curses or GNU ncurses library <http://www.gnu.org/software/ncurses/>.
If you are unsure about this, be sure to use './configure' to determine
whether you have these libraries and to help diagnose which packages may
need to be installed on your build machine to provide them.


Configuration
=============

By default, './configure' examines your build environment, searching for a
usable HTSlib and checking for requirements such as the curses development
files, and arranges for a plain samtools build.

This samtools release contains a copy of the HTSlib source code which will
be used to build samtools. If you already have a system-installed HTSlib
or another HTSlib that you would prefer to build against, you can arrange
this via the --with-htslib option.

The following configure options can be used to enable various features and
specify further optional external requirements:

--with-htslib=DIR
Specifies the HTSlib source tree or installation directory that samtools
should use to parse bioinformatics file formats etc. Configure will check
that DIR appears to contain HTSlib source files or to be the root of an
installation directory (i.e., it has 'include' and 'lib' subdirectories
containing HTSlib headers and libraries).

By default, configure looks for an HTSlib source tree within or alongside
the samtools source directory; if there are several likely candidates,
you will have to choose one via this option.

--with-htslib=system
Ignores any nearby HTSlib source trees, and builds samtools using an
existing HTSlib installation in a system directory (i.e., a directory
already being searched by $CPPFLAGS/$LDFLAGS).

--without-curses
Omit the curses-based 'tview' subcommand from the build. If you do not
have curses on your build machine or otherwise don't want the interactive
tview subcommand, this option disables it and skips testing for working
curses development files.

If you are building with an HTSlib source tree, HTSlib's configure script
will also be run. So HTSlib configure options can also be used and will be
passed down to the HTSlib configure. See HTSlib's INSTALL documentation for
details of these options.

SAMtools' faidx is able to index a bgzip-compressed FASTA file to save
diskspace.
The configure script also accepts the usual options and environment variables
for tuning installation locations and compilers: type './configure --help'
for details. For example,

The text-based viewer (tview) requires the GNU ncurses library
<http://www.gnu.org/software/ncurses/>, which comes with Mac OS X and most of
the modern Linux/Unix distributions. If you do not have this library installed,
you can still compile the rest of SAMtools by manually changing:
`-D_CURSES_LIB=1' to `-D_CURSES_LIB=0' at the line starting with `DFLAGS=', and
comment out the line starting with `LIBCURSES='.
Note that on some systems the library is available as -lcurses while on others
as -lncurses. This can be set in Makefile by setting LIBCURSES= -lcurses vs
-lncurses.
./configure CC=icc --prefix=/opt/icc-compiled

would specify that samtools is to be built with icc and installed into bin,
lib, etc subdirectories under /opt/icc-compiled.

Compilation
===========

'cd' to the samtools-1.x directory containing the package's source and type
'make' to compile samtools.
Installation Locations
======================

This samtools release contains a copy of HTSlib which will be used to build
samtools. If you already have a system-installed HTSlib or another HTSlib
that you would prefer to build against, you can arrange this by overriding
$(HTSDIR) by typing 'make HTSDIR=/path/to/htslib-source' -- see the makefile
for details.
By default, 'make install' installs samtools and the utilities under
/usr/local/bin and manual pages under /usr/local/share/man.

You can specify a different location to install Samtools by configuring
with --prefix=DIR or specify locations for particular parts of HTSlib by
configuring with --bindir=DIR and so on. Type './configure --help' for
the full list of such install directory options.

Installation
============
Alternatively you can specify different locations at install time by
typing 'make prefix=DIR install' or 'make bindir=DIR install' and so on.
Consult the list of prefix/exec_prefix/etc variables near the top of the
Makefile for the full list of such variables that can be overridden.

Type 'make install' to install the samtools executable and various scripts
and executables from misc/ and a manual page to /usr/local.
You can also specify a staging area by typing 'make DESTDIR=DIR install',
possibly in conjunction with other --prefix or prefix=DIR settings.
For example,

Type 'make prefix=/path/to/dir install' to install everything under your
choice of installation directory. The install target also understands
DESTDIR and the other usual installation directory variables.
make DESTDIR=/tmp/staging prefix=/opt

The bgzip and tabix utilities are provided by HTSlib. If you have not also
installed HTSlib separately, you may wish to install these utilities by hand
by copying samtools-1.x/htslib-1.x/{bgzip,tabix} to the same bin directory
to which you have installed samtools et al.
would install into bin and share/man subdirectories under /tmp/staging/opt.

0 comments on commit 95c561d

Please sign in to comment.