Skip to content

Commit 403cff6

Browse files
authored
Merge pull request #1 from algbio/update-speed-parameter
Update speed parameter
2 parents 2cd8684 + 962808d commit 403cff6

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ Key parameters:
2323
- `-a` Output file name. Format .gam or .json.
2424

2525
Parameters related to colinear chaining:
26-
- `--speed <int>` Use 2 or 3 (or larger values) if you want GraphChainer to be faster, but slightly less accurate (default 1).
26+
- `--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.
2727
- `--colinear-split-len <int>` The length of the fragments in which the long read is split to create anchors (default 35).
28-
- `--colinear-split-gap <int>` The distance between consecutive fragments (default 35). If `--speed` is set, then always `--colinear-split-gap = --speed * --colinear-split-len`.
28+
- `--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`).
2929
- `--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).
3030

3131
### Constructing an (acyclic) variation graph

src/Aligner.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ struct AlignerParams
5757
long long colinearGap;
5858
long long colinearSplitLen;
5959
long long colinearSplitGap;
60-
long long speed;
60+
double speed;
6161
bool fastMode;
6262

6363
};

src/AlignerMain.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ int main(int argc, char** argv)
4040
;
4141
boost::program_options::options_description clcparams("Colinear chaining parameters");
4242
clcparams.add_options()
43-
("speed", boost::program_options::value<long long>(), "Speed-up factor [default 1]. Use 2 or 3 for faster, but slightly less accurate alignments")
43+
("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.")
4444
("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]")
45-
("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 = --speed * --colinear-split-len.")
45+
("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).")
4646
("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].")
4747
// ("mpc-index,i", boost::program_options::value<std::string>(), "minimium path cover index filename")
4848
("fast-mode", "(Development purposes) Skip edit distance computation after chaining (output the path instead of alignment)")
@@ -205,6 +205,7 @@ int main(int argc, char** argv)
205205
params.colinearGap = 10000;
206206
params.colinearSplitLen = 35;
207207
params.colinearSplitGap = 35;
208+
params.speed = 1;
208209
}
209210

210211
if (vm.count("graph")) params.graphFile = vm["graph"].as<std::string>();
@@ -238,7 +239,7 @@ int main(int argc, char** argv)
238239
{
239240
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;
240241
}
241-
params.colinearSplitGap = params.speed * params.colinearSplitLen;
242+
params.colinearSplitGap = ceil(params.speed * params.colinearSplitLen);
242243
}
243244

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

0 commit comments

Comments
 (0)