Hi Russell, Is this code in BioJava? I sugest re-writing this to move seq.toUpperCase() out of the loop over i as this is potentialy expensive. Something like:
> int GCG_Checksum(String seq){ > int count = 0, > check = 0; String seq_uc = seq.toUpperCase(); > for(int i = 0; i < seq.length(); i++) { > count++; > //check += count * seq.toUpperCase().charAt(i); check += count * seq_uc.charAt(i); > if(count == 57)count = 0; > } > return check %= 10000; > } Russell Smithies wrote: > Don't panic, I found it :-) > > Here's my version: > ------------------------------------------------- > int GCG_Checksum(String seq){ > int count = 0, > check = 0; > for(int i = 0; i < seq.length(); i++) { > count++; > check += count * seq.toUpperCase().charAt(i); > if(count == 57)count = 0; > } > return check %= 10000; > } > > --------------------------------------------------- > > Russell Smithies > University of Otago > Dunedin > New Zealand > > > _________________________________________________________________ > Join the world's largest e-mail service with MSN Hotmail. > http://www.hotmail.com > > _______________________________________________ > Biojava-l mailing list - [EMAIL PROTECTED] > http://biojava.org/mailman/listinfo/biojava-l > _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com _______________________________________________ Biojava-l mailing list - [EMAIL PROTECTED] http://biojava.org/mailman/listinfo/biojava-l