--- /dev/null
+/**
+ *
+ */
+package org.vamsas.test.objects;
+
+import org.vamsas.objects.core.Alignment;
+import org.vamsas.objects.core.AlignmentSequence;
+import org.vamsas.objects.core.DataSet;
+import org.vamsas.objects.core.Sequence;
+import org.vamsas.objects.core.VAMSAS;
+
+/**
+ * @author jim
+ * test XSD-Java binding classes in org.vamsas.objects.core
+ */
+public class Core {
+ /**
+ *
+ * complete any automatically completable entries in the dataset
+ * @param ds
+ */
+ public static void complete(DataSet ds) {
+ Sequence[] q = ds.getSequence();
+ for (int i=0,j=q.length; i<j; i++) {
+ q[i].setStart(i+1);
+ q[i].setEnd(q[i].getSequence().length()+i+1);
+ }
+ }
+ public static Sequence Sequence(String Name, String Sequence, String Dictionary, int start, int end) {
+ Sequence seq= new Sequence();
+ seq.setDictionary(Dictionary);
+ seq.setName(Name);
+ seq.setSequence(Sequence);
+ seq.setStart(start);
+ if (start<=end) {
+ if ((end-start)!=Sequence.length())
+ seq.setEnd(start+Sequence.length());
+ } else {
+ // reverse topology mapping. TODO: decide if allowed to do start>end on Sequence object
+ if ((start-end)!=Sequence.length())
+ seq.setEnd(end+Sequence.length());
+ }
+ return seq;
+ }
+ public static VAMSAS getDemoVamsas() {
+ VAMSAS v=new VAMSAS();
+ DataSet ds = new DataSet();
+ ds.addSequence(Sequence("Dummy1","ASDFLEQ",
+ seq.setDictionary("info:iubmb.org/aminoacids");
+ seq.setName(
+ ds.addSequence(seq);
+ seq = new Sequence();
+ seq.setDictionary("info:iubmb.org/aminoacids");
+ seq.setName("Dummy1");
+ seq.setSequence("ASDFLEQ");
+ complete(ds);
+ v.addDataSet(ds);
+ Alignment al = new Alignment();
+
+ al.addAlignmentSequence(new AlignmentSequence());
+ return v;
+ }
+ /**
+ * @param args
+ */
+ public static void main(String[] args) {
+ // TODO Auto-generated method stub
+
+ }
+
+}