34 releases (18 breaking)
|0.20.0||Sep 18, 2023|
|0.18.0||Sep 12, 2023|
|0.14.1||Jul 31, 2023|
#17 in Biology
767 downloads per month
Used in 2 crates
Genome annotation with Rust and RocksDB.
Annona (from Taíno annon) is a genus of flowering plants in the pawpaw/sugar apple family, Annonaceae. It is the second largest genus in the family after Guatteria, containing approximately 166 species of mostly Neotropical and Afrotropical trees and shrubs.
Running the CLI
You can enable the annonars CLI by building the project with the
cli feature (easiest done with
Working with TSV Files
When built with the
annonars allows you to to import variant annotations from TSV files into RocksDB databases.
This allows you to import variant annotation TSVs as provided by CADD or dbNSFP.
Variants are specified in SPDI representation as described in Holmes et al. 2020.
All variants in one file refer to the same genome build.
You can import TSV files using
For example, to import the "CADD with all annotations" file, you can use the following:
--path-in-tsv InDels_inclAnno.tsv.gz \ --path-in-tsv whole_genome_SNVs_inclAnno.tsv.gz \ --path-out-rocksdb cadd-rocksdb \ --genome-release grch37 \ --db-name cadd \ --db-version 1.6 \ --col-chrom Chrom \ --col-start Pos \ --col-ref Ref \ --col-alt Alt \ --skip-row-count=1 \ --inference-row-count 100000 \ --add-default-null-values
- Set the genome release of the database to
- Set the meta information about data name and version to
- Use the columns
Altto specify the variant.
- The CADD files start with a copyright line above the columns header so we skip one row.
- Use the first 100,000 rows to infer the data types of the columns.
- Specify the default set of null values (
-) to be used for missing values.
annonars will first try to infer the schema from the first 100,000 rows.
It will then import the data into a RocksDB database.
The resulting schema will be dumped in JSON format.
If necessary, you can also specify a file with the schema in JSON file to use as a seed for the schema inference.
You might need to do this if you see an
"Unknown" type in the schema.
At the end, the database will be compacted, which may take some time but is necessary to reduce the size of the database and ensure that it can be read in read-only note.
After everything is done, you will have to manually look for a file matching
*.log in the output RocksDB directory.
This is the write-ahead log (WAL) of RocksDB file and can be safely deleted (it should be zero-sized if everything went well).
Here is how you can import dbNSFP. Note that you will have to build one RocksDB database per genome release that you want to use for lookup.
$(for f in dbNSFP4.4a_variant.*.gz; do echo --path-in-tsv $f; done) \ --path-out-rocksdb dbnsfp-rocksdb \ --genome-release grch37 \ --db-name dbnsfp \ --db-version 4.4a \ --col-chrom hg19_chr \ --col-start hg19_pos(1-based) \ --col-ref ref \ --col-alt alt \ --inference-row-count 100000 \ --null-values=.
annonars can use tabix indices to speedup database building.
If there is a
.tbi file for each of the input files then
annonars will use it and perform import in a parallel fashion based on genome windows.
annonars will import all input files in parallel (yet read through each file sequentially).
By default, one thread for each CPU core on the system is used.
You can control the number of threads to use by setting the environment variable
You can query the rocksdb databases using
tsv query, either based on a variant, a position (all variants at the position), or a region.
annonars uses SPDI-style coordinates (1-based, inclusive) for all queries.
You can optionally prefix your query with a gnome release (comparison is done case insensitive) and
annonars will check whether the database matches the genome release.
Managing GitHub Project with Terraform
v1 token in the protobuf schema refers to the internal version of the protocol buffer and not the version of, e.g., gnomAD.