Skip to main content

detect_format

Function detect_format 

Source
pub fn detect_format(path: &str) -> Result<InputFormat>
Expand description

Detects the alignment-file format from the leading magic bytes.

This check is intentionally lightweight because it runs before any expensive validation or parser setup.

§Arguments

  • path - Path to the input file.

§Returns

Ok(InputFormat::Bam) for BAM/BGZF, Ok(InputFormat::Sam) otherwise.