}\r
}\r
\r
+ public int [] getExactMapping()\r
+ {\r
+ // Print out the matching chars\r
+ int [] mapping = new int[astr1.length()];\r
+ int agap=0, bgap=0;\r
+ boolean gap;\r
+ for(int i=0; i<astr1.length(); i++)\r
+ {\r
+ mapping[i] = -1;\r
+ gap = false;\r
+\r
+ if(astr1.charAt(i)=='-')\r
+ {\r
+ agap++;gap = true;\r
+ }\r
+ if(astr2.charAt(i)=='-')\r
+ {\r
+ bgap++;gap = true;\r
+ }\r
+\r
+ if(!gap && astr1.charAt(i)==astr2.charAt(i))\r
+ {\r
+ mapping[i-agap] = i - bgap;\r
+ }\r
+\r
+ System.out.println(astr1.charAt(i)+" "+i + " "+mapping[i-agap]+" "+astr2.charAt(i));\r
+ }\r
+\r
+ return mapping;\r
+ }\r
+\r
/**\r
* DOCUMENT ME!\r
*/\r
*\r
* @param align The alignment object to sort\r
*/\r
- public static void sortByID(AlignmentI align, boolean dbprefix)\r
+ public static void sortByID(AlignmentI align)\r
{\r
int nSeq = align.getHeight();\r
\r
\r
for (int i = 0; i < nSeq; i++)\r
{\r
- ids[i] = align.getSequenceAt(i).getDisplayId(dbprefix, false);\r
+ ids[i] = align.getSequenceAt(i).getName();\r
seqs[i] = align.getSequenceAt(i);\r
}\r
\r
600, 500);\r
cap.setText(new AppletFormatAdapter().formatSequences(e.getActionCommand(),\r
viewport.getAlignment().getSequences(),\r
- viewport.showDBPrefix,\r
viewport.showJVSuffix));\r
}\r
\r
new FontChooser(alignPanel);\r
}\r
\r
- public void dbref_actionPerformed(ItemEvent e)\r
- {\r
- viewport.showDBPrefix = dbref.getState();\r
- alignPanel.fontChanged();\r
- alignPanel.repaint();\r
- }\r
\r
public void seqLimits_itemStateChanged(ItemEvent e)\r
{\r
{\r
addHistoryItem(new HistoryItem("ID Sort", viewport.alignment,\r
HistoryItem.SORT));\r
- AlignmentSorter.sortByID(viewport.getAlignment(), viewport.showDBPrefix);\r
+ AlignmentSorter.sortByID(viewport.getAlignment());\r
alignPanel.repaint();\r
}\r
\r
MenuItem pasteThis = new MenuItem();\r
protected CheckboxMenuItem applyToAllGroups = new CheckboxMenuItem();\r
protected MenuItem font = new MenuItem();\r
- protected CheckboxMenuItem dbref = new CheckboxMenuItem();\r
protected CheckboxMenuItem scaleAbove = new CheckboxMenuItem();\r
protected CheckboxMenuItem scaleLeft = new CheckboxMenuItem();\r
protected CheckboxMenuItem scaleRight = new CheckboxMenuItem();\r
font_actionPerformed(e);\r
}\r
});\r
- dbref.setLabel("ShowSequence DB Refs");\r
- dbref.setActionCommand("");\r
- dbref.setState(true);\r
- dbref.addItemListener(new java.awt.event.ItemListener() {\r
- public void itemStateChanged(ItemEvent e) {\r
- dbref_actionPerformed(e);\r
- }\r
- });\r
scaleAbove.setLabel("Scale Above");\r
scaleAbove.setState(true);\r
scaleAbove.addItemListener(new java.awt.event.ItemListener() {\r
searchMenu.add(findMenuItem);\r
viewMenu.add(font);\r
viewMenu.addSeparator();\r
- viewMenu.add(dbref);\r
viewMenu.add(seqLimits);\r
viewMenu.addSeparator();\r
viewMenu.add(wrapMenuItem);\r
int startSeq;\r
int endSeq;\r
\r
- boolean showDBPrefix = true;\r
boolean showJVSuffix = true;\r
boolean showText = true;\r
boolean showColourText = false;\r
showJVSuffix = b;\r
}\r
\r
- public boolean getShowDBPrefix()\r
- {\r
- return showDBPrefix;\r
- }\r
-\r
- public void setShowDBPrefix(boolean b)\r
- {\r
- showDBPrefix = b;\r
- }\r
-\r
public boolean getShowAnnotation()\r
{\r
return showAnnotation;\r
while (i < al.getHeight() && al.getSequenceAt(i) != null)\r
{\r
SequenceI s = al.getSequenceAt(i);\r
- id = s.getDisplayId(av.getShowDBPrefix(), av.getShowJVSuffix());\r
+ id = s.getDisplayId(av.getShowJVSuffix());\r
\r
if (fm.stringWidth(id) > idWidth)\r
{\r
gg.setColor(Color.black);\r
}\r
\r
- String string = s.getDisplayId(av.getShowDBPrefix(), av.getShowJVSuffix());\r
\r
- gg.drawString(string, 0,\r
+ gg.drawString( s.getDisplayId(av.getShowJVSuffix()), 0,\r
((i - starty) * charHeight) + ypos +\r
charHeight - (charHeight / 5));\r
\r
av.charHeight);\r
\r
gg.setColor(currentTextColor);\r
- String string = av.alignment.getSequenceAt(i)\r
- .getDisplayId(av.getShowDBPrefix(), av.getShowJVSuffix());\r
\r
- gg.drawString(string, 0,\r
+ gg.drawString(av.alignment.getSequenceAt(i)\r
+ .getDisplayId(av.getShowJVSuffix()), 0,\r
((i - starty) * av.charHeight) +\r
av.charHeight - (av.charHeight / 5));\r
}\r
protected CheckboxMenuItem fitToWindow = new CheckboxMenuItem();\r
Menu fileMenu = new Menu();\r
MenuItem newickOutput = new MenuItem();\r
- CheckboxMenuItem fullId = new CheckboxMenuItem();\r
\r
private void jbInit() throws Exception {\r
setLayout(borderLayout1);\r
newickOutput_actionPerformed(actionEvent);\r
}\r
});\r
- fullId.setLabel("Show Full Id");\r
- fullId.addItemListener(new ItemListener()\r
- {\r
- public void itemStateChanged(ItemEvent itemEvent)\r
- {\r
- fullId_itemStateChanged(itemEvent);\r
- }\r
- });\r
\r
add(scrollPane, BorderLayout.CENTER);\r
jMenuBar1.add(fileMenu);\r
jMenu2.add(distanceMenu);\r
jMenu2.add(bootstrapMenu);\r
jMenu2.add(placeholdersMenu);\r
- jMenu2.add(fullId);\r
- fullId.setState(true);\r
fileMenu.add(newickOutput);\r
}\r
\r
-\r
- public void fullId_itemStateChanged(ItemEvent itemEvent)\r
- {\r
- tree.findHeight(tree.getTopNode());\r
-\r
- // Now have to calculate longest name based on the leaves\r
- Vector leaves = tree.findLeaves(tree.getTopNode(), new Vector());\r
-\r
- treeCanvas.longestName="";\r
- for (int i = 0; i < leaves.size(); i++)\r
- {\r
- SequenceNode lf = (SequenceNode) leaves.elementAt(i);\r
- Sequence seq = (Sequence) lf.element();\r
- lf.setName(seq.getDisplayId(fullId.getState(), false));\r
- if(lf.getName().length() > treeCanvas.longestName.length())\r
- treeCanvas.longestName = lf.getName();\r
- }\r
-\r
- treeCanvas.repaint();\r
- }\r
-\r
}\r
boolean seqlimits = suffix.equalsIgnoreCase("true");\r
\r
String reply = new AppletFormatAdapter().formatSequences(format,\r
- currentAlignFrame.viewport.getAlignment().getSequences(),\r
- true, seqlimits);\r
+ currentAlignFrame.viewport.getAlignment().getSequences(), seqlimits);\r
return reply;\r
}\r
catch (Exception ex)\r
}\r
}\r
\r
- public SequenceI findShortName(String name)\r
- {\r
- int i = 0;\r
-\r
- while (i < sequences.size())\r
- {\r
- if (getSequenceAt(i).getShortName().equals(name))\r
- {\r
- return getSequenceAt(i);\r
- }\r
-\r
- i++;\r
- }\r
-\r
- return null;\r
- }\r
-\r
/** */\r
public SequenceI findName(String name)\r
{\r
for (int i = 0; i < getHeight(); i++)\r
{\r
\r
- seqs[i] = new Sequence(getSequenceAt(i).getDisplayId(true,true),\r
+ seqs[i] = new Sequence(getSequenceAt(i).getDisplayId(true),\r
AlignSeq.extractGaps(\r
jalview.util.Comparison.GapChars,\r
getSequenceAt(i).getSequence()\r
*/\r
public SequenceI findName(String name);\r
\r
- public SequenceI findShortName(String name);\r
-\r
\r
/**\r
* Finds index of a given sequence in the alignment.\r
{\r
SequenceI datasetSequence;\r
String name;\r
- String shortName;\r
String sequence;\r
String description;\r
int start;\r
\r
void parseId()\r
{\r
- // Read in any DB refs first\r
- StringTokenizer st = new StringTokenizer(name, "|");\r
- if(st.countTokens()<1)\r
- {\r
- shortName = name;\r
- return;\r
- }\r
-\r
- while (st.countTokens() > 1)\r
- {\r
- String a = st.nextToken();\r
- String b = st.nextToken();\r
- addDBRef(new DBRefEntry(a, "0", b));\r
- }\r
-\r
- if (st.hasMoreTokens())\r
- shortName = st.nextToken();\r
-\r
// Remove /start-end from sequence\r
- if (shortName.indexOf("/") > 0)\r
+ if (name.indexOf("/") > 0)\r
{\r
- st = new StringTokenizer(shortName, "/");\r
- String limits = null;\r
+ String limits = name.substring(name.lastIndexOf("/")+1);\r
try\r
{\r
- if (st.countTokens() == 2)\r
- {\r
-\r
- shortName = st.nextToken();\r
-\r
- limits = st.nextToken();\r
-\r
- st = new StringTokenizer(limits, "-");\r
+ StringTokenizer st = new StringTokenizer(limits, "-");\r
\r
if (st.countTokens() == 2)\r
{\r
setStart(Integer.valueOf(st.nextToken()).intValue());\r
setEnd(Integer.valueOf(st.nextToken()).intValue());\r
}\r
- }\r
\r
// If we're still in this loop, parsing of start and end was ok\r
// Therefore remove it from the sequence name\r
name = name.substring(0, name.lastIndexOf("/"));\r
}\r
catch (NumberFormatException ex)\r
- {\r
- // Problem parsing sequence limits. Just add it back to the\r
- // Id so we dont lose this info\r
- shortName += "/" + limits;\r
- }\r
+ { }\r
}\r
\r
}\r
*\r
* @return DOCUMENT ME!\r
*/\r
- public String getDisplayId(boolean dbref, boolean jvsuffix)\r
+ public String getDisplayId(boolean jvsuffix)\r
{\r
- StringBuffer result = new StringBuffer();\r
- if (dbref && dbrefs != null)\r
- {\r
- for (int i = 0; i < dbrefs.size(); i++)\r
- {\r
- DBRefEntry entry = (DBRefEntry) dbrefs.elementAt(i);\r
- result.append(entry.getSource() + "|" + entry.getAccessionId() + "|");\r
- }\r
- }\r
-\r
- result.append(shortName);\r
-\r
+ StringBuffer result = new StringBuffer(name);\r
if (jvsuffix)\r
{\r
result.append("/" + start + "-" + end);\r
\r
while ((j < i) && (j < sequence.length()))\r
{\r
- char c = sequence.charAt(j);\r
-\r
- if (!jalview.util.Comparison.isGap((c)))\r
+ if (!jalview.util.Comparison.isGap((sequence.charAt(j))))\r
{\r
pos++;\r
}\r
return datasetSequence;\r
}\r
\r
- public String getShortName()\r
- {\r
- return shortName;\r
- }\r
-\r
}\r
*/\r
public String getName();\r
\r
- public String getShortName();\r
+\r
/**\r
* DOCUMENT ME!\r
*\r
*\r
* @return DOCUMENT ME!\r
*/\r
- public String getDisplayId(boolean dbref, boolean jvsuffix);\r
+ public String getDisplayId(boolean jvsuffix);\r
\r
/**\r
* DOCUMENT ME!\r
}\r
\r
FastaFile ff = new FastaFile();\r
- ff.addDBPrefix( viewport.showDBPrefix );\r
ff.addJVSuffix( viewport.showJVSuffix );\r
c.setContents(new StringSelection( ff.print(seqs)), this);\r
Desktop.jalviewClipboard = new Object[]{seqs, viewport.alignment.getDataset()};\r
alignPanel.repaint();\r
}\r
\r
- public void seqDBRef_actionPerformed(ActionEvent e)\r
- {\r
- viewport.setShowDBPrefix(seqDBRef.isSelected());\r
-\r
- alignPanel.idPanel.idCanvas.setPreferredSize(alignPanel.calculateIdWidth());\r
- alignPanel.repaint();\r
- }\r
-\r
\r
/**\r
* DOCUMENT ME!\r
{\r
addHistoryItem(new HistoryItem("ID Sort", viewport.alignment,\r
HistoryItem.SORT));\r
- AlignmentSorter.sortByID(viewport.getAlignment(), viewport.showDBPrefix);\r
+ AlignmentSorter.sortByID(viewport.getAlignment());\r
alignPanel.repaint();\r
}\r
\r
int endRes;\r
int startSeq;\r
int endSeq;\r
- boolean showDBPrefix = true;\r
boolean showJVSuffix = true;\r
boolean showText = true;\r
boolean showColourText = false;\r
this.startSeq = 0;\r
this.endSeq = alignment.getHeight() - 1;\r
\r
- showDBPrefix = Cache.getDefault("SHOW_DBPREFIX", true);\r
showJVSuffix = Cache.getDefault("SHOW_JVSUFFIX", true);\r
showAnnotation = Cache.getDefault("SHOW_ANNOTATIONS", true);\r
showConservation = Cache.getDefault("SHOW_CONSERVATION", true);\r
showJVSuffix = b;\r
}\r
\r
- /**\r
- * DOCUMENT ME!\r
- *\r
- * @return DOCUMENT ME!\r
- */\r
- public boolean getShowDBPrefix()\r
- {\r
- return showDBPrefix;\r
- }\r
-\r
- /**\r
- * DOCUMENT ME!\r
- *\r
- * @param b DOCUMENT ME!\r
- */\r
- public void setShowDBPrefix(boolean b)\r
- {\r
- showDBPrefix = b;\r
- }\r
\r
/**\r
* DOCUMENT ME!\r
{\r
SequenceI s = al.getSequenceAt(i);\r
\r
- id = s.getDisplayId(av.getShowDBPrefix(), av.getShowJVSuffix());\r
+ id = s.getDisplayId(av.getShowJVSuffix());\r
\r
if (fm.stringWidth(id) > idWidth)\r
{\r
pg.setColor(currentTextColor);\r
\r
String string = av.getAlignment().getSequenceAt(i).getDisplayId\r
- (av.getShowDBPrefix(), av.getShowJVSuffix());\r
+ ( av.getShowJVSuffix());\r
\r
pg.drawString(string, 0,\r
( ( (i - startSeq) * av.charHeight) + av.getCharHeight()) -\r
for (int i = 0; i < av.alignment.getHeight(); i++)\r
{\r
SequenceI s = av.alignment.getSequenceAt(i);\r
- String string = s.getDisplayId(av.getShowDBPrefix(), av.getShowJVSuffix());\r
+ String string = s.getDisplayId( av.getShowJVSuffix());\r
\r
pg.drawString(string, 0,\r
( (i * av.charHeight) + ypos + av.charHeight) -\r
}\r
\r
\r
- gg.drawString( s.getDisplayId(av.getShowDBPrefix(), av.getShowJVSuffix()),\r
+ gg.drawString( s.getDisplayId(av.getShowJVSuffix()),\r
0, (((i - starty + 1) * charHeight) + ypos) - (charHeight / 5));\r
}\r
\r
\r
gg.setColor(currentTextColor);\r
\r
- String string = av.alignment.getSequenceAt(i).getDisplayId(\r
- av.getShowDBPrefix(), av.getShowJVSuffix());\r
+ String string = av.alignment.getSequenceAt(i).getDisplayId( av.getShowJVSuffix());\r
\r
gg.drawString(string, 0,\r
(((i - starty) * av.charHeight) + av.charHeight) -\r
if(seq!=-1)\r
{\r
StringBuffer tip = new StringBuffer("<html>");\r
- tip.append(av.alignment.getSequenceAt(seq).getDisplayId(true, true));\r
+ tip.append(av.alignment.getSequenceAt(seq).getDisplayId(true));\r
if (av.alignment.getSequenceAt(seq).getDescription() != null)\r
{\r
tip.append("<table width=250 border=0><tr><td><i>");\r
\r
import jalview.datamodel.*;\r
\r
-import jalview.io.*;\r
\r
import jalview.schemes.*;\r
\r
}\r
\r
\r
- if ((seq != null)\r
- && seq.getDatasetSequence().getPDBId() != null)\r
+ if ((seq != null))\r
+ // && seq.getDatasetSequence().getPDBId() != null)\r
{\r
- java.util.Enumeration e = seq.getDatasetSequence().getPDBId().elements();\r
- while(e.hasMoreElements())\r
+ //java.util.Enumeration e = seq.getDatasetSequence().getPDBId().elements();\r
+ // while(e.hasMoreElements())\r
{\r
+ final PDBEntry pdb = new PDBEntry();\r
+ pdb.setId("pdb");\r
\r
- final PDBEntry pdb = (PDBEntry)e.nextElement();\r
+\r
+ // (PDBEntry)e.nextElement();\r
JMenuItem pdbMenuItem = new JMenuItem();\r
pdbMenuItem.setText("View PDB entry: "+pdb.getId());\r
pdbMenuItem.addActionListener(new java.awt.event.ActionListener()\r
*/\r
void sequenceName_actionPerformed(ActionEvent e)\r
{\r
- String id = sequence.getDisplayId(false, false);\r
+ String id = sequence.getName();\r
String s = (String) JOptionPane.showInternalInputDialog(ap,\r
"Edit sequence name",\r
"Edit sequence name (" + sequence.getName() + ")",\r
epsRendering.addItem("Text");\r
epsRendering.setSelectedItem( Cache.getDefault("EPS_RENDERING", "Prompt each time"));\r
\r
- blcdb.setSelected( Cache.getDefault("BLC_DBPREFIX", false) );\r
blcjv.setSelected( Cache.getDefault("BLC_JVSUFFIX", true) );\r
- clustaldb.setSelected( Cache.getDefault("CLUSTAL_DBPREFIX", false) );\r
clustaljv.setSelected( Cache.getDefault("CLUSTAL_JVSUFFIX", true) );\r
- fastadb.setSelected( Cache.getDefault("FASTA_DBPREFIX", false) );\r
fastajv.setSelected( Cache.getDefault("FASTA_JVSUFFIX", true) );\r
- msfdb.setSelected( Cache.getDefault("MSF_DBPREFIX", false) );\r
msfjv.setSelected( Cache.getDefault("MSF_JVSUFFIX", true) );\r
- pfamdb.setSelected( Cache.getDefault("PFAM_DBPREFIX", false) );\r
pfamjv.setSelected( Cache.getDefault("PFAM_JVSUFFIX", true) );\r
- pileupdb.setSelected( Cache.getDefault("PILEUP_DBPREFIX", false) );\r
pileupjv.setSelected( Cache.getDefault("PILEUP_JVSUFFIX", true) );\r
- pirdb.setSelected( Cache.getDefault("PIR_DBPREFIX", false) );\r
pirjv.setSelected( Cache.getDefault("PIR_JVSUFFIX", true) );\r
\r
/****************************************************\r
}\r
\r
\r
- Cache.applicationProperties.setProperty("BLC_DBPREFIX", Boolean.toString(blcdb.isSelected()) );\r
Cache.applicationProperties.setProperty("BLC_JVSUFFIX", Boolean.toString(blcjv.isSelected()) );\r
- Cache.applicationProperties.setProperty("CLUSTAL_DBPREFIX", Boolean.toString(clustaldb.isSelected()) );\r
Cache.applicationProperties.setProperty("CLUSTAL_JVSUFFIX", Boolean.toString(clustaljv.isSelected()) );\r
- Cache.applicationProperties.setProperty("FASTA_DBPREFIX", Boolean.toString(fastadb.isSelected()) );\r
Cache.applicationProperties.setProperty("FASTA_JVSUFFIX", Boolean.toString(fastajv.isSelected()) );\r
- Cache.applicationProperties.setProperty("MSF_DBPREFIX", Boolean.toString(msfdb.isSelected()) );\r
Cache.applicationProperties.setProperty("MSF_JVSUFFIX", Boolean.toString(msfjv.isSelected()) );\r
- Cache.applicationProperties.setProperty("PFAM_DBPREFIX", Boolean.toString(pfamdb.isSelected()) );\r
Cache.applicationProperties.setProperty("PFAM_JVSUFFIX", Boolean.toString(pfamjv.isSelected()) );\r
- Cache.applicationProperties.setProperty("PILEUP_DBPREFIX", Boolean.toString(pileupdb.isSelected()) );\r
Cache.applicationProperties.setProperty("PILEUP_JVSUFFIX", Boolean.toString(pileupjv.isSelected()) );\r
- Cache.applicationProperties.setProperty("PIR_DBPREFIX", Boolean.toString(pirdb.isSelected()) );\r
Cache.applicationProperties.setProperty("PIR_JVSUFFIX", Boolean.toString(pirjv.isSelected()) );\r
\r
\r
// Set this to false to force a full panel paint\r
public void paintComponent(Graphics g)\r
{\r
+ super.paintComponent(g);\r
+\r
sr.renderGaps(av.renderGaps);\r
\r
- if ((img != null) &&\r
- (fastPaint && getVisibleRect() != g.getClipBounds()))\r
+ if ( img != null && (fastPaint\r
+ || (getVisibleRect().width != g.getClipBounds().width)\r
+ || (getVisibleRect().height != g.getClipBounds().height)))\r
{\r
g.drawImage(img, 0, 0, this);\r
fastPaint = false;\r
}\r
\r
\r
-\r
-\r
// this draws the whole of the alignment\r
imgWidth = getWidth();\r
imgHeight = getHeight();\r
\r
if (pdbCanvas != null)\r
{\r
- pdbCanvas.updateSeqColours();\r
+ pdbCanvas.updateSeqColours();\r
}\r
\r
}\r
\r
frame = new JInternalFrame();\r
frame.setContentPane(this);\r
- Desktop.addInternalFrame(frame, "Sequence Fetcher", 390, 120);\r
+ if(System.getProperty("os.name").startsWith("Mac"))\r
+ Desktop.addInternalFrame(frame, "Sequence Fetcher", 390, 135);\r
+ else\r
+ Desktop.addInternalFrame(frame, "Sequence Fetcher", 390, 120);\r
}\r
\r
private void jbInit()\r
\r
public void ok_actionPerformed(ActionEvent e)\r
{\r
- frame.setTitle("Sequence Fetcher - Fetching Sequence from " +\r
- database.getSelectedItem());\r
+ frame.setTitle("WSDBfetch@EBI Sequence Fetcher - Fetching Sequence...");\r
database.setEnabled(false);\r
textfield.setEnabled(false);\r
ok.setEnabled(false);\r
\r
Thread worker = new Thread(this);\r
worker.start();\r
-\r
}\r
\r
public void run()\r
}\r
else if (database.getSelectedItem().equals("PDB"))\r
{\r
+ String id = textfield.getText().toUpperCase();\r
+ String chain=null;\r
+ if(id.indexOf(":")>-1)\r
+ {\r
+ chain = id.substring(id.indexOf(":")+1);\r
+ id = id.substring(0,id.indexOf(":"));\r
+ System.out.println(id+" "+chain);\r
+ }\r
+\r
EBIFetchClient ebi = new EBIFetchClient();\r
- String[] reply = ebi.fetchData("pdb:" + textfield.getText(), "pdb",\r
+ String[] reply = ebi.fetchData("pdb:" + id, "pdb",\r
"raw");\r
try{\r
PDBfile pdbfile = new PDBfile(reply);\r
for (int i = 0; i < pdbfile.chains.size(); i++)\r
{\r
- result.append("\n>PDB|" + textfield.getText()+"|"+\r
+ if( chain == null || ((PDBChain)pdbfile.chains.elementAt(i)).id.toUpperCase().equals(chain))\r
+ result.append("\n>PDB|" + id+"|"+\r
( (PDBChain) pdbfile.chains.elementAt(i)).sequence.\r
getName() +\r
"\n"\r
textfield.setEnabled(true);\r
ok.setEnabled(true);\r
cancel.setEnabled(true);\r
- frame.setTitle("Sequence Fetcher");\r
-\r
-\r
+ frame.setTitle("WSDBfetch@EBI Sequence Fetcher");\r
}\r
\r
void showErrorMessage(String error)\r
treeCanvas.setTree(tree);\r
\r
treeCanvas.repaint();\r
-\r
-\r
- fullid.setState(treeCanvas.av.showDBPrefix);\r
- if(!treeCanvas.av.showDBPrefix)\r
- {\r
- fullid_actionPerformed(null);\r
- }\r
}\r
\r
}\r
}\r
\r
\r
- public void fullid_actionPerformed(ActionEvent e)\r
- {\r
- tree.findHeight(tree.getTopNode());\r
-\r
- // Now have to calculate longest name based on the leaves\r
- Vector leaves = tree.findLeaves(tree.getTopNode(), new Vector());\r
-\r
- treeCanvas.longestName="";\r
- for (int i = 0; i < leaves.size(); i++)\r
- {\r
- SequenceNode lf = (SequenceNode) leaves.elementAt(i);\r
- Sequence seq = (Sequence) lf.element();\r
- lf.setName(seq.getDisplayId(fullid.getState(), false));\r
- if(lf.getName().length() > treeCanvas.longestName.length())\r
- treeCanvas.longestName = lf.getName();\r
- }\r
-\r
- treeCanvas.repaint();\r
- }\r
-\r
-\r
/**\r
* DOCUMENT ME!\r
*\r
Vector headers;\r
long start;\r
long end;\r
- boolean dbPrefix = true;\r
boolean jvSuffix = true;\r
\r
/**\r
*/\r
public abstract String print();\r
\r
- public void addDBPrefix(boolean b)\r
- {\r
- dbPrefix = b;\r
- }\r
-\r
public void addJVSuffix(boolean b)\r
{\r
jvSuffix = b;\r
}\r
\r
/**\r
- * A general parser for ids. Will look for dbrefs in\r
- * Uniprot format source|id\r
- * And also Jalview /start-end\r
+ * A general parser for ids.\r
*\r
* @String id Id to be parsed\r
*/\r
seq = new Sequence(id, "");\r
}\r
\r
-\r
return seq;\r
}\r
\r
*/\r
String printId(SequenceI seq)\r
{\r
- return seq.getDisplayId(dbPrefix, jvSuffix);\r
+ return seq.getDisplayId(jvSuffix);\r
}\r
\r
}\r
*/\r
public String formatSequences(String format,\r
Vector seqs,\r
- boolean dbref,\r
boolean jvsuffix)\r
{\r
SequenceI[] s = new SequenceI[seqs.size()];\r
afile = new PfamFile();\r
}\r
\r
- afile.addDBPrefix(dbref);\r
afile.addJVSuffix(jvsuffix);\r
\r
afile.setSeqs(s);\r
if (format.equalsIgnoreCase("FASTA"))\r
{\r
afile = new FastaFile();\r
- afile.addDBPrefix(\r
- jalview.bin.Cache.getDefault("FASTA_DBPREFIX", false));\r
afile.addJVSuffix(\r
jalview.bin.Cache.getDefault("FASTA_JVSUFFIX", true));\r
}\r
else if (format.equalsIgnoreCase("MSF"))\r
{\r
afile = new MSFfile();\r
- afile.addDBPrefix(\r
- jalview.bin.Cache.getDefault("MSF_DBPREFIX", false));\r
afile.addJVSuffix(\r
jalview.bin.Cache.getDefault("MSF_JVSUFFIX", true));\r
}\r
else if (format.equalsIgnoreCase("PileUp"))\r
{\r
afile = new PileUpfile();\r
- afile.addDBPrefix(\r
- jalview.bin.Cache.getDefault("PILEUP_DBPREFIX", false));\r
afile.addJVSuffix(\r
jalview.bin.Cache.getDefault("PILEUP_JVSUFFIX", true));\r
}\r
else if (format.equalsIgnoreCase("CLUSTAL"))\r
{\r
afile = new ClustalFile();\r
- afile.addDBPrefix(\r
- jalview.bin.Cache.getDefault("CLUSTAL_DBPREFIX", false));\r
afile.addJVSuffix(\r
jalview.bin.Cache.getDefault("CLUSTAL_JVSUFFIX", true));\r
}\r
else if (format.equalsIgnoreCase("BLC"))\r
{\r
afile = new BLCFile();\r
- afile.addDBPrefix(\r
- jalview.bin.Cache.getDefault("BLC_DBPREFIX", false));\r
afile.addJVSuffix(\r
jalview.bin.Cache.getDefault("BLC_JVSUFFIX", true));\r
}\r
else if (format.equalsIgnoreCase("PIR"))\r
{\r
afile = new PIRFile();\r
- afile.addDBPrefix(\r
- jalview.bin.Cache.getDefault("PIR_DBPREFIX", false));\r
afile.addJVSuffix(\r
jalview.bin.Cache.getDefault("PIR_JVSUFFIX", true));\r
}\r
else if (format.equalsIgnoreCase("PFAM"))\r
{\r
afile = new PfamFile();\r
- afile.addDBPrefix(\r
- jalview.bin.Cache.getDefault("PFAM_DBPREFIX", false));\r
afile.addJVSuffix(\r
jalview.bin.Cache.getDefault("PFAM_JVSUFFIX", true));\r
}\r
{\r
seq = alignment.getSequenceAt(i);\r
\r
- String id = seq.getDisplayId(av.getShowDBPrefix(), av.getShowJVSuffix());\r
+ String id = seq.getDisplayId(av.getShowJVSuffix());\r
\r
out.println("<tr><td nowrap>" + id +\r
" </td>");\r
startPos = seq.findPosition( startRes );\r
endPos = seq.findPosition( endRes )-1;\r
\r
- String id = seq.getDisplayId(av.getShowDBPrefix(), av.getShowJVSuffix());\r
+ String id = seq.getDisplayId(av.getShowJVSuffix());\r
\r
out.println("<td nowrap>" + id +\r
" </td>");\r
seqIndex++, i++)\r
{\r
SequenceI sequence = (SequenceI) sequences.get(seqIndex);\r
- if(!ids.contains(sequence.getShortName()))\r
+ if(!ids.contains(sequence.getName()))\r
{\r
- ids.add(sequence.getShortName());\r
+ ids.add(sequence.getName());\r
unknownSequences.add(sequence);\r
}\r
}\r
{\r
entry = (UniprotEntry) entries.elementAt(i);\r
String idmatch = entry.getAccession().elementAt(0).toString();\r
- sequence = dataset.findShortName(idmatch);\r
+ sequence = dataset.findName(idmatch);\r
\r
if (sequence == null)\r
{\r
//Sequence maybe Name, not Accession\r
- idmatch = entry.getName().elementAt(0).toString();;\r
- sequence = dataset.findShortName(idmatch);\r
+ idmatch = entry.getName().elementAt(0).toString();\r
+ sequence = dataset.findName(idmatch);\r
}\r
\r
if (sequence == null)\r
import java.awt.*;\r
import java.awt.event.*;\r
import javax.swing.*;\r
-import javax.swing.event.*;\r
\r
import jalview.schemes.*;\r
\r
protected JCheckBoxMenuItem showTranslation = new JCheckBoxMenuItem();\r
//protected JTabbedPane tabbedPane = new JTabbedPane();\r
public JMenuItem featureSettings = new JMenuItem();\r
- public JCheckBoxMenuItem seqDBRef = new JCheckBoxMenuItem();\r
JMenuItem fetchSequence = new JMenuItem();\r
\r
public GAlignFrame()\r
featureSettings_actionPerformed(e);\r
}\r
});\r
- seqDBRef.setState( jalview.bin.Cache.getDefault("SHOW_DBPREFIX",true));\r
- seqDBRef.setText("Show Full Sequence Id");\r
- seqDBRef.addActionListener(new ActionListener()\r
- {\r
- public void actionPerformed(ActionEvent e)\r
- {\r
- seqDBRef_actionPerformed(e);\r
- }\r
- });\r
fetchSequence.setText("Fetch Sequence...");\r
fetchSequence.addActionListener(new ActionListener()\r
{\r
viewMenu.add(font);\r
viewMenu.addSeparator();\r
viewMenu.add(wrapMenuItem);\r
- viewMenu.add(seqDBRef);\r
viewMenu.add(seqLimits);\r
viewMenu.add(scaleAbove);\r
viewMenu.add(scaleLeft);\r
JLabel epsLabel = new JLabel();\r
protected JComboBox epsRendering = new JComboBox();\r
JLabel jLabel1 = new JLabel();\r
- JLabel jLabel2 = new JLabel();\r
- protected JCheckBox pileupdb = new JCheckBox();\r
- protected JCheckBox fastadb = new JCheckBox();\r
protected JCheckBox blcjv = new JCheckBox();\r
protected JCheckBox pileupjv = new JCheckBox();\r
- protected JCheckBox msfdb = new JCheckBox();\r
- protected JCheckBox pfamdb = new JCheckBox();\r
protected JCheckBox clustaljv = new JCheckBox();\r
protected JCheckBox msfjv = new JCheckBox();\r
- protected JCheckBox blcdb = new JCheckBox();\r
- protected JCheckBox clustaldb = new JCheckBox();\r
protected JCheckBox fastajv = new JCheckBox();\r
protected JCheckBox pfamjv = new JCheckBox();\r
- JLabel jLabel10 = new JLabel();\r
JLabel jLabel11 = new JLabel();\r
FlowLayout flowLayout1 = new FlowLayout();\r
- protected JCheckBox pirdb = new JCheckBox();\r
protected JCheckBox pirjv = new JCheckBox();\r
JPanel jPanel11 = new JPanel();\r
- GridLayout gridLayout3 = new GridLayout();\r
Font verdana11 = new java.awt.Font("Verdana", Font.PLAIN, 11);\r
protected JCheckBox seqLimit = new JCheckBox();\r
+ GridLayout gridLayout3 = new GridLayout();\r
/**\r
* Creates a new GPreferences object.\r
*/\r
jLabel1.setFont(verdana11);\r
jLabel1.setHorizontalAlignment(SwingConstants.CENTER);\r
jLabel1.setText("/start-end suffix");\r
- jLabel2.setFont(verdana11);\r
- jLabel2.setHorizontalAlignment(SwingConstants.RIGHT);\r
- jLabel2.setHorizontalTextPosition(SwingConstants.RIGHT);\r
- jLabel2.setText("Database ref prefix");\r
jLabel1.setFont(verdana11);\r
- jLabel2.setFont(verdana11);\r
fastajv.setFont(verdana11);\r
- fastajv.setHorizontalAlignment(SwingConstants.CENTER);\r
- jLabel10.setFont(new java.awt.Font("Verdana", Font.ITALIC, 11));\r
- jLabel10.setHorizontalAlignment(SwingConstants.RIGHT);\r
- jLabel10.setText("(Uniprot|P02055)");\r
+ fastajv.setHorizontalAlignment(SwingConstants.LEFT);\r
jLabel11.setFont(new java.awt.Font("Verdana", Font.ITALIC, 11));\r
jLabel11.setHorizontalAlignment(SwingConstants.CENTER);\r
jLabel11.setText("(/15-380)");\r
- clustaldb.setFont(verdana11);\r
- clustaldb.setHorizontalAlignment(SwingConstants.RIGHT);\r
- clustaldb.setHorizontalTextPosition(SwingConstants.LEFT);\r
- clustaldb.setText("Clustal ");\r
- blcdb.setFont(verdana11);\r
- blcdb.setHorizontalAlignment(SwingConstants.RIGHT);\r
- blcdb.setHorizontalTextPosition(SwingConstants.LEFT);\r
- blcdb.setText("BLC ");\r
- fastadb.setFont(verdana11);\r
- fastadb.setHorizontalAlignment(SwingConstants.RIGHT);\r
- fastadb.setHorizontalTextPosition(SwingConstants.LEFT);\r
- fastadb.setText("Fasta ");\r
- msfdb.setFont(verdana11);\r
- msfdb.setHorizontalTextPosition(SwingConstants.LEFT);\r
- msfdb.setHorizontalAlignment(SwingConstants.RIGHT);\r
- msfdb.setText("MSF ");\r
- pfamdb.setFont(verdana11);\r
- pfamdb.setHorizontalAlignment(SwingConstants.RIGHT);\r
- pfamdb.setHorizontalTextPosition(SwingConstants.LEFT);\r
- pfamdb.setText("PFAM ");\r
- pileupdb.setFont(verdana11);\r
- pileupdb.setHorizontalAlignment(SwingConstants.RIGHT);\r
- pileupdb.setHorizontalTextPosition(SwingConstants.LEFT);\r
- pileupdb.setText("Pileup ");\r
+ clustaljv.setText("Clustal ");\r
+ blcjv.setText("BLC ");\r
+ fastajv.setText("Fasta ");\r
+ msfjv.setText("MSF ");\r
+ pfamjv.setText("PFAM ");\r
+ pileupjv.setText("Pileup ");\r
msfjv.setFont(verdana11);\r
- msfjv.setHorizontalAlignment(SwingConstants.CENTER);\r
- pirdb.setFont(verdana11);\r
- pirdb.setHorizontalAlignment(SwingConstants.RIGHT);\r
- pirdb.setHorizontalTextPosition(SwingConstants.LEFT);\r
- pirdb.setText("PIR ");\r
+ msfjv.setHorizontalAlignment(SwingConstants.LEFT);\r
+ pirjv.setText("PIR ");\r
jPanel11.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
jPanel11.setBorder(titledBorder2);\r
- jPanel11.setBounds(new Rectangle(18, 72, 325, 182));\r
+ jPanel11.setBounds(new Rectangle(63, 70, 137, 182));\r
jPanel11.setLayout(gridLayout3);\r
- gridLayout3.setColumns(2);\r
- gridLayout3.setRows(9);\r
blcjv.setFont(verdana11);\r
- blcjv.setHorizontalAlignment(SwingConstants.CENTER);\r
+ blcjv.setHorizontalAlignment(SwingConstants.LEFT);\r
clustaljv.setFont(verdana11);\r
- clustaljv.setHorizontalAlignment(SwingConstants.CENTER);\r
+ clustaljv.setHorizontalAlignment(SwingConstants.LEFT);\r
pfamjv.setFont(verdana11);\r
- pfamjv.setHorizontalAlignment(SwingConstants.CENTER);\r
+ pfamjv.setHorizontalAlignment(SwingConstants.LEFT);\r
pileupjv.setFont(verdana11);\r
- pileupjv.setHorizontalAlignment(SwingConstants.CENTER);\r
+ pileupjv.setHorizontalAlignment(SwingConstants.LEFT);\r
pirjv.setFont(verdana11);\r
- pirjv.setHorizontalAlignment(SwingConstants.CENTER);\r
+ pirjv.setHorizontalAlignment(SwingConstants.LEFT);\r
seqLimit.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
seqLimit.setHorizontalTextPosition(SwingConstants.LEADING);\r
seqLimit.setText("Sequence Limits (/1-350)");\r
seqLimit.setBounds(new Rectangle(172, 82, 195, 23));\r
+ gridLayout3.setRows(9);\r
jPanel2.add(fullScreen);\r
jPanel2.add(annotations);\r
jPanel2.add(dbRef);\r
tabbedPane.add(visualTab, "Visual");\r
tabbedPane.add(connectTab,"Connections");\r
tabbedPane.add(exportTab, "Output");\r
- jPanel11.add(jLabel2);\r
jPanel11.add(jLabel1);\r
- jPanel11.add(jLabel10);\r
jPanel11.add(jLabel11);\r
- jPanel11.add(blcdb);\r
jPanel11.add(blcjv);\r
- jPanel11.add(clustaldb);\r
jPanel11.add(clustaljv);\r
- jPanel11.add(fastadb);\r
jPanel11.add(fastajv);\r
- jPanel11.add(msfdb);\r
jPanel11.add(msfjv);\r
- jPanel11.add(pfamdb);\r
jPanel11.add(pfamjv);\r
- jPanel11.add(pileupdb);\r
jPanel11.add(pileupjv);\r
- jPanel11.add(pirdb);\r
jPanel11.add(pirjv);\r
exportTab.add(epsLabel);\r
exportTab.add(epsRendering);\r
JMenuItem epsTree = new JMenuItem();\r
JMenu saveAsMenu = new JMenu();\r
JMenuItem textbox = new JMenuItem();\r
- protected JCheckBoxMenuItem fullid = new JCheckBoxMenuItem();\r
-\r
public GTreePanel()\r
{\r
try\r
textbox_actionPerformed(e);\r
}\r
});\r
- fullid.setText("Show Full Sequence Id");\r
- fullid.addActionListener(new ActionListener()\r
- {\r
- public void actionPerformed(ActionEvent e)\r
- {\r
- fullid_actionPerformed(e);\r
- }\r
- });\r
this.getContentPane().add(scrollPane, BorderLayout.CENTER);\r
jMenuBar1.add(jMenu1);\r
jMenuBar1.add(jMenu2);\r
jMenu2.add(distanceMenu);\r
jMenu2.add(bootstrapMenu);\r
jMenu2.add(placeholdersMenu);\r
- jMenu2.add(fullid);\r
saveAsMenu.add(saveAsNewick);\r
saveAsMenu.add(epsTree);\r
saveAsMenu.add(pngTree);\r