From 457d620b37b476e24b0241ac1c72409a16df0ad0 Mon Sep 17 00:00:00 2001 From: Lee Katz - Aspen Date: Mon, 20 Oct 2014 16:47:24 -0400 Subject: [PATCH] better logmsg; a TODO to help with computation speed if needed --- scripts/removeUninformativeSitesFromMatrix.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/removeUninformativeSitesFromMatrix.pl b/scripts/removeUninformativeSitesFromMatrix.pl index 0bb36b8..a6613ff 100755 --- a/scripts/removeUninformativeSitesFromMatrix.pl +++ b/scripts/removeUninformativeSitesFromMatrix.pl @@ -66,9 +66,11 @@ sub removeSitesFromMatrix{ while(my($pos,$genomeHash)=each(%$posHash)){ my ($is_variant,$is_indel,$is_ambiguous)=(0,0,0); my($refGenome,$refNt)=each(%$genomeHash); + # compare everything in the upper case my $REFNT=uc($refNt); + # TODO do all the refnt comparisons outside of the inner loop, if it helps save significant computation time while(my($genome,$nt)=each(%$genomeHash)){ - #for my $nt(values(%$genomeHash)) + # compare it in the upper case my $NT = uc($nt); # see if it is an invariant site. $is_variant=1 if($NT ne $REFNT); @@ -85,7 +87,7 @@ sub removeSitesFromMatrix{ # say whether it was kept or removed if($$settings{verbose}){ - logmsg "Deleted $contig:$pos" if(!$$matrix{$contig}{$pos}); + logmsg "Deleted $contig:$pos because either gap, ambiguity, or not variant" if(!$$matrix{$contig}{$pos}); logmsg "Kept $contig:$pos" if($$matrix{$contig}{$pos}); } # index the site if it was kept