Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finish caching support for ScoreServer #10

Open
welchr opened this issue Mar 25, 2019 · 0 comments
Open

Finish caching support for ScoreServer #10

welchr opened this issue Mar 25, 2019 · 0 comments

Comments

@welchr
Copy link
Member

welchr commented Mar 25, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant