Skip to content

Commit

Permalink
Removed unused --steps option in neoscan.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jade Cheng committed Jul 27, 2017
1 parent 84361a0 commit 26cfec4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/lib/jade.version.hpp
Expand Up @@ -30,7 +30,7 @@ namespace jade
char_type const * const title, ///< The program name.
ostream_type & out) ///< The output stream.
{
static const values current { 0, 0, 6416, 42877, 2015, 2017 };
static const values current { 0, 0, 6416, 43183, 2015, 2017 };

out << "ohana/" << title << ' '
<< current.major << '.'
Expand Down
11 changes: 5 additions & 6 deletions src/neoscan/jade.main.cpp
Expand Up @@ -19,14 +19,13 @@ ARGUMENTS
year-matrix path to the [I x 1] matrix for years
OPTIONS
--steps,-s (30) the number of steps to interpolate
--help,-h shows this help message and exits
--help,-h shows this help message and exits
DESCRIPTION
Performs a selection scan between ancient and modern data. The program can
take advantage of the dating for each individual ancient sample. The program
prints for each marker the step number when local optima is reached, the
global likelihood, the optimal local likelihood, and the likelihood ratio.
prints for each marker the delta when local optima is reached, the global
likelihood, the optimal local likelihood, and the likelihood ratio.
The program requires a <year-matrix>, which contains for each individual a
row representing the number of years going backward in time. For instance,
Expand All @@ -36,7 +35,7 @@ DESCRIPTION
[Notation]
K := Number of Components
This value must be greater than or equal to two.
This value must be greater than or equal to one.
I := Number of Individuals
This value must be greater than or equal to two.
Expand Down Expand Up @@ -90,7 +89,7 @@ DESCRIPTION
0.3 0.7 0.4 0.6
EXAMPLE
$ neoscan --steps 3 g.dgm q.matrix f.matrix years.json
$ neoscan g.dgm q.matrix f.matrix years.json
d global-lle local-lle lle-ratio
-1.00 +1.418028e+00 +1.418028e+00 +0.000000e+00
+0.00 +1.769128e+00 +1.769128e+00 +0.000000e+00
Expand Down
12 changes: 2 additions & 10 deletions src/neoscan/jade.neoscan.hpp
Expand Up @@ -90,13 +90,11 @@ namespace jade
const genotype_matrix_type & g, ///< The G matrix.
const matrix_type & q, ///< The Q matrix.
const matrix_type & f, ///< The F matrix.
const matrix_type & years, ///< The years matrix.
const size_t steps) ///< The number of steps.
const matrix_type & years) ///< The years matrix.
: _g (g)
, _q (q)
, _f (f)
, _y (_init_y(years, q))
, _steps (steps)
, _f_j (f.get_height(), 1)
{
verification_type::validate_gqf_sizes(g, q, f);
Expand Down Expand Up @@ -169,11 +167,6 @@ namespace jade
///
static void run(args & a)
{
const auto steps = a.read("--steps", "-s", size_t(30));
if (steps < 1)
throw jade::error()
<< "invalid number of steps (" << steps << ")";

const std::unique_ptr<genotype_matrix_type> g_ptr (
genotype_matrix_factory_type::create(a.pop<std::string>()));

Expand All @@ -184,7 +177,7 @@ namespace jade

std::cout << "d\tglobal_lle\tlocal_lle\tlle_ratio\n";

const basic_neoscan neoscan (*g_ptr, q, f, y, steps);
const basic_neoscan neoscan (*g_ptr, q, f, y);

neoscan.execute([](const output & out)
{
Expand Down Expand Up @@ -389,7 +382,6 @@ namespace jade
const matrix_type & _q; // [I x K]
const matrix_type & _f; // [K x J]
const matrix_type _y; // [I x 1]
const size_t _steps;

// scratch space
mutable matrix_type _f_j; // [K x 1]
Expand Down
12 changes: 6 additions & 6 deletions test/neoscan/test.neoscan.cpp
Expand Up @@ -64,7 +64,7 @@ namespace
2.0
)";

const auto expected_dgm_30 = []()
const auto expected_dgm = []()
{
queue_type out;
out.push({ +6.400005e-01, -2.586994e+00, -1.735003e+00 });
Expand All @@ -74,7 +74,7 @@ namespace
return out;
}();

const auto expected_lgm_30 = []()
const auto expected_lgm = []()
{
queue_type out;
out.push({ -1.999980e-01, -3.969019e-01, -1.667654e-01 });
Expand All @@ -96,9 +96,9 @@ namespace
const matrix_type f (f_in);
const matrix_type y (y_in);

neoscan_type neoscan (g, q, f, y, 30);
neoscan_type neoscan (g, q, f, y);

auto expected = expected_dgm_30;
auto expected = expected_dgm;

neoscan.execute([&expected](const neoscan_type::output & actual)
{
Expand Down Expand Up @@ -127,9 +127,9 @@ namespace
const matrix_type f (f_in);
const matrix_type y (y_in);

neoscan_type neoscan (g, q, f, y, 30);
neoscan_type neoscan (g, q, f, y);

auto expected = expected_lgm_30;
auto expected = expected_lgm;

neoscan.execute([&expected](const neoscan_type::output & actual)
{
Expand Down

0 comments on commit 26cfec4

Please sign in to comment.