Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Patro committed May 9, 2022
1 parent 0a48800 commit 7c39da1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 26 deletions.
2 changes: 0 additions & 2 deletions src/collate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ pub fn collate(
//expected_ori: Strand,
log: &slog::Logger,
) -> anyhow::Result<()> {
//}, Box<dyn std::error::Error>> {
let parent = std::path::Path::new(&input_dir);

// open the metadata file and read the json
Expand Down Expand Up @@ -258,7 +257,6 @@ pub fn collate_with_temp(
version: &str,
log: &slog::Logger,
) -> anyhow::Result<()> {
//Box<dyn std::error::Error>> {
// the number of corrected cells we'll write
let expected_output_chunks = tsv_map.len() as u64;
// the parent input directory
Expand Down
8 changes: 5 additions & 3 deletions src/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*
* License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
*/

use anyhow::Context;
use indicatif::{ProgressBar, ProgressStyle};
use slog::{crit, info};
//use num_format::{Locale};
Expand Down Expand Up @@ -493,7 +495,7 @@ pub fn view2(
print_header: bool,
_out_file: String,
log: &slog::Logger,
) -> Result<u64, Box<dyn std::error::Error>> {
) -> anyhow::Result<u64> {
let i_file = File::open(rad_file).unwrap();
let mut br = BufReader::new(i_file);
let hdr = rad_types::RadHeader::from_bytes(&mut br);
Expand Down Expand Up @@ -548,9 +550,9 @@ pub fn view2(
let mut num_reads: u64 = 0;

let bc_type = rad_types::decode_int_type_tag(bct.expect("no barcode tag description present."))
.expect("unknown barcode type id.");
.context("unknown barcode type id.")?;
let umi_type = rad_types::decode_int_type_tag(umit.expect("no umi tag description present"))
.expect("unknown barcode type id.");
.context("unknown barcode type id.")?;

let stdout = stdout(); // get the global stdout entity
let stdout_l = stdout.lock();
Expand Down
1 change: 0 additions & 1 deletion src/infer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ pub fn infer(
output_dir: String,
log: &slog::Logger,
) -> anyhow::Result<()> {
// Box<dyn std::error::Error>> {
info!(
log,
"inferring abundances from equivalence class count input."
Expand Down
20 changes: 0 additions & 20 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ fn gen_random_kmer(k: usize) -> String {
}

fn main() -> anyhow::Result<()> {
//}, Box<dyn std::error::Error>> {
let num_hardware_threads = num_cpus::get() as u32;
let max_num_threads: String = (num_cpus::get() as u32).to_string();
let max_num_collate_threads: String = (16_u32.min(num_hardware_threads).max(2_u32)).to_string();
Expand Down Expand Up @@ -186,25 +185,6 @@ fn main() -> anyhow::Result<()> {

// You can handle information about subcommands by requesting their matches by name
// (as below), requesting just the name used, or both at the same time
/*
if let Some(ref t) = opts.subcommand_matches("test") {
let input_file: String = t.value_of_t("input").expect("no input string specified");
let rad_dir: String = t.value_of_t("rad-dir").expect("no input string specified");
let min_reads: usize = t
.value_of_t("min-reads")
.expect("min-reads must be a valid integer");
if min_reads < 1 {
crit!(
log,
"min-reads < 1 is not supported, the value {} was provided",
min_reads
);
std::process::exit(1);
}
let _r = test_external_parse(input_file, rad_dir, min_reads, &log);
}
*/

if let Some(t) = opts.subcommand_matches("generate-permit-list") {
let input_dir: String = t.value_of_t("input").expect("no input directory specified");
let output_dir: String = t
Expand Down

0 comments on commit 7c39da1

Please sign in to comment.