import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.Vector;
import java.util.regex.Matcher;
import jalview.analysis.SecStrConsensus.SimpleBP;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.Annotation;
-import jalview.datamodel.SecondaryStructureAnnotation;
import jalview.datamodel.Sequence;
-import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;
import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied;
-import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;
import fr.orsay.lri.varna.factories.RNAFactory;
-import fr.orsay.lri.varna.factories.RNAFactory.RNAFileType;
import fr.orsay.lri.varna.models.rna.RNA;
-import fr.orsay.lri.varna.utils.RNAMLParser;
+/**
+ * @author jimp
+ *
+ */
public class RnamlFile extends AlignFile {
public int id;
public String namefile;
return r;
}
+ /* (non-Javadoc)
+ * @see jalview.io.AlignFile#parse()
+ */
+ public void parse() throws IOException
+ {
+ // rather than lose exception semantics whilst parsing RNAML with VARNA we
+ // wrap the routine and catch all exceptions before passing them up the
+ // chain as an IOException
+ try {
+ _parse();
+ } catch (Exception x)
+ {
+ error=true;
+ errormessage="Problem parsing data as RNAML ("+x.getMessage()+")";
+ throw new IOException("Couldn't parse the datasource as RNAML",x);
+ }
+ }
@SuppressWarnings("unchecked")
- public void parse() throws FileNotFoundException,
+ public void _parse() throws FileNotFoundException,
ExceptionPermissionDenied, ExceptionLoadingFailed,
ExceptionFileFormatOrSyntax {