The final SNV table
group_<group>_snv_table_final.tsv is the primary output of AccuSNV that you will likely want to work with. This TSV file has one row per filtered SNV position that AccuSNV called positive, with a considerable amount of information and detail for that SNV.
snv_table_unfiltered.tsv has the same columns, but it also contains the rows which AccuSNV decided are not valid SNVs (Pred_label = 0). Everything described below applies to both.
The information in this table can be divided into four general categories: SNV position and impact, how and why AccuSNV called it a SNV, the specific annotations, and the base pair at that site found in each sample.
Tip
You can load this table in R or Python for your analysis. A Python example is below:
import pandas as pd
snvs = pd.read_csv('group_pe_test_snv_table_final.tsv', sep='\t')
snvs[['genome_pos', 'product', 'aa_mutation', 'mutation_type', 'CNN_prob']]
Missing values: a . in the table means the column doesn’t apply. For example, intergenic SNVs have no product, aa_pos or sequence, so all three are recorded as . for intergenic SNVs.
SNV position and impact
These columns start the table because they are some of the fields you will most likely be interested in:
Column |
Example |
Meaning |
|---|---|---|
|
|
The position on the genome, counting through multiple concatenated contigs from 1. This is a global identifier for SNVs used throughout AccuSNV. |
|
|
The contig the SNV is on. |
|
|
The SNV position within that contig, 1-based. Will be equal to |
|
|
The inferred ancestral base, which is not necessarily the reference base. |
|
|
Every other base seen in any sample (comma-separated if more than one). |
|
|
The base of the reference genome at this site. |
|
|
The nucleotide mutation with respect to the gene, if the SNV is in a gene: ancestral base, position in the gene, and derived base. Comma-separated for more than one derived allele and will be |
|
|
The position of the SNV within a gene, if it is found within one. |
|
|
The amino-acid change, if the SNV changes the protein sequence: ancestral amino acid, codon number, and derived amino acid. |
|
|
|
|
|
Protein accession from the annotation that the SNV falls in. |
|
|
Locus tag from the annotation. |
|
|
Product description from the annotation of the gene the SNV is found in. |
Gene coordinate systems
The allele genotype columns (ancestral_allele, derived_allele, reference_allele) are reported in genome-forward orientation, so they can be compared with each other directly.
But gene_nucleotide_mutation is reported in gene orientation. On a reverse-strand gene both bases are complemented, which is why the first row of the test data reads G to T in the allele columns, but C692A in the gene column.
The gene sequence is reported in the gene orientation. Therefore, when a gene is on the forward strand:
gene_nt_position = contig_pos − gene_contig_start_pos + 1
sequence[gene_nt_position − 1] = ancestral_allele
And when a gene is on the reverse strand, the gene is counted from its last base on the contig, and the base is complemented:
gene_nt_position = gene_contig_stop_pos − contig_pos + 1
sequence[gene_nt_position − 1] = complement(ancestral_allele)
Mutation types
N (nonsynonymous): The change alters the amino acid sequence.
S (synonymous): The position is inside a coding sequence, but the change does not alter the amino acid.
P (promoter): Not in a gene, but <250 bp upstream of a gene, where it may affect expression.
I (intergenic): Not inside a gene and not in the 250 bp window upstream of one.
U (undetermined): The position is inside an annotated feature, but the effect is unknown because the gene is not a coding gene (e.g., in rRNA). Positions typed U are excluded from dN/dS.
SNV calling filters
More details on how all of these filters work can be found on the page describing How SNVs are called. The nine filter columns are not pass/fail flags. 0 means the position passed the check, 1 means the position failed the check, and -1 means the position had already been ruled out before that check.
Column |
Description |
|---|---|
|
The final AccuSNV call |
|
The AccuSNV CNN’s call, |
|
Whether the rule-based WideVariant filters called a variant ( |
|
The network’s probability, between 0 and 1, or |
|
SNV bcftools quality (default: better than 30). |
|
Whether the site has reads on both strands (default: at least 5x per strand). |
|
Whether the site’s reads within a sample agree (default: at least 85%). |
|
Whether too many reads at the site contain an indel (default: fewer than 33%). |
|
Whether too few samples have a base call at the site (default: no minimum). |
|
Whether the site is below minimum median depth across samples (default: at least 5x). |
|
Whether there is abnormally high coverage at the site (default: under 4x the genome median on average, 7x in any sample). |
|
Whether any sample differs from the inferred ancestor with at least |
|
Whether samples with the alternative allele have unusually low or high coverage compared to samples with the reference allele at the site. |
|
|
|
Whether enough samples have clonal read support (not mixed) at the site. |
|
The CNN’s call before AccuSNV rewrote |
|
The network’s probability before AccuSNV rewrote |
|
Why the CNN never scored the site: |
|
The one stage that dropped the site, or |
When CNN_pred is rewritten
CNN_pred and CNN_prob are the CNN’s outcome after AccuSNV has reconciled it with the rule-based filters, so they are not always what the network produced. There are two rewrites:
If
Qual_filterfailed. The site is dropped no matter what andCNN_predandCNN_probare both set to0.If the WideVariant filters called the site, the network did not, and the read mappings were rarely ambiguous. Then,
CNN_predbecomes1andCNN_probbecomes one minus the original probability (or1.0if the network never scored the site).
CNN_pred_raw and CNN_prob_raw have the values from before either rewrite, so comparing the two pairs tells you which sites AccuSNV overruled. snv_table_cnn_raw.tsv has the same numbers for the sites the network scored.
Removed_by column interpretation
The Removed_by column can tell you the reasons why a site was eliminated as a potential SNV.
Value |
Interpretation |
|---|---|
|
|
a filter name, e.g. |
The first of the WideVariant filters checks to fail, which caused the site to fail. |
|
The CNN could not score the site. |
|
The CNN did not score the site and no filter had failed. |
|
The filters called it and the network did not, but |
|
Only the CNN rejected the site. |
Detailed SNV annotations
Column |
Example |
Meaning |
|---|---|---|
|
|
The gene number across the whole genome (not restarting between contigs). |
|
|
The gene number per contig, restarting at 1 on each contig. |
|
|
The ‘best’ pair mutation quality for this position: across all pairs of ingroup samples with different alleles, takes the lower quality for each pair, then the highest pair quality. |
|
Any annotation ontology from the annotation file. |
|
|
|
|
|
|
The first base of the gene on the contig. |
|
|
Last base of the gene on the contig. |
|
|
The codon number of the affected amino acid within |
|
|
The four codons this position could produce if the changed base were A, T, C, then G, in that order. |
|
|
The amino acid each of those four possible codons encodes, in the same order. |
|
|
The gene’s coding sequence. Reverse-complemented for a reverse-strand gene, so it always reads in gene orientation. |
|
|
The protein sequence for the gene. |
Sample allele columns
There is also one column per sample, named as in your sample sheet, showing the base that AccuSNV finds at the SNV position in that sample. These calls are rebuilt with looser thresholds than the ones used to decide whether the position is a SNV: a base call needs a quality of 30, at least one read on each strand, and a major-allele frequency of 0.75 (set by annotate_min_major_allele_freq). These columns tell you what was observed at a SNV the overall data has already determined to be real, so the per-sample thresholds can be relaxed. If a sample still does not pass them, it gets an N here.
Raw CNN probabilities for SNVs
The file 2-SNV-filtering/group_<group>/snv_table_cnn_raw.tsv is the CNN’s raw output, and has three columns:
genome_pos CNN_pred CNN_prob
11476 1 0.999974250793457
96058 1 0.9999998807907104
This is the best place to identify the raw CNN probability each site received, as these probabilities are later processed by AccuSNV and combined with the WideVariant filters.
In fast mode, with >100,000 candidate positions by default, this file is the main result and is copied to snv_table_final.tsv in place of the usual annotated table.