Skip to content
/ yak Public
forked from lh3/yak

Yet another k-mer analyzer

License

Notifications You must be signed in to change notification settings

moraarut/yak

This branch is up to date with lh3/yak:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f389bad · Apr 1, 2024

History

71 Commits
Oct 11, 2019
Oct 7, 2019
Oct 11, 2019
Jul 17, 2020
Apr 30, 2023
May 1, 2023
Mar 9, 2020
Feb 27, 2020
Oct 7, 2019
Dec 25, 2021
Mar 11, 2020
May 1, 2023
Apr 30, 2023
Feb 27, 2020
Oct 7, 2019
Feb 27, 2020
Oct 7, 2019
Oct 7, 2019
Oct 7, 2019
Oct 7, 2019
Apr 1, 2024
Feb 27, 2020
Apr 1, 2024
Apr 30, 2023
Feb 27, 2020
Mar 12, 2020
Dec 2, 2022
Apr 30, 2023
Apr 1, 2024

Repository files navigation

IMPORTANT: Since 3ace4ff, the format of binary k-mer dump is incompatible with the previous versions. You have to rerun yak count to generate k-mer dump in the new format.

Getting Started

# Download and compile
git clone https://github.com/lh3/yak
cd yak && make

# build k-mer hash table for assembly; count singletons
./yak count -K1.5g -t32 -o asm.yak asm.fa.gz
# build k-mer hash tables for high-coverage reads; discard singletons
./yak count -b37 -t32 -o ccs.yak ccs-reads.fq.gz
# for paired end: to provide two identical streams
./yak count -b37 -t32 -o sr.yak <(zcat sr*.fq.gz) <(zcat sr*.fq.gz)

# compute assembly or reads QV
./yak qv -t32 -p -K3.2g -l100k sr.yak asm.fa.gz > asm-sr.qv.txt
./yak qv -t32 -p sr.yak ccs-reads.fq.gz > ccs-sr.qv.txt
# compute k-mer QV for reads
./yak inspect ccs.yak sr.yak > ccs-sr.kqv.txt
# evaluate the completeness of assembly
./yak inspect sr.yak asm.yak > sr-asm.kqv.txt

# print k-mer histogram
./yak inspect sr.yak > sr.hist

# partition chrX/Y in human de novo assembly
wget -O- 'https://zenodo.org/record/7882299/files/human-chrXY-yak.tar?download=1' | tar tf -
./yak sexchr -K2g -t16 chrY-no-par.yak chrX-no-par.yak par.yak hap1.fa hap2.fa > cnt.txt
./groupxy.pl cnt.txt|awk '$4==1'|cut -f2|seqtk subseq -l80 <(cat hap1.fa hap2.fa) - > new-hap1.fa
./groupxy.pl cnt.txt|awk '$4==2'|cut -f2|seqtk subseq -l80 <(cat hap1.fa hap2.fa) - > new-hap2.fa

Introduction

Yak is initially developed for two specific use cases: 1) to robustly estimate the base accuracy of CCS reads and assembly contigs, and 2) to investigate the systematic error rate of CCS reads. It achieves the goals by comparing sequences to the k-mer spectrum of short reads or by comparing spectra. No reference genome or truth data is needed.

It is worth noting that estimating base accuracy is tricky. When the accuracy approaches Q50, both unsampled and erroneous k-mers in short reads may interfere with a naive estimator. Yak introduces an empirical model to address this issue. Its estimate is less affected by the coverage and the quality of short reads.

About

Yet another k-mer analyzer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 93.9%
  • JavaScript 3.9%
  • Makefile 1.1%
  • Perl 1.1%