From fb6e7aa6e7bb3b7d474b33fcfc9f096e3bec212d Mon Sep 17 00:00:00 2001 From: Auden Cote-L'Heureux <52716489+AudenCote@users.noreply.github.com> Date: Fri, 1 Nov 2024 10:34:57 -0400 Subject: [PATCH] Changing CladeGrabbing.py to use less than or equal to for number of contaminants --- Utilities/for_trees/CladeGrabbing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utilities/for_trees/CladeGrabbing.py b/Utilities/for_trees/CladeGrabbing.py index e48d2ad..fe6476a 100644 --- a/Utilities/for_trees/CladeGrabbing.py +++ b/Utilities/for_trees/CladeGrabbing.py @@ -158,7 +158,7 @@ def get_subtrees(args, file): #Grab a clade as a subtree if 1) it has enough target taxa; 2) it has enough "at least" taxa; 3) it does not have too many contaminants - if len(target_leaves) >= args.min_presence and len(required_taxa_leaves) >= args.required_taxa_num and ((args.contaminants < 1 and len(leaves) < args.contaminants * len(target_leaves)) or len(leaves) < args.contaminants): + if len(target_leaves) >= args.min_presence and len(required_taxa_leaves) >= args.required_taxa_num and ((args.contaminants < 1 and len(leaves) <= args.contaminants * len(target_leaves)) or len(leaves) <= args.contaminants): selected_nodes.append(node) seen_leaves.extend([leaf.name for leaf in node]) #Write the subtrees to output .tre files