mirror of
https://github.com/quadram-institute-bioscience/readfx
synced 2026-01-13 09:31:34 +00:00
No description
| .github/workflows | ||
| benchmark | ||
| docs | ||
| readfx | ||
| src | ||
| tests | ||
| .gitignore | ||
| LICENSE | ||
| readfx.nim | ||
| readfx.nimble | ||
| README.md | ||
ReadFX - Nim FASTQ/FASTA Parser
The Nim FASTA/FASTQ parsing library for SeqFu.
Installation
nimble install readfx
Usage
import readfx
# Using the C wrapper (klib)
for record in readFQ("example.fastq"):
echo record.name, ": ", record.sequence.len
# Using pointer-based version (more efficient, reuses memory)
for record in readFQPtr("example.fastq.gz"):
echo $record.name, ": ", $record.sequence.len
# Using the native Nim implementation
var r: FQRecord
var f = xopen[GzFile]("example.fastq.gz")
defer: f.close()
while f.readFastx(r):
echo r.name, ": ", r.sequence.len
# Reading paired-end FASTQ files
for pair in readFQPair("sample_R1.fastq.gz", "sample_R2.fastq.gz"):
echo "R1: ", pair.read1.name, " (", pair.read1.sequence.len, " bp)"
echo "R2: ", pair.read2.name, " (", pair.read2.sequence.len, " bp)"
Authors
- Original library by Heng Li (kseq.h) and Andreas Wilm (readfq)
- Updated and maintained by Andrea Telatin and the Quadram Institute Bioscience Core Bioinformatics team
- Co-authored by Claude code