Posts

How to install ngsTools (2026)

To install ngsTools, you must first install several dependency libraries and software packages: $ sudo apt update $ sudo apt install git gsl-bin libgsl-dbg libgsl-dev libgslcblas0 gcc zlib1g-dev libbz2-dev liblzma-dev libcurl4-openssl-dev coreutils samtools perl r-base g++-9 $ sudo cpan Getopt::Long && sudo cpan Graph::Easy && sudo cpan Math::BigFloat && sudo cpan IO::Zlib $ sudo R -e "install.packages(c('optparse', 'tools', 'ggplot2', 'reshape2', 'plyr', 'gtools', 'LDheatmap', 'ape', 'grid', 'methods', 'phangorn', 'plot3D'))" Now you can install ngsTools. Ensure that your terminal is directed to the folder where you want ngsTools to be installed: $ git clone --recursive https://github.com/mfumagalli/ngsTools.git $ cd ngsTools $ sudo make CXX=g++-9

How to install Samtools using a Package Manager and Building from Source

  Option 1) Using a Package Manager: On Ubuntu/Debian:   $ sudo apt-get update $ sudo apt-get install samtools O n CentOS/RedHat: $ sudo yum install samtools   Option 2) Building from Source: Make sure you have all the dependencies installed. You can install them by running: $ sudo apt-get update $ sudo apt-get install build-essential zlib1g-dev libncurses-dev libbz2-dev liblzma-dev libcurl4-openssl-dev To install Samtools: $ cd path/to/installation/directory $ git clone --recurse-submodules https://github.com/samtools/samtools.git $ git clone --recurse-submodules https://github.com/samtools/htslib.git $ cd samtools $ make $ sudo make install

How to easily obtain a VCF file based on BAM files using BCFtools

Image
The VCF (Variant Call Format) is a widely used file format in bioinformatics for storing genetic variation data. It was developed as a standardized way to represent genetic variants such as SNPs (Single Nucleotide Polymorphisms), indels (insertions and deletions), and other types of genetic alterations. VCF files are typically the output of variant calling processes, which analyse DNA sequence data to identify differences between a sample and a reference genome. Each entry in a VCF file represents a specific position in the genome where variation has been observed. The file format includes essential information such as: Chromosome and Position: The genomic location of the variant. Reference and Alternate Alleles: The reference base(s) from the reference genome and the alternate base(s) observed in the sample. Genotype Information: For each sample, the file includes genotype data that indicate which alleles are present at that position. VCF files are highly flexible, supporting the stor...

How to interpret Tajima's D

Image
Tajima’s D  is a widely used statistic in population genetics. In simple terms, it quantifies how much genetic diversity deviates from what would be expected under a neutral model of evolution. The formula is: π is the nucleotide diversity . It is the count of differences of nucleotides per pair of sequences, and averages it over all the pairs and all sites. θ  is the number of segregating sites  – number of positions in the alignment that have variation – normalized by a factor that depends on the sample size.   Tajima’s D variation under population events: During a  population bottleneck , many rare variants are lost by genetic drift. This results in a reduction in the number of segregating sites – Watterson’s  θ  decreases. But the variants that survive are in a intermediate frequency, so π does not decrease as much as  θ , so  Tajima’s D > 0 . During a  population expansion , the number of individuals increases. Many recent mutati...