Expand description
Single source of truth for file-format/compression detection and the mappings derived from
it. Before this module existed, extension->format detection, the compression-level defaults,
and the OutputFormat->noodles Format mapping were each duplicated across reads.rs,
fastx.rs, and alignment/io.rs, with no guarantee the copies agreed.
Enums§
- Output
Encoding - What
crate::source::RecordSource::filter_reads_intoshould encode records as. Threading this through (rather than a rawOption<Format>+boolpair) means implementations that can never receive alignment output (e.g.crate::fastx::Fastx) don’t need to reason about the noodlesFormattype at all.
Functions§
- default_
compression_ level - The default compression level rasusa uses for a given compression format, when the user hasn’t requested a specific level.
- infer_
compression_ format - Infers a compression format from a path’s extension (e.g.
.gz-> Gzip), falling back tocompression::Format::Nofor an unrecognised or absent extension. - infer_
format_ from_ char - Infers an alignment
Formatfrom a single character/word (case-insensitive), for CLI value parsing. - infer_
format_ from_ path - Infers an alignment
Formatfrom a path’s extension (.sam/.bam/.cram). - is_
fasta_ extension - Whether
pathnames a FASTA file, based on its extension (a trailing compression extension such as.gzis stripped first). - is_
fasta_ output - Whether output should be written as FASTA, given an explicit
--output-format(if any) and a path to fall back to extension-based detection with when no explicit choice was made. - output_
alignment_ format - Maps a CLI-level
--output-formatselection to the noodles alignmentFormatit corresponds to. ReturnsNonefor FASTA/FASTQ selections or when no--output-formatwas given - callers fall back to extension-based inference (infer_format_from_path) in that case.