use strict; use warnings; my $clu_align=$ARGV[0]; open(IN,">",$clu_align) or die "can't open file $clu_align"; my @consensus; while(my $line=){ chomp($line); next if ($line =~ /^CLUSTAL/); # header row next if ($line=~ /^$/); # a few blank rows if ($line =~ /\*/){ push (@consensus,$line); } } close(IN); chomp(@consensus); #foreach my $c (@consensus){ just for debugging # print "consensus\n"; # print "$c\t"; # print "\n"; #} my( @index )= grep { $consensus[$_] eq "*" } 0..$#consensus; my $outfile="$clu_align.VarPositions"; open (OUT,">",$outfile); foreach my $i (@index) { print OUT "$i\tis not conserved\n"; }