Skip to content

Commit

Permalink
further cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Patro committed Jul 14, 2022
1 parent 23eb300 commit 3b23604
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 23 deletions.
11 changes: 3 additions & 8 deletions src/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,18 +491,13 @@ where
info!(log, "finished writing to {:?}.", rad_file.as_ref());
}

pub fn view<P>(rad_file: P, print_header: bool, out_file: String, log: &slog::Logger)
pub fn view<P>(rad_file: P, print_header: bool, log: &slog::Logger)
where
P: AsRef<Path>,
{
let _read_num = view2(rad_file, print_header, out_file, log).unwrap();
let _read_num = view2(rad_file, print_header, log).unwrap();
}
pub fn view2<P>(
rad_file: P,
print_header: bool,
_out_file: String,
log: &slog::Logger,
) -> anyhow::Result<u64>
pub fn view2<P>(rad_file: P, print_header: bool, log: &slog::Logger) -> anyhow::Result<u64>
where
P: AsRef<Path>,
{
Expand Down
19 changes: 4 additions & 15 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ fn main() -> anyhow::Result<()> {
arg!(-H --header "flag for printing header")
.takes_value(false)
.required(false),
)
.arg(arg!(-o --output [RADFILE] "output plain-text-file file"));
);

let gen_app = Command::new("generate-permit-list")
.about("Generate a permit list of barcodes from a RAD file")
Expand Down Expand Up @@ -358,11 +357,7 @@ fn main() -> anyhow::Result<()> {
if let Some(t) = opts.subcommand_matches("view") {
let rad_file: &PathBuf = t.get_one("rad").unwrap();
let print_header = t.is_present("header");
let mut out_file: String = String::from("");
if t.is_present("output") {
out_file = t.get_one::<String>("output").unwrap().clone();
}
alevin_fry::convert::view(rad_file, print_header, out_file, &log)
alevin_fry::convert::view(rad_file, print_header, &log)
}

// collate a rad file to group together all records corresponding
Expand Down Expand Up @@ -397,14 +392,8 @@ fn main() -> anyhow::Result<()> {
let input_dir: &PathBuf = t.get_one("input-dir").unwrap();
let output_dir: &PathBuf = t.get_one("output-dir").unwrap();
let tg_map: &PathBuf = t.get_one("tg-map").unwrap();
let resolution = t
.get_one::<ResolutionStrategy>("resolution")
.unwrap()
.clone();
let sa_model = t
.get_one::<SplicedAmbiguityModel>("sa-model")
.unwrap()
.clone();
let resolution = *t.get_one::<ResolutionStrategy>("resolution").unwrap();
let sa_model = *t.get_one::<SplicedAmbiguityModel>("sa-model").unwrap();
let small_thresh = *t.get_one("small-thresh").unwrap();
let filter_list: Option<&PathBuf> = t.get_one("quant-subset");
let large_graph_thresh: usize = *t.get_one("large-graph-thresh").unwrap();
Expand Down

0 comments on commit 3b23604

Please sign in to comment.