summary refs log tree commit diff
path: root/topics
diff options
context:
space:
mode:
authorAlexander_Kabui2025-09-04 17:44:13 +0300
committerPjotr Prins2026-01-05 11:12:10 +0100
commit4c11fa12c67091b56299a90c707d0a0af419ea27 (patch)
tree97577be01b56c92c64094797e9967a3776e5e273 /topics
parent1bad1517342aa816509c9026b033d9d9ffbf41bb (diff)
downloadgn-gemtext-4c11fa12c67091b56299a90c707d0a0af419ea27.tar.gz
feat: Add new rqtl2 topic: Using rqtl2 lmdb adapter.
Diffstat (limited to 'topics')
-rw-r--r--topics/lmms/rqtl2/using-rqtl2-lmdb-adapter.gmi67
1 files changed, 67 insertions, 0 deletions
diff --git a/topics/lmms/rqtl2/using-rqtl2-lmdb-adapter.gmi b/topics/lmms/rqtl2/using-rqtl2-lmdb-adapter.gmi
new file mode 100644
index 0000000..2fa0491
--- /dev/null
+++ b/topics/lmms/rqtl2/using-rqtl2-lmdb-adapter.gmi
@@ -0,0 +1,67 @@
+# R/qtl2 LMDB Adapter
+## Tags
+
+* assigned: alexm
+* priority: medium
+* type: feature, documentation
+* status: WIP
+* keywords: rqtl2, lmdb, adapter, cross
+
+## Description
+We want to add support for reading crosses from LMDB.
+Currently, R/qtl2 (https://kbroman.org/qtl2/) only supports reading from CSV files.
+
+## Tasks
+
+* [x] Dump genotypes to LMDB
+* [x] Dump cross metadata to LMDB
+* [-] Create a `read_lmdb_cross` adapter
+* [] Dump phenotypes to LMDB
+
+## Using the Adapter
+
+### Dumping the Genotypes
+You can find the `lmdb_matrix.py` script here:
+
+=> https://github.com/genenetwork/genenetwork3/scripts/lmdb_matrix.py
+
+```sh
+guix shell python-click python-lmdb python-wrapper python-numpy -- \
+     python lmdb_matrix.py import-genotype \
+     <path-to-genotype-file> <path-to-lmdb-store>
+````
+
+## Dumping the Cross Metadata
+
+The script can be found here:
+\=> [https://github.com/genenetwork/genenetwork3/pull/235/files](https://github.com/genenetwork/genenetwork3/pull/235/files)  # lmdb\_cross\_metadata.py
+
+You need to provide a cross file path. The currently supported formats are JSON and YAML.
+
+Example:
+
+```sh
+guix shell python-click python-lmdb python-wrapper python-pyyaml -- \
+     python dump_metadata.py dump-cross [LMDB_PATH] [CROSS_FILE_PATH] --file-format yaml/json
+
+# or
+
+python dump_metadata.py dump-cross "./test_lmdb_data" "./cross_file.json"
+```
+
+### Running the R/qtl2 LMDB Adapter Script
+
+The script `rqtl_lmdb_adapter.r` can be found here:
+=> https://github.com/genenetwork/genenetwork3/pull/235/files   # rqtl_lmdb_adapter.r
+
+```sh
+guix shell r r-thor r-rjson r-qtl2 -- \
+     Rscript [PATH_TO_ADAPTER_SCRIPT] [LMDB_PATH]
+
+# Example
+Rscript https://github.com/genenetwork/genenetwork3/pull/235/files ./lmdb_path
+```
+
+### References
+=> https://kbroman.org/qtl2/assets/vignettes/developer_guide.html
+