summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-06-03 18:52:11 +0530
committerArun Isaac2022-06-03 18:52:11 +0530
commit671b0ac68fee8c4268ed5a48b5256a0bf9da7cd6 (patch)
treed3e92121da88790fd785552160bbbcdf14dfb9a8
parentb0dd2e92991a0bed1c97c63ac8e0e82ce1c0453f (diff)
downloadgn-gemtext-671b0ac68fee8c4268ed5a48b5256a0bf9da7cd6.tar.gz
topics: Document genotype databases.
* topics/genotype-database.gmi: New file.
-rw-r--r--topics/genotype-database.gmi19
1 files changed, 19 insertions, 0 deletions
diff --git a/topics/genotype-database.gmi b/topics/genotype-database.gmi
new file mode 100644
index 0000000..c3f7691
--- /dev/null
+++ b/topics/genotype-database.gmi
@@ -0,0 +1,19 @@
+# Genotype database
+
+GeneNetwork has been using a plain text file format to store genotypes. We are now moving to a fast read-optimized genotype database file format built on LMDB.
+=> https://www.symas.com/lmdb Lightning Memory-Mapped Database
+
+To convert a plain text GeneNetwork genotype file `BXD.geno` to a genodb genotype database `bxd`, use the `genodb` CLI tool from cl-gn like so.
+```
+./genodb import BXD.geno bxd
+```
+=> https://git.genenetwork.org/GeneNetwork/cl-gn cl-gn
+
+genenetwork3 includes a tiny Python library to read the built genodb database. Here is a sample invocation reading row 17 from a database at `/tmp/bxd`.
+```
+from gn3 import genodb
+
+with genodb.GenotypeDatabase('/tmp/bxd') as db:
+ matrix = db.matrix()
+ print(matrix.row(17))
+```