Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Patro committed Aug 28, 2020
1 parent bfad006 commit 3377c79
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
8 changes: 5 additions & 3 deletions libradicl/src/pugutils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ pub(super) fn get_num_molecules_trivial_discard_all_ambig(
let mut counts = vec![0.0f32; num_genes];
let s = RandomState::<Hash64>::new();
let mut gene_map = HashMap::with_hasher(s);

let mut total_umis = 0u64;
let mut multi_gene_umis = 0u64;

Expand All @@ -322,9 +322,11 @@ pub(super) fn get_num_molecules_trivial_discard_all_ambig(
}
prev_gene_id = gid;
}

total_umis += umis.len() as u64;
if multi_gene { multi_gene_umis += umis.len() as u64; }
if multi_gene {
multi_gene_umis += umis.len() as u64;
}

// if the read is single-gene
// then add this equivalence class' list
Expand Down
13 changes: 9 additions & 4 deletions libradicl/src/quant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ fn extract_graph(

if hdist < 2 {
one_edit += 1;
if x.1 > (2 * y.1 - 1) {
if x.1 > (2 * y.1 - 1) {
return PUGEdgeType::XToY;
} else if y.1 > (2 * x.1 - 1) {
return PUGEdgeType::YToX;
Expand Down Expand Up @@ -251,7 +251,6 @@ fn extract_graph(
info!(log, "\n\n\n{}\n\n\n", one_edit as f64 / total_edits);
}


graph
}

Expand Down Expand Up @@ -600,7 +599,7 @@ pub fn quantify(
&mut unique_evidence,
&mut no_ambiguity,
num_genes,
true, // only unqique evidence
true, // only unqique evidence
&log,
);
if num_bootstraps > 0 {
Expand Down Expand Up @@ -825,7 +824,13 @@ pub fn quantify(

let mmrate_path = parent.join("mmrate.tsv");
let mut mmrate_file = File::create(mmrate_path).expect("couldn't open mmrate file");
let ostr = mmrate.lock().unwrap().iter().map(|x| x.to_string()).collect::<Vec<String>>().join("\t");
let ostr = mmrate
.lock()
.unwrap()
.iter()
.map(|x| x.to_string())
.collect::<Vec<String>>()
.join("\t");
writeln!(mmrate_file, "{}", ostr);

// write to matrix market if we are using it
Expand Down

0 comments on commit 3377c79

Please sign in to comment.