-
Notifications
You must be signed in to change notification settings - Fork 2
Introduction to the Reads based Genotyping tools
This project contains a set of programs that are used to inspect BAM files and derive genotypes relevant to the Genetic Report Cards (GRC). The tools have been initially developed for the analysis of aligned P. falciparum Illumina paired short reads files, but will be extended to other organisms in the future. Most of the organism-specific and locus-specific parameters are encoded in configuration files for flexibility.
There are four sets of tools at present:
- The GRC tools produce genotypes for the drug-resistance loci that are included in the GRC. These genotypes are (currently) expressed in terms of amino acid alleles
- The Sample Classification tools search for reads that can be used to classify a sample, for example to identify the presence in the samples of co-infecting strains of species other than P. falciparum by identifying reads with alleles only found in those species.
- The Heteroallelic Genotyping tools search across a coding region for any nonsynonymous mutation, classifying a sample as "wild type" unless it contains at least one such mutation. These genotypes are expressed in terms of amino acid alleles, and the tools handle heterozygous samples.
- The Barcoding tools produce genetic barcodes based on the concatenation of nucleotide alleles genotyped at multiple sites, specified as a list. These tools emulate the Sequenome genetic barcoding assays currently used by SpotMalaria.
These tools take as primary input BAM files from alignments against the V3 P. falciparum 3D7 reference genome. At a future stage, the choice of reference genome may be configurable. The tools can be invoked either on an individual sample, or on a set of samples. Genotyping tools are provided to produce one file per sample containing the genotyping data. There is also an aggregation tool that merges all results, producing a genotype file for a whole sample set.
The tools mostly (except for Barcoding tools) share a common model for how they determine results. Each process is controlled by a Task Configuration File, which specifies a set of loci where genotyping is to be performed. A locus is a region of the reference genome upon which reads covering the positions to be genotyped are likely to be mapped. Typically, for genotyping a single codon, we may specify a locus which contains all positions within +/- 200bp on either side.
For each locus we specify one or more anchors, i.e. nucleotide sequence patterns that must be matched in each read to be used for genotyping. An anchor is specified as a regular expression (regex), and the position of the first nucleotide in the expression. The tools will attempt to match the anchor regex in both reads that are mapped to the locus, and also unmapped reads. If an anchor is matched, the read will be aligned at the anchor’s starting position for further processing. No gaps are introduced in this alignment step.
If genotypes are to be produced at some position in the locus (this is the case for the GRC tools, but not for the sample classification tools which simply match alleles), then one or more targets must be specified for the locus. A target is specified as a names interval of nucleotide positions, currently assumed to be codons (hence the target length must be a multiple of 3). The tools will establish the codon(s) at the target location for all reads aligned against the anchor(s) in order to determine the genotype for the sample.
In the sample classification tools, targets are used somewhat differently: for each target (which need not contain an exact number of codons), a set of alleles is associated with a class (e.g. the name of a species) which is assigned to the reads. In other words, here the targets are used for exact sequence matching against a known set of alleles.
The read-based genotyping tools work by inspecting sequencing reads from a BAM file, produced by aligning the Illumina reads against a reference sequence. This can be different from genotyping from VCF files (e.g. those produced by samtools mpileup) in that we are able to use not only read counts from individual SNPs, but also read counts for sequences of nucleotides in each individual read, and thus are able to genotype codons or sequences of codons. This means we can characterize more reliably amino acid, haplotypes, and their mutations. In these tools we employ two different genotyping approaches: from alignment, or by read scan.
When we genotype from alignment, reads from a locus are extracted, selected by matching the specified locus anchor, and aligned in the same way as they are in the BAM file. This means that the short reads are adjusted for short indels and clipping, as determined by the aligner program that produced the BAM. This is similar to what samtools mpileup does for individual positions, but in this case we read sequences of nucleotides (e.g. codon sequences) from the reads. Once the alignment is constructed, the coordinates are determined from the position of the anchor, and the targets positions are located relative to the anchor position. Generally, genotyping from alignment works well in genomic regions where the reads are likely to align well to the reference sequences, with relatively few mismatches.
Unmapped reads, too, can be analyzed in tools using the alignment-based approach. In this case, they are selected by matching the anchor, and aligned as-is (with no indels or clipping) based in the anchor position. However, if the number of mismatches with respect to the alignment consensus is above a specified level, the reads as subsequently removed as poorly aligned.
Genotyping by read scan works somewhat differently, in that the read alignment from the BAM file is not retained. Instead, reads from a locus are extracted, and the selected and aligned by matching the locus anchor, without adjusting for indels and clipping. The targets from which the nucleotide sequences are read are then located relative to the anchor position. This approach may be preferable when analyzing reads that carry many differences with respect to the reference sequence, and may therefore not be easily aligned- for example, the speciation assays from mitochondrial DNA, in which reads from different species may present many mismatches against the Plasmodium falciparum reference, causing an aligner to introduce unexpected indels, or even discard the reads. In this scenario, the read scan approach can identify sequences associated to specific Plasmodium species.
One advantage of the read scan-based approach is the ability to process reads that were discarded by the aligner and are therefore unmapped in the BAM file. These reads are found by matching the anchor.
Note: a feature of read scan-based task is that reads can be extracted from multiple genome regions, as long as they match the same anchor. This is advantageous in some special cases, e.g. in speciation assays that have different species reference sequences for the same region.
To get started, read the Setup and Installation page.