• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.gitignoreH A D18-Jun-201822 54

LICENSEH A D18-Jun-20181.1 KiB2019

MakefileH A D03-May-2022608 2414

README.mdH A D18-Jun-20181.7 KiB6236

khash.hH A D18-Jun-201818.3 KiB549243

kseq.hH A D18-Jun-20188.2 KiB244192

seqtk.cH A D18-Jun-201853.5 KiB1,7271,586

README.md

1Introduction
2------------
3
4Seqtk is a fast and lightweight tool for processing sequences in the FASTA or
5FASTQ format. It seamlessly parses both FASTA and FASTQ files which can also be
6optionally compressed by gzip. To install `seqtk`,
7```sh
8git clone https://github.com/lh3/seqtk.git;
9cd seqtk; make
10```
11The only library dependency is zlib.
12
13Seqtk Examples
14--------------
15
16* Convert FASTQ to FASTA:
17
18        seqtk seq -a in.fq.gz > out.fa
19
20* Convert ILLUMINA 1.3+ FASTQ to FASTA and mask bases with quality lower than 20 to lowercases (the 1st command line) or to `N` (the 2nd):
21
22        seqtk seq -aQ64 -q20 in.fq > out.fa
23        seqtk seq -aQ64 -q20 -n N in.fq > out.fa
24
25* Fold long FASTA/Q lines and remove FASTA/Q comments:
26
27        seqtk seq -Cl60 in.fa > out.fa
28
29* Convert multi-line FASTQ to 4-line FASTQ:
30
31        seqtk seq -l0 in.fq > out.fq
32
33* Reverse complement FASTA/Q:
34
35        seqtk seq -r in.fq > out.fq
36
37* Extract sequences with names in file `name.lst`, one sequence name per line:
38
39        seqtk subseq in.fq name.lst > out.fq
40
41* Extract sequences in regions contained in file `reg.bed`:
42
43        seqtk subseq in.fa reg.bed > out.fa
44
45* Mask regions in `reg.bed` to lowercases:
46
47        seqtk seq -M reg.bed in.fa > out.fa
48
49* Subsample 10000 read pairs from two large paired FASTQ files (remember to use the same random seed to keep pairing):
50
51        seqtk sample -s100 read1.fq 10000 > sub1.fq
52        seqtk sample -s100 read2.fq 10000 > sub2.fq
53
54* Trim low-quality bases from both ends using the Phred algorithm:
55
56        seqtk trimfq in.fq > out.fq
57
58* Trim 5bp from the left end of each read and 10bp from the right end:
59
60        seqtk trimfq -b 5 -e 10 in.fa > out.fa
61
62