Skip to content

Finish caching support for ScoreServer #10

@welchr

Description

@welchr

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();
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions