Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install samtools under linux

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article is about how to install samtools under linux. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Installation Guide for samtools under linux

Sequence alignment (comparing the sequencing reads with genes or genomes with known sequence information) is the most important part of high-throughput sequencing data analysis. Both transcriptome and resequencing are based on the comparison results for subsequent analysis. The common format of the alignment results are sam and bam files. For example, the output of transcriptome Tophat analysis software is .bam file. In resequencing, BWA, bowtie and other alignment software are mainly output as .sam files.

Samtools is a tool software for operating sam and bam files, can compare the files for binary viewing, format conversion, sorting and merging, etc., combined with sam format in flag, tag and other information, you can also complete the statistical summary of the results, is an indispensable artifact to deal with sam and bam files!

Recently, the editor is also learning to use this software, but encountered great trouble during installation; because he did not carefully check the installation documentation before installation, but began to install directly after download, and always reported an error during installation, he found that samtools relied on many packages, so the editor sorted out the installation steps here to facilitate everyone's installation.

First, take a look at which libraries or packages samtools needs to install:

You can see that there are still a lot of bags needed. It doesn't matter. We can install it one by one. The editor installs the software in the biosoft directory under the root directory. Packages or libraries are installed by default and require root permission. Only samtools is installed under / biosoft/samtools/samtools-v1.9. )

Zlib Library installation

Download and extract:

Mkdir / biosoft/zlib

Cd / biosoft/zlib

Curl-O http://www.zlib.net/zlib-1.2.11.tar.gz

Tar xvfz zlib-1.2.11.tar.gz

Cd zlib-1.2.11

Enter the extracted zlib directory and execute the following command to install zlib

. / configure

Make

Make check

Make install

In the make install step, root permission may be required because you are installing zlib under the / usr/local/lib path. After the installation is successful, you can find libz.a under / usr/local/lib. Zlib installation is relatively simple and can usually be successfully installed.

Curses Library installation

The next step is to install the curses library, which can be installed directly using the command.

First look at the curses-related installation packages:

Yum search curses

The search results are shown in the following figure:

Find the installation file ncurses-devel.x86_64 and install it:

Yum-y install ncurses-devel.x86_64

Htslib package installation

After that, you need to install the htslib package.

Download:

Mkdir / biosoft/htslib

Cd / biosoft/htslib

Wget https://github.com/samtools/htslib/archive/develop.zip

Decompress:

Unzip develop.zip

Cd htslib-develop

Installation instructions:

Autoconf # Generate the configure script, if needed

. / configure # Optional, needed for choosing optional functionality

Make

Make install

An error may be reported during the. / configure process because some libraries or packages are not installed, so install the missing package according to the error message. All are installed using yum. Take bzip2 as an example, the system prompts that the library is missing, and yum search bzip2 searches for relevant installation packages, as follows:

Yum search bzip2

Select the file at the end of the devel.x86_64 in the search results to install, the installation package contains all the files of the library, such as header files, while the rest of the installation package contains only some files.

Yum-y install bzip2-devel.x86_64

After the installation is complete, once again. / configure, if prompted for missing libraries or packages, install them according to the previous method until all are successfully installed, and then compile.

Make

Make install

Samtools installation

Finally, you can install samtools, samtools official website address: https://github.com/samtools/samtools

Download and extract:

Mkdir / biosoft/samtools

Cd / biosoft/samtools

Wget https://github.com/samtools/samtools/archive/develop.zip

Unzip develop.zip

Mkdir samtools-v1.9

Cd samtools-develop

Compile and install:

Autoheader # Build config.h.in (this may generate a warning about # AC_CONFIG_SUBDIRS-please ignore it).

Autoconf-Wno-syntax # Generate the configure script

. / configure-- prefix=/biosoft/samtools/samtools-v1.9 #-- prefix add installation path

Make

Make install

As the previous preparatory work has been done, the installation of samtools will be very smooth at this time, and the editor will no longer encounter any error messages. This is where the installation of samtools is complete.

Thank you for reading! This is the end of this article on "how to install samtools under linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report