//\r
com.stevesoft.pat;\r
\r
-import java.io.*;\r
\r
public class Bits {\r
char[] carray;\r
// -- Happy Computing!\r
//\r
package com.stevesoft.pat;\r
-import java.io.File;\r
\r
/** This class is just like FileRegex, except that its accept method\r
only returns true if the file matching the pattern is a directory.*/\r
// -- Happy Computing!\r
//\r
package com.stevesoft.pat;\r
-import java.io.File;\r
\r
/** This class is just like FileRegex, except that its accept method\r
only returns true if the file matching the pattern is not a directory.*/\r
//\r
package com.stevesoft.pat;\r
import java.util.Hashtable;\r
-import java.util.Vector;\r
\r
/** Implements the parenthesis pattern subelement.*/\r
class OrMark extends Or {\r
//\r
package com.stevesoft.pat;\r
\r
-import java.io.*;\r
\r
/** This class allows you to match on a partial string.\r
If the allowOverRun flag is true, then the\r
//\r
package com.stevesoft.pat;\r
\r
-import java.io.*;\r
-import com.stevesoft.pat.wrap.*;\r
\r
/** This class is used internally by RegexReader to\r
store blocks of data. */\r
//\r
package com.stevesoft.pat;\r
import java.util.*;\r
-import java.io.*;\r
\r
/** This class is just like oneChar, but doesn't worry about case. */\r
class FastChar extends oneChar {\r
// -- Happy Computing!\r
//\r
package com.stevesoft.pat;\r
-import java.util.*;\r
-\r
/** \r
Shareware: package pat\r
<a href="copyright.html">Copyright 2001, Steven R. Brandt</a>\r
while(!sp.match(')'))\r
sp.inc();\r
} else if(sp.dontMatch && sp.c == 'w') {\r
- Regex r = new Regex();\r
+ //Regex r = new Regex();\r
//r._compile("[a-zA-Z0-9_]",mk);\r
//add(new Goop("\\w",r.thePattern));\r
Bracket b = new Bracket(false);\r
b.addOr(new oneChar((char)13));\r
add(b);\r
} else if(sp.dontMatch && sp.c == 'd') {\r
- Regex r = new Regex();\r
+ //Regex r = new Regex();\r
//r._compile("[0-9]",mk);\r
//add(new Goop("\\d",r.thePattern));\r
Range digit = new Range('0','9');\r
digit.printBrackets = true;\r
add(digit);\r
} else if(sp.dontMatch && sp.c == 'W') {\r
- Regex r = new Regex();\r
+ //Regex r = new Regex();\r
//r._compile("[^a-zA-Z0-9_]",mk);\r
//add(new Goop("\\W",r.thePattern));\r
Bracket b = new Bracket(true);\r
} else if(sp.match('{')) {\r
boolean bad = false;\r
StrPos sp2 = new StrPos(sp);\r
- StringBuffer sb = new StringBuffer();\r
+ //StringBuffer sb = new StringBuffer();\r
sp.inc();\r
patInt i1 = sp.getPatInt();\r
patInt i2 = null;\r
public RegexTokenizer(String txt,String ptrn) {\r
toParse = txt;\r
r = new Regex(ptrn);\r
- offset = r.BackRefOffset;\r
+ offset = Regex.BackRefOffset;\r
getMore();\r
}\r
/** Initialize the tokenizer with a Regex object. */\r
public RegexTokenizer(String txt,Regex r) {\r
toParse = txt;\r
this.r = r;\r
- offset = r.BackRefOffset;\r
+ offset = Regex.BackRefOffset;\r
getMore();\r
}\r
/** This should always be cast to a String, as in StringTokenizer,\r
public boolean hasMoreTokens() { return hasMoreElements(); }\r
/** Determines the # of remaining tokens */\r
public int countTokens() {\r
- int old_pos=pos,_count=count;\r
+ int _count=count;\r
while(hasMoreTokens())\r
nextToken();\r
count=_count;\r
//\r
package com.stevesoft.pat;\r
\r
-import java.util.*;\r
import com.stevesoft.pat.wrap.StringWrap;\r
\r
/** Internally used class. */\r
for(int ii=pos;ii<rmf;ii++)\r
sb.append(src.charAt(ii));\r
\r
- Vector v = new Vector();\r
for(ReplaceRule x=rp;x != null;x=x.next) {\r
x.apply(sb,r);\r
if(x instanceof SpecialRule) {\r
CaseMgr.toLowerCase(x) |\r
CaseMgr.toTitleCase(x));\r
}\r
- static { int x = Regex.BackRefOffset; }\r
String src;\r
int c,mask;\r
int offset;\r
p = p.next;\r
}\r
String st = sb.toString();\r
- char c0 = st.charAt(0), c1 = st.charAt(1);\r
Skip sk=null;\r
if(st.length()>2)\r
sk = new SkipBMH(st,ignoreCase,offset);\r
}\r
/** Read in an integer. */\r
public patInt getPatInt() {\r
- patInt pi = null;\r
if(incMatch("inf"))\r
return new patInf();\r
int i,cnt=0;\r
//\r
com.stevesoft.pat;\r
\r
-import com.stevesoft.pat.*;\r
\r
/** A tool that is used to make the \E, \U, \L, and \Q\r
elements of a substitution. */\r
//\r
package com.stevesoft.pat;\r
\r
-import java.util.*;\r
\r
/** This class is used to implement the Transformer\r
@see com.stevesoft.pat.Transform\r
for(int i=0;i<ra_len;i++) {\r
pt.ignoreCase = ra[i].ignoreCase;\r
pt.mFlag = ra[i].mFlag;\r
- pt.dotDoesntMatchCR = ra[i].dotDoesntMatchCR;\r
+ pt.dotDoesntMatchCR = Regex.dotDoesntMatchCR;\r
int r = ra[i].thePattern.matchInternal(pos,pt);\r
if(r >= 0) {\r
pn = i;\r
//\r
package com.stevesoft.pat;\r
\r
-import java.util.Vector;\r
import com.stevesoft.pat.wrap.StringWrap;\r
\r
/** Replacement rule used by the Transformer.\r
javax.xml.namespace.QName qName;
java.lang.Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class;
java.lang.Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class;
- java.lang.Class enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class;
+ /*java.lang.Class enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class;
java.lang.Class enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class;
java.lang.Class arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class;
java.lang.Class arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class;
java.lang.Class simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class;
java.lang.Class simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class;
java.lang.Class simplelistsf = org.apache.axis.encoding.ser.SimpleListSerializerFactory.class;
- java.lang.Class simplelistdf = org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class;
+ java.lang.Class simplelistdf = org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class;*/
qName = new javax.xml.namespace.QName("http://simple.objects.vamsas", "JpredResult");
cachedSerQNames.add(qName);
cls = vamsas.objects.simple.JpredResult.class;
javax.xml.namespace.QName qName;\r
java.lang.Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class;\r
java.lang.Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class;\r
- java.lang.Class enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class;\r
- java.lang.Class enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class;\r
+ //java.lang.Class enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class;\r
+ //java.lang.Class enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class;\r
java.lang.Class arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class;\r
java.lang.Class arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class;\r
- java.lang.Class simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class;\r
- java.lang.Class simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class;\r
- java.lang.Class simplelistsf = org.apache.axis.encoding.ser.SimpleListSerializerFactory.class;\r
- java.lang.Class simplelistdf = org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class;\r
+ //java.lang.Class simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class;\r
+ // java.lang.Class simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class;\r
+ //java.lang.Class simplelistsf = org.apache.axis.encoding.ser.SimpleListSerializerFactory.class;\r
+ //java.lang.Class simplelistdf = org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class;\r
qName = new javax.xml.namespace.QName("simple.objects.vamsas",\r
"Sequence");\r
cachedSerQNames.add(qName);\r
javax.xml.namespace.QName qName;
java.lang.Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class;
java.lang.Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class;
- java.lang.Class enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class;
- java.lang.Class enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class;
+ //java.lang.Class enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class;
+ //java.lang.Class enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class;
java.lang.Class arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class;
java.lang.Class arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class;
- java.lang.Class simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class;
- java.lang.Class simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class;
- java.lang.Class simplelistsf = org.apache.axis.encoding.ser.SimpleListSerializerFactory.class;
- java.lang.Class simplelistdf = org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class;
+ //java.lang.Class simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class;
+ //java.lang.Class simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class;
+ //java.lang.Class simplelistsf = org.apache.axis.encoding.ser.SimpleListSerializerFactory.class;
+ //java.lang.Class simplelistdf = org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class;
qName = new javax.xml.namespace.QName("vamsas", "ArrayOf_tns1_ServiceHandle");
cachedSerQNames.add(qName);
cls = ext.vamsas.ServiceHandle[].class;
*/\r
package jalview.analysis;\r
\r
-import jalview.analysis.*;\r
-\r
import jalview.datamodel.*;\r
\r
import java.util.*;\r
{\r
while (noClus > 2)\r
{\r
- if (type.equals("NJ"))\r
+ /* if (type.equals("NJ"))\r
{\r
float mind = findMinNJDistance();\r
}\r
else\r
{\r
float mind = findMinDistance();\r
- }\r
+ }*/\r
\r
Cluster c = joinClusters(mini, minj);\r
\r
boolean onefound = false;\r
\r
int one = -1;\r
- int two = -1;\r
+ //int two = -1;\r
\r
for (int i = 0; i < noseqs; i++)\r
{\r
{\r
if (onefound == false)\r
{\r
- two = i;\r
+ //two = i;\r
onefound = true;\r
}\r
else\r
}\r
}\r
\r
- Cluster c = joinClusters(one, two);\r
+ // Cluster c = joinClusters(one, two);\r
top = (SequenceNode) (node.elementAt(one));\r
\r
reCount(top);\r
public void findNewNJDistances(SequenceNode tmpi, SequenceNode tmpj,\r
float dist)\r
{\r
- float ih = 0;\r
- float jh = 0;\r
+ //float ih = 0;\r
+ // float jh = 0;\r
\r
- SequenceNode sni = tmpi;\r
- SequenceNode snj = tmpj;\r
+ //SequenceNode sni = tmpi;\r
+ //SequenceNode snj = tmpj;\r
\r
tmpi.dist = ((dist + ri) - rj) / 2;\r
tmpj.dist = (dist - tmpi.dist);\r
*/\r
public void findClusterNJDistance(int i, int j)\r
{\r
- int noi = ((Cluster) cluster.elementAt(i)).value.length;\r
- int noj = ((Cluster) cluster.elementAt(j)).value.length;\r
+ //int noi = ((Cluster) cluster.elementAt(i)).value.length;\r
+ //int noj = ((Cluster) cluster.elementAt(j)).value.length;\r
\r
// New distances from cluster to others\r
float[] newdist = new float[noseqs];\r
}\r
}\r
\r
- /**\r
- * DOCUMENT ME!\r
- *\r
- * @param node DOCUMENT ME!\r
- */\r
- public void setMaxDist(SequenceNode node)\r
- {\r
- this.maxdist = maxdist;\r
- }\r
\r
/**\r
* DOCUMENT ME!\r
{\r
// Generate a safely named sequence set and a hash to recover the sequence names\r
Hashtable map = new Hashtable();\r
- String[] un_names = new String[sequences.length];\r
+ //String[] un_names = new String[sequences.length];\r
\r
for (int i = 0; i < sequences.length; i++)\r
{\r
{\r
try\r
{\r
- treeFile = treeFile;\r
jalview.io.NewickFile fin = new jalview.io.NewickFile(applet.\r
getCodeBase() + treeFile, "URL");\r
fin.parse();\r
\r
public void findMenuItem_actionPerformed(ActionEvent e)\r
{\r
- Finder finder = new Finder(alignPanel);\r
+ new Finder(alignPanel);\r
}\r
\r
public void font_actionPerformed(ActionEvent e)\r
\r
public void userDefinedColour_actionPerformed(ActionEvent e)\r
{\r
- UserDefinedColours chooser = new UserDefinedColours(alignPanel, null);\r
+ new UserDefinedColours(alignPanel, null);\r
}\r
\r
public void PIDColour_actionPerformed(ActionEvent e)\r
\r
void init()\r
{\r
- this.ap = ap;\r
String fonts[] = Toolkit.getDefaultToolkit().getFontList();\r
for (int i = 0; i < fonts.length; i++)\r
{\r
\r
import java.awt.*;\r
\r
-import jalview.analysis.*;\r
import jalview.datamodel.*;\r
\r
public class IdCanvas\r
seq[i] = (Sequence) sequences.elementAt(i);\r
}\r
\r
- AlignFrame af = new AlignFrame(new Alignment(seq),\r
+ new AlignFrame(new Alignment(seq),\r
ap.alignFrame.applet,\r
"Pairwise Aligned Sequences");\r
\r
{\r
this.points = points;\r
this.npoint = npoint;\r
- this.av = av;\r
PaintRefresher.Register(this, av.alignment);\r
\r
prefsize = getPreferredSize();\r
\r
public void drawScene(Graphics g)\r
{\r
- boolean darker = false;\r
+ //boolean darker = false;\r
\r
int halfwidth = getSize().width / 2;\r
int halfheight = getSize().height / 2;\r
\r
public void rectSelect(int x1, int y1, int x2, int y2)\r
{\r
- boolean changedSel = false;\r
+ //boolean changedSel = false;\r
for (int i = 0; i < npoint; i++)\r
{\r
SequencePoint sp = (SequencePoint) points.elementAt(i);\r
if (node.left() == null && node.right() == null)\r
{\r
float height = node.height;\r
- float dist = node.dist;\r
+ //float dist = node.dist;\r
\r
- int xstart = (int) ( (height - dist) * scale) + offx;\r
+ //int xstart = (int) ( (height - dist) * scale) + offx;\r
int xend = (int) (height * scale) + offx;\r
\r
int ypos = (int) (node.ycount * chunk) + offy;\r
\r
import java.util.*;\r
\r
-import java.net.*;\r
import org.apache.log4j.Logger;\r
import org.apache.log4j.SimpleLayout;\r
import org.apache.log4j.Level;\r
\r
import jalview.gui.*;\r
\r
-import org.apache.log4j.*;\r
-\r
import javax.swing.*;\r
\r
import java.util.Vector;\r
*/\r
package jalview.datamodel;\r
\r
-import jalview.analysis.PCA;\r
-\r
-import jalview.io.*;\r
-\r
-import jalview.jbgui.*;\r
-\r
import jalview.schemes.*;\r
\r
-import java.awt.*;\r
\r
\r
/**\r
*/\r
package jalview.datamodel;\r
\r
-import jalview.analysis.*;\r
-\r
import java.awt.*;\r
\r
import java.util.*;\r
*/\r
package jalview.datamodel;\r
\r
-import jalview.datamodel.*;\r
-\r
import jalview.schemes.*;\r
\r
import java.util.*;\r
import java.awt.event.*;\r
import java.awt.print.*;\r
import javax.swing.*;\r
-import javax.swing.event.*;\r
\r
import jalview.analysis.*;\r
import jalview.datamodel.*;\r
if (viewport.showSequenceFeatures &&\r
! ( (Alignment) viewport.alignment).featuresAdded)\r
{\r
- SequenceFeatureFetcher sft = new SequenceFeatureFetcher(viewport.\r
+ new SequenceFeatureFetcher(viewport.\r
alignment,\r
alignPanel);\r
( (Alignment) viewport.alignment).featuresAdded = true;\r
conservationMenuItem.setSelected(false);\r
viewport.setConservationSelected(false);\r
\r
- ColourSchemeI cs = viewport.getGlobalColourScheme();\r
-\r
changeColour(viewport.getGlobalColourScheme());\r
\r
modifyPID_actionPerformed(null);\r
*/\r
public void BuildWebServiceMenu()\r
{\r
- if ( (Desktop.discoverer.services != null)\r
- && (Desktop.discoverer.services.size() > 0))\r
+ if ( (Discoverer.services != null)\r
+ && (Discoverer.services.size() > 0))\r
{\r
- Vector msaws = (Vector) Desktop.discoverer.services.get("MsaWS");\r
- Vector secstrpr = (Vector) Desktop.discoverer.services.get("SecStrPred");\r
+ Vector msaws = (Vector) Discoverer.services.get("MsaWS");\r
+ Vector secstrpr = (Vector) Discoverer.services.get("SecStrPred");\r
Vector wsmenu = new Vector();\r
if (msaws != null)\r
{\r
public void actionPerformed(ActionEvent e)\r
{\r
SequenceI[] msa = gatherSequencesForAlignment();\r
- MsaWSClient ct = new jalview.ws.MsaWSClient(sh, title, msa,\r
+ new jalview.ws.MsaWSClient(sh, title, msa,\r
false, true);\r
\r
}\r
public void actionPerformed(ActionEvent e)\r
{\r
SequenceI[] msa = gatherSequencesForAlignment();\r
- MsaWSClient ct = new jalview.ws.MsaWSClient(sh, title, msa,\r
+ new jalview.ws.MsaWSClient(sh, title, msa,\r
true, true);\r
\r
}\r
if (msa.length == 1)\r
{\r
// Single Sequence prediction\r
- jalview.ws.JPredClient ct = new jalview.ws.JPredClient(sh,\r
- title, msa[0]);\r
+ new jalview.ws.JPredClient(sh,title, msa[0]);\r
}\r
else\r
{\r
// TODO: group services by location as well as function.\r
}\r
\r
+ public void vamsasStore_actionPerformed(ActionEvent e)\r
+{\r
+ /* JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache.\r
+ getProperty("LAST_DIRECTORY"));\r
+\r
+ chooser.setFileView(new JalviewFileView());\r
+ chooser.setDialogTitle("Export to Vamsas file");\r
+ chooser.setToolTipText("Export");\r
+\r
+ int value = chooser.showSaveDialog(this);\r
+ */\r
+ // if (value == JalviewFileChooser.APPROVE_OPTION)\r
+ {\r
+ jalview.io.VamsasDatastore vs = new jalview.io.VamsasDatastore(viewport);\r
+ vs.store("C:\\Documents And Settings\\andrew\\Desktop\\vamsas.zip");\r
+ // chooser.getSelectedFile().getAbsolutePath();\r
+ }\r
+}\r
+\r
+public void vamsasLoad_actionPerformed(ActionEvent e)\r
+{\r
+ jalview.io.VamsasDatastore vs = new jalview.io.VamsasDatastore(viewport);\r
+ vs.load("C:\\Documents And Settings\\andrew\\Desktop\\vamsas.zip");\r
+}\r
+\r
+\r
}\r
case KeyEvent.VK_DELETE:\r
alignFrame.cut_actionPerformed(null);\r
break;\r
+\r
+ case KeyEvent.VK_P:\r
+ seqPanel.seqCanvas.increaseAARatio();\r
+ break;\r
+ case KeyEvent.VK_L:\r
+ seqPanel.seqCanvas.decreaseAARation();\r
+ break;\r
}\r
\r
}\r
annotationSpaceFillerHolder.setVisible(b);\r
annotationScroller.setVisible(b);\r
}\r
+ repaint();\r
}\r
\r
/**\r
import java.awt.event.*;\r
\r
import javax.swing.*;\r
-import javax.swing.event.InternalFrameEvent;\r
\r
\r
/**\r
null, new Object[]{this});\r
\r
dialog = pane.createDialog(Desktop.desktop, "EPS Rendering options");\r
- dialog.show();\r
+ dialog.setVisible(true);\r
\r
}\r
\r
jalview.bin.Cache.setProperty("EPS_RENDERING", value);\r
}\r
\r
- dialog.hide();\r
+ dialog.setVisible(false);\r
}\r
\r
public void cancel_actionPerformed(ActionEvent e)\r
{\r
cancelled = true;\r
- dialog.hide();\r
+ dialog.setVisible(false);\r
}\r
\r
public String getValue()\r
*/\r
package jalview.gui;\r
\r
-import jalview.analysis.*;\r
-\r
import jalview.datamodel.*;\r
\r
import java.awt.*;\r
*/\r
package jalview.gui;\r
\r
-import jalview.bin.*;\r
-\r
import jalview.io.*;\r
\r
import jalview.jbgui.*;\r
\r
while ((ypos <= canvasHeight) && (startRes < av.alignment.getWidth()))\r
{\r
+ g.setFont(av.getFont());\r
g.setColor(Color.black);\r
\r
if (av.scaleLeftWrapped)\r
* @param starty DOCUMENT ME!\r
* @param offset DOCUMENT ME!\r
*/\r
+\r
+ float aaRatio = 2f/3f;\r
+ public void increaseAARatio()\r
+ {\r
+ aaRatio += .025;\r
+ if(aaRatio>1)\r
+ aaRatio = 1;\r
+\r
+ repaint();\r
+ }\r
+\r
+ public void decreaseAARation()\r
+ {\r
+ aaRatio -= .025;\r
+ if(aaRatio<0)\r
+ aaRatio = 0;\r
+\r
+ repaint();\r
+ }\r
+\r
synchronized public void drawPanel(Graphics g1, int x1, int x2, int y1,\r
int y2, int startx, int starty, int offset)\r
{\r
Graphics2D g = (Graphics2D) g1;\r
g.setFont(av.getFont());\r
\r
- SequenceI nextSeq;\r
+\r
+ SequenceI nextSeq;\r
+\r
+ SequenceI dna = null;\r
+\r
+ int aaHeight = (int)(av.getCharHeight()*aaRatio);\r
+ int dnaHeight =(int)(av.getCharHeight() * (1-aaRatio));\r
+\r
+\r
+ java.awt.geom.AffineTransform transform = new java.awt.geom.AffineTransform();\r
+ transform.scale(1f/3f , 1);\r
+ Font dnafont = new Font(av.getFont().getName(), av.getFont().getStyle(),\r
+ dnaHeight);\r
+ dnafont = dnafont.deriveFont(transform);\r
+\r
+ Font aafont = new Font(av.getFont().getName(), av.getFont().getStyle(),\r
+ aaHeight);\r
+ transform = new java.awt.geom.AffineTransform();\r
+ transform.scale(1/aaRatio, 1);\r
+ aafont = aafont.deriveFont(transform);\r
\r
/// First draw the sequences\r
/////////////////////////////\r
for (int i = y1; i < y2; i++)\r
{\r
nextSeq = av.alignment.getSequenceAt(i);\r
+ g.setFont(aafont);\r
+/*\r
+ StringBuffer dnasb = new StringBuffer();\r
+ for (int j = 0; j < nextSeq.getLength(); j++)\r
+ {\r
+ java.util.Vector codons = jalview.schemes.ResidueProperties.getCodons(nextSeq.getSequence(j,\r
+ j + 1));\r
+ if (codons != null && codons.size() > 0)\r
+ dnasb.append(codons.elementAt(0).toString());\r
+ }\r
+\r
+ dna = new Sequence("dna", dnasb.toString());*/\r
+\r
\r
sr.drawSequence(g, nextSeq, av.alignment.findAllGroups(nextSeq),\r
- x1, x2, (x1 - startx) * av.charWidth,\r
- offset + ((i - starty) * av.charHeight), av.charWidth,\r
- av.charHeight);\r
+ x1, x2, (x1 - startx) * av.charWidth,\r
+ offset + ( (i - starty) * av.charHeight), av.charWidth,\r
+ aaHeight);\r
+\r
+\r
+ /* g.setFont(dnafont);\r
+\r
+ sr.drawSequence(g, dna, null,\r
+ x1, x2 * 3 +2, ( (x1 - startx) * av.charWidth) / 3,\r
+ offset + ( (i - starty) * av.charHeight) + aaHeight, av.charWidth / 3,\r
+ dnaHeight);*/\r
\r
if (av.showSequenceFeatures)\r
{\r
*/\r
package jalview.gui;\r
\r
-import jalview.analysis.*;\r
-\r
import jalview.datamodel.*;\r
\r
import jalview.schemes.*;\r
int charOffset = 0;\r
char s;\r
\r
+ float fwidth = width + ((float)av.charWidth/(float)width)/width;\r
+\r
+\r
+ if(av.charWidth != (av.charWidth/width)*width)\r
+ {\r
+\r
+ }\r
+\r
// Need to find the sequence position here.\r
String sequence = seq.getSequence();\r
\r
\r
charOffset = (width - fm.charWidth(s)) / 2;\r
graphics.drawString(String.valueOf(s),\r
- charOffset + x1 + (width * (i - start)), (y1 + height) - pady);\r
+ charOffset + x1 + (int)(fwidth * (i - start)), (y1 + height) - pady);\r
}\r
}\r
\r
\r
import javax.imageio.*;\r
\r
-import javax.swing.*;\r
import java.beans.PropertyChangeEvent;\r
\r
\r
import org.apache.axis.encoding.ser.JAFDataHandlerDeserializerFactory;\r
import org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory;\r
\r
-import java.io.*;\r
-\r
import javax.activation.DataHandler;\r
\r
import javax.xml.namespace.QName;\r
SequenceI seq;\r
ColourSchemeI cs = null;\r
AlignmentI alignment = av.getAlignment();\r
- String r;\r
- String g;\r
- String b;\r
\r
// draws the top row, the measure rule\r
out.println("<tr><td colspan=\"6\"></td>");\r
\r
import jalview.datamodel.*;\r
\r
-import jalview.util.*;\r
-\r
import java.io.*;\r
\r
import java.util.*;\r
\r
if (confirm != JOptionPane.YES_OPTION)\r
{\r
- ret = this.CANCEL_OPTION;\r
+ ret = JalviewFileChooser.CANCEL_OPTION;\r
}\r
}\r
\r
public class JalviewFileFilter\r
extends FileFilter\r
{\r
- private static String TYPE_UNKNOWN = "Type Unknown";\r
- private static String HIDDEN_FILE = "Hidden File";\r
public static Hashtable suffixHash = new Hashtable();\r
private Hashtable filters = null;\r
private String description = "no description";\r
*/\r
public void parse()\r
{\r
- com.stevesoft.pat.Regex gapre = new com.stevesoft.pat.Regex("\\~",\r
- "-");\r
-\r
int i = 0;\r
boolean seqFlag = false;\r
String key = new String();\r
String head = headers.elementAt(i).toString();\r
String seq = seqhash.get(head).toString();\r
\r
- int start = 1;\r
+ int start = -1;\r
int end = -1;\r
\r
if (maxLength < head.length())\r
\r
\r
// Replace ~ with a sensible gap character\r
- seq = gapre.replaceAll(seq);\r
+ seq = seq.replace('~', '-');\r
\r
Sequence newSeq = new Sequence(head, seq, start, end);\r
\r
*/\r
public static int checkSum(String seq)\r
{\r
- //String chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.*~&@";\r
int check = 0;\r
String sequence = seq.toUpperCase();\r
\r
- String index = "--------------------------------------&---*---.-----------------@ABCDEFGHIJKLMNOPQRSTUVWXYZ------ABCDEFGHIJKLMNOPQRSTUVWXYZ----@";\r
- index += "--------------------------------------------------------------------------------------------------------------------------------";\r
-\r
for (int i = 0; i < sequence.length(); i++)\r
{\r
try\r
{\r
- int pos = index.indexOf(sequence.charAt(i));\r
\r
- if (index.charAt(pos)!='_')\r
+ int value = sequence.charAt(i);\r
+ if (value!=-1)\r
{\r
- check += (((i % 57) + 1) * pos);\r
+ check += (i % 57 +1) * value;\r
}\r
}\r
catch (Exception e)\r
*\r
* @return DOCUMENT ME!\r
*/\r
- public static String print(SequenceI[] s, boolean is_NA)\r
+ public static String print(SequenceI[] seqs, boolean is_NA)\r
{\r
- com.stevesoft.pat.Regex re2gap = new com.stevesoft.pat.Regex(\r
- "[" + jalview.util.Comparison.GapChars + "]", "\\~");\r
+\r
+ SequenceI [] s = new SequenceI[seqs.length];\r
\r
StringBuffer out = new StringBuffer("!!" + (is_NA ? "NA" : "AA") +\r
"_MULTIPLE_ALIGNMENT 1.0\n\n"); // TODO: JBPNote : Jalview doesn't remember NA or AA yet.\r
int max = 0;\r
int maxid = 0;\r
int i = 0;\r
- String big = "";\r
\r
- while ((i < s.length) && (s[i] != null))\r
+ while ((i < seqs.length) && (seqs[i] != null))\r
{\r
- String sq;\r
- big += (sq = s[i].getSequence());\r
+ // Replace all internal gaps with . and external spaces with ~\r
+ s[i] =new Sequence(seqs[i].getName(),seqs[i].getSequence().replace('-', '.'));\r
+\r
+ StringBuffer sb = new StringBuffer(s[i].getSequence());\r
+ for (int ii = 0; ii < sb.length(); ii++)\r
+ {\r
+ if (sb.charAt(ii) == '.')\r
+ {\r
+ sb.replace(ii, ii + 1, "~");\r
+ }\r
+ else\r
+ break;\r
+ }\r
\r
- if (sq.length() > max)\r
+ for (int ii = sb.length() - 1; ii > 0; ii--)\r
+ {\r
+ if (sb.charAt(ii) == '.')\r
{\r
- max = sq.length();\r
+ sb.replace(ii, ii + 1, "~");\r
+ }\r
+ else\r
+ break;\r
+ }\r
+\r
+ s[i].setSequence(sb.toString());\r
+\r
+ if (s[i].getSequence().length() > max)\r
+ {\r
+ max = s[i].getSequence().length();\r
}\r
\r
i++;\r
"d");\r
i = 0;\r
\r
- long bigcheck = checkSum(big);\r
+ int bigChecksum = 0;\r
+ int [] checksums = new int[s.length];\r
+ while ( i < s.length )\r
+ {\r
+ checksums[i] = checkSum(s[i].getSequence());\r
+ bigChecksum += checksums[i];\r
+ i++;\r
+ }\r
+\r
long maxNB = 0;\r
out.append(" MSF: " + s[0].getSequence().length() + " Type: " +\r
- (is_NA ? "N" : "P") + " Check: " + bigcheck + " ..\n\n\n");\r
+ (is_NA ? "N" : "P") + " Check: " + (bigChecksum%10000) + " ..\n\n\n");\r
\r
String[] nameBlock = new String[s.length];\r
String[] idBlock = new String[s.length];\r
\r
+ i=0;\r
while ((i < s.length) && (s[i] != null))\r
{\r
- String name = s[i].getName() + "/" + s[i].getStart() + "-" +\r
- s[i].getEnd();\r
- int check = checkSum(s[i].getSequence());\r
- nameBlock[i] = new String(" Name: " + name + " ");\r
+ nameBlock[i] = new String(" Name: " + s[i].getName() + " ");\r
idBlock[i] = new String("Len: " +\r
- maxLenpad.form(s[i].getSequence().length()) + " Check:" +\r
- maxChkpad.form(check) + " Weight: 1.00\n");\r
+ maxLenpad.form(s[i].getSequence().length()) + " Check: " +\r
+ maxChkpad.form(checksums[i]) + " Weight: 1.00\n");\r
\r
- if (name.length() > maxid)\r
+ if (s[i].getName().length() > maxid)\r
{\r
- maxid = name.length();\r
+ maxid = s[i].getName().length();\r
}\r
\r
if (nameBlock[i].length() > maxNB)\r
while ((j < s.length) && (s[j] != null))\r
{\r
String name = s[j].getName();\r
- out.append(new Format("%-" + maxid + "s").form(name + "/" +\r
- s[j].getStart() + "-" + s[j].getEnd()) + " ");\r
+ out.append(new Format("%-" + maxid + "s").form(name)+ " ");\r
\r
for (int k = 0; k < 5; k++)\r
{\r
if ((end < s[j].getSequence().length()) &&\r
(start < s[j].getSequence().length()))\r
{\r
- out.append(re2gap.replaceAll(s[j].getSequence()\r
- .substring(start, end)));\r
+ out.append(s[j].getSequence().substring(start, end));\r
\r
if (k < 4)\r
{\r
- // out.append(" ");\r
+ out.append(" ");\r
}\r
else\r
{\r
{\r
if (start < s[j].getSequence().length())\r
{\r
- out.append(re2gap.replaceAll(\r
- s[j].getSequence().substring(start)));\r
+ out.append(s[j].getSequence().substring(start));\r
out.append("\n");\r
}\r
else\r
\r
import java.io.*;\r
\r
-import java.util.*;\r
-\r
\r
/**\r
* DOCUMENT ME!\r
\r
int d = -1;\r
int cp = 0;\r
- int flen = nf.length();\r
+ //int flen = nf.length();\r
\r
String Error = null;\r
String nodename = null;\r
return out.toString();\r
}\r
\r
- public static void main(String[] args)\r
- {\r
- String inStr = ">P1;LCAT_MOUSE_90.35\nMGLPGSPWQRVLLLLGLLLPPATPFWLLNVLFPPHTTPKAELSNHTRPVILVPGCLGNRLEAKLDKPDVVNW\nMCYRKTEDFFTIWLDFNLFLPLGVDCWIDNTRIVYNHSSGRVSNAPGVQIRVPGFGKTESVEYVDDNKLAGY\n\n>LCAT_PAPAN_95.78\nMGPPGSPWQWVPLLLGLLLPPAAPFWLLNVLFPPHTTPKAELSNHTRPVILVPGCLGNQLEAKLDKPDVVNW\nMCYRKTEDFFTIWLDLNMFLPLGVDCWIDNTRVVYNRSSGLVSNAPGVQIRVPGFGKTYSVEYLDSSKLAGY\nLHTLVQNLVNNGYVRDETVRAAPYDWRLEPGQQEEYYHKLAGLVEEMHAAYGKPVFLIGHSLGCLHLLYFLL\n";\r
- PIRFile fa = new PIRFile(inStr);\r
- }\r
}\r
\r
public static int checkSum(String seq)\r
{\r
- //String chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.*~&@";\r
+\r
int check = 0;\r
\r
String sequence = seq.toUpperCase();\r
\r
- String index = "--------------------------------------&---*---.-----------------@ABCDEFGHIJKLMNOPQRSTUVWXYZ------ABCDEFGHIJKLMNOPQRSTUVWXYZ----@";\r
- index += "--------------------------------------------------------------------------------------------------------------------------------";\r
-\r
for (int i = 0; i < sequence.length(); i++)\r
{\r
- try\r
- {\r
if (i < sequence.length())\r
{\r
- int pos = index.indexOf(sequence.charAt(i));\r
-\r
- if (index.charAt(pos)!='_')\r
+ int value = sequence.charAt(i);\r
+ if (value != -1)\r
{\r
- check += ( ( (i % 57) + 1) * pos);\r
+ check += (i % 57 + 1) * value;\r
}\r
}\r
- }\r
- catch (Exception e)\r
- {\r
- System.err.println("Exception during MSF Checksum calculation");\r
- e.printStackTrace();\r
- }\r
+\r
}\r
\r
return check % 10000;\r
int maxid = 0;\r
\r
int i = 0;\r
- String big = "";\r
-\r
- while ( (i < s.length) && (s[i] != null))\r
+ int bigChecksum = 0;\r
+ int[] checksums = new int[s.length];\r
+ while (i < s.length)\r
{\r
- big += s[i].getSequence();\r
+ checksums[i] = checkSum(s[i].getSequence());\r
+ bigChecksum += checksums[i];\r
i++;\r
}\r
\r
- i = 0;\r
-\r
- int bigcheck = checkSum(big);\r
-\r
out.append(" MSF: " + s[0].getSequence().length() +\r
- " Type: P Check: " + bigcheck + " ..\n\n\n");\r
+ " Type: P Check: " + bigChecksum%10000 + " ..\n\n\n");\r
\r
+ i=0;\r
while ( (i < s.length) && (s[i] != null))\r
{\r
String seq = s[i].getSequence();\r
- String name = s[i].getName() + "/" + s[i].getStart() + "-" +\r
- s[i].getEnd();\r
- int check = checkSum(s[i].getSequence());\r
- out.append(" Name: " + name + " oo Len: " +\r
- s[i].getSequence().length() + " Check: " + check +\r
+ out.append(" Name: " + s[i].getName() + " oo Len: " +\r
+ s[i].getSequence().length() + " Check: " + checksums[i] +\r
" Weight: 1.00\n");\r
\r
if (seq.length() > max)\r
max = seq.length();\r
}\r
\r
- if (name.length() > maxid)\r
+ if (s[i].getName().length() > maxid)\r
{\r
- maxid = name.length();\r
+ maxid = s[i].getName().length();\r
}\r
\r
i++;\r
while ( (j < s.length) && (s[j] != null))\r
{\r
String name = s[j].getName();\r
- out.append(new Format("%-" + maxid + "s").form(name + "/" +\r
- s[j].getStart() + "-" + s[j].getEnd()) + " ");\r
+ out.append(new Format("%-" + maxid + "s").form(name) + " ");\r
\r
for (int k = 0; k < 5; k++)\r
{\r
\r
import jalview.gui.*;\r
\r
-import jalview.io.*;\r
-\r
import java.io.*;\r
\r
import java.util.*;\r
\r
import org.apache.axis.client.*;\r
\r
-import java.awt.*;\r
-\r
import java.util.*;\r
\r
import javax.swing.*;\r
import javax.swing.event.*;\r
import jalview.io.FormatAdapter;\r
import jalview.datamodel.SequenceI;\r
-import java.awt.datatransfer.DataFlavor;\r
-import jalview.io.IdentifyFile;\r
\r
public class GFinder\r
extends JPanel\r
//symm.print(System.out);\r
//System.out.println();\r
// Copy the symmetric matrix for later\r
- Matrix origsymm = symm.copy();\r
+ //Matrix origsymm = symm.copy();\r
\r
// This produces the tridiagonal transformation matrix\r
- long tstart = System.currentTimeMillis();\r
+ //long tstart = System.currentTimeMillis();\r
symm.tred();\r
\r
- long tend = System.currentTimeMillis();\r
+ //long tend = System.currentTimeMillis();\r
\r
//System.out.println("Time take for tred = " + (tend-tstart) + "ms");\r
//System.out.println(" ---Tridiag transform matrix ---");\r
//symm.printE(System.out);\r
//System.out.println();\r
// Now produce the diagonalization matrix\r
- tstart = System.currentTimeMillis();\r
+ //tstart = System.currentTimeMillis();\r
symm.tqli();\r
- tend = System.currentTimeMillis();\r
+ //tend = System.currentTimeMillis();\r
\r
//System.out.println("Time take for tqli = " + (tend-tstart) + " ms");\r
//System.out.println(" --- New diagonalization matrix ---");\r
}\r
catch (IllegalArgumentException iare)\r
{\r
- browser = browser;\r
errorMessage = iare.getMessage();\r
\r
return null;\r
*/\r
package jalview.util;\r
\r
-import java.io.*;\r
\r
\r
/**\r
left_align = false;\r
fmt = ' ';\r
\r
- int state = 0;\r
int length = s.length();\r
int parse_state = 0;\r
\r
int i = 0;\r
int sign = 1;\r
double r = 0; // integer part\r
- double f = 0; // fractional part\r
+ //double f = 0; // fractional part\r
double p = 1; // exponent of fractional part\r
int state = 0; // 0 = int part, 1 = frac part\r
\r
import ext.vamsas.*;
import java.util.Vector;
import java.util.Hashtable;
-import java.util.ArrayList;
import java.util.StringTokenizer;
public class Discoverer
// so no need to access original discovery thread.
// Curent decision is to change properties then notify listeners with old and new values.
Hashtable oldServices = services;
- Vector oldServicelist = serviceList;
+ //Vector oldServicelist = serviceList;
services = sscat;
serviceList = cat;
firePropertyChange("services", oldServices, services);
" Service location failed\nfor URL :" + WsURL +\r
"\n" +\r
ex.getMessage());\r
- wsInfo.setStatus(wsInfo.STATE_STOPPED_SERVERERROR);\r
+ wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_SERVERERROR);\r
\r
return false;\r
}\r
this.sequence.setSeq(AlignSeq.extractGaps("-. ",\r
msf[0].getSequence()));\r
\r
- jalview.io.PileUpfile mwrite = new jalview.io.PileUpfile();\r
this.msa = new vamsas.objects.simple.Msfalignment();\r
- msa.setMsf(mwrite.print(msf));\r
+ msa.setMsf(jalview.io.PileUpfile.print(msf));\r
}\r
\r
public void run()\r
\r
\r
\r
- private void addFloatAnnotations(Alignment al, int[] gapmap,\r
+ /* private void addFloatAnnotations(Alignment al, int[] gapmap,\r
Vector values, String Symname,\r
String Visname, float min,\r
float max, int winLength)\r
\r
al.addAnnotation(new AlignmentAnnotation(Symname, Visname,\r
annotations, min, max, winLength));\r
- }\r
+ }*/\r
\r
void parseResult()\r
{\r
i++;\r
}\r
\r
- Hashtable scores = prediction.getScores();\r
+ //Hashtable scores = prediction.getScores();\r
\r
/* addFloatAnnotations(al, gapmap, (Vector)scores.get("JNETPROPH"),\r
"JnetpropH", "Jnet Helix Propensity", 0f,1f,1);\r
" Service location failed\nfor URL :" + WsURL +\r
"\n" +\r
ex.getMessage());\r
- wsInfo.setStatus(wsInfo.ERROR);\r
+ wsInfo.setStatus(WebserviceInfo.ERROR);\r
ex.printStackTrace();\r
\r
return false;\r
e.toString() +\r
"\n");\r
this.allowedServerExceptions = 0;\r
- wsInfo.setStatus(wsInfo.STATE_STOPPED_SERVERERROR);\r
+ wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_SERVERERROR);\r
wsInfo.appendProgressText(\r
"Failed to submit sequences for alignment.\n" +\r
"It is most likely that there is a problem with the server.\n" +\r
\r
if (s != null) {\r
\r
- Rectangle2D userBounds = s.getBounds2D();\r
+ //Rectangle2D userBounds = s.getBounds2D();\r
if (!_transform.isIdentity()) {\r
s = _transform.createTransformedShape(s);\r
}\r