The Bravo variant browser allows authorized access to its data through an API. Two levels are supported:
curl
. What it is for
What it is not for
In this tutorial we will introduce to you the high level API access to Bravo variant browser. We will cover how to:
bravo
command line tool from https://bravo.sph.umich.edu/freeze5/hg38/static/tools/bravo. Note: before using the tool, you may need to make it executable with chmod +x bravo
command on Linux or MacOS. Windows users need to download bravo.exe
command line tool from https://bravo.sph.umich.edu/freeze5/hg38/static/tools/windows/bravo.exe../bravo login
and follow the instructions on your screen. Windows users run bravo.exe login
.A single variant can be retrieved from Bravo using the ./bravo query-variant
command.
Execute ./bravo quert-variant -h
to see all available options:
You can retrieve variant by its identifier CHROM-POSITION-REF-ALT if you know its alleles. The default output format is JSON.
./bravo query-variant -v 22-16389447-A-G
Alternatively, you can retrieve variant by rs#.
Or, you can retrieve a variant by chromosome name and position. In this way, you will see all possible alleles if a variant is multi-allelic.
./bravo query-variant -c 22 -p 16390137
Bravo API supports VCF output as well. Enable it with -o
or --output
option.
./bravo query-variant -c 22 -p 16390137 -o vcf
All variants inside a region can be retrieved from Bravo using ./bravo query-region
command.
./bravo query-region -c 22 -s 16387675 -e 16390908 -o vcf
All variants inside a gene can be retrieved from Bravo using ./bravo query-gene command.
./bravo query-gene -n ABCD1P4 -o vcf
The bravo
commands query-gene
, query-region
, and annotate
(covered later) support result filtering by specified expression.
Let's retrieve all singletons in ABCD1P4 gene.
./bravo query-gene -n ABCD1P4 -f "allele_count==1" -o vcf
There are 478 singletons in this gene. Now, let's look how many of them did't pass filtering.
./bravo query-gene -n ABCD1P4 -f "allele_count==1&filter!=PASS" -o vcf
26 out of 476 singletons in ABCD1P4 gene didn't pass quality filters.
Bravo supports ==, !=, <, >, <=, >= comparison operators applicable to allele_count
(AC
in VCF), allele_freq
(AF
in VCF), allele_num
(AN
in VCF), site_quality
(QUAL
in VCF) and filter
(FILTER
in VCF) variant attributes.
If you have a list of candidate variants, then you can annotate them with inforomation from Bravo using the bravo annotate
command. Your list of variants must be in VCF format and preferrably sorted by position (for the best performance).
Download the list of ClinVar variants in APOE gene from https://bravo.sph.umich.edu/freeze5/hg38/static/tools/tutorial/clinvar_20180401_APOE.vcf. To annotate this list with allele frequences from Bravo, run the following command on Linux or Mac OS X:
cat clinvar_20180401_APOE.vcf | ./bravo annotate > clinvar_20180401_APOE_Bravo.vcf
and on Windows:
type clinvar_20180401_APOE.vcf | ./bravo annotate > clinvar_20180401_APOE_Bravo.vcf
The BRAVO_AC
, BRAVO_AN
, BRAVO_AF
, and BRAVO_FILTER
keys will be appended to the INFO
field for every variant from your list which is also present in Bravo.