*/
package jalview.gui;
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.GridLayout;
-import java.awt.Rectangle;
-import java.awt.Toolkit;
-import java.awt.datatransfer.Clipboard;
-import java.awt.datatransfer.DataFlavor;
-import java.awt.datatransfer.StringSelection;
-import java.awt.datatransfer.Transferable;
-import java.awt.dnd.DnDConstants;
-import java.awt.dnd.DropTargetDragEvent;
-import java.awt.dnd.DropTargetDropEvent;
-import java.awt.dnd.DropTargetEvent;
-import java.awt.dnd.DropTargetListener;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.awt.event.KeyAdapter;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.print.PageFormat;
-import java.awt.print.PrinterJob;
-import java.beans.PropertyChangeEvent;
-import java.io.File;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Deque;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Set;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JCheckBoxMenuItem;
-import javax.swing.JEditorPane;
-import javax.swing.JInternalFrame;
-import javax.swing.JLabel;
-import javax.swing.JLayeredPane;
-import javax.swing.JMenu;
-import javax.swing.JMenuItem;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JProgressBar;
-import javax.swing.JRadioButtonMenuItem;
-import javax.swing.JScrollPane;
-import javax.swing.SwingUtilities;
-
import jalview.analysis.AAFrequency;
import jalview.analysis.AlignmentSorter;
import jalview.analysis.AlignmentUtils;
import jalview.ws.jws2.jabaws2.Jws2Instance;
import jalview.ws.seqfetcher.DbSourceProxy;
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.GridLayout;
+import java.awt.Rectangle;
+import java.awt.Toolkit;
+import java.awt.datatransfer.Clipboard;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.StringSelection;
+import java.awt.datatransfer.Transferable;
+import java.awt.dnd.DnDConstants;
+import java.awt.dnd.DropTargetDragEvent;
+import java.awt.dnd.DropTargetDropEvent;
+import java.awt.dnd.DropTargetEvent;
+import java.awt.dnd.DropTargetListener;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.print.PageFormat;
+import java.awt.print.PrinterJob;
+import java.beans.PropertyChangeEvent;
+import java.io.File;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Deque;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Set;
+import java.util.Vector;
+
+import javax.swing.JButton;
+import javax.swing.JCheckBoxMenuItem;
+import javax.swing.JEditorPane;
+import javax.swing.JInternalFrame;
+import javax.swing.JLabel;
+import javax.swing.JLayeredPane;
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JProgressBar;
+import javax.swing.JRadioButtonMenuItem;
+import javax.swing.JScrollPane;
+import javax.swing.SwingUtilities;
+
/**
* DOCUMENT ME!
*
try
{
+ Desktop.setCurrentAlignFrame(this);
cap.setText(new FormatAdapter().formatSequences(e.getActionCommand(),
viewport.getAlignment(), omitHidden,
viewport.getColumnSelection()));
af.statusBar.setText(MessageManager
.getString("label.successfully_pasted_alignment_file"));
+
+ af.setShowSeqFeatures(true);
+ af.changeColour(Desktop.getCurrentGlobalColourScheme());
+ af.setMenusForViewport();
+
try
{
af.setMaximum(jalview.bin.Cache.getDefault("SHOW_FULLSCREEN",
*/
package jalview.gui;
+import jalview.api.AlignViewportI;
+import jalview.api.AlignmentViewPanel;
+import jalview.bin.Cache;
+import jalview.io.FileLoader;
+import jalview.io.FormatAdapter;
+import jalview.io.IdentifyFile;
+import jalview.io.JalviewFileChooser;
+import jalview.io.JalviewFileView;
+import jalview.jbgui.GSplitFrame;
+import jalview.jbgui.GStructureViewer;
+import jalview.schemes.ColourSchemeI;
+import jalview.structure.StructureSelectionManager;
+import jalview.util.ImageMaker;
+import jalview.util.MessageManager;
+import jalview.viewmodel.AlignmentViewport;
+import jalview.ws.params.ParamManager;
+
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.event.MenuEvent;
import javax.swing.event.MenuListener;
-import jalview.api.AlignViewportI;
-import jalview.api.AlignmentViewPanel;
-import jalview.bin.Cache;
-import jalview.io.FileLoader;
-import jalview.io.FormatAdapter;
-import jalview.io.IdentifyFile;
-import jalview.io.JalviewFileChooser;
-import jalview.io.JalviewFileView;
-import jalview.jbgui.GSplitFrame;
-import jalview.jbgui.GStructureViewer;
-import jalview.structure.StructureSelectionManager;
-import jalview.util.ImageMaker;
-import jalview.util.MessageManager;
-import jalview.viewmodel.AlignmentViewport;
-import jalview.ws.params.ParamManager;
-
/**
* Jalview Desktop
*
private static final int THREE = 3;
+ private static AlignFrame currentAlignFrame;
+
+ private static ColourSchemeI currentGlobalColourScheme;
+
public static jalview.ws.jws1.Discoverer discoverer;
public static Object[] jalviewClipboard;
{
new FileLoader().LoadFile(viewport, choice, FormatAdapter.FILE,
format);
+
+ viewport.setShowSequenceFeatures(true);
+ viewport.getAlignPanel().alignFrame.changeColour(Desktop
+ .getCurrentGlobalColourScheme());
+ viewport.getAlignPanel().alignFrame.setMenusForViewport();
}
else
{
myTopFrame.setDisplayedView(myTopFrame.alignPanel);
}
+
+ public static AlignFrame getCurrentAlignFrame()
+ {
+ return currentAlignFrame;
+ }
+
+ public static void setCurrentAlignFrame(AlignFrame currentAlignFrame)
+ {
+ Desktop.currentAlignFrame = currentAlignFrame;
+ }
+
+ public static ColourSchemeI getCurrentGlobalColourScheme()
+ {
+ return currentGlobalColourScheme;
+ }
+
+ public static void setCurrentGlobalColourScheme(
+ ColourSchemeI currentGlobalColourScheme)
+ {
+ Desktop.currentGlobalColourScheme = currentGlobalColourScheme;
+ }
+
+
}
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentI;
import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
import jalview.util.MessageManager;
import java.io.IOException;
+import java.util.ArrayList;
import java.util.Enumeration;
import java.util.Hashtable;
+import java.util.List;
import java.util.Vector;
/**
protected Vector<AlignmentAnnotation> annotations;
/**
+ * SequenceGroups to be added to the alignment object
+ */
+ protected List<SequenceGroup> seqGroups;
+
+ /**
* Properties to be added to generated alignment object
*/
protected Hashtable properties;
for (int i = 0; i < seqs.size(); i++)
{
- s[i] = (SequenceI) seqs.elementAt(i);
+ s[i] = seqs.elementAt(i);
}
return s;
* Rna.GetBasePairsFromAlignmentAnnotation(annotations.elementAt(i));
* Rna.HelixMap(pairArray);
*/
- AlignmentAnnotation an = (AlignmentAnnotation) annotations
+ AlignmentAnnotation an = annotations
.elementAt(i);
an.validateRangeAndDisplay();
al.addAnnotation(an);
}
+ public void addSeqGroups(AlignmentI al)
+ {
+ this.seqGroups = al.getGroups();
+ }
+
/**
* Add any additional information extracted from the file to the alignment
* properties.
{
seqs = new Vector();
annotations = new Vector();
+ seqGroups = new ArrayList<SequenceGroup>();
parseCalled=false;
}
*/
public static final String[] READABLE_FORMATS = new String[]
{ "BLC", "CLUSTAL", "FASTA", "MSF", "PileUp", "PIR", "PFAM", "STH",
- "PDB", "JnetFile", "RNAML", PhylipFile.FILE_DESC, "HTML" };
+ "PDB", "JnetFile", "RNAML", PhylipFile.FILE_DESC, JSONFile.FILE_DESC,
+ "HTML" };
/**
* List of readable format file extensions by application in order
*/
public static final String[] READABLE_EXTENSIONS = new String[]
{ "fa, fasta, mfa, fastq", "aln", "pfam", "msf", "pir", "blc", "amsa",
- "sto,stk", "xml,rnaml", PhylipFile.FILE_EXT, "jar,jvp", "html" };
+ "sto,stk", "xml,rnaml", PhylipFile.FILE_EXT, JSONFile.FILE_EXT,
+ "jar,jvp", "html" };
/**
* List of readable formats by application in order corresponding to
*/
public static final String[] READABLE_FNAMES = new String[]
{ "Fasta", "Clustal", "PFAM", "MSF", "PIR", "BLC", "AMSA", "Stockholm",
- "RNAML", PhylipFile.FILE_DESC, "Jalview", "HTML" };
+ "RNAML", PhylipFile.FILE_DESC, JSONFile.FILE_DESC, "Jalview", "HTML" };
/**
* List of valid format strings for use by callers of the formatSequences
*/
public static final String[] WRITEABLE_FORMATS = new String[]
{ "BLC", "CLUSTAL", "FASTA", "MSF", "PileUp", "PIR", "PFAM", "AMSA",
- "STH", PhylipFile.FILE_DESC };
+ "STH", PhylipFile.FILE_DESC, JSONFile.FILE_DESC };
/**
* List of extensions corresponding to file format types in WRITABLE_FNAMES
*/
public static final String[] WRITABLE_EXTENSIONS = new String[]
{ "fa, fasta, mfa, fastq", "aln", "pfam", "msf", "pir", "blc", "amsa",
- "sto,stk", PhylipFile.FILE_EXT, "jvp" };
+ "sto,stk", PhylipFile.FILE_EXT, JSONFile.FILE_EXT, "jvp" };
/**
* List of writable formats by the application. Order must correspond with the
*/
public static final String[] WRITABLE_FNAMES = new String[]
{ "Fasta", "Clustal", "PFAM", "MSF", "PIR", "BLC", "AMSA", "STH",
- PhylipFile.FILE_DESC, "Jalview" };
+ PhylipFile.FILE_DESC, JSONFile.FILE_DESC, "Jalview" };
public static String INVALID_CHARACTERS = "Contains invalid characters";
{
afile = new PhylipFile(inFile, type);
}
- // else if (format.equals(HtmlFile.FILE_DESC))
- // {
- // afile = new HtmlFile(inFile, type);
- // }
+ else if (format.equals(JSONFile.FILE_DESC))
+ {
+ afile = new JSONFile(inFile, type);
+ }
else if (format.equals("RNAML"))
{
afile = new RnamlFile(inFile, type);
Alignment al = new Alignment(afile.getSeqsAsArray());
afile.addAnnotations(al);
+ afile.addSeqGroups(al);
return al;
} catch (Exception e)
// Possible sequence is just residues with no label
afile = new FastaFile(">UNKNOWN\n" + inFile, "Paste");
Alignment al = new Alignment(afile.getSeqsAsArray());
+
+ afile.addSeqGroups(al);
afile.addAnnotations(al);
return al;
{
afile = new PhylipFile(source);
}
- // else if (format.equals(HtmlFile.FILE_DESC))
- // {
- // afile = new HtmlFile(source);
- // }
+ else if (format.equals(JSONFile.FILE_DESC))
+ {
+ afile = new JSONFile(source);
+ }
Alignment al = new Alignment(afile.getSeqsAsArray());
afile.addAnnotations(al);
+ afile.addSeqGroups(al);
return al;
} catch (Exception e)
try
{
AlignFile afile = null;
-
if (format.equalsIgnoreCase("FASTA"))
{
afile = new FastaFile();
{
afile = new PhylipFile();
}
- // else if (format.equalsIgnoreCase(HtmlFile.FILE_DESC))
- // {
- // afile = new HtmlFile();
- // }
+ else if (format.equalsIgnoreCase(JSONFile.FILE_DESC))
+ {
+ afile = new JSONFile();
+ }
else if (format.equalsIgnoreCase("RNAML"))
{
afile = new RnamlFile();
afile.addJVSuffix(jvsuffix);
afile.setSeqs(alignment.getSequencesArray());
+ afile.addSeqGroups(alignment);
+
+ // Add non auto calculated annotation to AlignFile
+ for (AlignmentAnnotation annot : alignment.getAlignmentAnnotation())
+ {
+ if (!annot.autoCalculated)
+ {
+ afile.annotations.add(annot);
+ }
+
+ }
String afileresp = afile.print();
if (afile.hasWarningMessage())
import jalview.exceptions.NoFileSelectedException;
import jalview.gui.AlignmentPanel;
import jalview.gui.FeatureRenderer;
-import jalview.json.binding.v1.BioJsAlignmentPojo;
-import jalview.json.binding.v1.BioJsFeaturePojo;
-import jalview.json.binding.v1.BioJsSeqPojo;
+import jalview.json.binding.v1.AlignmentPojo;
+import jalview.json.binding.v1.FeaturePojo;
+import jalview.json.binding.v1.SequencePojo;
import jalview.schemes.ColourSchemeProperty;
import jalview.util.MessageManager;
import jalview.viewmodel.AlignmentViewport;
public String getJalviewAlignmentAsJsonString(AlignmentI alignment)
throws IOException, JSONException
{
- BioJsAlignmentPojo bjsAlignment = new BioJsAlignmentPojo();
+ AlignmentPojo bjsAlignment = new AlignmentPojo();
bjsAlignment.setGlobalColorScheme(getGlobalColorScheme());
bjsAlignment.setJalviewVersion(jalviewVersion);
name.append(seq.getName()).append("/").append(seq.getStart())
.append("-").append(seq.getEnd());
- BioJsSeqPojo seqPojo = new BioJsSeqPojo();
+ SequencePojo seqPojo = new SequencePojo();
seqPojo.setId(String.valueOf(++count));
seqPojo.setEnd(seq.getEnd());
seqPojo.setStart(seq.getStart());
SequenceFeature[] seqFeatures = seq.getSequenceFeatures();
if (seqFeatures != null)
{
- ArrayList<BioJsFeaturePojo> bjsSeqFeatures = new ArrayList<BioJsFeaturePojo>();
+ ArrayList<FeaturePojo> bjsSeqFeatures = new ArrayList<FeaturePojo>();
for (SequenceFeature sf : seqFeatures)
{
if (displayedFeatures != null
String featureColour = jalview.util.Format.getHexString(fr
.findFeatureColour(Color.white, seq,
seq.findIndex(sf.getBegin())));
- BioJsFeaturePojo bjsFeature = new BioJsFeaturePojo();
+ FeaturePojo bjsFeature = new FeaturePojo();
bjsFeature.setFillColor(featureColour);
bjsFeature.setXstart(seq.findIndex(sf.getBegin()) - 1);
bjsFeature.setXend(seq.findIndex(sf.getEnd()));
- bjsFeature.setText(sf.getType());
+ bjsFeature.setType(sf.getType());
bjsSeqFeatures.add(bjsFeature);
}
}
import jalview.structure.StructureSelectionManager;
import jalview.util.MessageManager;
-import java.util.List;
import java.util.StringTokenizer;
import java.util.Vector;
}
if (sq.getPDBId() != null)
{
- for (PDBEntry pdbe : (List<PDBEntry>) sq.getPDBId())
+ for (PDBEntry pdbe : sq.getPDBId())
{
StructureSelectionManager.getStructureSelectionManager(
Desktop.instance).registerPDBEntry(pdbe);
if (source instanceof HtmlFile)
{
((HtmlFile) source).LoadAlignmentFeatures(alignFrame);
-
}
+ else if (source instanceof JSONFile)
+ {
+ ((JSONFile) source).LoadAlignmentFeatures(alignFrame);
+ }
+
if (raiseGUI)
{
// add the window to the GUI
throws java.io.IOException
{
Alignment al;
- if (format.equals("HTML"))
- {
- afile = new HtmlFile(inFile, type);
- al = new Alignment(afile.getSeqsAsArray());
- afile.addAnnotations(al);
- }
- else
- {
+ // if (format.equals(JSONFile.FILE_DESC))
+ // {
+ // // afile = new HtmlFile(inFile, type);
+ // al = new Alignment(afile.getSeqsAsArray());
+ // afile.addAnnotations(al);
+ // }
+ // else
+ // {
al = super.readFile(inFile, type, format);
- }
+ // }
+ afile.addSeqGroups(al);
+ afile.addAnnotations(al);
return al;
}
throws java.io.IOException
{
Alignment al;
- if (format.equals("HTML"))
- {
- afile = new HtmlFile(source);
- al = new Alignment(afile.getSeqsAsArray());
- afile.addAnnotations(al);
- }
- else
- {
+ // if (format.equals(JSONFile.FILE_DESC))
+ // {
+ // // afile = new HtmlFile(source);
+ // al = new Alignment(afile.getSeqsAsArray());
+ // afile.addAnnotations(al);
+ // }
+ // else
+ // {
al = (Alignment) super.readFromFile(source, format);
- }
+ // }
+ afile.addSeqGroups(al);
+ afile.addAnnotations(al);
return al;
}
return formatSequences(format, getCacheSuffixDefault(format), av, selectedOnly);
}
+
}
package jalview.io;
-import jalview.datamodel.Sequence;
-import jalview.datamodel.SequenceFeature;
import jalview.gui.AlignFrame;
-import jalview.json.binding.v1.BioJsAlignmentPojo.JalviewBioJsColorSchemeMapper;
import jalview.schemes.ColourSchemeI;
import java.io.IOException;
-import java.util.Iterator;
-import org.json.simple.JSONArray;
-import org.json.simple.JSONObject;
-import org.json.simple.parser.JSONParser;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
Element content = doc.getElementById("seqData");
String alignmentJsonString = content.val();
- JSONParser jsonParser = new JSONParser();
- JSONObject alignmentJsonObj = (JSONObject) jsonParser
- .parse(alignmentJsonString);
- JSONArray seqJsonArray = (JSONArray) alignmentJsonObj.get("seqs");
- String bioJsColourScheme = (String) alignmentJsonObj
- .get("globalColorScheme");
- cs = getJalviewColorScheme(bioJsColourScheme);
-
- for (Iterator<JSONObject> sequenceIter = seqJsonArray.iterator(); sequenceIter
- .hasNext();)
- {
- JSONObject sequence = sequenceIter.next();
- String sequcenceString = sequence.get("seq").toString();
- Sequence seq = new Sequence(sequence.get("name").toString(),
- sequcenceString, Integer.valueOf(sequence.get("start")
- .toString()), Integer.valueOf(sequence.get("end")
- .toString()));
-
- JSONArray jsonSeqArray = (JSONArray) sequence.get("features");
- SequenceFeature[] retrievedSeqFeatures = getJalviewSequenceFeatures(
- jsonSeqArray, seq);
- if (retrievedSeqFeatures != null)
- {
- seq.setSequenceFeatures(retrievedSeqFeatures);
- }
- seqs.add(seq);
- }
+ new JSONFile().parse(alignmentJsonString);
+
+ // JSONParser jsonParser = new JSONParser();
+ // JSONObject alignmentJsonObj = (JSONObject) jsonParser
+ // .parse(alignmentJsonString);
+ // JSONArray seqJsonArray = (JSONArray) alignmentJsonObj.get("seqs");
+ // String bioJsColourScheme = (String) alignmentJsonObj
+ // .get("globalColorScheme");
+ // cs = getJalviewColorScheme(bioJsColourScheme);
+ //
+ // for (Iterator<JSONObject> sequenceIter = seqJsonArray.iterator();
+ // sequenceIter
+ // .hasNext();)
+ // {
+ // JSONObject sequence = sequenceIter.next();
+ // String sequcenceString = sequence.get("seq").toString();
+ // Sequence seq = new Sequence(sequence.get("name").toString(),
+ // sequcenceString, Integer.valueOf(sequence.get("start")
+ // .toString()), Integer.valueOf(sequence.get("end")
+ // .toString()));
+ //
+ // JSONArray jsonSeqArray = (JSONArray) sequence.get("features");
+ // SequenceFeature[] retrievedSeqFeatures = getJalviewSequenceFeatures(
+ // jsonSeqArray, seq);
+ // if (retrievedSeqFeatures != null)
+ // {
+ // seq.setSequenceFeatures(retrievedSeqFeatures);
+ // }
+ // seqs.add(seq);
+ //
+ // }
} catch (Exception e)
{
e.printStackTrace();
}
}
- public SequenceFeature[] getJalviewSequenceFeatures(
- JSONArray jsonSeqFeatures, Sequence seq)
- {
- SequenceFeature[] seqFeatures = null;
- int count = 0;
- if (jsonSeqFeatures != null)
- {
- seqFeatures = new SequenceFeature[jsonSeqFeatures.size()];
- for (@SuppressWarnings("unchecked")
- Iterator<JSONObject> seqFeatureItr = jsonSeqFeatures.iterator(); seqFeatureItr
- .hasNext();)
- {
-
- SequenceFeature sequenceFeature = new SequenceFeature();
- JSONObject jsonFeature = seqFeatureItr.next();
- Long begin = (Long) jsonFeature.get("xStart");
- Long end = (Long) jsonFeature.get("xEnd");
- String type = (String) jsonFeature.get("text");
- // String color = (String) jsonFeature.get("fillColor");
-
- sequenceFeature.setBegin(seq.findPosition(begin.intValue()));
- sequenceFeature.setEnd(seq.findPosition(end.intValue()) - 1);
- sequenceFeature.setType(type);
- seqFeatures[count++] = sequenceFeature;
- }
- }
- return seqFeatures;
- }
+ // public SequenceFeature[] getJalviewSequenceFeatures(
+ // JSONArray jsonSeqFeatures, Sequence seq)
+ // {
+ // SequenceFeature[] seqFeatures = null;
+ // int count = 0;
+ // if (jsonSeqFeatures != null)
+ // {
+ // seqFeatures = new SequenceFeature[jsonSeqFeatures.size()];
+ // for (@SuppressWarnings("unchecked")
+ // Iterator<JSONObject> seqFeatureItr = jsonSeqFeatures.iterator();
+ // seqFeatureItr
+ // .hasNext();)
+ // {
+ //
+ // SequenceFeature sequenceFeature = new SequenceFeature();
+ // JSONObject jsonFeature = seqFeatureItr.next();
+ // Long begin = (Long) jsonFeature.get("xStart");
+ // Long end = (Long) jsonFeature.get("xEnd");
+ // String type = (String) jsonFeature.get("text");
+ // // String color = (String) jsonFeature.get("fillColor");
+ //
+ // sequenceFeature.setBegin(seq.findPosition(begin.intValue()));
+ // sequenceFeature.setEnd(seq.findPosition(end.intValue()) - 1);
+ // sequenceFeature.setType(type);
+ // seqFeatures[count++] = sequenceFeature;
+ // }
+ // }
+ // return seqFeatures;
+ // }
public void LoadAlignmentFeatures(AlignFrame af)
{
af.setMenusForViewport();
}
- private ColourSchemeI getJalviewColorScheme(String bioJsColourSchemeName)
- {
- ColourSchemeI jalviewColor = null;
- for (JalviewBioJsColorSchemeMapper cs : JalviewBioJsColorSchemeMapper
- .values())
- {
- if (cs.getBioJsName().equals(bioJsColourSchemeName))
- {
- jalviewColor = cs.getJvColourScheme();
- break;
- }
- }
- return jalviewColor;
- }
+ // private ColourSchemeI getJalviewColorScheme(String bioJsColourSchemeName)
+ // {
+ // ColourSchemeI jalviewColor = null;
+ // for (JalviewBioJsColorSchemeMapper cs : JalviewBioJsColorSchemeMapper
+ // .values())
+ // {
+ // if (cs.getBioJsName().equals(bioJsColourSchemeName))
+ // {
+ // jalviewColor = cs.getJvColourScheme();
+ // break;
+ // }
+ // }
+ // return jalviewColor;
+ // }
@Override
public String print()
break;
}
+ if (data.indexOf("{\"") > -1)
+ {
+ reply = JSONFile.FILE_DESC;
+ break;
+ }
// if (data.matches("<(\"[^\"]*\"|'[^']*'|[^'\">])*>"))
if (data.matches("<(?i)html(\"[^\"]*\"|'[^']*'|[^'\">])*>"))
{
--- /dev/null
+package jalview.io;
+
+import jalview.api.FeaturesDisplayedI;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.Annotation;
+import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceFeature;
+import jalview.datamodel.SequenceGroup;
+import jalview.datamodel.SequenceI;
+import jalview.gui.AlignFrame;
+import jalview.gui.Desktop;
+import jalview.json.binding.v1.AlignmentAnnotationPojo;
+import jalview.json.binding.v1.AlignmentPojo;
+import jalview.json.binding.v1.AlignmentPojo.JalviewBioJsColorSchemeMapper;
+import jalview.json.binding.v1.AnnotationPojo;
+import jalview.json.binding.v1.FeaturePojo;
+import jalview.json.binding.v1.SequenceGrpPojo;
+import jalview.json.binding.v1.SequencePojo;
+import jalview.schemes.ColourSchemeI;
+import jalview.schemes.ColourSchemeProperty;
+import jalview.viewmodel.AlignmentViewport;
+
+import java.awt.Color;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.Iterator;
+
+import org.json.simple.JSONArray;
+import org.json.simple.JSONObject;
+import org.json.simple.parser.JSONParser;
+
+public class JSONFile extends AlignFile
+{
+ private ColourSchemeI cs;
+
+ private String jalviewVersion;
+
+ private String webStartLaunchServletUrl = "http://www.jalview.org/services/launchApp";
+
+ public static final String FILE_EXT = "json";
+
+ public static final String FILE_DESC = "JSON";
+
+ private String globalColorScheme;
+
+ private Hashtable<String, Sequence> seqMap;
+
+ private FeaturesDisplayedI displayedFeatures;
+
+ // private AlignmentI al;
+
+ private AlignmentViewport av;
+
+ private jalview.api.FeatureRenderer fr;
+
+ public JSONFile()
+ {
+ super();
+ }
+
+ public JSONFile(FileParse source) throws IOException
+ {
+ super(source);
+ }
+
+ public JSONFile(String inFile, String type) throws IOException
+ {
+ super(inFile, type);
+ }
+
+
+ @Override
+ public void parse() throws IOException
+ {
+ StringBuilder jsonStringBuilder = new StringBuilder();
+ String currentLine;
+ while ((currentLine = nextLine()) != null)
+ {
+ jsonStringBuilder.append(currentLine);
+ }
+ parse(jsonStringBuilder.toString());
+
+ }
+
+ @Override
+ public String print()
+ {
+ AlignmentPojo jsonAlignmentPojo = new AlignmentPojo();
+ if (Desktop.getCurrentAlignFrame() != null)
+ {
+ jsonAlignmentPojo.setGlobalColorScheme(ColourSchemeProperty
+ .getColourName(Desktop.getCurrentAlignFrame().getViewport()
+ .getGlobalColourScheme()));
+ this.av = Desktop.getCurrentAlignFrame().getCurrentView();
+ this.fr = Desktop.getCurrentAlignFrame().alignPanel
+ .cloneFeatureRenderer();
+ displayedFeatures = av.getFeaturesDisplayed();
+ }
+ jsonAlignmentPojo.setJalviewVersion(jalviewVersion);
+ jsonAlignmentPojo.setWebStartUrl(webStartLaunchServletUrl);
+
+ System.out.println(">>>>>>>>>>>>>> found grps : " + seqGroups.size());
+ if (seqGroups.size() > 0)
+ {
+ ArrayList<SequenceGrpPojo> sequenceGroupsPojo = new ArrayList<SequenceGrpPojo>();
+ for (SequenceGroup seqGrp : seqGroups)
+ {
+ System.out.println(">>>>>>>>>>>> grp : " + seqGrp.getName());
+ SequenceGrpPojo seqGrpPojo = new SequenceGrpPojo();
+ seqGrpPojo.setGroupName(seqGrp.getName());
+ seqGrpPojo.setColourScheme(ColourSchemeProperty
+ .getColourName(seqGrp.cs));
+ seqGrpPojo.setColourText(seqGrp.getColourText());
+ seqGrpPojo.setDescription(seqGrp.getDescription());
+ seqGrpPojo.setDisplayBoxes(seqGrp.getDisplayBoxes());
+ seqGrpPojo.setDisplayText(seqGrp.getDisplayText());
+ seqGrpPojo.setEndRes(seqGrp.getEndRes());
+ seqGrpPojo.setStartRes(seqGrp.getStartRes());
+ seqGrpPojo.setShowNonconserved(seqGrp.getShowNonconserved());
+ jsonAlignmentPojo.getSequenceGroups().add(seqGrpPojo);
+ for(SequenceI seq : seqGrp.getSequences()){
+ seqGrpPojo.getSeqsHash().add(seq.getName() + "_" + seq.hashCode());
+ }
+ // sequenceGroupsPojo.add(seqGrpPojo);
+ }
+ }
+ for (AlignmentAnnotation annot : annotations)
+ {
+ AlignmentAnnotationPojo alignAnnotPojo = new AlignmentAnnotationPojo();
+ alignAnnotPojo.setDescription(annot.description);
+ alignAnnotPojo.setLabel(annot.label);
+ for (Annotation annotation : annot.annotations)
+ {
+ AnnotationPojo annotationPojo = new AnnotationPojo();
+ if (annotation != null)
+ {
+ annotationPojo.setDescription(annotation.description);
+ annotationPojo.setValue(annotation.value);
+ annotationPojo
+ .setSecondaryStructure(annotation.secondaryStructure);
+ annotationPojo.setDisplayCharacter(annotation.displayCharacter);
+ alignAnnotPojo.getAnnotations().add(annotationPojo);
+ }
+ else
+ {
+ alignAnnotPojo.getAnnotations().add(annotationPojo);
+ }
+ }
+ jsonAlignmentPojo.getAlignmentAnnotation().add(alignAnnotPojo);
+ }
+
+ int count = 0;
+ for (SequenceI seq : seqs)
+ {
+ StringBuilder name = new StringBuilder();
+ name.append(seq.getName()).append("/").append(seq.getStart())
+ .append("-").append(seq.getEnd());
+
+ SequencePojo jsonSeqPojo = new SequencePojo();
+
+ jsonSeqPojo.setId(seq.getName() + "_" + seq.hashCode());
+ jsonSeqPojo.setOrder(++count);
+ jsonSeqPojo.setEnd(seq.getEnd());
+ jsonSeqPojo.setStart(seq.getStart());
+ jsonSeqPojo.setName(name.toString());
+ jsonSeqPojo.setSeq(seq.getSequenceAsString());
+ jsonAlignmentPojo.getSeqs().add(jsonSeqPojo);
+
+ if (seq.getDatasetSequence() != null
+ && seq.getDatasetSequence().getSequenceFeatures() != null)
+ {
+ ArrayList<FeaturePojo> seqFeaturesPojo = new ArrayList<FeaturePojo>();
+ for (SequenceFeature sf : seq.getDatasetSequence()
+ .getSequenceFeatures())
+ {
+
+ if (displayedFeatures != null
+ && displayedFeatures.isVisible(sf.getType()))
+ {
+
+ String fillColor = ((fr != null) ? jalview.util.Format
+ .getHexString(fr.findFeatureColour(Color.white, seq,
+ seq.findIndex(sf.getBegin()))) : null);
+ FeaturePojo jsonFeature = new FeaturePojo();
+ jsonFeature.setXstart(seq.findIndex(sf.getBegin()) - 1);
+ jsonFeature.setXend(seq.findIndex(sf.getEnd()));
+ jsonFeature.setType(sf.getType());
+ jsonFeature.setDescription(sf.getDescription());
+ jsonFeature.setLinks(sf.links);
+ jsonFeature.setOtherDetails(sf.otherDetails);
+ jsonFeature.setScore(sf.getScore());
+ jsonFeature.setFillColor(fillColor);
+ jsonFeature.setFeatureGroup(sf.getFeatureGroup());
+ seqFeaturesPojo.add(jsonFeature);
+ }
+ }
+ jsonSeqPojo.setFeatures(seqFeaturesPojo);
+ }
+ }
+ return new com.json.JSONObject(jsonAlignmentPojo).toString()
+ .replaceAll("xstart", "xStart").replaceAll("xend", "xEnd");
+ }
+
+ public void parse(String jsonAlignmentString)
+ {
+ try
+ {
+ JSONParser jsonParser = new JSONParser();
+ JSONObject alignmentJsonObj = (JSONObject) jsonParser
+ .parse(jsonAlignmentString);
+ JSONArray seqJsonArray = (JSONArray) alignmentJsonObj.get("seqs");
+ JSONArray alAnnotJsonArray = (JSONArray) alignmentJsonObj.get("alignmentAnnotation");
+ JSONArray seqGrpJsonArray = (JSONArray) alignmentJsonObj.get("sequenceGroups");
+ String jsColourScheme = (String) alignmentJsonObj
+ .get("globalColorScheme");
+ System.out.println(">>>>>>>>>>>>>>>> global cs : " + jsColourScheme);
+ cs = getJalviewColorScheme(jsColourScheme);
+ seqMap = new Hashtable<String, Sequence>();
+ Desktop.setCurrentGlobalColourScheme(cs);
+ for (Iterator<JSONObject> sequenceIter = seqJsonArray.iterator(); sequenceIter
+ .hasNext();)
+ {
+ JSONObject sequence = sequenceIter.next();
+ String sequcenceString = sequence.get("seq").toString();
+ String sequenceName = sequence.get("name").toString();
+ String seqUniqueId = sequence.get("id").toString();
+ int start = Integer.valueOf(sequence.get("start").toString());
+ int end = Integer.valueOf(sequence.get("end").toString());
+ Sequence seq = new Sequence(sequenceName, sequcenceString, start,
+ end);
+ JSONArray jsonSeqArray = (JSONArray) sequence.get("features");
+ SequenceFeature[] retrievedSeqFeatures = getJalviewSequenceFeatures(
+ jsonSeqArray, seq);
+ if (retrievedSeqFeatures != null)
+ {
+ seq.setSequenceFeatures(retrievedSeqFeatures);
+ }
+ seqs.add(seq);
+ seqMap.put(seqUniqueId, seq);
+ }
+
+ // for (Iterator<JSONObject> seqGrpIter = seqGrpJsonArray.iterator();
+ // seqGrpIter
+ // .hasNext();)
+ // {
+ // JSONObject seqGrpObj = seqGrpIter.next();
+ // String grpName = seqGrpObj.get("groupName").toString();
+ // String colourScheme = seqGrpObj.get("colourScheme").toString();
+ // String description = (seqGrpObj.get("description") == null) ? null
+ // : seqGrpObj.get("description").toString();
+ // boolean displayBoxes = Boolean.valueOf(seqGrpObj
+ // .get("displayBoxes").toString());
+ // boolean displayText = Boolean.valueOf(seqGrpObj.get("displayText")
+ // .toString());
+ // boolean colourText = Boolean.valueOf(seqGrpObj.get("colourText")
+ // .toString());
+ // boolean showNonconserved = Boolean.valueOf(seqGrpObj.get(
+ // "showNonconserved").toString());
+ // int startRes = Integer
+ // .valueOf(seqGrpObj.get("startRes").toString());
+ // int endRes = Integer.valueOf(seqGrpObj.get("endRes").toString());
+ // JSONArray seqsHashArray = (JSONArray) seqGrpObj.get("seqsHash");
+ //
+ // ArrayList<SequenceI> grpSeqs = new ArrayList<SequenceI>();
+ // if (seqsHashArray.size() > 0)
+ // {
+ // Iterator<String> seqHashIter = seqsHashArray.iterator();
+ //
+ // while (seqHashIter.hasNext())
+ // {
+ // String seqHash = seqHashIter.next();
+ // Sequence sequence = seqMap.get(seqHash);
+ // if (sequence != null)
+ // {
+ // grpSeqs.add(sequence);
+ // }
+ // // System.out.println(">>>>>>>>>>>>>>>>>>>>>>> seqHash : "
+ // // + seqHash);
+ // }
+ // }
+ // System.out.println(">>>>>>>>>>>>>>>>>> scheme string : "
+ // + colourScheme);
+ // ColourSchemeI scheme = getJalviewColorScheme(colourScheme);
+ // System.out.println(">>>>>>>>>>>>>>>>>> scheme: " + scheme);
+ // SequenceGroup seqGrp = new SequenceGroup(grpSeqs, grpName, scheme,
+ // displayBoxes, displayText, colourText, startRes, endRes);
+ // this.seqGroups.add(seqGrp);
+ //
+ // }
+
+
+ for (Iterator<JSONObject> alAnnotIter = alAnnotJsonArray.iterator(); alAnnotIter
+ .hasNext();)
+ {
+ JSONObject alAnnot = alAnnotIter.next();
+ JSONArray annotJsonArray = (JSONArray) alAnnot
+ .get("annotations");
+ Annotation[] annotations = new Annotation[annotJsonArray.size()];
+ int count = 0;
+ for (Iterator<JSONObject> annotIter = annotJsonArray.iterator(); annotIter
+ .hasNext();)
+ {
+ JSONObject annot = annotIter.next();
+ if (annot == null)
+ {
+ annotations[count] = null;
+ }
+ else
+ {
+ float val = annot.get("value") == null ? null
+ : Float.valueOf(annot.get("value")
+ .toString());
+ String desc = annot.get("description") == null ? null : annot
+ .get("description").toString();
+
+ char ss = annot.get("secondaryStructure") == null ? null
+ : annot
+ .get("secondaryStructure").toString().charAt(0);
+ String displayChar = annot.get(
+ "displayCharacter").toString();
+
+ annotations[count] = new Annotation(displayChar, desc, ss, val);
+ }
+ ++count;
+ }
+
+ AlignmentAnnotation alignAnnot = new AlignmentAnnotation(alAnnot
+ .get("label").toString(), alAnnot.get("description")
+ .toString(), annotations);
+ this.annotations.add(alignAnnot);
+ }
+
+ } catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public SequenceFeature[] getJalviewSequenceFeatures(
+ JSONArray jsonSeqFeatures, Sequence seq)
+ {
+ SequenceFeature[] seqFeatures = null;
+ int count = 0;
+ if (jsonSeqFeatures != null)
+ {
+ seqFeatures = new SequenceFeature[jsonSeqFeatures.size()];
+ for (@SuppressWarnings("unchecked")
+ Iterator<JSONObject> seqFeatureItr = jsonSeqFeatures.iterator(); seqFeatureItr
+ .hasNext();)
+ {
+
+ SequenceFeature sequenceFeature = new SequenceFeature();
+ JSONObject jsonFeature = seqFeatureItr.next();
+ Long begin = (Long) jsonFeature.get("xStart");
+ Long end = (Long) jsonFeature.get("xEnd");
+ String type = (String) jsonFeature.get("type");
+ // String color = (String) jsonFeature.get("fillColor");
+ String featureGrp = (String) jsonFeature.get("featureGroup");
+ String descripiton = (String) jsonFeature.get("description");
+ Float score = Float.valueOf(jsonFeature.get("score").toString());
+ // Hashtable otherDetails = (Hashtable) jsonFeature
+ // .get("otherDetails");
+ // Vector<String> links = (Vector<String>) jsonFeature.get("links");
+
+ // sequenceFeature.links = links;
+ // sequenceFeature.otherDetails = otherDetails;
+ sequenceFeature.setScore(score);
+ sequenceFeature.setDescription(descripiton);
+
+ sequenceFeature.setBegin(seq.findPosition(begin.intValue()));
+ sequenceFeature.setEnd(seq.findPosition(end.intValue()) - 1);
+ sequenceFeature.setType(type);
+ seqFeatures[count++] = sequenceFeature;
+ }
+ }
+ return seqFeatures;
+ }
+
+ private ColourSchemeI getJalviewColorScheme(String bioJsColourSchemeName)
+ {
+ ColourSchemeI jalviewColor = null;
+ for (JalviewBioJsColorSchemeMapper cs : JalviewBioJsColorSchemeMapper
+ .values())
+ {
+ if (cs.getBioJsName().equalsIgnoreCase(bioJsColourSchemeName))
+ {
+ jalviewColor = cs.getJvColourScheme();
+ break;
+ }
+ }
+ return jalviewColor;
+ }
+
+ public void LoadAlignmentFeatures(AlignFrame af)
+ {
+ af.setShowSeqFeatures(true);
+ af.changeColour(cs);
+ af.setMenusForViewport();
+ }
+
+ public String getGlobalColorScheme()
+ {
+ return globalColorScheme;
+ }
+
+ public void setGlobalColorScheme(String globalColorScheme)
+ {
+ this.globalColorScheme = globalColorScheme;
+ }
+}
--- /dev/null
+package jalview.json.binding.v1;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class AlignmentAnnotationPojo
+{
+ private String label;
+
+ private String description;
+
+ private List<AnnotationPojo> annotations = new ArrayList();
+
+ public String getLabel()
+ {
+ return label;
+ }
+
+ public void setLabel(String label)
+ {
+ this.label = label;
+ }
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public void setDescription(String annotationId)
+ {
+ this.description = annotationId;
+ }
+
+ public List<AnnotationPojo> getAnnotations()
+ {
+ return annotations;
+ }
+
+ public void setAnnotations(List<AnnotationPojo> annotations)
+ {
+ this.annotations = annotations;
+ }
+}
import jalview.schemes.ZappoColourScheme;
import java.util.ArrayList;
+import java.util.List;
-public class BioJsAlignmentPojo
+public class AlignmentPojo
{
private String globalColorScheme = "none";
private String jalviewVersion;
private String webStartUrl;
- private ArrayList<BioJsSeqPojo> seqs = new ArrayList<BioJsSeqPojo>();
- public BioJsAlignmentPojo()
+ private List<SequencePojo> seqs = new ArrayList<SequencePojo>();
+
+ private List<AlignmentAnnotationPojo> alignmentAnnotation = new ArrayList<AlignmentAnnotationPojo>();
+
+ private List<SequenceGrpPojo> sequenceGroups = new ArrayList<SequenceGrpPojo>();
+
+ public AlignmentPojo()
{
}
- public ArrayList<BioJsSeqPojo> getSeqs()
+
+ public List<SequencePojo> getSeqs()
{
return seqs;
}
- public void setSeqs(ArrayList<BioJsSeqPojo> seqs)
+ public void setSeqs(ArrayList<SequencePojo> seqs)
{
this.seqs = seqs;
}
this.webStartUrl = webStartUrl;
}
+ public List<AlignmentAnnotationPojo> getAlignmentAnnotation()
+ {
+ return alignmentAnnotation;
+ }
+
+ public void setAlignmentAnnotation(List<AlignmentAnnotationPojo> alignmentAnnotation)
+ {
+ this.alignmentAnnotation = alignmentAnnotation;
+ }
+
+ public List<SequenceGrpPojo> getSequenceGroups()
+ {
+ return sequenceGroups;
+ }
+
+ public void setSequenceGroups(List<SequenceGrpPojo> sequenceGroups)
+ {
+ this.sequenceGroups = sequenceGroups;
+ }
+
public enum JalviewBioJsColorSchemeMapper
{
USER_DEFINED("User Defined", "user defined", null), NONE("None", "foo",
--- /dev/null
+package jalview.json.binding.v1;
+
+
+public class AnnotationPojo
+{
+ private String displayCharacter = "";
+
+ private String description;
+
+ private char secondaryStructure;
+
+ private float value;
+
+
+ public String getDisplayCharacter()
+ {
+ return displayCharacter;
+ }
+
+ public void setDisplayCharacter(String displayCharacter)
+ {
+ this.displayCharacter = displayCharacter;
+ }
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public void setDescription(String description)
+ {
+ this.description = description;
+ }
+
+ public char getSecondaryStructure()
+ {
+ return secondaryStructure;
+ }
+
+ public void setSecondaryStructure(char secondaryStructure)
+ {
+ this.secondaryStructure = secondaryStructure;
+ }
+
+ public float getValue()
+ {
+ return value;
+ }
+
+ public void setValue(float value)
+ {
+ this.value = value;
+ }
+}
+++ /dev/null
-package jalview.json.binding.v1;
-
-public class BioJsFeaturePojo
-{
-
- private int xstart;
-
- private int xend;
-
- private String text;
-
- private String fillColor;
-
- public BioJsFeaturePojo()
- {
- }
-
-
- public String getText()
- {
- return text;
- }
-
- public void setText(String text)
- {
- this.text = text;
- }
-
- public String getFillColor()
- {
- return "#" + fillColor;
- }
-
- public void setFillColor(String fillColor)
- {
- this.fillColor = fillColor;
- }
-
- public int getXstart()
- {
- return xstart;
- }
-
- public void setXstart(int xstart)
- {
- this.xstart = xstart;
- }
-
- public int getXend()
- {
- return xend;
- }
-
- public void setXend(int xend)
- {
- this.xend = xend;
- }
-
-
-}
--- /dev/null
+package jalview.json.binding.v1;
+
+import java.util.Hashtable;
+import java.util.Vector;
+
+public class FeaturePojo
+{
+
+ private int xstart;
+
+ private int xend;
+
+ private String type;
+
+ private String fillColor;
+
+ private Float score;
+
+ private String description;
+
+ private Hashtable otherDetails;
+
+ private String featureGroup;
+
+ private Vector<String> links;
+
+ public FeaturePojo()
+ {
+ }
+
+ public String getFillColor()
+ {
+ return "#" + fillColor;
+ }
+
+ public void setFillColor(String fillColor)
+ {
+ this.fillColor = fillColor;
+ }
+
+ public int getXstart()
+ {
+ return xstart;
+ }
+
+ public void setXstart(int xstart)
+ {
+ this.xstart = xstart;
+ }
+
+ public int getXend()
+ {
+ return xend;
+ }
+
+ public void setXend(int xend)
+ {
+ this.xend = xend;
+ }
+
+ public String getType()
+ {
+ return type;
+ }
+
+ public void setType(String type)
+ {
+ this.type = type;
+ }
+
+ public Float getScore()
+ {
+ return score;
+ }
+
+ public void setScore(Float score)
+ {
+ this.score = score;
+ }
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public void setDescription(String description)
+ {
+ this.description = description;
+ }
+
+ public Hashtable getOtherDetails()
+ {
+ return otherDetails;
+ }
+
+ public void setOtherDetails(Hashtable otherDetails)
+ {
+ this.otherDetails = otherDetails;
+ }
+
+ public Vector<String> getLinks()
+ {
+ return links;
+ }
+
+ public void setLinks(Vector<String> links)
+ {
+ this.links = links;
+ }
+
+ public String getFeatureGroup()
+ {
+ return featureGroup;
+ }
+
+ public void setFeatureGroup(String featureGroup)
+ {
+ this.featureGroup = featureGroup;
+ }
+}
--- /dev/null
+package jalview.json.binding.v1;
+
+import java.util.ArrayList;
+
+public class SequenceGrpPojo
+{
+ private String colourScheme;
+
+ private String groupName;
+
+ private String description;
+
+ private boolean displayBoxes;
+
+ private boolean displayText;
+
+ private boolean colourText;
+
+ private boolean showNonconserved;
+
+ private int startRes;
+
+ private int endRes;
+
+ private ArrayList<String> seqsHash = new ArrayList<String>();
+
+ public String getColourScheme()
+ {
+ return colourScheme;
+ }
+
+ public void setColourScheme(String colourScheme)
+ {
+ this.colourScheme = colourScheme;
+ }
+
+ public String getGroupName()
+ {
+ return groupName;
+ }
+
+ public void setGroupName(String groupName)
+ {
+ this.groupName = groupName;
+ }
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public void setDescription(String description)
+ {
+ this.description = description;
+ }
+
+ public boolean isDisplayBoxes()
+ {
+ return displayBoxes;
+ }
+
+ public void setDisplayBoxes(boolean displayBoxes)
+ {
+ this.displayBoxes = displayBoxes;
+ }
+
+ public boolean isDisplayText()
+ {
+ return displayText;
+ }
+
+ public void setDisplayText(boolean displayText)
+ {
+ this.displayText = displayText;
+ }
+
+ public boolean isColourText()
+ {
+ return colourText;
+ }
+
+ public void setColourText(boolean colourText)
+ {
+ this.colourText = colourText;
+ }
+
+ public boolean isShowNonconserved()
+ {
+ return showNonconserved;
+ }
+
+ public void setShowNonconserved(boolean showNonconserved)
+ {
+ this.showNonconserved = showNonconserved;
+ }
+
+ public int getStartRes()
+ {
+ return startRes;
+ }
+
+ public void setStartRes(int startRes)
+ {
+ this.startRes = startRes;
+ }
+
+ public int getEndRes()
+ {
+ return endRes;
+ }
+
+ public void setEndRes(int endRes)
+ {
+ this.endRes = endRes;
+ }
+
+ public ArrayList<String> getSeqsHash()
+ {
+ return seqsHash;
+ }
+
+ public void setSeqsHash(ArrayList<String> seqsHash)
+ {
+ this.seqsHash = seqsHash;
+ }
+}
import java.util.ArrayList;
-public class BioJsSeqPojo
+public class SequencePojo
{
private String seq;
private String id;
+ private int order;
+
private int start;
private int end;
- private ArrayList<BioJsFeaturePojo> features = new ArrayList<BioJsFeaturePojo>();
+ private ArrayList<FeaturePojo> features = new ArrayList<FeaturePojo>();
- public BioJsSeqPojo()
+ public SequencePojo()
{
}
- public BioJsSeqPojo(int start, int end, String id, String name, String seq)
+ public SequencePojo(int start, int end, String id, String name, String seq)
{
this.id = id;
this.name = name;
this.end = end;
}
- public ArrayList<BioJsFeaturePojo> getFeatures()
+ public ArrayList<FeaturePojo> getFeatures()
{
return features;
}
- public void setFeatures(ArrayList<BioJsFeaturePojo> features)
+ public void setFeatures(ArrayList<FeaturePojo> features)
{
this.features = features;
}
+
+ public int getOrder()
+ {
+ return order;
+ }
+
+ public void setOrder(int order)
+ {
+ this.order = order;
+ }
}