vamsasSet.setGapChar(jal.getGapCharacter() + "");
+ if(jal.getProperties()!=null)
+ {
+ Enumeration en = jal.getProperties().keys();
+ while(en.hasMoreElements())
+ {
+ String key = en.nextElement().toString();
+ SequenceSetProperties ssp = new SequenceSetProperties();
+ ssp.setKey(key);
+ ssp.setValue(jal.getProperties().get(key).toString());
+ vamsasSet.addSequenceSetProperties(ssp);
+ }
+ }
+
JSeq jseq;
//SAVE SEQUENCES
jalview.datamodel.Alignment al =
new jalview.datamodel.Alignment(orderedSeqs);
+ for(int i=0; i<vamsasSet.getSequenceSetPropertiesCount(); i++ )
+ {
+ SequenceSetProperties ssp = vamsasSet.getSequenceSetProperties(i);
+ al.setProperty(ssp.getKey(), ssp.getValue());
+ }
+
+
al.setDataset(null);
/////////////////////////////////
*/\r
private java.util.Vector _annotationList;\r
\r
+ /**\r
+ * Field _sequenceSetPropertiesList\r
+ */\r
+ private java.util.Vector _sequenceSetPropertiesList;\r
+\r
\r
//----------------/\r
//- Constructors -/\r
super();\r
_sequenceList = new Vector();\r
_annotationList = new Vector();\r
+ _sequenceSetPropertiesList = new Vector();\r
} //-- jalview.schemabinding.version2.SequenceSet()\r
\r
\r
} //-- void addSequence(int, jalview.schemabinding.version2.Sequence) \r
\r
/**\r
+ * Method addSequenceSetProperties\r
+ * \r
+ * \r
+ * \r
+ * @param vSequenceSetProperties\r
+ */\r
+ public void addSequenceSetProperties(jalview.schemabinding.version2.SequenceSetProperties vSequenceSetProperties)\r
+ throws java.lang.IndexOutOfBoundsException\r
+ {\r
+ _sequenceSetPropertiesList.addElement(vSequenceSetProperties);\r
+ } //-- void addSequenceSetProperties(jalview.schemabinding.version2.SequenceSetProperties) \r
+\r
+ /**\r
+ * Method addSequenceSetProperties\r
+ * \r
+ * \r
+ * \r
+ * @param index\r
+ * @param vSequenceSetProperties\r
+ */\r
+ public void addSequenceSetProperties(int index, jalview.schemabinding.version2.SequenceSetProperties vSequenceSetProperties)\r
+ throws java.lang.IndexOutOfBoundsException\r
+ {\r
+ _sequenceSetPropertiesList.insertElementAt(vSequenceSetProperties, index);\r
+ } //-- void addSequenceSetProperties(int, jalview.schemabinding.version2.SequenceSetProperties) \r
+\r
+ /**\r
* Method enumerateAnnotation\r
* \r
* \r
} //-- java.util.Enumeration enumerateSequence() \r
\r
/**\r
+ * Method enumerateSequenceSetProperties\r
+ * \r
+ * \r
+ * \r
+ * @return Enumeration\r
+ */\r
+ public java.util.Enumeration enumerateSequenceSetProperties()\r
+ {\r
+ return _sequenceSetPropertiesList.elements();\r
+ } //-- java.util.Enumeration enumerateSequenceSetProperties() \r
+\r
+ /**\r
* Method getAnnotation\r
* \r
* \r
} //-- int getSequenceCount() \r
\r
/**\r
+ * Method getSequenceSetProperties\r
+ * \r
+ * \r
+ * \r
+ * @param index\r
+ * @return SequenceSetProperties\r
+ */\r
+ public jalview.schemabinding.version2.SequenceSetProperties getSequenceSetProperties(int index)\r
+ throws java.lang.IndexOutOfBoundsException\r
+ {\r
+ //-- check bounds for index\r
+ if ((index < 0) || (index > _sequenceSetPropertiesList.size())) {\r
+ throw new IndexOutOfBoundsException();\r
+ }\r
+ \r
+ return (jalview.schemabinding.version2.SequenceSetProperties) _sequenceSetPropertiesList.elementAt(index);\r
+ } //-- jalview.schemabinding.version2.SequenceSetProperties getSequenceSetProperties(int) \r
+\r
+ /**\r
+ * Method getSequenceSetProperties\r
+ * \r
+ * \r
+ * \r
+ * @return SequenceSetProperties\r
+ */\r
+ public jalview.schemabinding.version2.SequenceSetProperties[] getSequenceSetProperties()\r
+ {\r
+ int size = _sequenceSetPropertiesList.size();\r
+ jalview.schemabinding.version2.SequenceSetProperties[] mArray = new jalview.schemabinding.version2.SequenceSetProperties[size];\r
+ for (int index = 0; index < size; index++) {\r
+ mArray[index] = (jalview.schemabinding.version2.SequenceSetProperties) _sequenceSetPropertiesList.elementAt(index);\r
+ }\r
+ return mArray;\r
+ } //-- jalview.schemabinding.version2.SequenceSetProperties[] getSequenceSetProperties() \r
+\r
+ /**\r
+ * Method getSequenceSetPropertiesCount\r
+ * \r
+ * \r
+ * \r
+ * @return int\r
+ */\r
+ public int getSequenceSetPropertiesCount()\r
+ {\r
+ return _sequenceSetPropertiesList.size();\r
+ } //-- int getSequenceSetPropertiesCount() \r
+\r
+ /**\r
* Method isValid\r
* \r
* \r
} //-- void removeAllSequence() \r
\r
/**\r
+ * Method removeAllSequenceSetProperties\r
+ * \r
+ */\r
+ public void removeAllSequenceSetProperties()\r
+ {\r
+ _sequenceSetPropertiesList.removeAllElements();\r
+ } //-- void removeAllSequenceSetProperties() \r
+\r
+ /**\r
* Method removeAnnotation\r
* \r
* \r
} //-- jalview.schemabinding.version2.Sequence removeSequence(int) \r
\r
/**\r
+ * Method removeSequenceSetProperties\r
+ * \r
+ * \r
+ * \r
+ * @param index\r
+ * @return SequenceSetProperties\r
+ */\r
+ public jalview.schemabinding.version2.SequenceSetProperties removeSequenceSetProperties(int index)\r
+ {\r
+ java.lang.Object obj = _sequenceSetPropertiesList.elementAt(index);\r
+ _sequenceSetPropertiesList.removeElementAt(index);\r
+ return (jalview.schemabinding.version2.SequenceSetProperties) obj;\r
+ } //-- jalview.schemabinding.version2.SequenceSetProperties removeSequenceSetProperties(int) \r
+\r
+ /**\r
* Method setAnnotation\r
* \r
* \r
} //-- void setSequence(jalview.schemabinding.version2.Sequence) \r
\r
/**\r
+ * Method setSequenceSetProperties\r
+ * \r
+ * \r
+ * \r
+ * @param index\r
+ * @param vSequenceSetProperties\r
+ */\r
+ public void setSequenceSetProperties(int index, jalview.schemabinding.version2.SequenceSetProperties vSequenceSetProperties)\r
+ throws java.lang.IndexOutOfBoundsException\r
+ {\r
+ //-- check bounds for index\r
+ if ((index < 0) || (index > _sequenceSetPropertiesList.size())) {\r
+ throw new IndexOutOfBoundsException();\r
+ }\r
+ _sequenceSetPropertiesList.setElementAt(vSequenceSetProperties, index);\r
+ } //-- void setSequenceSetProperties(int, jalview.schemabinding.version2.SequenceSetProperties) \r
+\r
+ /**\r
+ * Method setSequenceSetProperties\r
+ * \r
+ * \r
+ * \r
+ * @param sequenceSetPropertiesArray\r
+ */\r
+ public void setSequenceSetProperties(jalview.schemabinding.version2.SequenceSetProperties[] sequenceSetPropertiesArray)\r
+ {\r
+ //-- copy array\r
+ _sequenceSetPropertiesList.removeAllElements();\r
+ for (int i = 0; i < sequenceSetPropertiesArray.length; i++) {\r
+ _sequenceSetPropertiesList.addElement(sequenceSetPropertiesArray[i]);\r
+ }\r
+ } //-- void setSequenceSetProperties(jalview.schemabinding.version2.SequenceSetProperties) \r
+\r
+ /**\r
* Method unmarshal\r
* \r
* \r
{ //-- local scope\r
}\r
desc.setValidator(fieldValidator);\r
+ //-- _sequenceSetPropertiesList\r
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.SequenceSetProperties.class, "_sequenceSetPropertiesList", "sequenceSetProperties", org.exolab.castor.xml.NodeType.Element);\r
+ handler = (new org.exolab.castor.xml.XMLFieldHandler() {\r
+ public java.lang.Object getValue( java.lang.Object object ) \r
+ throws IllegalStateException\r
+ {\r
+ SequenceSet target = (SequenceSet) object;\r
+ return target.getSequenceSetProperties();\r
+ }\r
+ public void setValue( java.lang.Object object, java.lang.Object value) \r
+ throws IllegalStateException, IllegalArgumentException\r
+ {\r
+ try {\r
+ SequenceSet target = (SequenceSet) object;\r
+ target.addSequenceSetProperties( (jalview.schemabinding.version2.SequenceSetProperties) value);\r
+ }\r
+ catch (java.lang.Exception ex) {\r
+ throw new IllegalStateException(ex.toString());\r
+ }\r
+ }\r
+ public java.lang.Object newInstance( java.lang.Object parent ) {\r
+ return new jalview.schemabinding.version2.SequenceSetProperties();\r
+ }\r
+ } );\r
+ desc.setHandler(handler);\r
+ desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");\r
+ desc.setMultivalued(true);\r
+ addFieldDescriptor(desc);\r
+ \r
+ //-- validation code for: _sequenceSetPropertiesList\r
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();\r
+ fieldValidator.setMinOccurs(0);\r
+ { //-- local scope\r
+ }\r
+ desc.setValidator(fieldValidator);\r
} //-- jalview.schemabinding.version2.SequenceSetDescriptor()\r
\r
\r
--- /dev/null
+/*\r
+ * This class was automatically generated with \r
+ * <a href="http://www.castor.org">Castor 0.9.6</a>, using an XML\r
+ * Schema.\r
+ * $Id$\r
+ */\r
+\r
+package jalview.schemabinding.version2;\r
+\r
+ //---------------------------------/\r
+ //- Imported classes and packages -/\r
+//---------------------------------/\r
+\r
+import java.io.IOException;\r
+import java.io.Reader;\r
+import java.io.Serializable;\r
+import java.io.Writer;\r
+import org.exolab.castor.xml.MarshalException;\r
+import org.exolab.castor.xml.Marshaller;\r
+import org.exolab.castor.xml.Unmarshaller;\r
+import org.exolab.castor.xml.ValidationException;\r
+import org.xml.sax.ContentHandler;\r
+\r
+/**\r
+ * Class SequenceSetProperties.\r
+ * \r
+ * @version $Revision$ $Date$\r
+ */\r
+public class SequenceSetProperties implements java.io.Serializable {\r
+\r
+\r
+ //--------------------------/\r
+ //- Class/Member Variables -/\r
+ //--------------------------/\r
+\r
+ /**\r
+ * Field _key\r
+ */\r
+ private java.lang.String _key;\r
+\r
+ /**\r
+ * Field _value\r
+ */\r
+ private java.lang.String _value;\r
+\r
+\r
+ //----------------/\r
+ //- Constructors -/\r
+ //----------------/\r
+\r
+ public SequenceSetProperties() {\r
+ super();\r
+ } //-- jalview.schemabinding.version2.SequenceSetProperties()\r
+\r
+\r
+ //-----------/\r
+ //- Methods -/\r
+ //-----------/\r
+\r
+ /**\r
+ * Returns the value of field 'key'.\r
+ * \r
+ * @return String\r
+ * @return the value of field 'key'.\r
+ */\r
+ public java.lang.String getKey()\r
+ {\r
+ return this._key;\r
+ } //-- java.lang.String getKey() \r
+\r
+ /**\r
+ * Returns the value of field 'value'.\r
+ * \r
+ * @return String\r
+ * @return the value of field 'value'.\r
+ */\r
+ public java.lang.String getValue()\r
+ {\r
+ return this._value;\r
+ } //-- java.lang.String getValue() \r
+\r
+ /**\r
+ * Method isValid\r
+ * \r
+ * \r
+ * \r
+ * @return boolean\r
+ */\r
+ public boolean isValid()\r
+ {\r
+ try {\r
+ validate();\r
+ }\r
+ catch (org.exolab.castor.xml.ValidationException vex) {\r
+ return false;\r
+ }\r
+ return true;\r
+ } //-- boolean isValid() \r
+\r
+ /**\r
+ * Method marshal\r
+ * \r
+ * \r
+ * \r
+ * @param out\r
+ */\r
+ public void marshal(java.io.Writer out)\r
+ throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
+ {\r
+ \r
+ Marshaller.marshal(this, out);\r
+ } //-- void marshal(java.io.Writer) \r
+\r
+ /**\r
+ * Method marshal\r
+ * \r
+ * \r
+ * \r
+ * @param handler\r
+ */\r
+ public void marshal(org.xml.sax.ContentHandler handler)\r
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
+ {\r
+ \r
+ Marshaller.marshal(this, handler);\r
+ } //-- void marshal(org.xml.sax.ContentHandler) \r
+\r
+ /**\r
+ * Sets the value of field 'key'.\r
+ * \r
+ * @param key the value of field 'key'.\r
+ */\r
+ public void setKey(java.lang.String key)\r
+ {\r
+ this._key = key;\r
+ } //-- void setKey(java.lang.String) \r
+\r
+ /**\r
+ * Sets the value of field 'value'.\r
+ * \r
+ * @param value the value of field 'value'.\r
+ */\r
+ public void setValue(java.lang.String value)\r
+ {\r
+ this._value = value;\r
+ } //-- void setValue(java.lang.String) \r
+\r
+ /**\r
+ * Method unmarshal\r
+ * \r
+ * \r
+ * \r
+ * @param reader\r
+ * @return Object\r
+ */\r
+ public static java.lang.Object unmarshal(java.io.Reader reader)\r
+ throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
+ {\r
+ return (jalview.schemabinding.version2.SequenceSetProperties) Unmarshaller.unmarshal(jalview.schemabinding.version2.SequenceSetProperties.class, reader);\r
+ } //-- java.lang.Object unmarshal(java.io.Reader) \r
+\r
+ /**\r
+ * Method validate\r
+ * \r
+ */\r
+ public void validate()\r
+ throws org.exolab.castor.xml.ValidationException\r
+ {\r
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
+ validator.validate(this);\r
+ } //-- void validate() \r
+\r
+}\r
--- /dev/null
+/*\r
+ * This class was automatically generated with \r
+ * <a href="http://www.castor.org">Castor 0.9.6</a>, using an XML\r
+ * Schema.\r
+ * $Id$\r
+ */\r
+\r
+package jalview.schemabinding.version2;\r
+\r
+ //---------------------------------/\r
+ //- Imported classes and packages -/\r
+//---------------------------------/\r
+\r
+import org.exolab.castor.mapping.AccessMode;\r
+import org.exolab.castor.xml.TypeValidator;\r
+import org.exolab.castor.xml.XMLFieldDescriptor;\r
+import org.exolab.castor.xml.validators.*;\r
+\r
+/**\r
+ * Class SequenceSetPropertiesDescriptor.\r
+ * \r
+ * @version $Revision$ $Date$\r
+ */\r
+public class SequenceSetPropertiesDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {\r
+\r
+\r
+ //--------------------------/\r
+ //- Class/Member Variables -/\r
+ //--------------------------/\r
+\r
+ /**\r
+ * Field nsPrefix\r
+ */\r
+ private java.lang.String nsPrefix;\r
+\r
+ /**\r
+ * Field nsURI\r
+ */\r
+ private java.lang.String nsURI;\r
+\r
+ /**\r
+ * Field xmlName\r
+ */\r
+ private java.lang.String xmlName;\r
+\r
+ /**\r
+ * Field identity\r
+ */\r
+ private org.exolab.castor.xml.XMLFieldDescriptor identity;\r
+\r
+\r
+ //----------------/\r
+ //- Constructors -/\r
+ //----------------/\r
+\r
+ public SequenceSetPropertiesDescriptor() {\r
+ super();\r
+ nsURI = "www.vamsas.ac.uk/jalview/version2";\r
+ xmlName = "sequenceSetProperties";\r
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;\r
+ org.exolab.castor.xml.XMLFieldHandler handler = null;\r
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;\r
+ //-- initialize attribute descriptors\r
+ \r
+ //-- _key\r
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_key", "key", org.exolab.castor.xml.NodeType.Attribute);\r
+ desc.setImmutable(true);\r
+ handler = (new org.exolab.castor.xml.XMLFieldHandler() {\r
+ public java.lang.Object getValue( java.lang.Object object ) \r
+ throws IllegalStateException\r
+ {\r
+ SequenceSetProperties target = (SequenceSetProperties) object;\r
+ return target.getKey();\r
+ }\r
+ public void setValue( java.lang.Object object, java.lang.Object value) \r
+ throws IllegalStateException, IllegalArgumentException\r
+ {\r
+ try {\r
+ SequenceSetProperties target = (SequenceSetProperties) object;\r
+ target.setKey( (java.lang.String) value);\r
+ }\r
+ catch (java.lang.Exception ex) {\r
+ throw new IllegalStateException(ex.toString());\r
+ }\r
+ }\r
+ public java.lang.Object newInstance( java.lang.Object parent ) {\r
+ return null;\r
+ }\r
+ } );\r
+ desc.setHandler(handler);\r
+ addFieldDescriptor(desc);\r
+ \r
+ //-- validation code for: _key\r
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();\r
+ { //-- local scope\r
+ StringValidator typeValidator = new StringValidator();\r
+ typeValidator.setWhiteSpace("preserve");\r
+ fieldValidator.setValidator(typeValidator);\r
+ }\r
+ desc.setValidator(fieldValidator);\r
+ //-- _value\r
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_value", "value", org.exolab.castor.xml.NodeType.Attribute);\r
+ desc.setImmutable(true);\r
+ handler = (new org.exolab.castor.xml.XMLFieldHandler() {\r
+ public java.lang.Object getValue( java.lang.Object object ) \r
+ throws IllegalStateException\r
+ {\r
+ SequenceSetProperties target = (SequenceSetProperties) object;\r
+ return target.getValue();\r
+ }\r
+ public void setValue( java.lang.Object object, java.lang.Object value) \r
+ throws IllegalStateException, IllegalArgumentException\r
+ {\r
+ try {\r
+ SequenceSetProperties target = (SequenceSetProperties) object;\r
+ target.setValue( (java.lang.String) value);\r
+ }\r
+ catch (java.lang.Exception ex) {\r
+ throw new IllegalStateException(ex.toString());\r
+ }\r
+ }\r
+ public java.lang.Object newInstance( java.lang.Object parent ) {\r
+ return null;\r
+ }\r
+ } );\r
+ desc.setHandler(handler);\r
+ addFieldDescriptor(desc);\r
+ \r
+ //-- validation code for: _value\r
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();\r
+ { //-- local scope\r
+ StringValidator typeValidator = new StringValidator();\r
+ typeValidator.setWhiteSpace("preserve");\r
+ fieldValidator.setValidator(typeValidator);\r
+ }\r
+ desc.setValidator(fieldValidator);\r
+ //-- initialize element descriptors\r
+ \r
+ } //-- jalview.schemabinding.version2.SequenceSetPropertiesDescriptor()\r
+\r
+\r
+ //-----------/\r
+ //- Methods -/\r
+ //-----------/\r
+\r
+ /**\r
+ * Method getAccessMode\r
+ * \r
+ * \r
+ * \r
+ * @return AccessMode\r
+ */\r
+ public org.exolab.castor.mapping.AccessMode getAccessMode()\r
+ {\r
+ return null;\r
+ } //-- org.exolab.castor.mapping.AccessMode getAccessMode() \r
+\r
+ /**\r
+ * Method getExtends\r
+ * \r
+ * \r
+ * \r
+ * @return ClassDescriptor\r
+ */\r
+ public org.exolab.castor.mapping.ClassDescriptor getExtends()\r
+ {\r
+ return null;\r
+ } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() \r
+\r
+ /**\r
+ * Method getIdentity\r
+ * \r
+ * \r
+ * \r
+ * @return FieldDescriptor\r
+ */\r
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity()\r
+ {\r
+ return identity;\r
+ } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() \r
+\r
+ /**\r
+ * Method getJavaClass\r
+ * \r
+ * \r
+ * \r
+ * @return Class\r
+ */\r
+ public java.lang.Class getJavaClass()\r
+ {\r
+ return jalview.schemabinding.version2.SequenceSetProperties.class;\r
+ } //-- java.lang.Class getJavaClass() \r
+\r
+ /**\r
+ * Method getNameSpacePrefix\r
+ * \r
+ * \r
+ * \r
+ * @return String\r
+ */\r
+ public java.lang.String getNameSpacePrefix()\r
+ {\r
+ return nsPrefix;\r
+ } //-- java.lang.String getNameSpacePrefix() \r
+\r
+ /**\r
+ * Method getNameSpaceURI\r
+ * \r
+ * \r
+ * \r
+ * @return String\r
+ */\r
+ public java.lang.String getNameSpaceURI()\r
+ {\r
+ return nsURI;\r
+ } //-- java.lang.String getNameSpaceURI() \r
+\r
+ /**\r
+ * Method getValidator\r
+ * \r
+ * \r
+ * \r
+ * @return TypeValidator\r
+ */\r
+ public org.exolab.castor.xml.TypeValidator getValidator()\r
+ {\r
+ return this;\r
+ } //-- org.exolab.castor.xml.TypeValidator getValidator() \r
+\r
+ /**\r
+ * Method getXMLName\r
+ * \r
+ * \r
+ * \r
+ * @return String\r
+ */\r
+ public java.lang.String getXMLName()\r
+ {\r
+ return xmlName;\r
+ } //-- java.lang.String getXMLName() \r
+\r
+}\r