Debian Codegraph @

README

raw
1 Samtools implements various utilities for post-processing alignments in the
2 SAM, BAM, and CRAM formats, including indexing, variant calling (in conjunction
3 with bcftools), and a simple alignment viewer.
4
5
6 Building samtools
7 =================
8
9 The typical simple case of building Samtools using the HTSlib bundled within
10 this Samtools release tarball is done as follows:
11
12 cd .../samtools-1.22.1 # Within the unpacked release directory
13 ./configure
14 make
15
16 You may wish to copy the resulting samtools executable into somewhere on your
17 $PATH, or run it where it is.
18
19 Rather than running-in-place like that, the next simplest typical case is to
20 install samtools etc properly into a directory of your choosing. Building for
21 installation using the HTSlib bundled within this Samtools release tarball,
22 and building the various HTSlib utilities such as bgzip is done as follows:
23
24 cd .../samtools-1.22.1 # Within the unpacked release directory
25 ./configure --prefix=/path/to/location
26 make all all-htslib
27 make install install-htslib
28
29 You will likely wish to add /path/to/location/bin to your $PATH.
30
31 See INSTALL for full building and installation instructions and details.
32
33 Building with HTSlib plug-in support
34 ====================================
35
36 Enabling plug-ins causes some parts of HTSlib to be built as separate modules.
37 There are two advantages to this:
38
39 * The static library libhts.a has fewer dependencies, which makes linking
40 third-party code against it easier.
41
42 * It is possible to build extra plug-ins in addition to the ones that are
43 bundled with HTSlib. For example, the hts-plugins repository
44 <https://github.com/samtools/htslib-plugins> includes a module that
45 allows direct access to files stored in an iRODS data management
46 repository (see <https://irods.org/>).
47
48 To build with plug-ins, you need to use the --enable-plugins configure option
49 as follows:
50
51 cd .../samtools-1.22.1 # Within the unpacked release directory
52 ./configure --enable-plugins --prefix=/path/to/location
53 make all all-htslib
54 make install install-htslib
55
56 There are two other configure options that affect plug-ins. These are:
57 --with-plugin-dir=DIR plug-in installation location
58 --with-plugin-path=PATH default plug-in search path
59
60 The default for --with-plugin-dir is <prefix>/libexec/htslib.
61 --with-plugin-path sets the built-in search path used to find the plug-ins. By
62 default this is the directory set by the --with-plugin-dir option. Multiple
63 directories should be separated by colons.
64
65 Setting --with-plugin-path is useful if you want to run directly from
66 the source distribution instead of installing the package. In that case
67 you can use:
68
69 cd .../samtools-1.22.1 # Within the unpacked release directory
70 ./configure --enable-plugins --with-plugin-path=$PWD/htslib-1.22.1
71 make all all-htslib
72
73 It is possible to override the built-in search path using the HTS_PATH
74 environment variable. Directories should be separated by colons. To
75 include the built-in path, add an empty entry to HTS_PATH:
76
77 export HTS_PATH=:/my/path # Search built-in path first
78 export HTS_PATH=/my/path: # Search built-in path last
79 export HTS_PATH=/my/path1::/my/path2 # Search built-in path between others
80
81 Using an optimised zlib library
82 ===============================
83
84 Samtools has been minimally tested against both the Intel-optimised and
85 CloudFlare-optimised zlibs and shown to work.
86
87 They can be downloaded from:
88
89 https://github.com/jtkukunas/zlib # Intel
90 https://github.com/cloudflare/zlib # CloudFlare
91
92 Neither Samtools nor HTSlib needs recompiling to use these optimised libraries,
93 but the LD_LIBRARY_PATH environment variable should be set to a directory
94 containing the libz.so.1 file.
95
96 Benchmarks comparing the various zlibs are available at:
97
98 http://www.htslib.org/benchmarks/zlib.html
99
100 It is recommended that you perform your own rigorous tests for an entire
101 pipeline if you wish to switch to one of the optimised zlib implementations.
102
103 Citing
104 ======
105
106 Please cite this paper when using SAMtools for your publications:
107
108 Twelve years of SAMtools and BCFtools
109 Petr Danecek, James K Bonfield, Jennifer Liddle, John Marshall, Valeriu Ohan, Martin O Pollard, Andrew Whitwham, Thomas Keane, Shane A McCarthy, Robert M Davies, Heng Li
110 GigaScience, Volume 10, Issue 2, February 2021, giab008, https://doi.org/10.1093/gigascience/giab008
111
112 @article{10.1093/gigascience/giab008,
113 author = {Danecek, Petr and Bonfield, James K and Liddle, Jennifer and Marshall, John and Ohan, Valeriu and Pollard, Martin O and Whitwham, Andrew and Keane, Thomas and McCarthy, Shane A and Davies, Robert M and Li, Heng},
114 title = "{Twelve years of SAMtools and BCFtools}",
115 journal = {GigaScience},
116 volume = {10},
117 number = {2},
118 year = {2021},
119 month = {02},
120 abstract = "{SAMtools and BCFtools are widely used programs for processing and analysing high-throughput sequencing data. They include tools for file format conversion and manipulation, sorting, querying, statistics, variant calling, and effect analysis amongst other methods.The first version appeared online 12 years ago and has been maintained and further developed ever since, with many new features and improvements added over the years. The SAMtools and BCFtools packages represent a unique collection of tools that have been used in numerous other software projects and countless genomic pipelines.Both SAMtools and BCFtools are freely available on GitHub under the permissive MIT licence, free for both non-commercial and commercial use. Both packages have been installed \\&gt;1 million times via Bioconda. The source code and documentation are available from https://www.htslib.org.}",
121 issn = {2047-217X},
122 doi = {10.1093/gigascience/giab008},
123 url = {https://doi.org/10.1093/gigascience/giab008},
124 note = {giab008},
125 eprint = {https://academic.oup.com/gigascience/article-pdf/10/2/giab008/36332246/giab008.pdf},
126 }