[Biojava-l] Error writing large Fasta seqs?

Thomas Down td2@sanger.ac.uk
Mon, 2 Apr 2001 10:05:53 +0100


On Mon, Apr 02, 2001 at 02:38:44PM +1200, Schreiber, Mark wrote:
> If I make the following change to FastaFormat the problem is removed but I
> am concerned about if this was the true cause of the problem:
> 
>         for(int pos = 1; pos <= seq.length(); pos += lineWidth) {
>             int end = Math.min(pos + lineWidth - 1, seq.length());
>             os.println(seq.subStr(pos, end));
>         }
>     }
> 
> Originally the for statement read:
> 
> 
>         for(int pos = 1; pos <= seq.length() +1; pos += lineWidth) {
>             int end = Math.min(pos + lineWidth - 1, seq.length());
>             os.println(seq.subStr(pos, end));
>         }
> 
> The +1 after pos <= seq.length() seems to be incorrect given the <=
> evaluation.

Sequence-dumping bites again :(.

Yes, I think your patch is right.

Do you have CVS write access?  If you, you might like to get
onto Matthew and ask him to create an account.

   Thomas.