Skip to main content

Module input

Module input 

Source
Expand description

Opening an input and reading it as batches of raw FASTA records.

Pipeline: the stored bytes are read once (files, FIFOs, <(…) and standard input alike) and teed to a SHA-256 thread; the format is recognised from the first bytes (gzip/BGZF, bzip2, Zstandard or plain text; unsupported formats, xz among them (D116), get an explicit error with a hint); the decompressed text has one UTF-8 byte-order mark and the blank lines before the first record removed (UTF-16/32 is refused with an iconv hint); and seq_io splits it into records, which are copied byte for byte into batches for the parallel normaliser. Every structural error stops the run with the source and as much of the record, line and byte as applies.

Structs§

BatchLimits
Limits of the batches after the first.
BatchReader
Splits the text into batches of records.
ChecksumJob
The SHA-256 of the stored bytes, computed on its own thread.
Opened
An opened input, ready to be read as batches.
RawBatch
A batch of consecutive records sharing one buffer.
RawRecord
A record copied verbatim from the input: >header line and sequence lines.

Enums§

Source
Where an input comes from.

Constants§

COMPRESSION_EXTENSIONS
Extensions of the compressions DiMA reads (file dialogs offer them).
FASTA_EXTENSIONS
Extensions of FASTA alignments.

Functions§

is_descriptor_alias
true for a path that names an open descriptor rather than a file: /dev/stdin, /dev/stdout, /dev/stderr, /dev/fd/N (process substitution, <(...)) and /proc/<pid>/fd/N. Its file name is a descriptor number chosen by the shell, so it names nothing (D45: such inputs are named like standard input).
open
Opens source for reading.
query_name_from_source
The query name implied by an input’s file name (D45): the file name without known compression and FASTA extensions, or None for standard input or an empty stem.
sha256_file
Reads a whole regular file’s checksum without parsing it (used by tests and by the GUI’s change detection).