Skip to content

Commit

Permalink
Restore unconditional filter and re-scope a few things.
Browse files Browse the repository at this point in the history
  • Loading branch information
macklin-10x committed Mar 31, 2024
1 parent 633c4e9 commit 2d1846e
Showing 1 changed file with 26 additions and 23 deletions.
49 changes: 26 additions & 23 deletions enclone_print/src/print_clonotypes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ pub fn print_clonotypes(

let mut stats_pass1 = Vec::<Vec<(String, Vec<String>)>>::new();

for _ in [0] {
let bads = (|| -> Result<_, String> {
// pass 1

// Sort exact subclonotypes.
Expand Down Expand Up @@ -329,9 +329,23 @@ pub fn print_clonotypes(
if !(n >= ctl.clono_filt_opt.ncells_low
|| ctl.clono_group_opt.asymmetric_center == "from_filters")
{
continue;
return Ok(Vec::new());
}
{
// Mark some weak exact subclonotypes for deletion.
let mut bads = vec![false; exacts.len()];
delete_weaks(ctl, &exacts, exact_clonotypes, mat, refdata, &mut bads);

// Done unless on second pass. Unless there are bounds or COMPLETE specified
// or VAR_DEF specified.

if ctl.clono_filt_opt.bounds.is_empty()
&& !ctl.gen_opt.complete
&& ctl.gen_opt.var_def.is_empty()
{
return Ok(bads);
}

// Find variant positions. And some other things.

let mut vars = Vec::<Vec<usize>>::new();
Expand All @@ -353,20 +367,6 @@ pub fn print_clonotypes(
&mut res.out_data,
);

// Mark some weak exact subclonotypes for deletion.
let mut bads = vec![false; exacts.len()];
delete_weaks(ctl, &exacts, exact_clonotypes, mat, refdata, &mut bads);

// Done unless on second pass. Unless there are bounds or COMPLETE specified
// or VAR_DEF specified.

if ctl.clono_filt_opt.bounds.is_empty()
&& !ctl.gen_opt.complete
&& ctl.gen_opt.var_def.is_empty()
{
continue;
}

// Define amino acid positions to show.

let show_aa = build_show_aa(
Expand Down Expand Up @@ -707,14 +707,17 @@ pub fn print_clonotypes(

process_complete(ctl, nexacts, &mut bads, mat);

// Delete weak exact subclonotypes.

if !ctl.clono_filt_opt.protect_bads {
erase_if(&mut mults, &bads);
erase_if(&mut exacts, &bads);
}
Ok(bads)
}
} // end pass 1
})()?; // end pass 1

// Delete weak exact subclonotypes.

if !ctl.clono_filt_opt.protect_bads {
erase_if(&mut mults, &bads);
erase_if(&mut exacts, &bads);
}

for _ in [0] {
// pass 2

Expand Down

0 comments on commit 2d1846e

Please sign in to comment.