Skip to content

Commit 4cb636c

Browse files
committed
Add spinner, and various fix
1 parent 15ce114 commit 4cb636c

File tree

5 files changed

+365
-139
lines changed

5 files changed

+365
-139
lines changed

Cargo.lock

Lines changed: 48 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ keywords = ["bioinformatics", "demultiplexing"]
1515
anyhow = "1.0.40"
1616
bio = "0.33.0"
1717
clap = "~2.33"
18+
indicatif = "0.16"
1819
exitcode = "1.1.2"
1920
niffler = "2.3.2"
2021
thiserror = "1.0"

src/app.rs

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,47 +21,50 @@ pub fn build_app() -> App<'static, 'static> {
2121
.arg(
2222
Arg::with_name("BARCODE")
2323
.help("Input barcode file.")
24-
.long_help(
25-
"Takes the barcode file containing barcode and output files names data. \
26-
File is formated as barcode\tfile_R1.(fa|fq)\tfile_R2.(fa|fq) for each barcode \
27-
for paired-end data or barcode\tfile.(fa|fq) for single-end data.",
24+
.long_help("Takes the barcode file containing barcode and output files data.\n \
25+
Barcode file is tsv formated:\n \
26+
`barcode1 file2_R1.fq file1_R2.fq`\n \
27+
`barcode2 file2_R1.fq file2_R2.fq`\n \
28+
`...`\n \
29+
for paired-end data or like:\n \
30+
`barcode1 file1.fq`\n \
31+
`barcode2 file2.fq`\n \
32+
`...`\n \
33+
for single-end data.",
2834
)
2935
.required(true)
3036
.index(1),
3137
)
3238
.arg(
3339
Arg::with_name("FORWARD")
34-
.help("Input forward fasta or fastq file. Can be .(gz|xz|bz2) compressed.")
40+
.help("Input forward fasta or fastq file.\n Can be .(gz|xz|bz2) compressed.")
3541
.long_help(
36-
"Input fasta or fastq file. Correspond to forward file if demultiplexing \
37-
paired-end data or to the single file in demultiplexing single-end data.",
42+
"Input fasta or fastq forward file if demultiplexing paired-end\n \
43+
data or to the single file in demultiplexing single-end data.",
3844
)
3945
.required(true)
4046
.index(2),
4147
)
4248
.arg(
4349
Arg::with_name("REVERSE")
44-
.help("Input reverse fasta or fastq file. Can be .(gz|xz|bz2) compressed.")
50+
.help("Input reverse fasta or fastq file.\n Can be .(gz|xz|bz2) compressed.")
4551
.long_help(
46-
"Input fasta or fastq file. Correspond to reverse file if demultiplexing \
47-
paired-end data. Should be ommited in single-end mode.",
52+
"Input fasta or fastq reverse file if demultiplexing paired-end\n \
53+
data. Should be ommited in single-end mode.",
4854
)
4955
.index(3),
5056
)
5157
.arg(
5258
Arg::with_name("mismatch")
53-
.long_help("Maximum number of mismatches allowed in barcode sequence")
59+
.long_help("Maximum number of mismatches allowed in barcode")
5460
.short("m")
5561
.long("mismatch")
5662
.value_name("N")
5763
.default_value("0"),
5864
)
5965
.arg(
6066
Arg::with_name("output")
61-
.help("Output folder")
62-
.long_help(
63-
"Specifies the ouput directory name. Default to sabreur_out.",
64-
)
67+
.help("Specifies the ouput directory")
6568
.short("o")
6669
.long("out")
6770
.value_name("FOLDER")
@@ -71,33 +74,48 @@ pub fn build_app() -> App<'static, 'static> {
7174
Arg::with_name("format")
7275
.help("Set output files compression format.")
7376
.long_help(
74-
"Specifies the compression format of the demultiplexed files. \
75-
Options availables are gz, xz or bz2 depending on your installation \
76-
on your operating system of these libraries.",
77+
"Specifies the compression format of the demultiplexed files:\n \
78+
gz: for gzip files\n \
79+
xz: for xz (lzma) files\n \
80+
bz2: for bzip2 files\n \
81+
Note: These options are available depending on your\n \
82+
installation of their supporting libraries.\n \
83+
Find more on sabreur homepage.",
7784
)
7885
.long("format")
7986
.short("f")
8087
.takes_value(true)
81-
.possible_values(&["gz", "xz", "bz2"]),
88+
.possible_values(&["gz", "xz", "bz2"])
89+
.hide_possible_values(true),
8290
)
8391
.arg(
8492
Arg::with_name("level")
8593
.help("Set the compression level")
8694
.long_help(
87-
"Specifies the compression level wanted for the demultiplexed file",
95+
"Specifies the compression level wanted for the demultiplexed file:\n \
96+
1: Level One, optimize the compression time\n \
97+
2: Level Two\n \
98+
3: Level Three\n \
99+
4: Level Four\n \
100+
5: Level Five\n \
101+
6: Level Six\n \
102+
7: Level Seven\n \
103+
8: Level Eight\n \
104+
9: Level Nine, optimize the size of the output\n",
88105
)
89106
.long("level")
90107
.short("l")
91108
.takes_value(true)
92109
.possible_values(&["1", "2", "3", "4", "5", "6", "7", "8", "9"])
110+
.hide_possible_values(true)
93111
.default_value("1"),
94112
)
95113
.arg(
96114
Arg::with_name("force")
97115
.help("Force reuse of default output directory")
98116
.long_help(
99-
"Reuse the default output directory (sabreur_out). \
100-
This will erase existing directory before creating it.",
117+
"Reuse the default output directory (sabreur_out).\n \
118+
This will erase existing directory before creating it.",
101119
)
102120
.long("force")
103121
.takes_value(false),

0 commit comments

Comments
 (0)