pax_global_header 0000666 0000000 0000000 00000000064 14142226151 0014510 g ustar 00root root 0000000 0000000 52 comment=85129eaf5fd03e88b6751d3e8e69784cdc4878af
unik-5.0.1/ 0000775 0000000 0000000 00000000000 14142226151 0012461 5 ustar 00root root 0000000 0000000 unik-5.0.1/LICENSE 0000775 0000000 0000000 00000002113 14142226151 0013466 0 ustar 00root root 0000000 0000000 Copyright (c) 2018 - 2018 Wei Shen (shenwei356@gmail.com)
The MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
unik-5.0.1/README.md 0000775 0000000 0000000 00000005536 14142226151 0013754 0 ustar 00root root 0000000 0000000 # .uniq v5
[](https://pkg.go.dev/github.com/shenwei356/uniq)
This package provides k-mer serialization methods for the package [kmers](https://github.com/shenwei356/kmers),
TaxIds of k-mers are optionally saved, while there's no frequency information.
This package is used in project [unikmer](https://github.com/shenwei356/unikmer) and [kmcp](https://github.com/shenwei356/kmcp).
## Details
K-mers (represented in `uint64` in RAM ) are serialized in 8-Byte
(or less Bytes for shorter k-mers in compact format,
or much less Bytes for sorted k-mers) arrays and
optionally compressed in gzip format with extension of `.unik`.
TaxIds are optionally stored next to k-mers with 4 or less bytes.
## Compression rate comparison
No TaxIds stored in this test.

label |encoded-kmera|gzip-compressedb|compact-formatc|sortedd|comment
:---------------|:----------------------:|:-------------------------:|:------------------------:|:----------------:|:------------------------------------------------------
`plain` | | | | |plain text
`gzip` | |✔ | | |gzipped plain text
`unik.default` |✔ |✔ | | |gzipped encoded k-mers in fixed-length byte array
`unik.compat` |✔ |✔ |✔ | |gzipped encoded k-mers in shorter fixed-length byte array
`unik.sorted` |✔ |✔ | |✔ |gzipped sorted encoded k-mers
- a One k-mer is encoded as `uint64` and serialized in 8 Bytes.
- b K-mers file is compressed in gzip format by default,
users can switch on global option `-C/--no-compress` to output non-compressed file.
- c One k-mer is encoded as `uint64` and serialized in 8 Bytes by default.
However few Bytes are needed for short k-mers, e.g., 4 Bytes are enough for
15-mers (30 bits). This makes the file more compact with smaller file size,
controled by global option `-c/--compact `.
- d One k-mer is encoded as `uint64`, all k-mers are sorted and compressed
using varint-GB algorithm.
- In all test, flag `--canonical` is ON when running `unikmer count`.
## License
[MIT License](https://github.com/shenwei356/unikmer/blob/master/LICENSE)
## History
This package was originally maintained in [unikmer](https://github.com/shenwei356/unikmer).
The magic number of binary format is still `.unikmer` for keeping compatibility.
unik-5.0.1/compression-ratio/ 0000775 0000000 0000000 00000000000 14142226151 0016136 5 ustar 00root root 0000000 0000000 unik-5.0.1/compression-ratio/.gitignore 0000664 0000000 0000000 00000000503 14142226151 0020124 0 ustar 00root root 0000000 0000000 # Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
# Test binary, build with `go test -c`
*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
*.directory
unikmer/unikmer*
unikmer/binaries*
doc/site/*
*ssshtest
*.unik
t_*
*.nextflow.log*
*.brename_detail.txt
*/Rplots.pdf
unik-5.0.1/compression-ratio/README.md 0000664 0000000 0000000 00000001433 14142226151 0017416 0 ustar 00root root 0000000 0000000 ## Compression ratio comparison
No Taxids stored.
1. Prepare a genome sequence, I used human genome chromosome X (`t_chrX.fa.gz`)
2. Computation
f=t_chrX.fa.gz
./cr2.sh $f > table.tsv
3. Plot
cat table.tsv \
| csvtk -t mutate2 -L 1 -n r_gzip -e '$gzip/$plain*100' \
| csvtk -t mutate2 -L 1 -n r_unik.default -e '$unik/$plain*100' \
| csvtk -t mutate2 -L 1 -n r_unik.compact -e '$cunik/$plain*100' \
| csvtk -t mutate2 -L 1 -n r_unik.sorted -e '$sunik/$plain*100' \
| csvtk -t cut -F -f k,num,r_* \
| csvtk -t gather -k group -v value -F -f 'r_*' \
| csvtk -t replace -f group -p 'r_' \
| csvtk -t replace -f num -p '^(.+)$' -k size.tsv -r '{kv} k-mers' \
> table.r.tsv
./plot.R
unik-5.0.1/compression-ratio/cr.jpg 0000664 0000000 0000000 00000734123 14142226151 0017256 0 ustar 00root root 0000000 0000000 JFIF ,, C
$.' ",#(7),01444'9=82<.342 C
2!!22222222222222222222222222222222222222222222222222 F"
} !1AQa"q2#BR$3br
%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz
w !1AQaq"2B #3Rbr
$4%&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz ? (
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(_ֿ*wk"{8٢F'<4k ?BZ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