Skip to content

Commit

Permalink
Merge pull request #9 from algbio/change_speed_to_step
Browse files Browse the repository at this point in the history
Change speed for sampling-step
  • Loading branch information
elarielcl authored Nov 22, 2022
2 parents 6741b94 + cdb9518 commit 5cd1512
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ Key parameters:
- `-a` Output file name. Format .gam or .json.

Parameters related to colinear chaining:
- `--speed <double>` Speed-up factor (default 1). Use >1 (<1, >0) for faster (slower), but less (more) accurate alignments. It increases (decreases) the sampling rate of fragments.
- `--sampling-step <double>` Sampling step factor (default 1). Use >1 (<1, >0) for faster (slower), but less (more) accurate alignments. It increases (decreases) the sampling sparsity of fragments.
- `--colinear-split-len <int>` The length of the fragments in which the long read is split to create anchors (default 35).
- `--colinear-split-gap <int>` The distance between consecutive fragments (default 35). If `--speed` is set, then always `--colinear-split-gap = ceil(--speed * --colinear-split-len`).
- `--colinear-split-gap <int>` The distance between consecutive fragments (default 35). If `--sampling-step` is set, then always `--colinear-split-gap = ceil(--sampling-step * --colinear-split-len`).
- `--colinear-gap <int>` When converting an optimal chain of anchors into an alignment path, split the path if the distance in the graph between consecutive anchors is greater than this value (default 10000).

### Constructing an (acyclic) variation graph
Expand Down
2 changes: 1 addition & 1 deletion src/Aligner.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ struct AlignerParams
long long colinearGap;
long long colinearSplitLen;
long long colinearSplitGap;
double speed;
double samplingStep;
bool fastMode;

};
Expand Down
14 changes: 7 additions & 7 deletions src/AlignerMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ int main(int argc, char** argv)
;
boost::program_options::options_description clcparams("Colinear chaining parameters");
clcparams.add_options()
("speed", boost::program_options::value<long long>(), "Speed-up factor [default 1]. Use >1 (<1, >0) for faster (slower), but less (more) accurate alignments. It increases (decreases) the sampling rate of fragments.")
("sampling-step", boost::program_options::value<long long>(), "Sampling step factor (default 1). Use >1 (<1, >0) for faster (slower), but less (more) accurate alignments. It increases (decreases) the sampling sparsity of fragments.")
("colinear-split-len", boost::program_options::value<long long>(), "The length of the fragments in which the long read is split to create anchors. [default 35]")
("colinear-split-gap", boost::program_options::value<long long>(), "The distance between consecutive fragments [default 35]. If --speed is set, then always --colinear-split-gap = ceil(--speed * --colinear-split-len).")
("colinear-split-gap", boost::program_options::value<long long>(), "The distance between consecutive fragments [default 35]. If --sampling-step is set, then always --colinear-split-gap = ceil(--sampling-step * --colinear-split-len).")
("colinear-gap", boost::program_options::value<long long>(), "When converting an optimal chain of anchors into an alignment path, split the path if the distance between consecutive anchors is greater than this value [default 10000].")
// ("mpc-index,i", boost::program_options::value<std::string>(), "minimium path cover index filename")
("fast-mode", "(Development purposes) Skip edit distance computation after chaining (output the path instead of alignment)")
Expand Down Expand Up @@ -205,7 +205,7 @@ int main(int argc, char** argv)
params.colinearGap = 10000;
params.colinearSplitLen = 35;
params.colinearSplitGap = 35;
params.speed = 1;
params.samplingStep = 1;
}

if (vm.count("graph")) params.graphFile = vm["graph"].as<std::string>();
Expand All @@ -230,16 +230,16 @@ int main(int argc, char** argv)
if (vm.count("colinear-gap")) params.colinearGap = vm["colinear-gap"].as<long long>();
if (vm.count("colinear-split-len")) params.colinearSplitLen = vm["colinear-split-len"].as<long long>();
if (vm.count("colinear-split-gap")) params.colinearSplitGap = vm["colinear-split-gap"].as<long long>();
if (vm.count("speed")) params.speed = vm["speed"].as<long long>();
if (vm.count("sampling-step")) params.samplingStep = vm["sampling-step"].as<long long>();
if (vm.count("mpc-index")) params.IndexMpcFile = vm["mpc-index"].as<std::string>();

if (params.speed != 1)
if (params.samplingStep != 1)
{
if (vm.count("colinear-split-gap"))
{
std::cerr << "WARNING: --speed and --colinear-split-gap are both set! --colinear-split-gap will be ignored, and set to (--speed * --colinear-split-len)" << std::endl;
std::cerr << "WARNING: --sampling-step and --colinear-split-gap are both set! --colinear-split-gap will be ignored, and set to (--sampling-step * --colinear-split-len)" << std::endl;
}
params.colinearSplitGap = ceil(params.speed * params.colinearSplitLen);
params.colinearSplitGap = ceil(params.samplingStep * params.colinearSplitLen);
}

if (vm.count("DP-restart-stride")) params.DPRestartStride = vm["DP-restart-stride"].as<size_t>();
Expand Down

0 comments on commit 5cd1512

Please sign in to comment.