[Biojava-l] GCG Checksums

Andrew Macgregor andrew@anatomy.otago.ac.nz
Tue, 15 Oct 2002 09:34:09 +1300


Hi Russell and Mark,

Thanks for the code segment Russell, I see you'd posted it back in Jan/Feb
as well, I'd grabbed it from there. I don't think copyright or the like can
be too much of an issue as Bioperl has a module to do this.

Cheers, Andrew.




Russell Smithies wrote:

> Hi,
> 
> Here's a bit of code I wrote last year to calculate the GCG checksums:
> 
> public int GCGChecksum(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 % 100000;
> }
> 
> As you can see, it's only a hashing checksum so I don't think you'll be
> breaking anyone's copyright.
> 
> hope this helps,
> 
> Russell
> 
>> Message: 2
>> Subject: RE: [Biojava-l] GCG format...
>> Date: Mon, 14 Oct 2002 12:05:29 +1300
>> From: "Schreiber, Mark" <mark.schreiber@agresearch.co.nz>
>> To: "Wiepert, Mathieu" <Wiepert.Mathieu@mayo.edu>,
>>        "Andrew Macgregor" <andrew@anatomy.otago.ac.nz>,
>>        "BioJava" <biojava-l@biojava.org>
>> 
>> One of the issues with GCG format is the checksum. I have seen methods
>> that calculate and verify the checksum but I'm not sure that they are
>> supposed to be used. Ie GCG won't tell you how to do it so doing it
>> anyway might be breaking some annoying little copyright law.
>> 
>> - Mark
>>