Manta Documentation

repository·master·Indexed 19 days ago

https://github.com/illumina/manta

Manta is a high-performance structural variant (SV) and indel caller for germline and somatic variant detection from paired-end sequencing reads. It detects deletions, insertions, inversions, tandem duplications, and interchromosomal translocations. The documentation includes a User Guide for configuration and result interpretation, a Developer Guide for C++11 and Python 2.6+ contributors, and technical Methods regarding its mathematical models and algorithms.

Tokens
18.6K
Snippets
52
Records
86
Agent score
59%

What's inside Manta

  1. Overview of Manta C++ libraries

    master

    The Manta C++ codebase is organized into several specialized libraries. Developers building or extending Manta should use these libraries to access core functionality:

    • alignment: Sequence alignment utilities.
    • applications/X: Contains code specific to a particular command-line application (where X is the application name).
    • appstats: Shared performance tracking code used across different applications.
    • assembly: Local sequence assembly utilities.
    • blt_util: General utility functions shared between manta, starling, strelka, and gvcftools.
    • common: General utility functions sourced from CASAVA, Grouper, and Isaac.
    • format: Logic for converting data into external formats.
    • htsapi: C++ wrapper objects built on top of samtools/htslib and other utilities for standard genomic indexed file formats (e.g., bam, cram, bed, vcf).
    • manta: The default library for project-specific logic. New logic should be added here unless a clear pattern emerges that justifies creating a new specialized library.
    • options: Shared command-line options objects used across different applications.
    • svgraph: Components for SV (Structural Variant) locus graphs.
    • test: Logic used exclusively for unit testing. This is linked into unit tests but is not included in production binaries.
  2. Overview of Manta Structural Variant Caller

    master

    Manta is a tool for calling structural variants (SVs) and indels from mapped paired-end sequencing reads. It is optimized for two primary use cases:

    1. Germline variation: Analysis of small sets of diploid individuals.
    2. Somatic variation: Analysis of tumor/normal sample pairs (with experimental support for unmatched tumor samples).

    Key Capabilities

    • Discovery & Assembly: Discovers, assembles, and scores large-scale SVs, medium-sized indels, and large insertions.
    • Evidence Integration: Combines paired-end and split-read evidence for improved accuracy, though it can report variants even without successful breakpoint assemblies if other evidence is strong.
    • Performance: Designed for rapid analysis on standard compute hardware (e.g., analyzing NA12878 at 50x coverage in <20 minutes on a 20-core server).

    Input and Output

    • Input: Accepts mapped reads in BAM or CRAM formats.
    • Output: Reports all SV and indel inferences in VCF 4.1 format.
  3. Understand the purpose of Manta Docker images

    master

    The Docker images and scripts located in the deployment/ subdirectory are intended for the official release process of Manta. They are designed to build conventional binary releases by using an older OS (to ensure wide compatibility) paired with a newer compiler (to leverage modern C++ features and improve binary performance).

    Note: These images are not intended for end-users who simply want to run Manta within a Docker container for analysis.

  4. Access Manta documentation

    master

    Manta documentation is organized into three primary sections depending on your needs:

    • User Guide: The main resource for running Manta, configuring it, and interpreting results.
    • Developer Guide: Guidelines and instructions for contributors developing new methods within the Manta framework.
    • Methods: Detailed technical descriptions of the mathematical models and algorithms used by Manta.
  5. What is CTPL and when to use it

    master

    CTPL is a modern, efficient, header-only C++ thread pool library. It implements the thread pool pattern to allow for parallel execution of jobs while minimizing the overhead of loading and destroying threads.

    Use a thread pool when you want to:

    1. Minimize thread management overhead: Reuse existing threads instead of creating/destroying them for every task.
    2. Limit concurrency: Control the number of parallel jobs running simultaneously to manage system resources.
    3. Improve responsiveness: Offload time-consuming tasks (like event handlers) to background threads.
  6. Operating System compatibility for Manta

    master

    Manta's compatibility across platforms is as follows:

    • Linux: Supported on Ubuntu 12.04, 14.04, 16.04 and CentOS 6, 7 (requires specific package additions).
    • OS X: Builds and passes basic tests on OS X 10.9, but full WGS (Whole Genome Sequencing) analyses are not tested on this platform.
    • Windows: Manta does not build or run on Windows. However, library-level compilation is possible for Visual Studio users (refer to the developer guide).
  7. Understand TestAssembler read selection and orientation logic

    master

    When using TestAssembler, the tool applies specific logic for selecting and orienting reads that differs from Manta's full SV analysis pipeline:

    • Selection: Every read present in the input BAM file is selected as input for the assembler.
    • Orientation: Read orientation is only modified for unmapped reads that have mapped read pairs. In these cases, the unmapped read is assigned the opposite strand orientation of its mapped partner.
  8. Interpret Manta VCF output details

    master

    Manta follows the VCF 4.1 specification. Key representation details include:

    Sample Names

    Extracted from the first @RG (read group) record in the input alignment header. Spaces are replaced with underscores. Defaults to SAMPLE1, SAMPLE2, etc., if no name is found.

    Small Indels

    Variants are reported with full REF and ALT sequences (rather than symbolic alleles) if they meet these criteria:

    1. Can be entirely expressed as a combination of inserted/deleted sequence.
    2. Length is < 1000bp.
    3. Breakends/inserted sequences are not imprecise. Small indels include a CIGAR INFO tag describing the event.

    Large Insertions with Incomplete Assembly

    If an insertion cannot be fully assembled, Manta uses the <INS> symbolic allele and provides the following INFO fields to describe the known ends:

    • LEFT_SVINSSEQ: Assembled left side of the insert.
    • RIGHT_SVINSSEQ: Assembled right side of the insert.
    chr1    11830208        MantaINS:1577:0:0:0:3:0 T       <INS>   999     PASS    END=11830208;SVTYPE=INS;CIPOS=0,12;CIEND=0,12;HOMLEN=12;HOMSEQ=TAAATTTTTCTT;LEFT_SVINSSEQ=TAAATTTTTCTTTTTTCTTTTTTTTTTAAATTTATTTTTTTATTGATAATTCTTGGGTGTTTCTCACAGAGGGGGATTTGGCAGGGTCACGGGACAACAGTGGAGGGAAGGTCAGCAGACAAACAAGTGAACAAAGGTCTCTGGTTTTCCCAGGCAGAGGACCCTGCGGCCTTCCGCAGTGTTCGTGTCCCTGATTACCTGAGATTAGGGATTTGTGATGACTCCCAACGAGCATGCTGCCTTCAAGCATCTGTTCAACAAAGCACATCTTGCACTGCCCTTAATTCATTTAACCCCGAGTGGACACAGCACATGTTTCAAAGAG;RIGHT_SVINSSEQ=GGGGCAGAGGCGCTCCCCACATCTCAGATGATGGGCGGCCAGGCAGAGACGCTCCTCACTTCCTAGATGTGATGGCGGCTGGGAAGAGGCGCTCCTCACTTCCTAGATGGGACGGCGGCCGGGCGGAGACGCTCCTCACTTTCCAGACTGGGCAGCCAGGCAGAGGGGCTCCTCACATCCCAGACGATGGGCGGCCAGGCAGAGACACTCCCCACTTCCCAGACGGGGTGGCGGCCGGGCAGAGGCTGCAATCTCGGCACTTTGGGAGGCCAAGGCAGGCGGCTGCTCCTTGCCCTCGGGCCCCGCGGGGCCCGTCCGCTCCTCCAGCCGCTGCCTCC  GT:FT:GQ:PL:PR:SR       0/1:PASS:999:999,0,999:22,24:22,32      0/1:PASS:999:999,0,999:18,25:24,20    0/0:PASS:230:0,180,999:39,0:34,0
  9. How Manta's SV discovery process works

    master

    Manta's discovery process consists of two primary stages:

    1. Build breakend association graph: The entire genome is scanned to find evidence of possible SVs and large indels. This evidence is organized into a graph where edges connect genomic regions with potential breakend associations. Edges can be local (connecting a region to itself for indels) or long-range (connecting two different regions for translocations).
    2. Analyze graph edges to find SVs: Manta analyzes individual graph edges or highly connected groups to discover and score SV candidates. This includes inferring candidates, attempting breakpoint assembly, scoring/genotyping using biological models (diploid germline or somatic), and filtering before outputting to VCF.
  10. Run Manta: Configuration and Execution Workflow

    master

    Manta operates in a two-step procedure:

    1. Configuration: Use the ${MANTA_INSTALL_PATH}/bin/configManta.py script to specify input data (BAM/CRAM files, reference genome) and variant calling options. This step generates a workflow run script: ${MANTA_ANALYSIS_PATH}/runWorkflow.py.

    2. Execution: Run the generated ${MANTA_ANALYSIS_PATH}/runWorkflow.py script to execute the actual analysis. This step controls parallelization (e.g., number of cores) and can be interrupted and resumed without changing the final result.

    Requirements:

    • All input alignment files (BAM or CRAM) and the reference sequence must use the same chromosome names in the same order.
    • All input alignment files and reference sequences must be indexed with samtools (or an equivalent utility).
    # Step 1: Configure
    ${MANTA_INSTALL_PATH}/bin/configManta.py --bam sample.bam --referenceFasta ref.fa --runDir ./analysis_dir
    
    # Step 2: Execute
    ./analysis_dir/runWorkflow.py -j 8
  11. Understand Manta's INFO/EVENT field mechanism

    master

    Manta uses the INFO/EVENT field to group multiple junctions that are hypothesized to occur together as part of a single complex variant event (e.g., a reciprocal translocation pair).

    All individual variant records belonging to the same event will share the same INFO/EVENT string. This mechanism allows Manta to increase sensitivity by lowering evidence thresholds for additional junctions that follow a consistent pattern with an existing candidate junction. Currently, this mechanism is primarily used for identifying reciprocal translocation pairs and is limited to a maximum of 2 junctions per event.

  12. Detected variant classes in Manta

    master

    Manta detects all variation classes explainable as novel DNA adjacencies. All adjacencies are classified into the following categories based on the breakend pattern:

    • Deletions
    • Insertions
      • Fully-assembled insertions
    • Insertions
      • Partially-assembled (i.e., inferred) insertions
    • Inversions
    • Tandem Duplications
    • Interchromosomal Translocations

    Note: Manta classifies the adjacency but does not automatically infer higher-level constructs (e.g., it does not perform depth or B-allele frequency tests to confirm a deletion type).