*/
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;
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;
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);
}
&& j < row.annotations.length; j++)
{
if (refSeq != null
- && jalview.util.Comparison.isGap(refSeq.getCharAt(j)))
+ && Comparison.isGap(refSeq.getCharAt(j)))
{
continue;
}
{
text.append(comma
+ "["
- + jalview.util.Format
+ + Format
.getHexString(row.annotations[j].colour)
+ "]");
comma = ",";
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
}
}
text.append("outlineColour=");
- text.append(jalview.util.Format.getHexString(sg.getOutlineColour()));
+ text.append(Format.getHexString(sg.getOutlineColour()));
text.append("\t");
text.append("displayBoxes=");
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)
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())
{
try
{
- String idformat = new jalview.io.IdentifyFile().Identify(file,
+ String idformat = new IdentifyFile().Identify(file,
protocol);
if (idformat == null)
{
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;
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");
{
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())
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
{
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());
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();
}
import jalview.schemes.UserColourScheme;
import jalview.util.Format;
import jalview.util.MapList;
+import jalview.util.ParseHtmlBodyAndLinks;
import java.io.IOException;
import java.util.ArrayList;
}
try
{
- colour = new jalview.schemes.GraduatedColor(
+ colour = new GraduatedColor(
new UserColourScheme(mincol).findColour('A'),
new UserColourScheme(maxcol).findColour('A'), min,
max);
}
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;
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"))
{
{
gcol.nextToken();
tval = gcol.nextToken();
- ((jalview.schemes.GraduatedColor) colour)
+ ((GraduatedColor) colour)
.setThresh(new Float(tval).floatValue());
} catch (Exception e)
{
{
return;
}
- jalview.util.ParseHtmlBodyAndLinks parsed = new jalview.util.ParseHtmlBodyAndLinks(
+ ParseHtmlBodyAndLinks parsed = new ParseHtmlBodyAndLinks(
sf.getDescription(), removeHTML, newline);
sf.description = (removeHTML) ? parsed.getNonHtmlContent()
import jalview.api.ComplexAlignFile;
import jalview.api.FeaturesDisplayedI;
+import jalview.bin.Cache;
import jalview.bin.Jalview;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.ColumnSelection;
String type = protocol.equals(FormatAdapter.FILE) ? "RECENT_FILE"
: "RECENT_URL";
- String historyItems = jalview.bin.Cache.getProperty(type);
+ String historyItems = Cache.getProperty(type);
StringTokenizer st;
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);
}
}
try
{
- alignFrame.setMaximum(jalview.bin.Cache.getDefault(
+ alignFrame.setMaximum(Cache.getDefault(
"SHOW_FULLSCREEN", false));
} catch (java.beans.PropertyVetoException ex)
{
import jalview.api.AlignExportSettingI;
import jalview.api.AlignmentViewPanel;
+import jalview.bin.Cache;
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.Comparison;
/**
* Additional formatting methods used by the application in a number of places.
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
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--;
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);
{
if (isValidFormat(format))
{
- return jalview.bin.Cache.getDefault(format.toUpperCase()
+ return Cache.getDefault(format.toUpperCase()
+ "_JVSUFFIX", true);
}
return false;
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)
{
*/
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;
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");
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
out.println("\n</body>\n</html>");
out.close();
- jalview.util.BrowserLauncher.openURL("file:///" + choice);
+ BrowserLauncher.openURL("file:///" + choice);
} catch (Exception ex)
{
ex.printStackTrace();
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);
if (color.getRGB() < -1)
{
- out.println("<td bgcolor=\"#"
- + jalview.util.Format.getHexString(color) + "\">"
- + seq.getCharAt(res) + "</td>");
+ out.println("<td bgcolor=\"#" + Format.getHexString(color)
+ + "\">" + seq.getCharAt(res) + "</td>");
}
else
{
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);
if (color.getRGB() < -1)
{
- out.println("<td bgcolor=\"#"
- + jalview.util.Format.getHexString(color) + "\">"
- + seq.getCharAt(res) + "</td>");
+ out.println("<td bgcolor=\"#" + Format.getHexString(color)
+ + "\">" + seq.getCharAt(res) + "</td>");
}
else
{
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;
{
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();
}
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
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)
{
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");
}
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;
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()));
//////////////////////////////////////////////////////////////////
package jalview.io;
+import jalview.bin.Cache;
import jalview.util.MessageManager;
import jalview.util.Platform;
public RecentlyOpened()
{
- String historyItems = jalview.bin.Cache.getProperty("RECENT_FILE");
+ String historyItems = Cache.getProperty("RECENT_FILE");
StringTokenizer st;
Vector recent = new Vector();
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceI;
+import jalview.util.Comparison;
import jalview.util.Format;
import java.io.IOException;
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];
*/
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
{
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))
{
{
value = r.stringMatched(1);
}
- // jalview.bin.Cache.log.debug("from '" + field + "' matched '" + value +
+ // Cache.log.debug("from '" + field + "' matched '" + value +
// "'");
try
{
}
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 */
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++)
{
// 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;
// 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
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
};
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;
// Deal with quoted fields
case '\'':
- com.stevesoft.pat.Regex qnodename = new com.stevesoft.pat.Regex(
+ Regex qnodename = new Regex(
"'([^']|'')+'");
if (qnodename.searchFrom(nf, fcp))
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;
* '"+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
+ 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
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");
*/
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
{
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;
import jalview.datamodel.Annotation;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceI;
+import jalview.schemes.ResidueProperties;
import jalview.util.MessageManager;
import java.io.BufferedReader;
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);
}
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
+import jalview.util.DBRefUtils;
import jalview.util.UrlLink;
import java.util.ArrayList;
{
// 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
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;
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);
}
{
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);
}
}
{
// 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)
{
{
// 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)
{
}
}
- dbrf = jalview.util.DBRefUtils.parseToDbRef(seqO, dbsource, dbsource,
+ dbrf = DBRefUtils.parseToDbRef(seqO, dbsource, dbsource,
dbr);
if (dbrf != null)
{
{
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);
{
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);
}
import jalview.datamodel.AlignmentI;
import jalview.datamodel.Annotation;
import jalview.datamodel.SequenceI;
+import jalview.util.Comparison;
import java.awt.Color;
import java.io.IOException;
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)
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;
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;
{
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.
// /////////////////////////////////////////
// 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
}
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));
// of
// utf8
// translation
- if (alan.graph != jalview.datamodel.AlignmentAnnotation.NO_GRAPH)
+ if (alan.graph != AlignmentAnnotation.NO_GRAPH)
{
ae.addValue(alan.annotations[a].value);
}
@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());
}
@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());
}
} 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.");
}
}
// 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()
// 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
.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
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.
* @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)
}
}
}
- jalview.datamodel.AlignmentAnnotation jan = null;
+ AlignmentAnnotation jan = null;
if (a_label == null || a_label.length() == 0)
{
a_label = annotation.getType();
{
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
}
}
}
- jan = new jalview.datamodel.AlignmentAnnotation(a_label, a_descr,
+ jan = new AlignmentAnnotation(a_label, a_descr,
arow, min, max, type);
}
else
// 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
* @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;
}
* @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());
AlignmentViewport av = viewport;
try
{
- jalview.datamodel.AlignmentI jal = av.getAlignment();
+ AlignmentI jal = av.getAlignment();
// /////////////////////////////////////////
// SAVE THE DATASET
DataSet dataset = null;
*/
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!
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()));
}
}
}
*/
package jalview.io.packed;
+import jalview.io.FileParse;
+
/**
* API for a data provider that can be used with
* jalview.io.packed.ParsePackedSet
*
* @return
*/
- jalview.io.FileParse getDataSource();
+ FileParse getDataSource();
/**
* association context for data. Either null or a specific sequence.
*/
package jalview.io.packed;
+import jalview.analysis.NJTree;
+import jalview.analysis.SeqsetUtils;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.SequenceI;
import jalview.io.NewickFile;
{
public AlignmentI al;
- public List<jalview.io.NewickFile> trees;
+ public List<NewickFile> trees;
AlignmentSet(AlignmentI a)
{
al = a;
- trees = new ArrayList<jalview.io.NewickFile>();
+ trees = new ArrayList<NewickFile>();
}
/**
// 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();
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;
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);
}
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)
{
try
{
- jalview.io.NewickFile nf = new jalview.io.NewickFile(src);
+ NewickFile nf = new NewickFile(src);
if (!nf.isValid())
{
nf.close();
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;
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();
}
}
// 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();
// 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();
}
* @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)
{
* @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)
*/
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
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();
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;
}
else
{
- jalview.bin.Cache.log.debug("Ignoring mapless DbRef.Map "
+ Cache.log.debug("Ignoring mapless DbRef.Map "
+ jvobj.getSrcAccString());
}
*
* @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
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);
}
//
// 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);
{
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
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)
// 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);
}
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();
}
else
{
- jalview.bin.Cache.log.debug("Ignoring mapless DbRef.Map "
+ Cache.log.debug("Ignoring mapless DbRef.Map "
+ jvobj.getSrcAccString());
}
}
*/
package jalview.io.vamsas;
+import jalview.bin.Cache;
import jalview.io.VamsasAppDatastore;
+import jalview.util.MapList;
import jalview.util.MessageManager;
import java.util.List;
* @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()
: ("<no Id registered> " + map.toString())));
* @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);
* @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)
*/
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;
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
*
public Sequencemapping(VamsasAppDatastore datastore,
SequenceMapping sequenceMapping)
{
- super(datastore, sequenceMapping, jalview.util.MapList.class);
+ super(datastore, sequenceMapping, MapList.class);
doJvUpdate();
}
* @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)
{
}
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.");
public void updateFromDoc()
{
- update((SequenceMapping) vobj, (jalview.datamodel.Mapping) jvobj);
+ update((SequenceMapping) vobj, (Mapping) jvobj);
}
private void conflict(Mapping mjvmapping, SequenceMapping sequenceMapping)
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;
}
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;
else
{
if (((Sequence) sequenceMapping.getMap()).getDictionary().equals(
- uk.ac.vamsas.objects.utils.SymbolDictionary.STANDARD_NA))
+ SymbolDictionary.STANDARD_NA))
{
dnaToProt = true;
sense = false;
if (!dnaToProt)
{
- jalview.bin.Cache.log
+ Cache.log
.warn("Ignoring Mapping - don't support protein to protein mapping in vamsas document yet.");
return;
}
// 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");
}
}
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);
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;
else
{
if (sdmap.getDictionary().equals(
- uk.ac.vamsas.objects.utils.SymbolDictionary.STANDARD_NA))
+SymbolDictionary.STANDARD_NA))
{
dnaToProt = true;
sense = false;
}
// 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);
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);
}
/**
- * 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
* 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;
// }
: 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)
{
*/
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;
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;
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);
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,
}
}
if (alsq.size() < sequences.length)
+ {
Cache.log
.warn("Not recovered all alignment sequences for given set of input sequence CIGARS");
+ }
return alsq;
}
public void UpdateSequenceTreeMap(TreePanel tp)
{
if (tp == null || tree == null)
+ {
return;
+ }
Vector leaves = new Vector();
if (tp.getTree() == null)
{
--occurence;
}
else
+ {
bn = null;
+ }
}
return bn;
}
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++)
{