Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brentp/d4-nim
nim-lang wrapper for https://github.com/38/d4-format
https://github.com/brentp/d4-nim
bioinformatics genomics high-throughput-sequencing
Last synced: 25 days ago
JSON representation
nim-lang wrapper for https://github.com/38/d4-format
- Host: GitHub
- URL: https://github.com/brentp/d4-nim
- Owner: brentp
- License: mit
- Created: 2020-05-15T18:34:58.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-08-27T19:22:24.000Z (2 months ago)
- Last Synced: 2024-09-20T00:04:12.698Z (about 2 months ago)
- Topics: bioinformatics, genomics, high-throughput-sequencing
- Language: Nim
- Size: 22.5 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# d4-nim
This is a [nim](https://nim-lang.org) wrapper for Hao Hou's [d4](https://github.com/38/d4-format) which
can be thought of as a way to store integer data in a compressed array. A common use-case will be depth storage
and querying. His library also has a command-line depth extractor that is faster than [mosdepth](https://github.com/brentp/mosdepth).
The extracted (compressed) file can quickly queried for summary info such as mean depth of a region.Usage in nim looks like:
```Nim
var d4f:D4
doAssert d4f.open("hg002.d4")
echo d4f.chromosomes # ordered table
echo d4f.chromosomes["1"]for iv in d4f.query("1", 249_200_100):
echo iv # (tuple of start:uint32, end:uint32, value:int32)var start = 249_200_100'u32
var stop = 249_240_621'u32
# each entry in vals contains the depth for pos-start
var vals:seq[int32] = d4f.values("1", start, stop)
```