compress_sequence

Function compress_sequence 

Source
pub fn compress_sequence(sequence: &str) -> Vec<u8> 
Expand description

Compresses a DNA sequence into a vector of bytes.

The DNA sequence is compressed by representing each base (A, C, T, G) with 2 bits. The compressed data starts with a 4-byte (u32) integer representing the length of the original sequence.

§Arguments

  • sequence - A string slice that holds the DNA sequence.

§Returns

A vector of bytes containing the compressed DNA sequence.