# Pack Ann: bio\_db 3.1 + bio\_db\_repo 20.3.8 + lib 2.6

**URL:** <https://swi-prolog.discourse.group/t/pack-ann-bio-db-3-1-bio-db-repo-20-3-8-lib-2-6/1983>\
**Category:** Pack\
**Created:** [March 9, 2020, 12:53pm UTC](https://swi-prolog.discourse.group/t/pack-ann-bio-db-3-1-bio-db-repo-20-3-8-lib-2-6/1983 "2020-03-09T12:53:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicos](https://avatars.discourse-cdn.com/v4/letter/n/7feea3/32.png) [@nicos](https://swi-prolog.discourse.group/u/nicos)\
**Post date:** [March 9, 2020, 12:53pm UTC](https://swi-prolog.discourse.group/t/pack-ann-bio-db-3-1-bio-db-repo-20-3-8-lib-2-6/1983/1 "2020-03-09T12:53:36Z")

</div>

New version of [bio\_db](https://github.com/nicos-angelopoulos/bio_db) is now available on the pack server.

Installation

?- pack\_install( pack(bio\_db) ).

bio\_db is a pack servicing high quality biological data. The data reside with pack(bio\_db\_repo).

The pack provides data from some of the best resources for biological data, including NCBI, HGNC, EBI and STRING.  
If you install bio\_db\_repo all data is accessible, otherwise data tables will be downloaded as you need them.  
bio\_db\_repo contains 64 tables taking 270Mb of zipped space.  
Assuming Prolog-only access to data, then a maximum of 3.1 Gb of space will be used.  
The first time a Prolog table is accessed, it is (a) expanded from the zip form,  
and (b) a .qlf is generated automatically that will enable faster future loads.

Data tables are served as Prolog facts that are either loaded in memory via fast loading qlfs or served-from-disk from a variety of  
database engines (including SQLite, Berkeley and RocksDB).

Version 3.1 depends on pack(lib) 2.6, which allows packs to be composed of a hierarchy of “cells”.

Currently bio\_db serves human and mouse data.

Both  
?- use\_module( library(bio\_db) ).  
and  
?- use\_module( library(lib) ).  
?- lib(bio\_db).

load the “full” module.  
In either case, only hot-swappable code is loaded at this point.

Test with:  
?- map\_hgnc\_symb\_hgnc( ‘LMTK3’, Hgnc ).  
Hgnc = 19295.

?- lib( & bio\_db ).  
loads the skeleton of the module (prolog/bio\_db) but none of the cell files that give access to data predicates.  
This is usually how the cell files get access to the core predicates.

?- lib( bio\_db(mouse) ).  
limit access to mouse data only.

?- lib( bio\_db(hs) ).  
access to human data only.

?- lib( bio\_db(hs(hgnc)) ).  
access to the HGNC datasets for human.

As of bio\_db 2.0 all the code for fetching the data  
and preparing them to the bio\_db formats is publicaly available (auxil/build\_repo).  
On a Linux-like system a single query downloads all data  
from primary sources and transform them to bio\_db format  
(auxil/build\_repo/std\_repo.pl ?- std\_repo([]).)

links:  
(ICLP 2019 paper): [https://arxiv.org/abs/1909.08254](https://arxiv.org/abs/1909.08254)  
[http://stoics.org.uk/~nicos/packs/sware/bio\_db](http://stoics.org.uk/~nicos/packs/sware/bio_db)  
[https://github.com/nicos-angelopoulos/bio\_db](https://github.com/nicos-angelopoulos/bio_db)  
[http://stoics.org.uk/~nicos/packs/sware/bio\_db\_repo](http://stoics.org.uk/~nicos/packs/sware/bio_db_repo)  
[http://stoics.org.uk/~nicos/packs/sware/lib](http://stoics.org.uk/~nicos/packs/sware/lib)

## Nicos Angelopoulos March 9th, 2020

> **[Nicos Angelopoulos](http://stoics.org.uk/~nicos/)**
