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

Seem to have fixed simreads issue of rng not handling large enough values #61

Merged
merged 2 commits into from
Oct 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions data/md5sum.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
8dc13cfc9c7af9c5ed368d5e2462275e tests/reads_1.fq
04f73fa36d90fbe9e157e5c3214e585a tests/reads.mstats
da3003dc18e6ecfcf0586705444ca6f8 tests/reads_pbat_pe_1.fq
bbfd18b0cc7cf93ad4ed317ef996f3ee tests/reads_pbat_pe_2.fq
7d2e72d75fe2e55f978dffa76a492c61 tests/reads_pbat_pe.mstats
2415d44925cc23fa60a0d78c9af04509 tests/reads_pbat_pe.sam
d49efb9f420b4edeb4647217fa247e6d tests/reads_pe_1.fq
3627c807f259109ea0c4c2b7bcd12320 tests/reads_pe_2.fq
0efe8fb80106f2edb370e8f7e7c1bbb6 tests/reads_pe.mstats
3c10bd0ce3f7d458a05a334a351d96ff tests/reads_pe.sam
3dd98274d8b707878aaad8246c6df9f6 tests/reads_rpbat_pe_1.fq
fcf5e4d93ac62dafcfb279e95103ad0e tests/reads_rpbat_pe_2.fq
19329a8ec659a82dc82e56a0ca6999b0 tests/reads_rpbat_pe.mstats
c6980b863b86d7e491e3f9358943bcd3 tests/reads_rpbat_pe.sam
0f2ad3720fd50961494222a3cf1dbef1 tests/reads.sam
e95a8739a378bc5628c76ffbe8293682 tests/reads_1.fq
447647120a08d3b58162414fae4f4a39 tests/reads.mstats
5487eb32b5492ddba3a95a8461e2ff4c tests/reads_pbat_pe_1.fq
aff19aeae4184c38cf364b3a94527098 tests/reads_pbat_pe_2.fq
d5edb7b66a5db666c98b9954306bbc09 tests/reads_pbat_pe.mstats
6976cb8096a7b36dde542dff893271bc tests/reads_pbat_pe.sam
514bf940e7d5f44e57291a75e1fc6629 tests/reads_pe_1.fq
64e17fc1e424f9cb21879d38ddf745e5 tests/reads_pe_2.fq
e36536c8320a2acbaa66efa0baec145a tests/reads_pe.mstats
4fbbd861d63acee0e01aae8d0d7d071c tests/reads_pe.sam
e94e71292fccd255bad3f3694efe7a4b tests/reads_rpbat_pe_1.fq
8bfa00acd0639dc66acd5aa8ac0369d5 tests/reads_rpbat_pe_2.fq
cc99b34bdb1f878d9d49e4140aa8fb19 tests/reads_rpbat_pe.mstats
a0644d10b10bbe96f2fa295f4c02486f tests/reads_rpbat_pe.sam
e7a2a3690bc17de0881e7fb2623841ec tests/reads.sam
bcbf01be810cbf4051292813eb6b9225 tests/tRex1.idx
8 changes: 5 additions & 3 deletions src/simreads.cpp
Original file line number Diff line number Diff line change
@@ -66,13 +66,15 @@ namespace simreads_random {
// implementations of rand() on different OS meant that even with
// the same seed, the results could be different. This meant testing
// didn't work.

std::random_device rd;
std::mt19937 e;
bool initialized = false;
std::default_random_engine e;
std::uniform_real_distribution<double> dr;
std::uniform_int_distribution<uint64_t> di;
void
initialize(const size_t the_seed) {
e = std::default_random_engine(the_seed);
initialize([[maybe_unused]] const size_t the_seed) {
e = std::mt19937(the_seed);
initialized = true;
}