module Fastx
Defined in:
fastx.crfastx/exceptions.cr
fastx/fasta.cr
fastx/fasta/reader.cr
fastx/fasta/writer.cr
fastx/fastq.cr
fastx/fastq/reader.cr
fastx/fastq/writer.cr
fastx/format.cr
fastx/version.cr
Constant Summary
-
VERSION =
{{ (`shards version /home/runner/work/fastx.cr/fastx.cr/src/fastx`).chomp.stringify }}
Class Method Summary
-
.decode_bases(bases : Enumerable(UInt8)) : String
Converts a UInt8 array (ASCII codes) to a DNA string.
-
.decode_phred(scores : Enumerable(UInt8), offset = 33) : String
Converts an array of Phred scores to a quality string.
-
.encode_bases(sequence : IO::Memory | String) : Slice(UInt8)
Converts a DNA sequence (String or IO::Memory) to a UInt8 slice, where each base is encoded as a single byte (A, C, G, T, N → 65, 67, 71, 84, 78; others → 78).
-
.encode_phred(quality : String, offset = 33) : Array(UInt8)
Converts a quality string to an array of Phred scores.
-
.normalize_base(c : UInt8) : UInt8
Normalizes a single base character to uppercase ACGTN.
-
.open(filename : Path | String, mode = "r", format : Format | Nil = nil, &)
Opens a FASTA/FASTQ file with automatic format detection or explicit format.
-
.open(filename : Path | String, mode = "r", format : Format | Nil = nil)
Opens a FASTA/FASTQ file with automatic format detection or explicit format.
Class Method Detail
Converts a UInt8 array (ASCII codes) to a DNA string.
Converts an array of Phred scores to a quality string.
Converts a DNA sequence (String or IO::Memory) to a UInt8 slice, where each base is encoded as a single byte (A, C, G, T, N → 65, 67, 71, 84, 78; others → 78). This representation is suitable for byte-wise or array processing.
Converts a quality string to an array of Phred scores.
Normalizes a single base character to uppercase ACGTN. Non-ACGTN characters are converted to N (78u8).
Opens a FASTA/FASTQ file with automatic format detection or explicit format. Yields the appropriate Reader/Writer to the block and automatically closes it.
Opens a FASTA/FASTQ file with automatic format detection or explicit format. Returns the appropriate Reader/Writer instance (manual close required).