Git Product home page Git Product logo

alignstats's Introduction

AlignStats

Overview

AlignStats produces various alignment, whole genome coverage, and capture coverage metrics for sequence alignment files in SAM, BAM, and CRAM format. This program is designed to serve reporting and quality control purposes in sequencing analysis pipelines at the Baylor College of Medicine Human Genome Sequencing Center (BCM-HGSC). Descriptions of reported metrics can be found in doc/.

Building

AlignStats requires a recent version of HTSlib (versions 1.3 and higher are known to work, version 1.4 or higher is suggested). The -p option for multithreading requires libpthread support.

To build AlignStats, run:

autoconf
./configure
make

AlignStats multithreading support is enabled by running configure as:

./configure --enable-multithreading

Usage

alignstats [-i INPUT] [-j FORMAT] [-o OUTPUT]
           [-h] [-v] [-n NUMREADS] [-p] [-P INT]
           [-r REGIONS] [-t TARGET] [-m COVMASK] [-T REFFASTA]
           [-q INT] [-f INT] [-F INT]
           [-D] [-U] [-A] [-C] [-W]

Runtime options:
    -h          Print usage information.
    -v          Print verbose runtime information output to stderr.
    -n INT      Maximum number of records to keep in memory.
    -p          Use separate threads for reading and processing records
                (requires builtin pthread support).
    -P INT      Number of HTSlib decompression threads to spawn.

File options:
    -i INPUT    Read INPUT as the input SAM, BAM, or CRAM file (stdin). Input
                must be coordinate-sorted for accurate results.
    -j FORMAT   Specify file format of input alignment file ("sam", "bam", or
                "cram" available, default guessed from filename or "sam").
    -o OUTPUT   Write report to OUTPUT (stdout).
    -r REGIONS  File in BED format listing which regions to process. By
                default, all available records are processed. This option
                requires the alignment file to be indexed.
    -t TARGET   File in BED format listing capture coverage regions. Required
                if capture coverage statistics are enabled.
    -m COVMASK  File in BED format listing regions of N bases in reference.
                Coverage counts will be suppressed for these regions.
    -T REFFASTA Indexed FASTA reference file for CRAM input alignment.

Processing options:
    -q INT      Only process records with minimum read quality of INT.
    -f INT      Only process records with all bits in INT set in FLAG.
    -F INT      Only process records with none of bits in INT set in FLAG.

Reporting options:
    -D          Disable excluding duplicate reads from coverage statistics.
    -U          Disable processing unplaced unmapped reads (CHROM "*") when
                using the -r option.
    -A          Disable reporting alignment statistics.
    -C          Disable reporting capture coverage statistics.
    -W          Disable reporting whole genome coverage statistics.

Usage Examples

alignstats -i sample.bam -o report.txt -r regions.bed -t targets.bed -m n_regions.bed

Run AlignStats with sample.bam as the input alignment file, regions.bed as the input regions file, targets.bed as the input target file, n_regions.bed as the input coverage mask file, and report.txt as the output report file. Both whole genome and capture statistics will be produced for coverage metrics.

alignstats -v -p -i sample.bam -r regions.bed -t targets.bed -m n_regions.bed -o report.txt

Run the first command in verbose mode and enable multithreading (if supported).

alignstats -i sample.bam -r regions.bed -t targets.bed -m n_regions.bed

Same as the first command, but the report will be printed to stdout.

alignstats -C -i sample.bam -o report.txt

Only produce alignment statistics and whole genome coverage statistics (suppress capture coverage statistics) for sample.bam.

Disclaimers

While extensive testing and validation have been performed at the BCM-HGSC to confirm the accuracy of metrics reported by AlignStats, no guarantees of accuracy are made or implied.

The set of metrics reported by AlignStats may change in the course of continued development by the BCM-HGSC.

alignstats's People

Contributors

jfarek avatar

Stargazers

 avatar Isin Altinkaya avatar Camilo García avatar Wanjin Hu(胡万金) avatar MR avatar Eike Steinig avatar slp avatar  avatar (major) john (major) avatar Gungor Budak avatar shivanshss avatar gdama avatar Erik Garrison avatar S Daniel Zafar avatar Jason Walker avatar migun avatar Anthony Ferrari avatar Richard avatar Rob Flickenger avatar

Watchers

James Cloos avatar Adam English avatar Adam avatar (major) john (major) avatar  avatar

alignstats's Issues

Just a thank you

We have used alignstats extensively for years. Its the most comprehensive set of alignment metrics for QC I've found. So thank you.

Capture Coverage stats are mis-calculated when using a non-flattened target BED file

Running alignstats v0.9.1 on exome data using -t $TARGETBED, I saw that CapCoverageBasesXPct could be >100%, which obviously shouldn't happen. It turns out my target BED file contains some overlapping regions-- when I flattened the target BED using bedtools merge, it solved the >100% problem and also changed most of the Capture Coverage stats.

Before flattening the target BED:

    "CapCoverageMean": 181.524612,
    "CapCoverageMedian": 143,
    "CapCoverageBases1Pct": 101.808569,
    "CapCoverageBases10Pct": 101.039721,
    "CapCoverageBases15Pct": 100.750766,
    "CapCoverageBases20Pct": 100.353403,
    "CapCoverageBases30Pct": 99.067630,
    "CapCoverageBases40Pct": 97.000803,
    "CapCoverageBases50Pct": 94.217440,

After flattening the target BED using bedtools sort -i $BED | bedtools merge:

    "CapCoverageMean": 175.893082,
    "CapCoverageMedian": 145,
    "CapCoverageBases1Pct": 98.920129,
    "CapCoverageBases10Pct": 98.162529,
    "CapCoverageBases15Pct": 97.877255,
    "CapCoverageBases20Pct": 97.485368,
    "CapCoverageBases30Pct": 96.222010,
    "CapCoverageBases40Pct": 94.197695,
    "CapCoverageBases50Pct": 91.472594,

I'd suggest to check and warn users if their target BED contains overlapping regions, or else flatten the target BED internally.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.