fastx
Version, currently 0.3.08 versions
github.com/bio-cr/fastx.cr
FASTA/FASTQ reader and writer for Crystal.
2 stars
3 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
fastx:
github: bio-cr/fastx.cr
version: ~> 0.3.0Then run:
shards installshard.yml
- Crystal
- no constraint declared
- License
- MIT
- Author
- kojix2
Dependencies
Development Dependencies
- ameba*github: crystal-ameba/amebadev
README
Fastx.cr
Small FASTA/FASTQ I/O for Crystal.
Installation
Add this to shard.yml:
dependencies:
fastx:
github: bio-cr/fastx.cr
Then run:
shards install
Features
- Read and write FASTA
- Read and write FASTQ
- Auto-handle gzip when the path ends with
.gz - Iterate with owned
Stringvalues or lower-allocation borrowedBytes - Stream large records line by line without accumulating full sequences
- Encode/decode nucleotide bases and FASTQ quality scores
Quick Start
Read FASTA:
require "fastx"
Fastx::Fasta::Reader.open("reads.fa.gz") do |reader|
reader.each do |header, sequence|
puts "#{header}\t#{sequence.bytesize}"
end
end
Read FASTQ:
Fastx::Fastq::Reader.open("reads.fq.gz") do |reader|
reader.each do |identifier, sequence, quality|
puts "#{identifier}\t#{sequence.bytesize}\t#{quality.bytesize}"
end
end
Write FASTA:
Fastx::Fasta::Writer.open("out.fa", line_width: 80) do |writer|
writer.write("seq1", "ACGTACGT")
end
Write FASTQ:
Fastx::Fastq::Writer.open("out.fq.gz") do |writer|
writer.write("seq1", "ACGT", "!!!!")
end
Guides
- Getting started
- Reading FASTA and FASTQ
- Writing FASTA and FASTQ
- Streams and limits
- Base and quality encoding
License
MIT License
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.3.0- Tagged
- Jun 26, 2026
- Commit
79d059fa7bc9- Indexed
- yes
Dependents
Repository
github.com/bio-cr/fastx.cr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 15, 2026
- Synced
- Aug 14, 2026
- Versions
- 8