|
Zip and Skip Tries
|
Manages efficient loading of multiple genetic sequences from a combined file. More...
Classes | |
| struct | GeneInfo |
| Structure to track information about a gene in the combined file. More... | |
Public Member Functions | |
| GeneManager (const std::string &path) | |
| Constructs a GeneManager for accessing genes in the specified path. | |
| ~GeneManager () | |
| Destructor for GeneManager. | |
| std::vector< Gene > | all_genes () const |
| Retrieves all genes from the combined file. | |
| std::vector< Gene > | get_random_genes (size_t count) const |
| Retrieves a random subset of genes from the combined file. | |
Private Member Functions | |
| void | save_sizes () |
| Saves the size information of genes to a companion file. | |
| void | load_sizes () |
| Loads gene size information from the companion file. | |
Private Attributes | |
| std::string | m_path |
| Path to the combined binary file. | |
| std::ifstream | m_file |
| File stream for reading gene data (mutable to allow const methods to read) | |
| std::vector< GeneInfo > | m_gene_infos |
| Index of all genes in the combined file. | |
Manages efficient loading of multiple genetic sequences from a combined file.
This class provides utilities for loading genes from a combined binary file created by combine_dna_bin_files(). It maintains an index of genes in the file for fast random access without loading the entire dataset into memory at once.
Definition at line 225 of file genetics.cuh.
| GeneManager::GeneManager | ( | const std::string & | path | ) |
Constructs a GeneManager for accessing genes in the specified path.
| path | Path to the combined binary file containing genetic sequences. |
| std::runtime_error | If the file cannot be opened or is improperly formatted. |
Definition at line 411 of file genetics.cu.
| GeneManager::~GeneManager | ( | ) |
Destructor for GeneManager.
Closes any open file streams.
Definition at line 522 of file genetics.cu.
| std::vector< Gene > GeneManager::all_genes | ( | ) | const |
Retrieves all genes from the combined file.
Definition at line 527 of file genetics.cu.
Retrieves a random subset of genes from the combined file.
| count | The number of random genes to retrieve. |
Definition at line 543 of file genetics.cu.
|
private |
Loads gene size information from the companion file.
Reads the .sizes file to populate the m_gene_infos vector with metadata about each gene in the combined binary file.
| std::runtime_error | If the sizes file cannot be opened or is corrupted. |
Definition at line 500 of file genetics.cu.
|
private |
Saves the size information of genes to a companion file.
Creates a .sizes file alongside the combined binary file that stores metadata about each gene for efficient future loading.
Definition at line 472 of file genetics.cu.
|
mutableprivate |
File stream for reading gene data (mutable to allow const methods to read)
Definition at line 267 of file genetics.cuh.
|
private |
Index of all genes in the combined file.
Definition at line 268 of file genetics.cuh.
|
private |
Path to the combined binary file.
Definition at line 266 of file genetics.cuh.