Skip to content

Commit

Permalink
better logmsg; a TODO to help with computation speed if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
lskatz committed Oct 20, 2014
1 parent 0015ca8 commit 457d620
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/removeUninformativeSitesFromMatrix.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Expand Down

0 comments on commit 457d620

Please sign in to comment.