| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | f=$1; |
| 3 | |
| 4 | function NKscip-shell shell shell-project 0.0.0 NK(). (){ |
| 5 | echoscip-shell system . . echo. $(($1<<10)) |
| 6 | } |
| 7 | |
| 8 | function NMscip-shell shell shell-project 0.0.0 NM(). (){ |
| 9 | echoscip-shell system . . echo. $(($1<<20)) |
| 10 | } |
| 11 | |
| 12 | function NGscip-shell shell shell-project 0.0.0 NG(). (){ |
| 13 | echoscip-shell system . . echo. $(($1<<30)) |
| 14 | } |
| 15 | |
| 16 | |
| 17 | # echo counting k-mers (not sorted) |
| 18 | j=12 # depends on your cpus and memory |
| 19 | seqscip-shell system . . seq. 11 2 32 \ |
| 20 | | rush -v f=$f 'if [[ -e {f}.k{}.unik ]]; then exit; fi; \ |
| 21 | unikmer count -K -k {} {f} -o {f}.k{}' |
| 22 | |
| 23 | |
| 24 | echoscip-shell system . . echo. -e "k\tnum\tplain\tgzip\tunik\tcunik\tsunik"; |
| 25 | for s in $(NKscip-shell shell shell-project 0.0.0 NK(). 1) $(NMscip-shell shell shell-project 0.0.0 NM(). 1) $(NMscip-shell shell shell-project 0.0.0 NM(). 10) $(NMscip-shell shell shell-project 0.0.0 NM(). 100); do |
| 26 | seqscip-shell system . . seq. 11 2 32 \ |
| 27 | | rush -j 6 -k -v f=$f -v s=$s -v 'F={f}.k{}.unik' \ |
| 28 | 'sum=$(unikmer stats {F} -Ta | csvtk cut -t -f number | sed 1d); |
| 29 | if [[ $sum -lt {s} ]]; then exit; fi; \ |
| 30 | plain=$(unikmer head -n {s} {F} | unikmer view | wc -c); \ |
| 31 | gzip=$(unikmer head -n {s} {F} | unikmer view | gzip -c | wc -c); \ |
| 32 | unik=$(unikmer head -n {s} {F} | wc -c); \ |
| 33 | cunik=$(unikmer head -n {s} {F} | unikmer view | unikmer dump -c | wc -c); \ |
| 34 | sunik=$(unikmer head -n {s} {F} | unikmer sort | wc -c); \ |
| 35 | echo -ne "{}\t{s}\t$plain\t$gzip\t$unik\t$cunik\t$sunik\n";' |
| 36 | done |
| 37 |