-
- if (database.getSelectedItem().equals("PDB"))
- {
- // Parse out the ids from the structured names
- boolean errors = false;
- for (int i = 0; i < sequences.length; i++)
- {
- PDBEntry entry = new PDBEntry();
- com.stevesoft.pat.Regex idbits = new com.stevesoft.pat.Regex(
- "PDB\\|([0-9A-z]{4})\\|(.)");
- if (idbits.search(sequences[i].getName()))
- {
- String pdbid = idbits.substring(1);
- String pdbccode = idbits.substring(2);
- // Construct the PDBEntry
- entry.setId(pdbid);
- if (entry.getProperty() == null)
- entry.setProperty(new Hashtable());
- entry.getProperty().put("chains",
- pdbccode
- + "=" + sequences[i].getStart()
- + "-" + sequences[i].getEnd());
- sequences[i].getDatasetSequence().addPDBId(entry);
-
- // We make a DBRefEtntry because we have obtained the PDB file from a verifiable source
- // JBPNote - PDB DBRefEntry should also carry the chain and mapping information
- DBRefEntry dbentry = new DBRefEntry(jalview.datamodel.DBRefSource.PDB,"0",pdbid);
- sequences[i].getDatasetSequence().addDBRef(dbentry);
- }
- else
- {
- // don't add an entry for this chain, but this is probably a bug
- // that the user should know about.
- jalview.bin.Cache.log.warn(
- "No PDBEntry constructed for sequence " + i + " : " +
- sequences[i].getName());
- errors = true;
- }
- }
- if (errors)
- jalview.bin.Cache.log.warn(
- "Query string that resulted in PDBEntry construction failure was :\n" +
- textfield.getText());
- }
-