read_fasta

Function read_fasta 

Source
pub fn read_fasta(filename: &str) -> Result<DataFrame, MotifError>
Expand description

Reads sequences from a FASTA format file and converts them into a Polars DataFrame.

§Arguments

  • filename - Path to the FASTA file to read

§Returns

  • Result<DataFrame> - A DataFrame with two columns:
    • “label”: The sequence identifiers (without ‘>’ prefix)
    • “sequence”: The corresponding DNA/RNA sequences in uppercase

§Errors

  • Returns MotifError::InvalidFileFormat if no sequences are found
  • Returns MotifError::DataError if DataFrame creation fails
  • Returns std::io::Error for file reading issues