[Biojava-l] GCG checkSums

Thomas Down td2@sanger.ac.uk
Thu, 31 Jan 2002 11:56:58 +0000


On Tue, Jan 29, 2002 at 07:54:49PM +0000, 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;
>        }
> 
> ---------------------------------------------------

That looks sensible.  Do you want to see it included
in the BioJava package?  If so, could you suggest a
location within the API structure?

I'm not familiar with how GCG checksums are used in
practice.  Are they applied just to sequence data, or
to complete (and perhaps annotated) sequence database
entries?

   Thomas.