Skip to content

Commit 9d59aac

Browse files
author
Felix Van der Jeugt
committed
Merge branch 'argument-rename'
* argument-rename: rename DNA/AA-file options
2 parents 97eca3e + e9e199d commit 9d59aac

File tree

3 files changed

+28
-33
lines changed

3 files changed

+28
-33
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "frag_gene_scan_rs"
3-
version = "0.2.0"
3+
version = "0.3.1"
44
authors = ["Felix Van der Jeugt <[email protected]>"]
55
edition = "2018"
66

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ where:
7171

7272
### Additional options
7373

74-
* `-m meta_file`, `-d dna_file` and `-e aa_file` can be used to write
75-
output to specific files, instead of having the program create filenames
76-
with predetermined extentions. These take precedence over the `-o`
77-
option.
74+
* `-m meta_file`, `-n nucleotide_file` and `-a aa_file` can be used to
75+
write output to specific files, instead of having the program create
76+
filenames with predetermined extentions. These take precedence over
77+
the `-o` option.
7878

7979
* Leaving out the `-o` option or using the name `stdout` causes
8080
FragGeneScanRs to only write the predicted proteins to standard output.

src/bin/FragGeneScanRs.rs

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ fn main() -> Result<()> {
3737
.takes_value(true)
3838
.default_value("stdin")
3939
.help("Sequence file name including the full path. Using 'stdin' (or not suplying this argument) reads from standard input."))
40-
.arg(Arg::with_name("output-file")
40+
.arg(Arg::with_name("output-prefix")
4141
.short("o")
42-
.long("output-file-name")
43-
.value_name("output_file_name")
42+
.long("output-prefix")
43+
.value_name("output_prefix")
4444
.takes_value(true)
45-
.help("Output metadata, proteins and dna to files with this base name. Using 'stdout' write the predicted AA reads to standard output."))
45+
.help("Output metadata (.out), proteins (.faa) and genes (.ffn) to files with this prefix. Use 'stdout' to write the predicted proteins to standard output."))
4646
.arg(Arg::with_name("complete")
4747
.short("w")
4848
.long("complete")
@@ -90,24 +90,17 @@ fn main() -> Result<()> {
9090
.takes_value(true)
9191
.help("Output metadata to this file (supersedes -o)."))
9292
.arg(Arg::with_name("aa-file")
93-
.short("e")
93+
.short("a")
9494
.long("aa-file")
9595
.value_name("aa_file")
9696
.takes_value(true)
97-
.help("Output predicted AA reads to this file (supersedes -o)."))
98-
.arg(Arg::with_name("dna-file")
99-
.short("d")
100-
.long("dna-file")
101-
.value_name("dna_file")
97+
.help("Output predicted proteins to this file (supersedes -o)."))
98+
.arg(Arg::with_name("nucleotide-file")
99+
.short("n")
100+
.long("nucleotide-file")
101+
.value_name("nucleotide_file")
102102
.takes_value(true)
103-
.help("Output predicted DNA reads to this file (supersedes -o)."))
104-
// .arg(Arg::with_name("translation-table")
105-
// .short("x")
106-
// .long("translation-table")
107-
// .value_name("translation_table")
108-
// .takes_value(true)
109-
// .default_value("11")
110-
// .help("Which translation table to use."))
103+
.help("Output predicted genes to this file (supersedes -o)."))
111104
.get_matches();
112105

113106
let (global, locals) = hmm::get_train_from_file(
@@ -120,17 +113,19 @@ fn main() -> Result<()> {
120113
filename => Box::new(File::open(filename)?),
121114
};
122115

123-
let mut aastream: Option<Box<dyn Write + Send>> =
124-
match (matches.value_of("aa-file"), matches.value_of("output-file")) {
125-
(Some(filename), _) => Some(Box::new(File::create(filename)?)),
126-
(None, Some("stdout")) => Some(Box::new(io::stdout())),
127-
(None, Some(filename)) => Some(Box::new(File::create(filename.to_owned() + ".faa")?)),
128-
(None, None) => None,
129-
};
116+
let mut aastream: Option<Box<dyn Write + Send>> = match (
117+
matches.value_of("aa-file"),
118+
matches.value_of("output-prefix"),
119+
) {
120+
(Some(filename), _) => Some(Box::new(File::create(filename)?)),
121+
(None, Some("stdout")) => Some(Box::new(io::stdout())),
122+
(None, Some(filename)) => Some(Box::new(File::create(filename.to_owned() + ".faa")?)),
123+
(None, None) => None,
124+
};
130125

131126
let metastream: Option<File> = match (
132127
matches.value_of("meta-file"),
133-
matches.value_of("output-file"),
128+
matches.value_of("output-prefix"),
134129
) {
135130
(Some(filename), _) => Some(File::create(filename)?),
136131
(None, Some("stdout")) => None,
@@ -139,8 +134,8 @@ fn main() -> Result<()> {
139134
};
140135

141136
let dnastream: Option<File> = match (
142-
matches.value_of("dna-file"),
143-
matches.value_of("output-file"),
137+
matches.value_of("nucleotide-file"),
138+
matches.value_of("output-prefix"),
144139
) {
145140
(Some(filename), _) => Some(File::create(filename)?),
146141
(None, Some("stdout")) => None,

0 commit comments

Comments
 (0)