/*\r
* Jalview - A Sequence Alignment Editor and Viewer\r
-* Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
+* Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
*\r
* This program is free software; you can redistribute it and/or\r
* modify it under the terms of the GNU General Public License\r
int noSeqs = 0;\r
int maxLength = 0;\r
Vector seqs;\r
- Vector headers;\r
+ Vector annotations;\r
long start;\r
long end;\r
boolean jvSuffix = true;\r
{\r
}\r
\r
- /**\r
- * Creates a new AlignFile object.\r
- *\r
- * @param inStr DOCUMENT ME!\r
- */\r
- public AlignFile(String inStr)\r
- {\r
- initData();\r
- System.out.println("is this ever called??");\r
-\r
- try\r
- {\r
- parse();\r
- }\r
- catch (Exception ex)\r
- {\r
- }\r
- }\r
\r
/**\r
* Constructor which parses the data from a file of some specified type.\r
return s;\r
}\r
\r
+ public void addAnnotations(Alignment al)\r
+ {\r
+ for(int i=0; i<annotations.size(); i++)\r
+ {\r
+ al.addAnnotation(\r
+ (AlignmentAnnotation)annotations.elementAt(i)\r
+ );\r
+ }\r
+\r
+ }\r
+\r
/**\r
* Initialise objects to store sequence data in.\r
*/\r
protected void initData()\r
{\r
seqs = new Vector();\r
- headers = new Vector();\r
+ annotations = new Vector();\r
}\r
\r
/**\r
}\r
\r
// Checks whether sequence is valid aa characters\r
- protected boolean isValidProteinSequence(String sequence)\r
+ protected boolean isValidProteinSequence(char [] sequence)\r
{\r
- for (int i = 0; i < sequence.length(); i++)\r
- if (!jalview.schemes.ResidueProperties.aaHash.containsKey(\r
- String.valueOf(sequence.charAt(i))))\r
+ for (int i = 0; i < sequence.length; i++)\r
+ if (jalview.schemes.ResidueProperties.aaIndex[sequence[i]]==-1)\r
{\r
- invalidCharacter = sequence.charAt(i);\r
+ invalidCharacter = sequence[i];\r
return false;\r
}\r
\r