Skip to content

Commit

Permalink
Merge branch 'argument-rename'
Browse files Browse the repository at this point in the history
* argument-rename:
  rename DNA/AA-file options
  • Loading branch information
Felix Van der Jeugt committed Aug 2, 2021
2 parents 97eca3e + 82a9e4d commit 4df00dc
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 29 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "frag_gene_scan_rs"
version = "0.2.0"
version = "0.3.0"
authors = ["Felix Van der Jeugt <[email protected]>"]
edition = "2018"

Expand Down
51 changes: 23 additions & 28 deletions src/bin/FragGeneScanRs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ fn main() -> Result<()> {
.takes_value(true)
.default_value("stdin")
.help("Sequence file name including the full path. Using 'stdin' (or not suplying this argument) reads from standard input."))
.arg(Arg::with_name("output-file")
.arg(Arg::with_name("output-prefix")
.short("o")
.long("output-file-name")
.value_name("output_file_name")
.long("output-prefix")
.value_name("output_prefix")
.takes_value(true)
.help("Output metadata, proteins and dna to files with this base name. Using 'stdout' write the predicted AA reads to standard output."))
.help("Output metadata (.out), proteins (.faa) and genes (.ffn) to files with this prefix. Use 'stdout' to write the predicted proteins to standard output."))
.arg(Arg::with_name("complete")
.short("w")
.long("complete")
Expand Down Expand Up @@ -90,24 +90,17 @@ fn main() -> Result<()> {
.takes_value(true)
.help("Output metadata to this file (supersedes -o)."))
.arg(Arg::with_name("aa-file")
.short("e")
.short("a")
.long("aa-file")
.value_name("aa_file")
.takes_value(true)
.help("Output predicted AA reads to this file (supersedes -o)."))
.arg(Arg::with_name("dna-file")
.short("d")
.long("dna-file")
.value_name("dna_file")
.help("Output predicted proteins to this file (supersedes -o)."))
.arg(Arg::with_name("nucleotide-file")
.short("n")
.long("nucleotide-file")
.value_name("nucleotide_file")
.takes_value(true)
.help("Output predicted DNA reads to this file (supersedes -o)."))
// .arg(Arg::with_name("translation-table")
// .short("x")
// .long("translation-table")
// .value_name("translation_table")
// .takes_value(true)
// .default_value("11")
// .help("Which translation table to use."))
.help("Output predicted genes to this file (supersedes -o)."))
.get_matches();

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

let mut aastream: Option<Box<dyn Write + Send>> =
match (matches.value_of("aa-file"), matches.value_of("output-file")) {
(Some(filename), _) => Some(Box::new(File::create(filename)?)),
(None, Some("stdout")) => Some(Box::new(io::stdout())),
(None, Some(filename)) => Some(Box::new(File::create(filename.to_owned() + ".faa")?)),
(None, None) => None,
};
let mut aastream: Option<Box<dyn Write + Send>> = match (
matches.value_of("aa-file"),
matches.value_of("output-prefix"),
) {
(Some(filename), _) => Some(Box::new(File::create(filename)?)),
(None, Some("stdout")) => Some(Box::new(io::stdout())),
(None, Some(filename)) => Some(Box::new(File::create(filename.to_owned() + ".faa")?)),
(None, None) => None,
};

let metastream: Option<File> = match (
matches.value_of("meta-file"),
matches.value_of("output-file"),
matches.value_of("output-prefix"),
) {
(Some(filename), _) => Some(File::create(filename)?),
(None, Some("stdout")) => None,
Expand All @@ -139,8 +134,8 @@ fn main() -> Result<()> {
};

let dnastream: Option<File> = match (
matches.value_of("dna-file"),
matches.value_of("output-file"),
matches.value_of("nucleotide-file"),
matches.value_of("output-prefix"),
) {
(Some(filename), _) => Some(File::create(filename)?),
(None, Some("stdout")) => None,
Expand Down

0 comments on commit 4df00dc

Please sign in to comment.