Cool stuff the Ensembl VEP can do: Filtering

The VEP (Variant Effect Predictor) is our most popular tool and is incredibly useful for annotating genetic variants with the genes they hit and what effect they have on them. But did you know you can filter your results? Both in the web interface and using the script?

If you’re annotating variants from a sample to prioritise the variants likely to cause a rare phenotype, you probably want to use some filters. Two important filters people often use in this case are variant consequences, choosing only to look at loss of function or missense variants, and allele frequency, choosing only to look at rare or previously unseen variants.

Filtering in the web tool

To filter your variants in the web tool, you can use the filter options, which are found just above the results table. Select the field you want to filter by, choose if you want to match text, compare values or look for a list (for example of gene names or variant IDs) found in a file. In the example below, I’ve filtered by missense variants and I’m about to add another filter for allele frequency less than 5%.

The VEP will let you download your newly filtered list of variants, using the download options on the right.

Filtering with the script

If you’re using the script to annotate your variants locally, you can use the filtering script. This script will be installed along with the VEP, so no need to install anything new. Just run the command for filtering after you’ve run the VEP. For example, if I wanted to filter and see only missense variants with an allele frequency less than 5%, like I did in the web tool, I could run the command:

./filter_vep -i out.txt -o out_filtered.txt -filter "Consequence is missense_variant" and "AF < 0.05"