libsequence  1.9.5
nSL_from_ms.cc
1 
2 #include <cmath>
3 #include <iostream>
4 #include <Sequence/VariantMatrix.hpp>
5 #include <Sequence/VariantMatrixViews.hpp>
6 #include <Sequence/variant_matrix/msformat.hpp>
8 
9 int
10 main(int argc, char** argv)
11 {
12  auto vm = Sequence::from_msformat(std::cin);
13  for (std::size_t i = 0; i < vm.nsites; ++i)
14  {
15  auto n = Sequence::nsl(vm, i, 0);
16  if (!std::isnan(n.nsl))
17  {
18  std::cout << vm.positions[i] << ' ' << n.nsl << ' '
19  << n.ihs << ' ' << n.core_count << '\n';
20  }
21  }
22 }
VariantMatrix from_msformat(streamtype &input_stream)
Create VariantMatrix from "ms"-like input format.
Definition: msformat.hpp:20
nSLiHS nsl(const VariantMatrix &m, const std::size_t core, const std::int8_t refstate)
nSL and iHS statistics
Definition: nsl.cc:76
nSL and iHS