Skip to content

Commit eaa5822

Browse files
committed
fasten_mutate: added documentation to say maximum number of SNPs
1 parent 373eccc commit eaa5822

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

src/bin/fasten_mutate.rs

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,24 @@
99
//! ## Usage
1010
//!
1111
//! ```text
12+
//! fasten_mutate: Introduces point mutations randomly. There is no
13+
//! evolutionary model; multiple hits are allowed. Therefore,
14+
//! the number of SNPs through --snps is an upper
15+
//! limit.
1216
//!
13-
//! Usage: fasten_mutate [-h] [-n INT] [-p] [-v] [-s INT] [-m]
17+
//! Usage: fasten_mutate [-h] [-n INT] [-p] [--verbose] [--version] [-s INT] [-m]
1418
//!
1519
//! Options:
1620
//! -h, --help Print this help menu.
1721
//! -n, --numcpus INT Number of CPUs (default: 1)
1822
//! -p, --paired-end The input reads are interleaved paired-end
19-
//! -v, --verbose Print more status messages
20-
//! -s, --snps INT Number of SNPs (point mutations) to include per read.
23+
//! --verbose Print more status messages
24+
//! --version Print the version of Fasten and exit
25+
//! -s, --snps INT Maximum number of SNPs (point mutations) to include
26+
//! per read.
2127
//! -m, --mark lowercase all reads but uppercase the SNPs (not yet
2228
//! implemented)
29+
//!
2330
//! ```
2431
2532
extern crate getopts;
@@ -37,14 +44,20 @@ use fasten::fasten_base_options;
3744
use fasten::fasten_base_options_matches;
3845
use fasten::logmsg;
3946

47+
use regex::Regex;
4048

4149
fn main(){
4250
let mut opts = fasten_base_options();
4351
// Options specific to this script
44-
opts.optopt("s", "snps", "Number of SNPs (point mutations) to include per read.", "INT");
52+
opts.optopt("s", "snps", "Maximum number of SNPs (point mutations) to include per read.", "INT");
4553
opts.optflag("m", "mark", "lowercase all reads but uppercase the SNPs (not yet implemented)");
4654

47-
let matches = fasten_base_options_matches("Mutates reads. There is no mutation model; only randomness.", opts);
55+
let description = "Introduces point mutations randomly. There is no evolutionary model; multiple hits are allowed. Therefore, the number of SNPs through --snps is an upper limit."
56+
.to_string();
57+
let regex = Regex::new(r"(.{1,60}\s+)").unwrap();
58+
let wrapped_description = regex.replace_all(&description, "$1\n");
59+
60+
let matches = fasten_base_options_matches(&wrapped_description, opts);
4861

4962
if matches.opt_present("paired-end") {
5063
logmsg("WARNING: --paired-end is not utilized in this script");

0 commit comments

Comments
 (0)