or to cross-reference other bioinformatics websites before retrieving
a sequence data in jalview. The underlying technology is provided by
EBI and is based on Apache Solr which is a text based search engine.</p>
-
<p>
The PDB Sequence Fetcher interface can be opened by selecting <strong>PDB</strong>
as the choice database from the <strong>'Select Database
Retrieval Source'</strong> interface of <a href="seqfetch.html">Sequence
Fetcher</a>.
</p>
- <br>
-
- <img src="pdbseqfetcher.png" align="left"
- alt="PDB sequence fetcher (introduced in Jalview 2.x.x)">
-
- <br>
<p>
- <strong>Searching the PDB Database</strong><br> Once the
- interface is opened, typing in the search text box will execute a live
- query to the PDB database and display the results on-the-fly as seen
- in the screen-shot above. Use the drop-down menu to select a specific
- field to search by in the PDB database, the default option is <strong>'ALL'</strong>.
- Furthermore, the PDB search interface also provides the following
- functionalities:
+ <img src="pdbseqfetcher.png" align="left"
+ alt="PDB sequence fetcher (introduced in Jalview 2.x.x)">
+ </p>
+
+ <strong>Searching the PDB Database</strong>
+ <br> Once the interface is opened, typing in the search text box
+ will execute a live query to the PDB database and display the results
+ on-the-fly as seen in the screen-shot above. Use the drop-down menu to
+ select a specific field to search by in the PDB database, the default
+ option is
+ <strong>'ALL'</strong>. Furthermore, the PDB search interface also
+ provides the following functionalities:
<ul>
<li>Retrieving a unique chain for a PDB entry: <br>To
retrieve a specific chain for a PDB entry, append the PDB ID with a
entry.setProperty(new Hashtable());
if (chains.elementAt(i).id != null)
{
- entry.getProperty().put("CHAIN", chains.elementAt(i).id);
+ // entry.getProperty().put("CHAIN", chains.elementAt(i).id);
+ entry.setChainCode(String.valueOf(chains.elementAt(i).id));
}
if (inFile != null)
{
public class PDBEntry
{
- String file;
+ private String file;
- String type;
+ private String type;
- String id;
+ private String id;
+ private String chainCode;
+
+ public enum Type
+ {
+ PDB, FILE
+ }
Hashtable properties;
/*
return true;
}
PDBEntry o = (PDBEntry) obj;
- return (file == o.file || (file != null && o.file != null && o.file
- .equals(file)))
- && (type == o.type || (type != null && o.type != null && o.type
+ return /*
+ * (file == o.file || (file != null && o.file != null && o.file
+ * .equals(file))) &&
+ */
+ (type == o.type || (type != null && o.type != null && o.type
.equals(type)))
&& (id == o.id || (id != null && o.id != null && o.id
.equalsIgnoreCase(id)))
+ && (chainCode == o.chainCode || (chainCode != null
+ && o.chainCode != null && o.chainCode
+ .equalsIgnoreCase(chainCode)))
&& (properties == o.properties || (properties != null
&& o.properties != null && properties
.equals(o.properties)));
*
* @param filePath
*/
- public PDBEntry(String filePath, String pdbId)
+ // public PDBEntry(String filePath, String pdbId)
+ // {
+ // this.file = filePath;
+ // this.id = pdbId;
+ // }
+
+ public PDBEntry(String pdbId, String chain, PDBEntry.Type type,
+ String filePath)
{
- this.file = filePath;
this.id = pdbId;
+ this.chainCode = chain;
+ this.type = type.toString();
+ this.file = filePath;
}
-
+
/**
* Copy constructor.
*
file = entry.file;
type = entry.type;
id = entry.id;
+ chainCode = entry.chainCode;
if (entry.properties != null)
{
properties = (Hashtable) entry.properties.clone();
return file;
}
- public void setType(String type)
+ public void setType(PDBEntry.Type type)
{
- this.type = type;
+ this.type = type.toString();
}
public String getType()
return properties;
}
+ public String getChainCode()
+ {
+ return chainCode;
+ }
+
+ public void setChainCode(String chainCode)
+ {
+ this.chainCode = chainCode;
+ }
+
}
*/
package jalview.datamodel;
+import jalview.analysis.AlignSeq;
+import jalview.util.StringUtils;
+
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import fr.orsay.lri.varna.models.rna.RNA;
-import jalview.analysis.AlignSeq;
-import jalview.util.StringUtils;
-
/**
*
* Implements the SequenceI interface for a char[] based sequence object.
{
pdbIds = new Vector<PDBEntry>();
}
- if (!pdbIds.contains(entry))
+ if (pdbIds.contains(entry))
+ {
+ updatePDBEntry(pdbIds.get(pdbIds.indexOf(entry)), entry);
+ }
+ else
{
pdbIds.addElement(entry);
}
}
+ private static void updatePDBEntry(PDBEntry oldEntry, PDBEntry newEntry)
+ {
+ if (newEntry.getFile() != null)
+ {
+ oldEntry.setFile(newEntry.getFile());
+ }
+ }
+
/**
* DOCUMENT ME!
*
pdbe.setId(getDataName());
sq.addPDBId(pdbe);
pdbe.setProperty(new Hashtable());
- pdbe.getProperty().put("CHAIN", "" + _lastChainId);
+ // pdbe.getProperty().put("CHAIN", "" + _lastChainId);
+ pdbe.setChainCode(String.valueOf(_lastChainId));
// JAL-1533
// Need to put the number of models for this polymer somewhere for Chimera/others to grab
// pdbe.getProperty().put("PDBMODELS", biopoly.)
*/
package jalview.gui;
+import jalview.bin.Cache;
+import jalview.datamodel.Alignment;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.ColumnSelection;
+import jalview.datamodel.PDBEntry;
+import jalview.datamodel.SequenceI;
+import jalview.io.AppletFormatAdapter;
+import jalview.io.JalviewFileChooser;
+import jalview.io.JalviewFileView;
+import jalview.schemes.BuriedColourScheme;
+import jalview.schemes.ColourSchemeI;
+import jalview.schemes.HelixColourScheme;
+import jalview.schemes.HydrophobicColourScheme;
+import jalview.schemes.PurinePyrimidineColourScheme;
+import jalview.schemes.StrandColourScheme;
+import jalview.schemes.TaylorColourScheme;
+import jalview.schemes.TurnColourScheme;
+import jalview.schemes.ZappoColourScheme;
+import jalview.structures.models.AAStructureBindingModel;
+import jalview.util.MessageManager;
+import jalview.util.Platform;
+
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.event.MenuEvent;
import javax.swing.event.MenuListener;
-import jalview.bin.Cache;
-import jalview.datamodel.Alignment;
-import jalview.datamodel.AlignmentI;
-import jalview.datamodel.ColumnSelection;
-import jalview.datamodel.PDBEntry;
-import jalview.datamodel.SequenceI;
-import jalview.io.AppletFormatAdapter;
-import jalview.io.JalviewFileChooser;
-import jalview.io.JalviewFileView;
-import jalview.schemes.BuriedColourScheme;
-import jalview.schemes.ColourSchemeI;
-import jalview.schemes.HelixColourScheme;
-import jalview.schemes.HydrophobicColourScheme;
-import jalview.schemes.PurinePyrimidineColourScheme;
-import jalview.schemes.StrandColourScheme;
-import jalview.schemes.TaylorColourScheme;
-import jalview.schemes.TurnColourScheme;
-import jalview.schemes.ZappoColourScheme;
-import jalview.structures.models.AAStructureBindingModel;
-import jalview.util.MessageManager;
-import jalview.util.Platform;
-
public class AppJmol extends StructureViewerBase
{
AppJmolBinding jmb;
PDBEntry[] pdbentrys = new PDBEntry[files.length];
for (int i = 0; i < pdbentrys.length; i++)
{
- PDBEntry pdbentry = new PDBEntry(files[i], ids[i]);
+ // PDBEntry pdbentry = new PDBEntry(files[i], ids[i]);
+ PDBEntry pdbentry = new PDBEntry(ids[i], null, PDBEntry.Type.PDB,
+ files[i]);
pdbentrys[i] = pdbentry;
}
// / TODO: check if protocol is needed to be set, and if chains are
{
// just transfer the file name from the first sequence's first
// PDBEntry
- file = new File(((PDBEntry) pdbseq.getSequenceAt(0).getPDBId()
- .elementAt(0)).getFile()).getAbsolutePath();
+ file = new File(pdbseq.getSequenceAt(0).getPDBId()
+ .elementAt(0).getFile()).getAbsolutePath();
jmb.getPdbEntry(pi).setFile(file);
files.append(" \"" + Platform.escapeString(file) + "\"");
{
entry.setId(pdbfile.id);
}
+ entry.setType(PDBEntry.Type.FILE);
if (pdbfile != null)
{
*/
package jalview.gui;
-import java.awt.Rectangle;
-import java.io.BufferedReader;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.io.PrintWriter;
-import java.lang.reflect.InvocationTargetException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.IdentityHashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.StringTokenizer;
-import java.util.Vector;
-import java.util.jar.JarEntry;
-import java.util.jar.JarInputStream;
-import java.util.jar.JarOutputStream;
-
-import javax.swing.JInternalFrame;
-import javax.swing.JOptionPane;
-import javax.swing.SwingUtilities;
-
-import org.exolab.castor.xml.Unmarshaller;
-
import jalview.api.structures.JalviewStructureDisplayI;
import jalview.bin.Cache;
import jalview.datamodel.AlignedCodonFrame;
import jalview.ws.params.AutoCalcSetting;
import jalview.ws.params.WsParamSetI;
+import java.awt.Rectangle;
+import java.io.BufferedReader;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.lang.reflect.InvocationTargetException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Hashtable;
+import java.util.IdentityHashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import java.util.StringTokenizer;
+import java.util.Vector;
+import java.util.jar.JarEntry;
+import java.util.jar.JarInputStream;
+import java.util.jar.JarOutputStream;
+
+import javax.swing.JInternalFrame;
+import javax.swing.JOptionPane;
+import javax.swing.SwingUtilities;
+
+import org.exolab.castor.xml.Unmarshaller;
+
/**
* Write out the current jalview desktop state as a Jalview XML stream.
*
{
jalview.datamodel.PDBEntry entry = new jalview.datamodel.PDBEntry();
entry.setId(ids[p].getId());
- entry.setType(ids[p].getType());
+ if (ids[p].getType() != null)
+ {
+ if (ids[p].getType().equalsIgnoreCase("PDB"))
+ {
+ entry.setType(PDBEntry.Type.PDB);
+ }
+ else
+ {
+ entry.setType(PDBEntry.Type.FILE);
+ }
+ }
if (ids[p].getFile() != null)
{
if (!pdbloaded.containsKey(ids[p].getFile()))
{
String filePath = pdb.getValue().getFilePath();
String pdbId = pdb.getValue().getPdbId();
- pdbs.add(new PDBEntry(filePath, pdbId));
+ // pdbs.add(new PDBEntry(filePath, pdbId));
+ pdbs.add(new PDBEntry(pdbId, null, PDBEntry.Type.PDB, filePath));
final List<SequenceI> seqList = pdb.getValue().getSeqList();
SequenceI[] seqs = seqList.toArray(new SequenceI[seqList.size()]);
allseqs.add(seqs);
import jalview.binding.Tree;
import jalview.binding.UserColours;
import jalview.binding.Viewport;
+import jalview.datamodel.PDBEntry;
import jalview.schemes.ColourSchemeI;
import jalview.schemes.ColourSchemeProperty;
import jalview.schemes.ResidueProperties;
{
jalview.datamodel.PDBEntry entry = new jalview.datamodel.PDBEntry();
entry.setId(ids[p].getId());
- entry.setType(ids[p].getType());
+ if (ids[p].getType() != null)
+ {
+ if (ids[p].getType().equalsIgnoreCase("PDB"))
+ {
+ entry.setType(PDBEntry.Type.PDB);
+ }
+ else
+ {
+ entry.setType(PDBEntry.Type.FILE);
+ }
+ }
al.getSequenceAt(i).getDatasetSequence().addPDBId(entry);
StructureSelectionManager.getStructureSelectionManager(
Desktop.instance).registerPDBEntry(entry);
DefaultTableModel tableModel = new DefaultTableModel();
tableModel.addColumn("Sequence");
tableModel.addColumn("PDB Id");
+ tableModel.addColumn("Chain");
tableModel.addColumn("Type");
tableModel.addColumn("File");
cachedEntryMap = new Hashtable<String, PDBEntry>();
{
for (PDBEntry pdbEntry : seq.getDatasetSequence().getPDBId())
{
+ String chain = pdbEntry.getChainCode() == null ? "_" : pdbEntry
+ .getChainCode();
String[] pdbEntryRowData = new String[]
- { seq.getDisplayId(false), pdbEntry.getId(), pdbEntry.getType(),
+ { seq.getDisplayId(false), pdbEntry.getId(),
+ chain,
+ pdbEntry.getType(),
pdbEntry.getFile() };
tableModel.addRow(pdbEntryRowData);
cachedEntryMap.put(seq.getDisplayId(false) + pdbEntry.getId(),
{
PDBEntry newEntry = new PDBEntry();
newEntry.setId(response.getPdbId());
- newEntry.setType("PDB");
+ newEntry.setType(PDBEntry.Type.PDB);
seq.getDatasetSequence().addPDBId(newEntry);
}
}
.toString();
PDBEntry pdbEntry = new PDBEntry();
pdbEntry.setId(pdbIdStr);
- pdbEntry.setType("PDB");
+ pdbEntry.setType(PDBEntry.Type.PDB);
pdbEntriesToView[count++] = pdbEntry;
}
}
PDBEntry pdbEntry = new PDBEntry();
pdbEntry.setId(txt_search.getText());
- pdbEntry.setType("PDB");
+ pdbEntry.setType(PDBEntry.Type.PDB);
selectedSequence.getDatasetSequence().addPDBId(pdbEntry);
PDBEntry[] pdbEntriesToView = new PDBEntry[]
{ pdbEntry };
*/
package jalview.util;
+import jalview.datamodel.DBRefEntry;
+import jalview.datamodel.DBRefSource;
+import jalview.datamodel.PDBEntry;
+import jalview.datamodel.SequenceI;
+
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Hashtable;
import com.stevesoft.pat.Regex;
-import jalview.datamodel.DBRefEntry;
-import jalview.datamodel.DBRefSource;
-import jalview.datamodel.PDBEntry;
-import jalview.datamodel.SequenceI;
-
public class DBRefUtils
{
private static Map<String, String> canonicalSourceNameLookup = new HashMap<String, String>();
ref = new DBRefEntry(locsrc, version, pdbid + chaincode);
PDBEntry pdbr = new PDBEntry();
pdbr.setId(pdbid);
+ pdbr.setType(PDBEntry.Type.PDB);
pdbr.setProperty(new Hashtable());
- pdbr.getProperty().put("CHAIN", chaincode);
+ pdbr.setChainCode(chaincode);
+ // pdbr.getProperty().put("CHAIN", chaincode);
seq.addPDBId(pdbr);
} else {
System.err.println("Malformed PDB DR line:"+acn);
--- /dev/null
+package jalview.datamodel;
+
+import static org.junit.Assert.assertTrue;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class PDBEntryTest
+{
+
+ @Before
+ public void setUp() throws Exception
+ {
+ }
+
+ @After
+ public void tearDown() throws Exception
+ {
+ }
+
+ @Test
+ public void test()
+ {
+ PDBEntry pdbEntry = new PDBEntry("1xyz", "A", PDBEntry.Type.PDB,
+ "x/y/z/File");
+
+ PDBEntry case1 = new PDBEntry("1XYZ", "A", PDBEntry.Type.PDB,
+ "x/y/z/File");
+ PDBEntry case2 = new PDBEntry("1xyz", "a", PDBEntry.Type.PDB,
+ "x/y/z/File");
+ PDBEntry case3 = new PDBEntry("1xyz", "A", PDBEntry.Type.FILE,
+ "x/y/z/File");
+ PDBEntry case4 = new PDBEntry(null, null, null, null);
+ PDBEntry case5 = new PDBEntry(null, "A", PDBEntry.Type.PDB,
+ "x/y/z/File");
+ PDBEntry case6 = new PDBEntry("1xyz", null, PDBEntry.Type.PDB,
+ "x/y/z/File");
+ PDBEntry case7 = new PDBEntry("1xyz", "A", null, "x/y/z/File");
+ PDBEntry case8 = new PDBEntry("1xyz", "A", PDBEntry.Type.PDB, null);
+
+ System.out.println(">>>> Testing case 1");
+ assertTrue(pdbEntry.equals(case1));
+ System.out.println(">>>> Testing case 2");
+ assertTrue(pdbEntry.equals(case2));
+ System.out.println(">>>> Testing case 3");
+ assertTrue(!pdbEntry.equals(case3));
+ System.out.println(">>>> Testing case 4");
+ assertTrue(!pdbEntry.equals(case4));
+ System.out.println(">>>> Testing case 5");
+ assertTrue(!pdbEntry.equals(case5));
+ System.out.println(">>>> Testing case 6");
+ assertTrue(!pdbEntry.equals(case6));
+ System.out.println(">>>> Testing case 7");
+ assertTrue(!pdbEntry.equals(case7));
+ System.out.println(">>>> Testing case 8");
+ assertTrue(pdbEntry.equals(case8));
+
+ }
+
+}