Most of the code for caching score statistic segments has been implemented, but it needs to be finished/tested.
For now, the server seems to be "fast enough" for the small regions/numbers of genes we're handling. It may become more necessary however as testing on real data continues.
Relevant parts:
|
//string segment_key = make_segment_cache_key(genotype_dataset_id, phenotype_dataset_id, phenotype, samples_name, segment->get_chromosome(), segment->get_start_bp(), segment->get_stop_bp()); |
|
string ScoreServer::make_segment_cache_key(uint32_t genotype_dataset_id, uint32_t phenotype_dataset_id, const string& phenotype_name, const string& samples_name, const string& chromosome, uint64_t start_bp, uint64_t stop_bp) { |
|
stringstream os(ios::binary | ios::out); |
|
os.write(reinterpret_cast<const char*>(&genotype_dataset_id), sizeof(genotype_dataset_id)); |
|
os.write(reinterpret_cast<const char*>(&phenotype_dataset_id), sizeof(phenotype_dataset_id)); |
|
os.write(phenotype_name.c_str(), phenotype_name.size()); |
|
os.write(samples_name.c_str(), samples_name.size()); |
|
os.write(chromosome.c_str(), chromosome.size()); |
|
os.write(reinterpret_cast<const char*>(&start_bp), sizeof(start_bp)); |
|
os.write(reinterpret_cast<const char*>(&stop_bp), sizeof(stop_bp)); |
|
os.flush(); |
|
return os.str(); |
|
} |
Most of the code for caching score statistic segments has been implemented, but it needs to be finished/tested.
For now, the server seems to be "fast enough" for the small regions/numbers of genes we're handling. It may become more necessary however as testing on real data continues.
Relevant parts:
LDServer/core/src/ScoreServer.cpp
Line 192 in 9a94a7d
LDServer/core/src/ScoreServer.cpp
Lines 91 to 102 in 9a94a7d