From: gmungoc Date: Fri, 10 Jul 2015 05:15:04 +0000 (+0100) Subject: JAL-1807 explicit imports (jalview.io.*) X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=67b3acb8df1438ef37a756c04e14f5a3b8406808;p=jalview.git JAL-1807 explicit imports (jalview.io.*) --- diff --git a/src/jalview/io/AMSAFile.java b/src/jalview/io/AMSAFile.java index 2fc17d5..6e81464 100644 --- a/src/jalview/io/AMSAFile.java +++ b/src/jalview/io/AMSAFile.java @@ -20,9 +20,10 @@ */ package jalview.io; -import jalview.datamodel.*; +import jalview.datamodel.AlignmentAnnotation; +import jalview.datamodel.AlignmentI; -public class AMSAFile extends jalview.io.FastaFile +public class AMSAFile extends FastaFile { AlignmentI al; diff --git a/src/jalview/io/AnnotationFile.java b/src/jalview/io/AnnotationFile.java index 88cb46e..8706ad5 100755 --- a/src/jalview/io/AnnotationFile.java +++ b/src/jalview/io/AnnotationFile.java @@ -34,6 +34,8 @@ import jalview.schemes.ColourSchemeI; import jalview.schemes.ColourSchemeProperty; import jalview.schemes.ResidueProperties; import jalview.schemes.UserColourScheme; +import jalview.util.Comparison; +import jalview.util.Format; import java.io.BufferedReader; import java.io.FileReader; @@ -278,8 +280,8 @@ public class AnnotationFile graphLine.append("\t"); graphLine.append(row.getThreshold().label); graphLine.append("\t"); - graphLine.append(jalview.util.Format.getHexString(row - .getThreshold().colour)); + graphLine + .append(Format.getHexString(row.getThreshold().colour)); graphLine.append(newline); } @@ -310,7 +312,7 @@ public class AnnotationFile && j < row.annotations.length; j++) { if (refSeq != null - && jalview.util.Comparison.isGap(refSeq.getCharAt(j))) + && Comparison.isGap(refSeq.getCharAt(j))) { continue; } @@ -377,7 +379,7 @@ public class AnnotationFile { text.append(comma + "[" - + jalview.util.Format + + Format .getHexString(row.annotations[j].colour) + "]"); comma = ","; @@ -398,7 +400,7 @@ public class AnnotationFile colours.append("COLOUR\t"); colours.append(row.label); colours.append("\t"); - colours.append(jalview.util.Format.getHexString(color)); + colours.append(Format.getHexString(color)); colours.append(newline); } if (row.scaleColLabel || row.showAllColLabels @@ -597,7 +599,7 @@ public class AnnotationFile } } text.append("outlineColour="); - text.append(jalview.util.Format.getHexString(sg.getOutlineColour())); + text.append(Format.getHexString(sg.getOutlineColour())); text.append("\t"); text.append("displayBoxes="); @@ -615,13 +617,13 @@ public class AnnotationFile if (sg.textColour != java.awt.Color.black) { text.append("textCol1="); - text.append(jalview.util.Format.getHexString(sg.textColour)); + text.append(Format.getHexString(sg.textColour)); text.append("\t"); } if (sg.textColour2 != java.awt.Color.white) { text.append("textCol2="); - text.append(jalview.util.Format.getHexString(sg.textColour2)); + text.append(Format.getHexString(sg.textColour2)); text.append("\t"); } if (sg.thresholdTextColour != 0) @@ -633,7 +635,7 @@ public class AnnotationFile if (sg.idColour != null) { text.append("idColour="); - text.append(jalview.util.Format.getHexString(sg.idColour)); + text.append(Format.getHexString(sg.idColour)); text.append("\t"); } if (sg.isHidereps()) diff --git a/src/jalview/io/AppletFormatAdapter.java b/src/jalview/io/AppletFormatAdapter.java index 90400f4..e4c4f3d 100755 --- a/src/jalview/io/AppletFormatAdapter.java +++ b/src/jalview/io/AppletFormatAdapter.java @@ -827,7 +827,7 @@ public class AppletFormatAdapter { try { - String idformat = new jalview.io.IdentifyFile().Identify(file, + String idformat = new IdentifyFile().Identify(file, protocol); if (idformat == null) { diff --git a/src/jalview/io/BioJsHTMLOutput.java b/src/jalview/io/BioJsHTMLOutput.java index 73be79f..e8e993b 100644 --- a/src/jalview/io/BioJsHTMLOutput.java +++ b/src/jalview/io/BioJsHTMLOutput.java @@ -1,10 +1,13 @@ package jalview.io; import jalview.api.AlignmentViewPanel; +import jalview.bin.Cache; import jalview.datamodel.AlignmentExportData; import jalview.exceptions.NoFileSelectedException; +import jalview.gui.AlignFrame; import jalview.json.binding.v1.BioJSReleasePojo; import jalview.json.binding.v1.BioJSRepositoryPojo; +import jalview.util.BrowserLauncher; import jalview.util.MessageManager; import java.io.BufferedInputStream; @@ -31,10 +34,10 @@ public class BioJsHTMLOutput public static final String DEFAULT_DIR = System.getProperty("user.home") + File.separatorChar + ".biojs_templates" + File.separatorChar; - public static final String BJS_TEMPLATES_LOCAL_DIRECTORY = jalview.bin.Cache + public static final String BJS_TEMPLATES_LOCAL_DIRECTORY = Cache .getDefault("biojs_template_directory", DEFAULT_DIR); - public static final String BJS_TEMPLATE_GIT_REPO = jalview.bin.Cache + public static final String BJS_TEMPLATE_GIT_REPO = Cache .getDefault( "biojs_template_git_repo", "https://raw.githubusercontent.com/tcofoegbu/bjs-template/master/package.json"); @@ -53,7 +56,7 @@ public class BioJsHTMLOutput { String outputFile = getOutputFile(); // String jalviewAlignmentJson = JSONFile.getJSONData(ap); - AlignmentExportData exportData = jalview.gui.AlignFrame + AlignmentExportData exportData = AlignFrame .getAlignmentForExport( JSONFile.FILE_DESC, ap.getAlignViewport()); if (exportData.getSettings().isCancelled()) @@ -77,7 +80,7 @@ public class BioJsHTMLOutput out.print(generatedBioJsWithJalviewAlignmentAsJson); out.flush(); out.close(); - jalview.util.BrowserLauncher.openURL("file:///" + outputFile); + BrowserLauncher.openURL("file:///" + outputFile); } catch (NoFileSelectedException ex) { // do noting if no file was selected @@ -91,7 +94,7 @@ public class BioJsHTMLOutput { String selectedFile = null; JalviewFileChooser jvFileChooser = new JalviewFileChooser( - jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[] + Cache.getProperty("LAST_DIRECTORY"), new String[] { "html" }, new String[] { "HTML files" }, "HTML files"); jvFileChooser.setFileView(new JalviewFileView()); @@ -104,7 +107,7 @@ public class BioJsHTMLOutput int fileChooserOpt = jvFileChooser.showSaveDialog(null); if (fileChooserOpt == JalviewFileChooser.APPROVE_OPTION) { - jalview.bin.Cache.setProperty("LAST_DIRECTORY", jvFileChooser + Cache.setProperty("LAST_DIRECTORY", jvFileChooser .getSelectedFile().getParent()); selectedFile = jvFileChooser.getSelectedFile().getPath(); } diff --git a/src/jalview/io/FeaturesFile.java b/src/jalview/io/FeaturesFile.java index 57f6384..f965d23 100755 --- a/src/jalview/io/FeaturesFile.java +++ b/src/jalview/io/FeaturesFile.java @@ -31,6 +31,7 @@ import jalview.schemes.GraduatedColor; import jalview.schemes.UserColourScheme; import jalview.util.Format; import jalview.util.MapList; +import jalview.util.ParseHtmlBodyAndLinks; import java.io.IOException; import java.util.ArrayList; @@ -393,7 +394,7 @@ public class FeaturesFile extends AlignFile } try { - colour = new jalview.schemes.GraduatedColor( + colour = new GraduatedColor( new UserColourScheme(mincol).findColour('A'), new UserColourScheme(maxcol).findColour('A'), min, max); @@ -406,9 +407,9 @@ public class FeaturesFile extends AlignFile } if (colour != null) { - ((jalview.schemes.GraduatedColor) colour) + ((GraduatedColor) colour) .setColourByLabel(labelCol); - ((jalview.schemes.GraduatedColor) colour) + ((GraduatedColor) colour) .setAutoScaled(abso == null); // add in any additional parameters String ttype = null, tval = null; @@ -418,17 +419,17 @@ public class FeaturesFile extends AlignFile ttype = gcol.nextToken(); if (ttype.toLowerCase().startsWith("below")) { - ((jalview.schemes.GraduatedColor) colour) + ((GraduatedColor) colour) .setThreshType(AnnotationColourGradient.BELOW_THRESHOLD); } else if (ttype.toLowerCase().startsWith("above")) { - ((jalview.schemes.GraduatedColor) colour) + ((GraduatedColor) colour) .setThreshType(AnnotationColourGradient.ABOVE_THRESHOLD); } else { - ((jalview.schemes.GraduatedColor) colour) + ((GraduatedColor) colour) .setThreshType(AnnotationColourGradient.NO_THRESHOLD); if (!ttype.toLowerCase().startsWith("no")) { @@ -444,7 +445,7 @@ public class FeaturesFile extends AlignFile { gcol.nextToken(); tval = gcol.nextToken(); - ((jalview.schemes.GraduatedColor) colour) + ((GraduatedColor) colour) .setThresh(new Float(tval).floatValue()); } catch (Exception e) { @@ -1155,7 +1156,7 @@ public class FeaturesFile extends AlignFile { return; } - jalview.util.ParseHtmlBodyAndLinks parsed = new jalview.util.ParseHtmlBodyAndLinks( + ParseHtmlBodyAndLinks parsed = new ParseHtmlBodyAndLinks( sf.getDescription(), removeHTML, newline); sf.description = (removeHTML) ? parsed.getNonHtmlContent() diff --git a/src/jalview/io/FileLoader.java b/src/jalview/io/FileLoader.java index 3aded05..1edf832 100755 --- a/src/jalview/io/FileLoader.java +++ b/src/jalview/io/FileLoader.java @@ -22,6 +22,7 @@ package jalview.io; import jalview.api.ComplexAlignFile; import jalview.api.FeaturesDisplayedI; +import jalview.bin.Cache; import jalview.bin.Jalview; import jalview.datamodel.AlignmentI; import jalview.datamodel.ColumnSelection; @@ -199,7 +200,7 @@ public class FileLoader implements Runnable String type = protocol.equals(FormatAdapter.FILE) ? "RECENT_FILE" : "RECENT_URL"; - String historyItems = jalview.bin.Cache.getProperty(type); + String historyItems = Cache.getProperty(type); StringTokenizer st; @@ -225,11 +226,11 @@ public class FileLoader implements Runnable newHistory.append(recent.elementAt(i)); } - jalview.bin.Cache.setProperty(type, newHistory.toString()); + Cache.setProperty(type, newHistory.toString()); if (protocol.equals(FormatAdapter.FILE)) { - jalview.bin.Cache.setProperty("DEFAULT_FILE_FORMAT", format); + Cache.setProperty("DEFAULT_FILE_FORMAT", format); } } @@ -411,7 +412,7 @@ public class FileLoader implements Runnable try { - alignFrame.setMaximum(jalview.bin.Cache.getDefault( + alignFrame.setMaximum(Cache.getDefault( "SHOW_FULLSCREEN", false)); } catch (java.beans.PropertyVetoException ex) { diff --git a/src/jalview/io/FormatAdapter.java b/src/jalview/io/FormatAdapter.java index 8a563fa..dc93cf9 100755 --- a/src/jalview/io/FormatAdapter.java +++ b/src/jalview/io/FormatAdapter.java @@ -22,6 +22,7 @@ package jalview.io; import jalview.api.AlignExportSettingI; import jalview.api.AlignmentViewPanel; +import jalview.bin.Cache; import jalview.datamodel.Alignment; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; @@ -29,6 +30,7 @@ import jalview.datamodel.ColumnSelection; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; +import jalview.util.Comparison; /** * Additional formatting methods used by the application in a number of places. @@ -58,13 +60,13 @@ public class FormatAdapter extends AppletFormatAdapter private void init() { - if (jalview.bin.Cache.getDefault("STRUCT_FROM_PDB", true)) + if (Cache.getDefault("STRUCT_FROM_PDB", true)) { - annotFromStructure = jalview.bin.Cache.getDefault("ADD_TEMPFACT_ANN", + annotFromStructure = Cache.getDefault("ADD_TEMPFACT_ANN", true); - localSecondaryStruct = jalview.bin.Cache.getDefault("ADD_SS_ANN", + localSecondaryStruct = Cache.getDefault("ADD_SS_ANN", true); - serviceSecondaryStruct = jalview.bin.Cache.getDefault("USE_RNAVIEW", + serviceSecondaryStruct = Cache.getDefault("USE_RNAVIEW", true); } else @@ -114,14 +116,14 @@ public class FormatAdapter extends AppletFormatAdapter if (startEnd != null) { // get first non-gaped residue start position - while (jalview.util.Comparison.isGap(seqs[i] + while (Comparison.isGap(seqs[i] .getCharAt(startIndex)) && startIndex < endIndex) { startIndex++; } // get last non-gaped residue end position - while (jalview.util.Comparison.isGap(seqs[i].getCharAt(endIndex)) + while (Comparison.isGap(seqs[i].getCharAt(endIndex)) && endIndex > startIndex) { endIndex--; @@ -165,50 +167,50 @@ public class FormatAdapter extends AppletFormatAdapter if (format.equalsIgnoreCase("FASTA")) { afile = new FastaFile(); - afile.addJVSuffix(jalview.bin.Cache.getDefault("FASTA_JVSUFFIX", + afile.addJVSuffix(Cache.getDefault("FASTA_JVSUFFIX", true)); } else if (format.equalsIgnoreCase("MSF")) { afile = new MSFfile(); - afile.addJVSuffix(jalview.bin.Cache + afile.addJVSuffix(Cache .getDefault("MSF_JVSUFFIX", true)); } else if (format.equalsIgnoreCase("PileUp")) { afile = new PileUpfile(); - afile.addJVSuffix(jalview.bin.Cache.getDefault("PILEUP_JVSUFFIX", + afile.addJVSuffix(Cache.getDefault("PILEUP_JVSUFFIX", true)); } else if (format.equalsIgnoreCase("CLUSTAL")) { afile = new ClustalFile(); - afile.addJVSuffix(jalview.bin.Cache.getDefault("CLUSTAL_JVSUFFIX", + afile.addJVSuffix(Cache.getDefault("CLUSTAL_JVSUFFIX", true)); } else if (format.equalsIgnoreCase("BLC")) { afile = new BLCFile(); - afile.addJVSuffix(jalview.bin.Cache + afile.addJVSuffix(Cache .getDefault("BLC_JVSUFFIX", true)); } else if (format.equalsIgnoreCase("PIR")) { afile = new PIRFile(); - afile.addJVSuffix(jalview.bin.Cache + afile.addJVSuffix(Cache .getDefault("PIR_JVSUFFIX", true)); } else if (format.equalsIgnoreCase("PFAM")) { afile = new PfamFile(); - afile.addJVSuffix(jalview.bin.Cache.getDefault("PFAM_JVSUFFIX", + afile.addJVSuffix(Cache.getDefault("PFAM_JVSUFFIX", true)); } /* * amsa is not supported by this function - it requires an alignment * rather than a sequence vector else if (format.equalsIgnoreCase("AMSA")) * { afile = new AMSAFile(); afile.addJVSuffix( - * jalview.bin.Cache.getDefault("AMSA_JVSUFFIX", true)); } + * Cache.getDefault("AMSA_JVSUFFIX", true)); } */ afile.setSeqs(seqs); @@ -233,7 +235,7 @@ public class FormatAdapter extends AppletFormatAdapter { if (isValidFormat(format)) { - return jalview.bin.Cache.getDefault(format.toUpperCase() + return Cache.getDefault(format.toUpperCase() + "_JVSUFFIX", true); } return false; @@ -277,8 +279,7 @@ public class FormatAdapter extends AppletFormatAdapter public String formatSequences(String format, AlignmentI alignment, String[] omitHidden, int[] exportRange, boolean suffix, - ColumnSelection colSel, - jalview.datamodel.SequenceGroup selgp) + ColumnSelection colSel, SequenceGroup selgp) { if (omitHidden != null) { diff --git a/src/jalview/io/HTMLOutput.java b/src/jalview/io/HTMLOutput.java index 3c31b7f..5376fa4 100755 --- a/src/jalview/io/HTMLOutput.java +++ b/src/jalview/io/HTMLOutput.java @@ -20,14 +20,22 @@ */ package jalview.io; -import java.io.*; - -import java.awt.*; - -import jalview.datamodel.*; -import jalview.gui.*; +import jalview.bin.Cache; +import jalview.datamodel.AlignmentI; +import jalview.datamodel.SequenceI; +import jalview.gui.AlignViewport; +import jalview.gui.AlignmentPanel; +import jalview.gui.FeatureRenderer; +import jalview.gui.SequenceRenderer; +import jalview.util.BrowserLauncher; +import jalview.util.Comparison; +import jalview.util.Format; import jalview.util.MessageManager; +import java.awt.Color; +import java.awt.Font; +import java.io.PrintWriter; + public class HTMLOutput { AlignViewport av; @@ -48,7 +56,7 @@ public class HTMLOutput fr.transferSettings(fr1); JalviewFileChooser chooser = new JalviewFileChooser( - jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[] + Cache.getProperty("LAST_DIRECTORY"), new String[] { "html" }, new String[] { "HTML files" }, "HTML files"); @@ -61,7 +69,7 @@ public class HTMLOutput if (value == JalviewFileChooser.APPROVE_OPTION) { String choice = chooser.getSelectedFile().getPath(); - jalview.bin.Cache.setProperty("LAST_DIRECTORY", chooser + Cache.setProperty("LAST_DIRECTORY", chooser .getSelectedFile().getParent()); try @@ -102,7 +110,7 @@ public class HTMLOutput out.println("\n\n"); out.close(); - jalview.util.BrowserLauncher.openURL("file:///" + choice); + BrowserLauncher.openURL("file:///" + choice); } catch (Exception ex) { ex.printStackTrace(); @@ -143,7 +151,7 @@ public class HTMLOutput for (int res = 0; res < seq.getLength(); res++) { - if (!jalview.util.Comparison.isGap(seq.getCharAt(res))) + if (!Comparison.isGap(seq.getCharAt(res))) { color = sr.getResidueBoxColour(seq, res); @@ -156,9 +164,8 @@ public class HTMLOutput if (color.getRGB() < -1) { - out.println("" - + seq.getCharAt(res) + ""); + out.println("" + seq.getCharAt(res) + ""); } else { @@ -245,7 +252,7 @@ public class HTMLOutput for (int res = startRes; res < endRes; res++) { - if (!jalview.util.Comparison.isGap(seq.getCharAt(res))) + if (!Comparison.isGap(seq.getCharAt(res))) { color = sr.getResidueBoxColour(seq, res); @@ -258,9 +265,8 @@ public class HTMLOutput if (color.getRGB() < -1) { - out.println("" - + seq.getCharAt(res) + ""); + out.println("" + seq.getCharAt(res) + ""); } else { diff --git a/src/jalview/io/HtmlSvgOutput.java b/src/jalview/io/HtmlSvgOutput.java index 781eace..6311b9b 100644 --- a/src/jalview/io/HtmlSvgOutput.java +++ b/src/jalview/io/HtmlSvgOutput.java @@ -1,12 +1,13 @@ package jalview.io; - import jalview.api.FeatureRenderer; +import jalview.bin.Cache; import jalview.datamodel.AlignmentExportData; import jalview.datamodel.SequenceI; import jalview.gui.AlignViewport; import jalview.gui.AlignmentPanel; import jalview.gui.HTMLOptions; import jalview.math.AlignmentDimension; +import jalview.util.BrowserLauncher; import jalview.util.MessageManager; import java.awt.Color; @@ -48,14 +49,14 @@ public class HtmlSvgOutput { JalviewFileChooser chooser = getHTMLChooser(); - chooser.setFileView(new jalview.io.JalviewFileView()); + chooser.setFileView(new JalviewFileView()); chooser.setDialogTitle(ap.alignFrame.getTitle()); chooser.setToolTipText(MessageManager.getString("action.save")); int value = chooser.showSaveDialog(ap.alignFrame); - if (value == jalview.io.JalviewFileChooser.APPROVE_OPTION) + if (value == JalviewFileChooser.APPROVE_OPTION) { - jalview.bin.Cache.setProperty("LAST_DIRECTORY", chooser + Cache.setProperty("LAST_DIRECTORY", chooser .getSelectedFile().getParent()); file = chooser.getSelectedFile(); } @@ -67,7 +68,7 @@ public class HtmlSvgOutput SVGGraphics2D g2 = new SVGGraphics2D(aDimension.getWidth(), aDimension.getHeight()); - String renderStyle = jalview.bin.Cache.getDefault("HTML_RENDERING", + String renderStyle = Cache.getDefault("HTML_RENDERING", "Prompt each time"); // If we need to prompt, and if the GUI is visible then @@ -120,7 +121,7 @@ public class HtmlSvgOutput if (!(System.getProperty("java.awt.headless") != null && System .getProperty("java.awt.headless").equals("true"))) { - jalview.util.BrowserLauncher.openURL("file:///" + file); + BrowserLauncher.openURL("file:///" + file); } } catch (Exception e) { @@ -130,8 +131,8 @@ public class HtmlSvgOutput static JalviewFileChooser getHTMLChooser() { - return new jalview.io.JalviewFileChooser( - jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[] + return new JalviewFileChooser( + Cache.getProperty("LAST_DIRECTORY"), new String[] { "html" }, new String[] { "Hypertext Markup Language" }, "Hypertext Markup Language"); } diff --git a/src/jalview/io/JSONFile.java b/src/jalview/io/JSONFile.java index b079a3c..e0da795 100644 --- a/src/jalview/io/JSONFile.java +++ b/src/jalview/io/JSONFile.java @@ -45,6 +45,7 @@ import jalview.json.binding.v1.SequenceGrpPojo; import jalview.json.binding.v1.SequencePojo; import jalview.schemes.ColourSchemeI; import jalview.schemes.ColourSchemeProperty; +import jalview.util.Format; import jalview.viewmodel.seqfeatures.FeaturesDisplayed; import java.awt.Color; @@ -328,9 +329,8 @@ public class JSONFile extends AlignFile implements ComplexAlignFile SequenceFeaturesPojo jsonFeature = new SequenceFeaturesPojo( String.valueOf(seq.hashCode())); - String featureColour = (fr == null) ? null : jalview.util.Format - .getHexString(fr - .findFeatureColour(Color.white, seq, + String featureColour = (fr == null) ? null : Format + .getHexString(fr.findFeatureColour(Color.white, seq, seq.findIndex(sf.getBegin()))); jsonFeature.setXstart(seq.findIndex(sf.getBegin()) - 1); jsonFeature.setXend(seq.findIndex(sf.getEnd())); diff --git a/src/jalview/io/JalviewFileChooser.java b/src/jalview/io/JalviewFileChooser.java index 0a6dc33..9ce7588 100755 --- a/src/jalview/io/JalviewFileChooser.java +++ b/src/jalview/io/JalviewFileChooser.java @@ -21,6 +21,7 @@ ////////////////////////////////////////////////////////////////// package jalview.io; +import jalview.bin.Cache; import jalview.util.MessageManager; import jalview.util.Platform; @@ -263,7 +264,7 @@ public class JalviewFileChooser extends JFileChooser public RecentlyOpened() { - String historyItems = jalview.bin.Cache.getProperty("RECENT_FILE"); + String historyItems = Cache.getProperty("RECENT_FILE"); StringTokenizer st; Vector recent = new Vector(); diff --git a/src/jalview/io/MSFfile.java b/src/jalview/io/MSFfile.java index cfa733c..ab2c497 100755 --- a/src/jalview/io/MSFfile.java +++ b/src/jalview/io/MSFfile.java @@ -22,6 +22,7 @@ package jalview.io; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceI; +import jalview.util.Comparison; import jalview.util.Format; import java.io.IOException; @@ -213,7 +214,7 @@ public class MSFfile extends AlignFile public String print(SequenceI[] seqs) { - boolean is_NA = jalview.util.Comparison.isNucleotide(seqs); + boolean is_NA = Comparison.isNucleotide(seqs); SequenceI[] s = new SequenceI[seqs.length]; diff --git a/src/jalview/io/ModellerDescription.java b/src/jalview/io/ModellerDescription.java index 30f46bf..9a3453f 100755 --- a/src/jalview/io/ModellerDescription.java +++ b/src/jalview/io/ModellerDescription.java @@ -20,7 +20,11 @@ */ package jalview.io; -import jalview.datamodel.*; +import jalview.datamodel.DBRefEntry; +import jalview.datamodel.DBRefSource; +import jalview.datamodel.SequenceI; + +import com.stevesoft.pat.Regex; public class ModellerDescription { @@ -95,8 +99,7 @@ public class ModellerDescription private resCode validResidueCode(String field) { Integer val = null; - com.stevesoft.pat.Regex r = new com.stevesoft.pat.Regex( - "\\s*((([-0-9]+).?)|FIRST|LAST|@)"); + Regex r = new Regex("\\s*((([-0-9]+).?)|FIRST|LAST|@)"); if (!r.search(field)) { @@ -107,7 +110,7 @@ public class ModellerDescription { value = r.stringMatched(1); } - // jalview.bin.Cache.log.debug("from '" + field + "' matched '" + value + + // Cache.log.debug("from '" + field + "' matched '" + value + // "'"); try { @@ -162,7 +165,7 @@ public class ModellerDescription } else { - // jalview.bin.Cache.log.debug( + // Cache.log.debug( // "Ignoring non-Modeller description: invalid integer-like // field '" + field + "'"); type = -1; /* invalid field! - throw the FieldSet away */ @@ -273,8 +276,7 @@ public class ModellerDescription if (seq.getDatasetSequence() != null && seq.getDatasetSequence().getDBRef() != null) { - jalview.datamodel.DBRefEntry[] dbr = seq.getDatasetSequence() - .getDBRef(); + DBRefEntry[] dbr = seq.getDatasetSequence().getDBRef(); int i, j; for (i = 0, j = dbr.length; i < j; i++) { @@ -284,8 +286,7 @@ public class ModellerDescription // ModellerField // JBPNote Need to get info from the user about whether the sequence // is the one being modelled, or if it is a template. - if (dbr[i].getSource() - .equals(jalview.datamodel.DBRefSource.PDB)) + if (dbr[i].getSource().equals(DBRefSource.PDB)) { fields.put(Fields[LOCALID], dbr[i].getAccessionId()); t = 2; diff --git a/src/jalview/io/NewickFile.java b/src/jalview/io/NewickFile.java index 92456d5..90f7faf 100755 --- a/src/jalview/io/NewickFile.java +++ b/src/jalview/io/NewickFile.java @@ -26,11 +26,16 @@ // TODO: Extended SequenceNodeI to hold parsed NHX strings package jalview.io; -import java.io.*; +import jalview.datamodel.SequenceNode; +import jalview.util.MessageManager; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; import java.util.StringTokenizer; -import jalview.datamodel.*; -import jalview.util.MessageManager; +import com.stevesoft.pat.Regex; /** * Parse a new hanpshire style tree Caveats: NHX files are NOT supported and the @@ -84,13 +89,13 @@ public class NewickFile extends FileParse boolean printRootInfo = true; - private com.stevesoft.pat.Regex[] NodeSafeName = new com.stevesoft.pat.Regex[] - { new com.stevesoft.pat.Regex().perlCode("m/[\\[,:'()]/"), // test for + private Regex[] NodeSafeName = new Regex[] + { new Regex().perlCode("m/[\\[,:'()]/"), // test for // requiring // quotes - new com.stevesoft.pat.Regex().perlCode("s/'/''/"), // escaping quote + new Regex().perlCode("s/'/''/"), // escaping quote // characters - new com.stevesoft.pat.Regex().perlCode("s/\\/w/_/") // unqoted whitespace + new Regex().perlCode("s/\\/w/_/") // unqoted whitespace // transformation }; @@ -291,7 +296,7 @@ public class NewickFile extends FileParse boolean ascending = false; // flag indicating that we are leaving the // current node - com.stevesoft.pat.Regex majorsyms = new com.stevesoft.pat.Regex( + Regex majorsyms = new Regex( "[(\\['),;]"); int nextcp = 0; @@ -353,7 +358,7 @@ public class NewickFile extends FileParse // Deal with quoted fields case '\'': - com.stevesoft.pat.Regex qnodename = new com.stevesoft.pat.Regex( + Regex qnodename = new Regex( "'([^']|'')+'"); if (qnodename.searchFrom(nf, fcp)) @@ -362,7 +367,7 @@ public class NewickFile extends FileParse nodename = new String(qnodename.stringMatched().substring(1, nl - 1)); // unpack any escaped colons - com.stevesoft.pat.Regex xpandquotes = com.stevesoft.pat.Regex + Regex xpandquotes = Regex .perlCode("s/''/'/"); String widernodename = xpandquotes.replaceAll(nodename); nodename = widernodename; @@ -397,7 +402,7 @@ public class NewickFile extends FileParse * '"+nf.substring(cp,fcp)+"'"); } */ // verify termination. - com.stevesoft.pat.Regex comment = new com.stevesoft.pat.Regex("]"); + Regex comment = new Regex("]"); if (comment.searchFrom(nf, fcp)) { // Skip the comment field @@ -430,11 +435,11 @@ public class NewickFile extends FileParse + fstring.substring(cend + 1); } - com.stevesoft.pat.Regex uqnodename = new com.stevesoft.pat.Regex( + Regex uqnodename = new Regex( "\\b([^' :;\\](),]+)"); - com.stevesoft.pat.Regex nbootstrap = new com.stevesoft.pat.Regex( + Regex nbootstrap = new Regex( "\\s*([0-9+]+)\\s*:"); - com.stevesoft.pat.Regex ndist = new com.stevesoft.pat.Regex( + Regex ndist = new Regex( ":([-0-9Ee.+]+)"); if (!parsednodename @@ -964,7 +969,7 @@ public class NewickFile extends FileParse trf.parse(); System.out.println("Original file :\n"); - com.stevesoft.pat.Regex nonl = new com.stevesoft.pat.Regex("\n+", ""); + Regex nonl = new Regex("\n+", ""); System.out.println(nonl.replaceAll(newickfile.toString()) + "\n"); System.out.println("Parsed file.\n"); diff --git a/src/jalview/io/PIRFile.java b/src/jalview/io/PIRFile.java index adbf81a..daf8bf0 100755 --- a/src/jalview/io/PIRFile.java +++ b/src/jalview/io/PIRFile.java @@ -20,10 +20,12 @@ */ package jalview.io; -import java.io.*; -import java.util.*; +import jalview.datamodel.Sequence; +import jalview.datamodel.SequenceI; +import jalview.util.Comparison; -import jalview.datamodel.*; +import java.io.IOException; +import java.util.Vector; public class PIRFile extends AlignFile { @@ -106,7 +108,7 @@ public class PIRFile extends AlignFile public String print(SequenceI[] s) { - boolean is_NA = jalview.util.Comparison.isNucleotide(s); + boolean is_NA = Comparison.isNucleotide(s); int len = 72; StringBuffer out = new StringBuffer(); int i = 0; diff --git a/src/jalview/io/RnamlFile.java b/src/jalview/io/RnamlFile.java index c15bc6c..2aa6d4b 100644 --- a/src/jalview/io/RnamlFile.java +++ b/src/jalview/io/RnamlFile.java @@ -25,6 +25,7 @@ import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.Annotation; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceI; +import jalview.schemes.ResidueProperties; import jalview.util.MessageManager; import java.io.BufferedReader; @@ -163,7 +164,7 @@ public class RnamlFile extends AlignFile for (int k = 0; k < rna.length(); k++) { ann[k] = new Annotation(annot[k], "", - jalview.schemes.ResidueProperties.getRNASecStrucState( + ResidueProperties.getRNASecStrucState( annot[k]).charAt(0), 0f); } diff --git a/src/jalview/io/SequenceAnnotationReport.java b/src/jalview/io/SequenceAnnotationReport.java index 7c96d45..3bfccc9 100644 --- a/src/jalview/io/SequenceAnnotationReport.java +++ b/src/jalview/io/SequenceAnnotationReport.java @@ -24,6 +24,7 @@ package jalview.io; import jalview.datamodel.DBRefEntry; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; +import jalview.util.DBRefUtils; import jalview.util.UrlLink; import java.util.ArrayList; @@ -234,7 +235,7 @@ public class SequenceAnnotationReport { // collect matching db-refs - DBRefEntry[] dbr = jalview.util.DBRefUtils.selectRefs(seq.getDBRef(), + DBRefEntry[] dbr = DBRefUtils.selectRefs(seq.getDBRef(), new String[] { target }); // collect id string too diff --git a/src/jalview/io/StockholmFile.java b/src/jalview/io/StockholmFile.java index 6490d28..3edcd75 100644 --- a/src/jalview/io/StockholmFile.java +++ b/src/jalview/io/StockholmFile.java @@ -31,7 +31,10 @@ import jalview.datamodel.Mapping; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; +import jalview.schemes.ResidueProperties; +import jalview.util.DBRefUtils; import jalview.util.Format; +import jalview.util.MapList; import jalview.util.MessageManager; import java.io.BufferedReader; @@ -156,7 +159,7 @@ public class StockholmFile extends AlignFile for (int k = 0; k < rna.length(); k++) { ann[k] = new Annotation(annot[k], "", - jalview.schemes.ResidueProperties.getRNASecStrucState( + ResidueProperties.getRNASecStrucState( annot[k]).charAt(0), 0f); } @@ -309,7 +312,7 @@ public class StockholmFile extends AlignFile { String src = dbr.substring(0, dbr.indexOf(";")); String acn = dbr.substring(dbr.indexOf(";") + 1); - jalview.util.DBRefUtils.parseToDbRef(seqO, src, "0", acn); + DBRefUtils.parseToDbRef(seqO, src, "0", acn); } } @@ -738,14 +741,14 @@ public class StockholmFile extends AlignFile { // strip of last subdomain sdbac = sdbac.substring(0, sdbac.indexOf(".")); - dbrf = jalview.util.DBRefUtils.parseToDbRef(seqO, seqdb, dbsource, + dbrf = DBRefUtils.parseToDbRef(seqO, seqdb, dbsource, sdbac); if (dbrf != null) { dbrs.add(dbrf); } } - dbrf = jalview.util.DBRefUtils.parseToDbRef(seqO, dbsource, dbsource, + dbrf = DBRefUtils.parseToDbRef(seqO, dbsource, dbsource, dbr); if (dbr != null) { @@ -760,7 +763,7 @@ public class StockholmFile extends AlignFile { // strip off last subdomain sdbac = sdbac.substring(0, sdbac.indexOf(".")); - dbrf = jalview.util.DBRefUtils.parseToDbRef(seqO, seqdb, dbsource, + dbrf = DBRefUtils.parseToDbRef(seqO, seqdb, dbsource, sdbac); if (dbrf != null) { @@ -768,7 +771,7 @@ public class StockholmFile extends AlignFile } } - dbrf = jalview.util.DBRefUtils.parseToDbRef(seqO, dbsource, dbsource, + dbrf = DBRefUtils.parseToDbRef(seqO, dbsource, dbsource, dbr); if (dbrf != null) { @@ -779,7 +782,7 @@ public class StockholmFile extends AlignFile { for (DBRefEntry d : dbrs) { - jalview.util.MapList mp = new jalview.util.MapList(new int[] + MapList mp = new MapList(new int[] { seqO.getStart(), seqO.getEnd() }, new int[] { st, en }, 1, 1); jalview.datamodel.Mapping mping = new Mapping(mp); @@ -830,12 +833,12 @@ public class StockholmFile extends AlignFile { if (detectbrackets.search(pos)) { - ann.secondaryStructure = jalview.schemes.ResidueProperties + ann.secondaryStructure = ResidueProperties .getRNASecStrucState(pos).charAt(0); } else { - ann.secondaryStructure = jalview.schemes.ResidueProperties + ann.secondaryStructure = ResidueProperties .getDssp3state(pos).charAt(0); } diff --git a/src/jalview/io/TCoffeeScoreFile.java b/src/jalview/io/TCoffeeScoreFile.java index ca8a22a..4f94be9 100644 --- a/src/jalview/io/TCoffeeScoreFile.java +++ b/src/jalview/io/TCoffeeScoreFile.java @@ -25,6 +25,7 @@ import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; import jalview.datamodel.Annotation; import jalview.datamodel.SequenceI; +import jalview.util.Comparison; import java.awt.Color; import java.io.IOException; @@ -592,7 +593,7 @@ public class TCoffeeScoreFile extends AlignFile for (int j = 0; j < jSize; j++) { byte val = srow[j]; - if (s != null && jalview.util.Comparison.isGap(s.getCharAt(j))) + if (s != null && Comparison.isGap(s.getCharAt(j))) { annotations[j] = null; if (val > 0) diff --git a/src/jalview/io/VamsasAppDatastore.java b/src/jalview/io/VamsasAppDatastore.java index 7df7cb2..7608e51 100644 --- a/src/jalview/io/VamsasAppDatastore.java +++ b/src/jalview/io/VamsasAppDatastore.java @@ -23,6 +23,7 @@ package jalview.io; import jalview.bin.Cache; import jalview.datamodel.AlignedCodonFrame; import jalview.datamodel.AlignmentAnnotation; +import jalview.datamodel.AlignmentI; import jalview.datamodel.GraphLine; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; @@ -33,6 +34,7 @@ import jalview.io.vamsas.Datasetsequence; import jalview.io.vamsas.DatastoreItem; import jalview.io.vamsas.DatastoreRegistry; import jalview.io.vamsas.Rangetype; +import jalview.util.MapList; import jalview.util.MessageManager; import jalview.viewmodel.AlignmentViewport; @@ -285,8 +287,8 @@ public class VamsasAppDatastore { try { - jalview.datamodel.AlignmentI jal = av.getAlignment(); - jalview.datamodel.AlignmentI jds = jal.getDataset(); + AlignmentI jal = av.getAlignment(); + AlignmentI jds = jal.getDataset(); boolean nw = false; VAMSAS root = null; // will be resolved based on Dataset Parent. // ///////////////////////////////////////// @@ -538,7 +540,7 @@ public class VamsasAppDatastore // SAVE ANNOTATIONS if (jal.getAlignmentAnnotation() != null) { - jalview.datamodel.AlignmentAnnotation[] aa = jal + AlignmentAnnotation[] aa = jal .getAlignmentAnnotation(); java.util.HashMap AlSeqMaps = new HashMap(); // stores int maps from // alignment columns to @@ -667,7 +669,7 @@ public class VamsasAppDatastore } setAnnotationType(an, aa[i]); - if (aa[i].graph != jalview.datamodel.AlignmentAnnotation.NO_GRAPH) + if (aa[i].graph != AlignmentAnnotation.NO_GRAPH) { an.setGraph(true); an.setGroup(Integer.toString(aa[i].graphGroup)); @@ -1041,7 +1043,7 @@ public class VamsasAppDatastore // of // utf8 // translation - if (alan.graph != jalview.datamodel.AlignmentAnnotation.NO_GRAPH) + if (alan.graph != AlignmentAnnotation.NO_GRAPH) { ae.addValue(alan.annotations[a].value); } @@ -1323,7 +1325,7 @@ public class VamsasAppDatastore @Override public JarInputStream getJarInputStream() throws IOException { - jalview.bin.Cache.log + Cache.log .debug("Returning client input stream for Jalview from Vamsas Document."); return new JarInputStream(cappdata.getClientInputStream()); } @@ -1371,7 +1373,7 @@ public class VamsasAppDatastore @Override public JarInputStream getJarInputStream() throws IOException { - jalview.bin.Cache.log + Cache.log .debug("Returning user input stream for Jalview from Vamsas Document."); return new JarInputStream(cappdata.getUserInputStream()); } @@ -1532,14 +1534,14 @@ public class VamsasAppDatastore } catch (Exception e) { // TODO raise GUI warning if user requests it. - jalview.bin.Cache.log + Cache.log .error("Couldn't update jalview client application data. Giving up - local settings probably lost.", e); } } else { - jalview.bin.Cache.log + Cache.log .error("Couldn't access client application data for vamsas session. This is probably a vamsas client bug."); } } @@ -1668,7 +1670,7 @@ public class VamsasAppDatastore // annotations if (dsSeq == null) { - jalview.bin.Cache.log + Cache.log .warn("Couldn't resolve jalview sequenceI for dataset object reference " + ((Vobject) dataset.getDataSetAnnotations( dsa).getSeqRef(0)).getVorbaId() @@ -1711,7 +1713,7 @@ public class VamsasAppDatastore // TODO check this handles multiple views properly AlignmentViewport av = findViewport(alignment); - jalview.datamodel.AlignmentI jal = null; + AlignmentI jal = null; if (av != null) { // TODO check that correct alignment object is retrieved when @@ -1753,7 +1755,7 @@ public class VamsasAppDatastore .getAlignmentSequenceAnnotation(); for (int a = 0; a < vasannot.length; a++) { - jalview.datamodel.AlignmentAnnotation asa = (jalview.datamodel.AlignmentAnnotation) getvObj2jv(vasannot[a]); // TODO: + AlignmentAnnotation asa = (AlignmentAnnotation) getvObj2jv(vasannot[a]); // TODO: // 1:many // jalview // alignment @@ -1839,7 +1841,7 @@ public class VamsasAppDatastore for (int j = 0; j < an.length; j++) { - jalview.datamodel.AlignmentAnnotation jan = (jalview.datamodel.AlignmentAnnotation) getvObj2jv(an[j]); + AlignmentAnnotation jan = (AlignmentAnnotation) getvObj2jv(an[j]); if (jan != null) { // update or stay the same. @@ -2185,8 +2187,8 @@ public class VamsasAppDatastore * @param annotation * @return unbound jalview alignment annotation object. */ - private jalview.datamodel.AlignmentAnnotation getjAlignmentAnnotation( - jalview.datamodel.AlignmentI jal, + private AlignmentAnnotation getjAlignmentAnnotation( + AlignmentI jal, uk.ac.vamsas.objects.core.RangeAnnotation annotation) { if (annotation == null) @@ -2255,7 +2257,7 @@ public class VamsasAppDatastore } } } - jalview.datamodel.AlignmentAnnotation jan = null; + AlignmentAnnotation jan = null; if (a_label == null || a_label.length() == 0) { a_label = annotation.getType(); @@ -2297,14 +2299,14 @@ public class VamsasAppDatastore { if (type == 0) { - type = jalview.datamodel.AlignmentAnnotation.BAR_GRAPH; // default + type = AlignmentAnnotation.BAR_GRAPH; // default // type of // value // annotation if (has[HASHPHOB]) { // no hints - so we ensure HPHOB display is like this. - type = jalview.datamodel.AlignmentAnnotation.BAR_GRAPH; + type = AlignmentAnnotation.BAR_GRAPH; } } // make bounds and automatic description strings for jalview user's @@ -2376,7 +2378,7 @@ public class VamsasAppDatastore } } } - jan = new jalview.datamodel.AlignmentAnnotation(a_label, a_descr, + jan = new AlignmentAnnotation(a_label, a_descr, arow, min, max, type); } else @@ -2388,7 +2390,7 @@ public class VamsasAppDatastore // width - if it is not complete, then mark regions on the annotation // row. } - jan = new jalview.datamodel.AlignmentAnnotation(a_label, a_descr, + jan = new AlignmentAnnotation(a_label, a_descr, arow); jan.setThreshold(null); jan.annotationId = annotation.getVorbaId().toString(); // keep all the @@ -2551,17 +2553,17 @@ public class VamsasAppDatastore * @param default unit for mapped * @return MapList */ - private jalview.util.MapList parsemapType(MapType maprange, int localu, + private MapList parsemapType(MapType maprange, int localu, int mappedu) { - jalview.util.MapList ml = null; + MapList ml = null; int[] localRange = getMapping(maprange.getLocal()); int[] mappedRange = getMapping(maprange.getMapped()); long lu = maprange.getLocal().hasUnit() ? maprange.getLocal().getUnit() : localu; long mu = maprange.getMapped().hasUnit() ? maprange.getMapped() .getUnit() : mappedu; - ml = new jalview.util.MapList(localRange, mappedRange, (int) lu, + ml = new MapList(localRange, mappedRange, (int) lu, (int) mu); return ml; } @@ -2590,7 +2592,7 @@ public class VamsasAppDatastore * @param ml * @param setUnits */ - private void initMapType(MapType maprange, jalview.util.MapList ml, + private void initMapType(MapType maprange, MapList ml, boolean setUnits) { maprange.setLocal(new Local()); @@ -2707,7 +2709,7 @@ public class VamsasAppDatastore AlignmentViewport av = viewport; try { - jalview.datamodel.AlignmentI jal = av.getAlignment(); + AlignmentI jal = av.getAlignment(); // ///////////////////////////////////////// // SAVE THE DATASET DataSet dataset = null; diff --git a/src/jalview/io/WSWUBlastClient.java b/src/jalview/io/WSWUBlastClient.java index db4acc4..9061aa0 100755 --- a/src/jalview/io/WSWUBlastClient.java +++ b/src/jalview/io/WSWUBlastClient.java @@ -20,15 +20,30 @@ */ package jalview.io; -import java.util.*; +import jalview.analysis.AlignSeq; +import jalview.datamodel.AlignmentI; +import jalview.datamodel.DBRefEntry; +import jalview.datamodel.DBRefSource; +import jalview.datamodel.Sequence; +import jalview.gui.AlignmentPanel; +import jalview.gui.CutAndPasteTransfer; +import jalview.gui.Desktop; +import jalview.util.MessageManager; -import javax.swing.*; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.StringTokenizer; +import java.util.Vector; -import jalview.analysis.*; -import jalview.datamodel.*; -import jalview.gui.*; -import jalview.util.MessageManager; -import uk.ac.ebi.www.*; +import javax.swing.ImageIcon; +import javax.swing.JOptionPane; + +import uk.ac.ebi.www.Data; +import uk.ac.ebi.www.InputParams; +import uk.ac.ebi.www.WSFile; +import uk.ac.ebi.www.WSWUBlast; +import uk.ac.ebi.www.WSWUBlastService; +import uk.ac.ebi.www.WSWUBlastServiceLocator; /** * DOCUMENT ME! @@ -166,9 +181,8 @@ public class WSWUBlastClient DBRefEntry[] entries = oldseq.getDBRef(); if (entries != null) { - oldseq.addDBRef(new jalview.datamodel.DBRefEntry( - jalview.datamodel.DBRefSource.UNIPROT, "0", entries[0] - .getAccessionId())); + oldseq.addDBRef(new DBRefEntry(DBRefSource.UNIPROT, "0", + entries[0].getAccessionId())); } } } diff --git a/src/jalview/io/packed/DataProvider.java b/src/jalview/io/packed/DataProvider.java index fecc5ca..c868b85 100644 --- a/src/jalview/io/packed/DataProvider.java +++ b/src/jalview/io/packed/DataProvider.java @@ -20,6 +20,8 @@ */ package jalview.io.packed; +import jalview.io.FileParse; + /** * API for a data provider that can be used with * jalview.io.packed.ParsePackedSet @@ -67,7 +69,7 @@ public interface DataProvider * * @return */ - jalview.io.FileParse getDataSource(); + FileParse getDataSource(); /** * association context for data. Either null or a specific sequence. diff --git a/src/jalview/io/packed/JalviewDataset.java b/src/jalview/io/packed/JalviewDataset.java index d613796..76c9b18 100644 --- a/src/jalview/io/packed/JalviewDataset.java +++ b/src/jalview/io/packed/JalviewDataset.java @@ -20,6 +20,8 @@ */ package jalview.io.packed; +import jalview.analysis.NJTree; +import jalview.analysis.SeqsetUtils; import jalview.datamodel.AlignmentI; import jalview.datamodel.SequenceI; import jalview.io.NewickFile; @@ -103,12 +105,12 @@ public class JalviewDataset { public AlignmentI al; - public List trees; + public List trees; AlignmentSet(AlignmentI a) { al = a; - trees = new ArrayList(); + trees = new ArrayList(); } /** @@ -141,15 +143,13 @@ public class JalviewDataset // jalview.analysis.SeqsetUtils.deuniquifyAndMerge(parentDataset, // seqDetails, al,true); - jalview.analysis.SeqsetUtils.deuniquify(seqDetails, - al.getSequencesArray(), true); + SeqsetUtils.deuniquify(seqDetails, al.getSequencesArray(), true); // 2. Update names of associated nodes in any trees for (NewickFile nf : trees) { // the following works because all trees are already had node/SequenceI // associations created. - jalview.analysis.NJTree njt = new jalview.analysis.NJTree( - al.getSequencesArray(), nf); + NJTree njt = new NJTree(al.getSequencesArray(), nf); // this just updates the displayed leaf name on the tree according to // the SequenceIs. njt.renameAssociatedNodes(); diff --git a/src/jalview/io/packed/ParsePackedSet.java b/src/jalview/io/packed/ParsePackedSet.java index a4ef77e..fda4faa 100644 --- a/src/jalview/io/packed/ParsePackedSet.java +++ b/src/jalview/io/packed/ParsePackedSet.java @@ -21,10 +21,13 @@ package jalview.io.packed; import jalview.datamodel.AlignmentI; +import jalview.io.AnnotationFile; import jalview.io.AppletFormatAdapter; +import jalview.io.FeaturesFile; import jalview.io.FileParse; import jalview.io.FormatAdapter; import jalview.io.IdentifyFile; +import jalview.io.NewickFile; import jalview.io.packed.DataProvider.JvDataType; import java.io.BufferedReader; @@ -124,7 +127,7 @@ public class ParsePackedSet br = new BufferedReader(src.getReader()); } // TODO: add columnSelection to context - if (new jalview.io.AnnotationFile().parseAnnotationFrom( + if (new AnnotationFile().parseAnnotationFrom( context.getLastAlignment(), null, br)) { context.updateSetModified(true); @@ -161,7 +164,7 @@ public class ParsePackedSet } try { - jalview.io.FeaturesFile ff = new jalview.io.FeaturesFile(src); + FeaturesFile ff = new FeaturesFile(src); context.updateSetModified(ff.parse(context.getLastAlignment(), context.featureColours, false, context.relaxedIdMatching)); } catch (Exception e) @@ -174,7 +177,7 @@ public class ParsePackedSet { try { - jalview.io.NewickFile nf = new jalview.io.NewickFile(src); + NewickFile nf = new NewickFile(src); if (!nf.isValid()) { nf.close(); diff --git a/src/jalview/io/vamsas/Datasetsequence.java b/src/jalview/io/vamsas/Datasetsequence.java index 9c86557..d170513 100644 --- a/src/jalview/io/vamsas/Datasetsequence.java +++ b/src/jalview/io/vamsas/Datasetsequence.java @@ -23,6 +23,7 @@ package jalview.io.vamsas; import jalview.datamodel.DBRefEntry; import jalview.datamodel.SequenceI; import jalview.io.VamsasAppDatastore; + import uk.ac.vamsas.objects.core.DataSet; import uk.ac.vamsas.objects.core.DbRef; import uk.ac.vamsas.objects.core.Sequence; @@ -137,9 +138,8 @@ public class Datasetsequence extends DatastoreItem for (int sf = 0; sf < sfSize; sf++) { - modified |= new jalview.io.vamsas.Sequencefeature(datastore, - (jalview.datamodel.SequenceFeature) sq - .getSequenceFeatures()[sf], dataset, + modified |= new Sequencefeature(datastore, + sq.getSequenceFeatures()[sf], dataset, (Sequence) vobj).docWasUpdated(); } } @@ -181,7 +181,7 @@ public class Datasetsequence extends DatastoreItem // jalview.datamodel.DBRefEntry dbentry; for (int db = 0; db < entries.length; db++) { - modifiedthedoc |= new jalview.io.vamsas.Dbref(datastore, + modifiedthedoc |= new Dbref(datastore, // dbentry = entries[db], sq, (Sequence) vobj, dataset).docWasUpdated(); @@ -208,7 +208,7 @@ public class Datasetsequence extends DatastoreItem // DbRef dbentry; for (int db = 0; db < entries.length; db++) { - modifiedtheseq |= new jalview.io.vamsas.Dbref(datastore, + modifiedtheseq |= new Dbref(datastore, // dbentry = entries[db], vsq, sq).jvWasUpdated(); } diff --git a/src/jalview/io/vamsas/DatastoreItem.java b/src/jalview/io/vamsas/DatastoreItem.java index 11c7e91..3b922a9 100644 --- a/src/jalview/io/vamsas/DatastoreItem.java +++ b/src/jalview/io/vamsas/DatastoreItem.java @@ -87,10 +87,12 @@ public abstract class DatastoreItem * @param vobj * @return Jalview datamodel object bound to the vamsas document object */ - protected Object getvObj2jv(uk.ac.vamsas.client.Vobject vobj) + protected Object getvObj2jv(Vobject vobj) { if (vobj2jv == null) + { return null; + } VorbaId id = vobj.getVorbaId(); if (id == null) { @@ -113,7 +115,7 @@ public abstract class DatastoreItem * @param jvobj * @param vobj */ - protected void bindjvvobj(Object jvobj, uk.ac.vamsas.client.Vobject vobj) + protected void bindjvvobj(Object jvobj, Vobject vobj) { VorbaId id = vobj.getVorbaId(); if (id == null) diff --git a/src/jalview/io/vamsas/Dbref.java b/src/jalview/io/vamsas/Dbref.java index aacdecf..a82d9d4 100644 --- a/src/jalview/io/vamsas/Dbref.java +++ b/src/jalview/io/vamsas/Dbref.java @@ -20,25 +20,29 @@ */ package jalview.io.vamsas; +import jalview.bin.Cache; import jalview.datamodel.DBRefEntry; +import jalview.datamodel.Mapping; import jalview.datamodel.SequenceI; +import jalview.io.VamsasAppDatastore; + import uk.ac.vamsas.objects.core.DataSet; import uk.ac.vamsas.objects.core.DbRef; import uk.ac.vamsas.objects.core.Map; import uk.ac.vamsas.objects.core.Sequence; -import jalview.io.VamsasAppDatastore; +import uk.ac.vamsas.objects.utils.SymbolDictionary; public class Dbref extends Rangetype { - jalview.datamodel.SequenceI sq = null; + SequenceI sq = null; uk.ac.vamsas.objects.core.Sequence sequence = null; DataSet ds; public Dbref(VamsasAppDatastore datastore, DBRefEntry dbentry, - jalview.datamodel.SequenceI sq2, - uk.ac.vamsas.objects.core.Sequence sequence2, DataSet dataset) + SequenceI sq2, uk.ac.vamsas.objects.core.Sequence sequence2, + DataSet dataset) { super(datastore, dbentry, DbRef.class); // initialise object specific attributes @@ -53,7 +57,7 @@ public class Dbref extends Rangetype public Dbref(VamsasAppDatastore datastore, DbRef ref, Sequence vdseq, SequenceI dsseq) { - super(datastore, ref, jalview.datamodel.DBRefEntry.class); + super(datastore, ref, DBRefEntry.class); sequence = vdseq; sq = dsseq; ds = (DataSet) vdseq.getV_parent(); @@ -70,7 +74,7 @@ public class Dbref extends Rangetype if (jvobj.getMap() != null) { // Record mapping to external database coordinate system. - jalview.datamodel.Mapping mp = jvobj.getMap(); + Mapping mp = jvobj.getMap(); if (mp.getMap() != null) { Map vMap = null; @@ -91,7 +95,7 @@ public class Dbref extends Rangetype } else { - jalview.bin.Cache.log.debug("Ignoring mapless DbRef.Map " + Cache.log.debug("Ignoring mapless DbRef.Map " + jvobj.getSrcAccString()); } @@ -103,7 +107,7 @@ public class Dbref extends Rangetype * * @param mp */ - private void updateMapTo(jalview.datamodel.Mapping mp) + private void updateMapTo(Mapping mp) { log.info("Performing updateMapTo remove this message when we know what we're doing."); // TODO determine how sequences associated with database mappings are stored @@ -124,8 +128,8 @@ public class Dbref extends Rangetype mp.getTo(), (mp.getMappedWidth() == mp.getWidth()) ? sequence .getDictionary() - : ((mp.getMappedWidth() == 3) ? uk.ac.vamsas.objects.utils.SymbolDictionary.STANDARD_NA - : uk.ac.vamsas.objects.utils.SymbolDictionary.STANDARD_AA), + : ((mp.getMappedWidth() == 3) ? SymbolDictionary.STANDARD_NA + : SymbolDictionary.STANDARD_AA), ds); } // @@ -157,12 +161,11 @@ public class Dbref extends Rangetype // TODO: Jalview ignores all the other maps if (vobj.getMapCount() > 1) { - jalview.bin.Cache.log + Cache.log .debug("Ignoring additional mappings on DbRef: " + jvobj.getSource() + ":" + jvobj.getAccessionId()); } - jalview.datamodel.Mapping mp = new jalview.datamodel.Mapping( - parsemapType(vobj.getMap(0))); + Mapping mp = new Mapping(parsemapType(vobj.getMap(0))); if (jvobj.getMap() == null || !mp.equals(jvobj.getMap())) { jvobj.setMap(mp); @@ -174,7 +177,7 @@ public class Dbref extends Rangetype { DbRef vobj = (DbRef) this.vobj; DBRefEntry jvobj = (DBRefEntry) this.jvobj; - jalview.bin.Cache.log.debug("Conflict in dbentry update for " + Cache.log.debug("Conflict in dbentry update for " + vobj.getAccessionId() + vobj.getSource() + " " + vobj.getVorbaId()); // TODO Auto-generated method stub @@ -186,7 +189,7 @@ public class Dbref extends Rangetype DbRef vobj = (DbRef) this.vobj; DBRefEntry jvobj = (DBRefEntry) this.jvobj; // add new dbref - sq.addDBRef(jvobj = new jalview.datamodel.DBRefEntry(vobj.getSource() + sq.addDBRef(jvobj = new DBRefEntry(vobj.getSource() .toString(), vobj.getVersion().toString(), vobj .getAccessionId().toString())); if (vobj.getMapCount() > 0) @@ -194,11 +197,11 @@ public class Dbref extends Rangetype // TODO: Jalview ignores all the other maps if (vobj.getMapCount() > 1) { - jalview.bin.Cache.log + Cache.log .debug("Ignoring additional mappings on DbRef: " + jvobj.getSource() + ":" + jvobj.getAccessionId()); } - jalview.datamodel.Mapping mp = new jalview.datamodel.Mapping( + Mapping mp = new Mapping( parsemapType(vobj.getMap(0))); jvobj.setMap(mp); } @@ -219,7 +222,7 @@ public class Dbref extends Rangetype sequence.addDbRef(dbref); if (jvobj.getMap() != null) { - jalview.datamodel.Mapping mp = jvobj.getMap(); + Mapping mp = jvobj.getMap(); if (mp.getMap() != null) { Map vMap = new Map(); @@ -229,7 +232,7 @@ public class Dbref extends Rangetype } else { - jalview.bin.Cache.log.debug("Ignoring mapless DbRef.Map " + Cache.log.debug("Ignoring mapless DbRef.Map " + jvobj.getSrcAccString()); } } diff --git a/src/jalview/io/vamsas/Rangetype.java b/src/jalview/io/vamsas/Rangetype.java index 08b1b52..64a07e1 100644 --- a/src/jalview/io/vamsas/Rangetype.java +++ b/src/jalview/io/vamsas/Rangetype.java @@ -20,7 +20,9 @@ */ package jalview.io.vamsas; +import jalview.bin.Cache; import jalview.io.VamsasAppDatastore; +import jalview.util.MapList; import jalview.util.MessageManager; import java.util.List; @@ -246,26 +248,26 @@ public abstract class Rangetype extends DatastoreItem * @param default unit for mapped * @return MapList */ - protected jalview.util.MapList parsemapType(MapType maprange, int localu, + protected MapList parsemapType(MapType maprange, int localu, int mappedu) { - jalview.util.MapList ml = null; + MapList ml = null; int[] localRange = getIntervals(maprange.getLocal()); int[] mappedRange = getIntervals(maprange.getMapped()); long lu = maprange.getLocal().hasUnit() ? maprange.getLocal().getUnit() : localu; long mu = maprange.getMapped().hasUnit() ? maprange.getMapped() .getUnit() : mappedu; - ml = new jalview.util.MapList(localRange, mappedRange, (int) lu, + ml = new MapList(localRange, mappedRange, (int) lu, (int) mu); return ml; } - protected jalview.util.MapList parsemapType(MapType map) + protected MapList parsemapType(MapType map) { if (!map.getLocal().hasUnit() || map.getMapped().hasUnit()) { - jalview.bin.Cache.log + Cache.log .warn("using default mapping length of 1:1 for map " + (map.isRegistered() ? map.getVorbaId().toString() : (" " + map.toString()))); @@ -280,7 +282,7 @@ public abstract class Rangetype extends DatastoreItem * @param ml * @param setUnits */ - protected void initMapType(MapType maprange, jalview.util.MapList ml, + protected void initMapType(MapType maprange, MapList ml, boolean setUnits) { initMapType(maprange, ml, setUnits, false); @@ -294,7 +296,7 @@ public abstract class Rangetype extends DatastoreItem * @param reverse * - reverse MapList mapping for Local and Mapped ranges and units */ - protected void initMapType(MapType maprange, jalview.util.MapList ml, + protected void initMapType(MapType maprange, MapList ml, boolean setUnits, boolean reverse) { if (ml == null) diff --git a/src/jalview/io/vamsas/Sequencemapping.java b/src/jalview/io/vamsas/Sequencemapping.java index 4929a06..9bdd6b3 100644 --- a/src/jalview/io/vamsas/Sequencemapping.java +++ b/src/jalview/io/vamsas/Sequencemapping.java @@ -20,12 +20,16 @@ */ package jalview.io.vamsas; +import jalview.bin.Cache; import jalview.datamodel.AlignedCodonFrame; import jalview.datamodel.AlignmentI; +import jalview.datamodel.DBRefEntry; import jalview.datamodel.Mapping; import jalview.datamodel.SequenceI; import jalview.gui.Desktop; import jalview.io.VamsasAppDatastore; +import jalview.structure.StructureSelectionManager; +import jalview.util.MapList; import java.util.Vector; @@ -34,14 +38,15 @@ import uk.ac.vamsas.objects.core.DataSet; import uk.ac.vamsas.objects.core.Sequence; import uk.ac.vamsas.objects.core.SequenceMapping; import uk.ac.vamsas.objects.core.SequenceType; +import uk.ac.vamsas.objects.utils.SymbolDictionary; /** * binds a vamsas sequence mapping object from the vamsas document to a maplist * object associated with a mapping in the Jalview model. We use the maplist * object because these are referred to both in the Mapping object associated - * with a jalview.datamodel.DBRefEntry and in the array of - * jalview.datamodel.AlCodonFrame objects that Jalview uses to propagate - * sequence mapping position highlighting across the views. + * with a DBRefEntry and in the array of jalview.datamodel.AlCodonFrame objects + * that Jalview uses to propagate sequence mapping position highlighting across + * the views. * * @author JimP * @@ -51,7 +56,7 @@ public class Sequencemapping extends Rangetype public Sequencemapping(VamsasAppDatastore datastore, SequenceMapping sequenceMapping) { - super(datastore, sequenceMapping, jalview.util.MapList.class); + super(datastore, sequenceMapping, MapList.class); doJvUpdate(); } @@ -71,7 +76,7 @@ public class Sequencemapping extends Rangetype * @param ds */ public Sequencemapping(VamsasAppDatastore datastore, - jalview.datamodel.Mapping mjvmapping, + Mapping mjvmapping, uk.ac.vamsas.objects.core.SequenceType from, uk.ac.vamsas.objects.core.DataSet ds) { @@ -96,13 +101,13 @@ public class Sequencemapping extends Rangetype } if (from != null && sequenceMapping.getLoc() != from) { - jalview.bin.Cache.log.warn("Probable IMPLEMENTATION ERROR: " + from + Cache.log.warn("Probable IMPLEMENTATION ERROR: " + from + " doesn't match the local mapping sequence."); } if (ds != null && sequenceMapping.is__stored_in_document() && sequenceMapping.getV_parent() != ds) { - jalview.bin.Cache.log + Cache.log .warn("Probable IMPLEMENTATION ERROR: " + ds + " doesn't match the parent of the bound sequence mapping object."); @@ -132,7 +137,7 @@ public class Sequencemapping extends Rangetype public void updateFromDoc() { - update((SequenceMapping) vobj, (jalview.datamodel.Mapping) jvobj); + update((SequenceMapping) vobj, (Mapping) jvobj); } private void conflict(Mapping mjvmapping, SequenceMapping sequenceMapping) @@ -152,7 +157,7 @@ public class Sequencemapping extends Rangetype SequenceType to = (SequenceType) getjv2vObj(jvto); if (to == null) { - jalview.bin.Cache.log + Cache.log .warn("FIXME NONFATAL - do a second update: Ignoring Forward Reference to seuqence not yet bound to vamsas seuqence object"); return; } @@ -162,10 +167,10 @@ public class Sequencemapping extends Rangetype boolean dnaToProt = false, sense = false; // ensure that we create a mapping with the correct sense if (((Sequence) sequenceMapping.getLoc()).getDictionary().equals( - uk.ac.vamsas.objects.utils.SymbolDictionary.STANDARD_NA)) + SymbolDictionary.STANDARD_NA)) { if (((Sequence) sequenceMapping.getMap()).getDictionary().equals( - uk.ac.vamsas.objects.utils.SymbolDictionary.STANDARD_AA)) + SymbolDictionary.STANDARD_AA)) { dnaToProt = true; sense = true; @@ -174,7 +179,7 @@ public class Sequencemapping extends Rangetype else { if (((Sequence) sequenceMapping.getMap()).getDictionary().equals( - uk.ac.vamsas.objects.utils.SymbolDictionary.STANDARD_NA)) + SymbolDictionary.STANDARD_NA)) { dnaToProt = true; sense = false; @@ -183,7 +188,7 @@ public class Sequencemapping extends Rangetype if (!dnaToProt) { - jalview.bin.Cache.log + Cache.log .warn("Ignoring Mapping - don't support protein to protein mapping in vamsas document yet."); return; } @@ -223,28 +228,28 @@ public class Sequencemapping extends Rangetype // mapping bindjvvobj(mjvmapping.getMap(), sequenceMapping); - jalview.bin.Cache.log.debug("Successfully created mapping " + Cache.log.debug("Successfully created mapping " + sequenceMapping.getVorbaId()); } - // private void update(jalview.util.MapList mjvmapping, + // private void update(MapList mjvmapping, // SequenceMapping sequenceMapping) { - jalview.bin.Cache.log + Cache.log .error("Not implemented: Jalview Update Alcodon Mapping:TODO!"); } private void update(SequenceMapping sequenceMapping, - jalview.datamodel.Mapping mjvmapping) + Mapping mjvmapping) { - jalview.bin.Cache.log + Cache.log .error("Not implemented: Update DBRef Mapping from Jalview"); } - private void update(jalview.datamodel.Mapping mjvmapping, + private void update(Mapping mjvmapping, SequenceMapping sequenceMapping) { - jalview.bin.Cache.log + Cache.log .error("Not implemented: Jalview Update Sequence DBRef Mapping"); } @@ -281,7 +286,7 @@ public class Sequencemapping extends Rangetype } if (sdloc == null || sdmap == null) { - jalview.bin.Cache.log.info("Ignoring non sequence-sequence mapping"); + Cache.log.info("Ignoring non sequence-sequence mapping"); return; } mobj = this.getvObj2jv(sdloc); @@ -297,16 +302,16 @@ public class Sequencemapping extends Rangetype if (from == null || to == null) { - jalview.bin.Cache.log + Cache.log .error("Probable Vamsas implementation error : unbound dataset sequences involved in a mapping are being parsed!"); return; } if (sdloc.getDictionary().equals( - uk.ac.vamsas.objects.utils.SymbolDictionary.STANDARD_NA)) +SymbolDictionary.STANDARD_NA)) { if (sdmap.getDictionary().equals( - uk.ac.vamsas.objects.utils.SymbolDictionary.STANDARD_AA)) +SymbolDictionary.STANDARD_AA)) { dnaToProt = true; sense = true; @@ -318,7 +323,7 @@ public class Sequencemapping extends Rangetype else { if (sdmap.getDictionary().equals( - uk.ac.vamsas.objects.utils.SymbolDictionary.STANDARD_NA)) +SymbolDictionary.STANDARD_NA)) { dnaToProt = true; sense = false; @@ -340,13 +345,13 @@ public class Sequencemapping extends Rangetype } // create and add the new mapping to (each) dataset's codonFrame - jalview.util.MapList mapping = null; + MapList mapping = null; if (dnaToProt) { if (!sense) { mapping = this.parsemapType(sequenceMapping, 1, 3); // invert sense - mapping = new jalview.util.MapList(mapping.getToRanges(), + mapping = new MapList(mapping.getToRanges(), mapping.getFromRanges(), mapping.getToRatio(), mapping.getFromRatio()); acf.addMap(to, from, mapping); @@ -363,7 +368,7 @@ public class Sequencemapping extends Rangetype acf.addMap(from, to, mapping); } bindjvvobj(mapping, sequenceMapping); - jalview.structure.StructureSelectionManager + StructureSelectionManager .getStructureSelectionManager(Desktop.instance).addMapping(acf); // Try to link up any conjugate database references in the two sequences // matchConjugateDBRefs(from, to, mapping); @@ -372,8 +377,8 @@ public class Sequencemapping extends Rangetype } /** - * Complete any 'to' references in jalview.datamodel.Mapping objects - * associated with conjugate DBRefEntry under given mapping + * Complete any 'to' references in Mapping objects associated with conjugate + * DBRefEntry under given mapping * * @param from * sequence corresponding to from reference for sequence mapping @@ -383,37 +388,37 @@ public class Sequencemapping extends Rangetype * maplist parsed in same sense as from and to */ private void matchConjugateDBRefs(SequenceI from, SequenceI to, - jalview.util.MapList smap) + MapList smap) { if (from.getDBRef() == null && to.getDBRef() == null) { - if (jalview.bin.Cache.log.isDebugEnabled()) + if (Cache.log.isDebugEnabled()) { - jalview.bin.Cache.log.debug("Not matching conjugate refs for " + Cache.log.debug("Not matching conjugate refs for " + from.getName() + " and " + to.getName()); } return; } - if (jalview.bin.Cache.log.isDebugEnabled()) + if (Cache.log.isDebugEnabled()) { - jalview.bin.Cache.log.debug("Matching conjugate refs for " + Cache.log.debug("Matching conjugate refs for " + from.getName() + " and " + to.getName()); } - jalview.datamodel.DBRefEntry[] fdb = from.getDBRef(); - jalview.datamodel.DBRefEntry[] tdb = new jalview.datamodel.DBRefEntry[to + DBRefEntry[] fdb = from.getDBRef(); + DBRefEntry[] tdb = new DBRefEntry[to .getDBRef().length]; int tdblen = to.getDBRef().length; System.arraycopy(to.getDBRef(), 0, tdb, 0, tdblen); Vector matched = new Vector(); - jalview.util.MapList smapI = smap.getInverse(); + MapList smapI = smap.getInverse(); for (int f = 0; f < fdb.length; f++) { - jalview.datamodel.DBRefEntry fe = fdb[f]; - jalview.datamodel.Mapping fmp = fe.getMap(); + DBRefEntry fe = fdb[f]; + Mapping fmp = fe.getMap(); boolean fmpnnl = fmp != null; // if (fmpnnl && fmp.getTo()!=null) // { - // jalview.bin.Cache.log.debug("Not overwriting existing To reference in + // Cache.log.debug("Not overwriting existing To reference in // "+fe); // continue; // } @@ -425,13 +430,13 @@ public class Sequencemapping extends Rangetype : false; for (int t = 0; t < tdblen; t++) { - jalview.datamodel.DBRefEntry te = tdb[t]; + DBRefEntry te = tdb[t]; if (te != null) { if (fe.getSource().equals(te.getSource()) && fe.getAccessionId().equals(te.getAccessionId())) { - jalview.datamodel.Mapping tmp = te.getMap(); + Mapping tmp = te.getMap(); boolean tmpnnl = tmp != null; if (tmpnnl && tmp.getTo() != null) { diff --git a/src/jalview/io/vamsas/Tree.java b/src/jalview/io/vamsas/Tree.java index b5ada26..f007463 100644 --- a/src/jalview/io/vamsas/Tree.java +++ b/src/jalview/io/vamsas/Tree.java @@ -20,12 +20,6 @@ */ package jalview.io.vamsas; -import java.io.IOException; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.List; -import java.util.Vector; - import jalview.analysis.NJTree; import jalview.bin.Cache; import jalview.datamodel.AlignmentI; @@ -35,10 +29,18 @@ import jalview.datamodel.SeqCigar; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceI; import jalview.datamodel.SequenceNode; +import jalview.gui.AlignFrame; import jalview.gui.TreePanel; import jalview.io.NewickFile; import jalview.io.VamsasAppDatastore; import jalview.viewmodel.AlignmentViewport; + +import java.io.IOException; +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.List; +import java.util.Vector; + import uk.ac.vamsas.client.Vobject; import uk.ac.vamsas.objects.core.AlignmentSequence; import uk.ac.vamsas.objects.core.Entry; @@ -68,14 +70,12 @@ public class Tree extends DatastoreItem private AlignmentView inputData = null; public static void updateFrom(VamsasAppDatastore datastore, - jalview.gui.AlignFrame alignFrame, - uk.ac.vamsas.objects.core.Tree vtree) + AlignFrame alignFrame, uk.ac.vamsas.objects.core.Tree vtree) { Tree toTree = new Tree(datastore, alignFrame, vtree); } - public Tree(VamsasAppDatastore datastore, - jalview.gui.AlignFrame alignFrame, + public Tree(VamsasAppDatastore datastore, AlignFrame alignFrame, uk.ac.vamsas.objects.core.Tree vtree) { super(datastore, vtree, TreePanel.class); @@ -84,7 +84,7 @@ public class Tree extends DatastoreItem private NewickFile getNtree() throws IOException { - return new jalview.io.NewickFile(tree.getNewick(0).getContent()); + return new NewickFile(tree.getNewick(0).getContent()); } public Tree(VamsasAppDatastore datastore, TreePanel tp2, AlignmentI jal2, @@ -290,8 +290,10 @@ public class Tree extends DatastoreItem } } if (alsq.size() < sequences.length) + { Cache.log .warn("Not recovered all alignment sequences for given set of input sequence CIGARS"); + } return alsq; } @@ -305,7 +307,9 @@ public class Tree extends DatastoreItem public void UpdateSequenceTreeMap(TreePanel tp) { if (tp == null || tree == null) + { return; + } Vector leaves = new Vector(); if (tp.getTree() == null) { @@ -473,7 +477,9 @@ public class Tree extends DatastoreItem --occurence; } else + { bn = null; + } } return bn; } @@ -511,7 +517,7 @@ public class Tree extends DatastoreItem public Object[] recoverInputData(Provenance tp) { AlignmentViewport javport = null; - jalview.datamodel.AlignmentI jal = null; + AlignmentI jal = null; jalview.datamodel.CigarArray view = null; for (int pe = 0; pe < tp.getEntryCount(); pe++) {