[Biojava-l] BioException from SeqIOTools

Ren, Zhen zren at amylin.com
Tue Apr 8 17:59:15 EDT 2003


I compiled JAR files using the latest code through cvs and the latest JDKs including 1.4.1_01, 1.4.1_02 and 1.4.2_beta all have the same problem.  Any other thought? Thanks.  -Zhen

-----Original Message-----
From: Schreiber, Mark [mailto:mark.schreiber at agresearch.co.nz]
Sent: Tuesday, April 08, 2003 4:45 PM
To: Ren, Zhen; biojava-l at biojava.org
Subject: RE: [Biojava-l] BioException from SeqIOTools


Hi -
 
This sort of thing used to show up on large files with earlier versions of biojava. What version are you using?
 
- Mark
 

	-----Original Message----- 
	From: Ren, Zhen [mailto:zren at amylin.com] 
	Sent: Wed 9/04/2003 5:01 a.m. 
	To: biojava-l at biojava.org 
	Cc: 
	Subject: [Biojava-l] BioException from SeqIOTools
	
	

	Hi, there,
	
	Can anyone tell me what is wrong in the following snippet?  I can not attach you my troubling big FASTA file with lots of protein sequences in it.  When the problematic sequence is extracted from the file, the exception disappears.  Thanks so much.
	
	Zhen
	
	import java.io.*;
	import org.biojava.bio.*;
	import org.biojava.bio.seq.*;
	import org.biojava.bio.seq.io.*;
	
	public class TestSeqIOTools {
	
	    public static void main(String[] args) {
	
	        if (args.length != 1) {
	            System.out.println("Usage: java TestSeqIOTools filename.fasta");
	            System.exit(1);
	        }
	
	        try {
	            BufferedReader fin = new BufferedReader(new FileReader(args[0]));
	            SequenceIterator stream = SeqIOTools.readFastaProtein(fin);
	            while(stream.hasNext()) {
	                Sequence seq = stream.nextSequence();
	                System.out.println(">" + seq.getName());
	                System.out.println(seq.seqString());
	            }
	            fin.close();
	        } catch(BioException e) {
	            System.err.println("BioException: " + e.getMessage());
	            e.printStackTrace();
	            System.exit(0);
	        } catch(IOException ex) {
	            System.err.println("IOException: " + ex.getMessage());
	        }
	    }
	}
	
	C:\Biojava\trouble>javac TestSeqIOTools.java
	
	C:\Biojava\trouble>java TestSeqIOTools mySeqs.fasta
	......
	>AAY11855;
	MTRECPSPAPGPGAPLSGSVLAEAAVVFAVVLSIHATVW
	BioException: Could not read sequence
	java.io.IOException: Can't reset: Mark invalid parseStart=89 bytesRead=512
	        at org.biojava.bio.seq.io.FastaFormat.readSequenceData(FastaFormat.java:170)
	        at org.biojava.bio.seq.io.FastaFormat.readSequence(FastaFormat.java:120)
	        at org.biojava.bio.seq.io.StreamReader.nextSequence(StreamReader.java:100)
	rethrown as org.biojava.bio.BioException: Could not read sequence
	        at org.biojava.bio.seq.io.StreamReader.nextSequence(StreamReader.java:103)
	        at TestSeqIOTools.main(TestSeqIOTools.java:19)
	
	_______________________________________________
	Biojava-l mailing list  -  Biojava-l at biojava.org
	http://biojava.org/mailman/listinfo/biojava-l
	


=======================================================================
Attention: The information contained in this message and/or attachments
from AgResearch Limited is intended only for the persons or entities
to which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipients is prohibited by AgResearch
Limited. If you have received this message in error, please notify the
sender immediately.
=======================================================================



More information about the Biojava-l mailing list