dunno260 has asked for the wisdom of the Perl Monks concerning the following question:
sub comNucCount { my($string1, $string2) = @_; $string1 = lc $string1; $string2 = lc $string2; # we assume that the strings have the same length my($length) = length($string1); my($position); my($a,$c,$g,$t) = "0"; for ($position=0; $position < $length ; ++$position) { if(substr($string1,$position,1) eq substr($string2,$position,1 +)) { if(substr($string1,$position,1) eq 'a'){$a++} if(substr($string1,$position,1) eq 'c'){$c++} if(substr($string1,$position,1) eq 'g'){$g++} if(substr($string1,$position,1) eq 't'){$t++} } } return "A=$a, C=$c, G=$g, T=$t"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: String/Integer Concatenation
by Ovid (Cardinal) on Mar 02, 2006 at 21:02 UTC | |
|
Re: String/Integer Concatenation
by ikegami (Patriarch) on Mar 02, 2006 at 21:09 UTC | |
|
Re: String/Integer Concatenation
by GrandFather (Saint) on Mar 02, 2006 at 21:53 UTC |