Skip to content
Open
Show file tree
Hide file tree
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
Binary file modified data/1000GP_Phase3.GBR.chr22.hap.gz
Binary file not shown.
Binary file modified data/chr22.map.gz
Binary file not shown.
4 changes: 3 additions & 1 deletion src/ihs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,16 @@ void calcIhsNoMpi(
std::cout << "Calculations took " << std::chrono::duration<double, std::milli>(diff).count() << "ms" << std::endl;

auto unStd = ihsfinder->unStdIHSByLine();
auto freQs = ihsfinder->freqsByLine();

std::ofstream out2(outfile);
out2 << "Index\tID\tFreq\tiHH_0\tiHH_1\tiHS\tStd iHS" << std::endl;

for (const auto& it : res)
{
auto s = unStd[it.first];
out2 << it.first << '\t' << hm.lineToId(it.first) << '\t' << s.freq << '\t' << s.iHH_0 << '\t' << s.iHH_1 << '\t' << s.iHS << "\t" << it.second << std::endl;
auto q = freQs[it.first];
out2 << it.first << '\t' << hm.lineToId(it.first) << '\t' << q << '\t' << s.iHH_0 << '\t' << s.iHH_1 << '\t' << s.iHS << "\t" << it.second << std::endl;
}
std::cout << "# valid loci: " << res.size() << std::endl;
std::cout << "# loci with MAF <= " << minMAF << ": " << ihsfinder->numOutsideMaf() << std::endl;
Expand Down
4 changes: 3 additions & 1 deletion src/ihs_mpi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ void calcIhsMpi(
IHSFinder::LineMap res = ihsfinder->normalize();

auto unStd = ihsfinder->unStdIHSByLine();
auto freQs = ihsfinder->freqsByLine();

/*std::ofstream out(outfile);
out << "Location\tiHH_0\tiHH_1\tiHS" << std::endl;
Expand All @@ -165,7 +166,8 @@ void calcIhsMpi(
for (const auto& it : res)
{
auto s = unStd[it.first];
out2 << it.first << '\t' << hap.lineToId(it.first) << '\t' << s.freq << '\t' << s.iHH_0 << '\t' << s.iHH_1 << '\t' << s.iHS << "\t" << it.second << std::endl;
auto q = freQs[it.first];
out2 << it.first << '\t' << hap.lineToId(it.first) << '\t' << q << '\t' << s.iHH_0 << '\t' << s.iHH_1 << '\t' << s.iHS << "\t" << it.second << std::endl;
}
std::cout << "# valid loci: " << res.size() << std::endl;
std::cout << "# loci with MAF <= " << minMAF << ": " << ihsfinder->numOutsideMaf() << std::endl;
Expand Down