Defines the BitString class for compact character string storage and comparison.
A class to store strings compactly into integers, packing multiple characters into a single word.
T * alloc_to_device(size_t size)
Allocates memory on the CUDA device.
BitString< Nucleotide, 2 > Gene
A specialized BitString for representing genetic sequences.
Contains utilities for working with genetic data and file formats.
Gene from_file(const std::string &filename)
Loads a gene from a file with automatic format detection.
static const std::string DNA_BIN_COMBINED_EXTENSION
File extension for combined binary DNA files.
Gene from_gbk(const std::string &filename)
Loads a gene from a GenBank format file.
static const std::string DNA_BIN_SIZES_EXTENSION
File extension for binary DNA file size information.
std::vector< std::filesystem::path > get_virus_nucleotide_paths()
Gets paths to all virus nucleotide files in the virus directory.
Gene from_dna(const std::string &filename)
Loads a gene from a plain text DNA format file.
void to_dna(const Gene &gene, const std::string &filename)
Saves a gene to a plain text DNA format file.
static const std::string GBK_EXTENSION
File extension for GenBank format files.
static const std::string DNA_EXTENSION
File extension for plain text DNA files.
static const std::string FNA_EXTENSION
File extension for FASTA nucleotide format files.
FileType get_file_type(const std::string &filename)
Determines the file type based on its filename extension.
std::vector< std::string > get_dna_strings_from_directory(const std::string &dirname)
Extracts DNA strings from all supported files in a directory.
Gene from_stream(std::istream &stream)
Loads a gene from an input stream.
static const std::string VIRUS_DIRECTORY
Path to the virus genome data directory.
static const std::string GENETIC_DIRECTORY
Path to the genetic data directory.
Gene from_fna(const std::string &filename)
Loads a gene from a FASTA nucleotide format file.
FileType
Enumerates the supported genetic file formats.
@ DNA
Plain text DNA format (.dna)
@ UNKNOWN
Unknown or unsupported file format.
@ FNA
FASTA nucleotide format (.fna)
@ DNA_BIN_COMBINED
Combined binary DNA format (.dna.bin.combined)
@ DNA_BIN
Binary DNA format (.dna.bin)
@ GBK
GenBank format (.gbk)
std::vector< Gene > from_directory(const std::string &dirname)
Loads all genes from files in a directory with automatic format detection.
static const std::string DNA_BIN_EXTENSION
File extension for binary DNA files.
void combine_dna_bin_files(const std::string &dirname, const std::string &combined_filename)
Combines multiple binary DNA files into a single combined file.
static const std::string ABC_HUMI_DIRECTORY
Path to the ABC-HuMi dataset directory.
Defines nucleotide representation and related utility functions.
Structure to track information about a gene in the combined file.
std::string name
Name or identifier of the gene.
std::streampos position
File position where the gene data begins.
size_t size
Size of the gene data in bytes.
Manages efficient loading of multiple genetic sequences from a combined file.
std::string m_path
Path to the combined binary file.
void load_sizes()
Loads gene size information from the companion file.
std::vector< GeneInfo > m_gene_infos
Index of all genes in the combined file.
std::vector< Gene > get_random_genes(size_t count) const
Retrieves a random subset of genes from the combined file.
void save_sizes()
Saves the size information of genes to a companion file.
~GeneManager()
Destructor for GeneManager.
std::ifstream m_file
File stream for reading gene data (mutable to allow const methods to read)
std::vector< Gene > all_genes() const
Retrieves all genes from the combined file.