import jalview.util.MessageManager;
import jalview.ws.dbsources.EBIAlfaFold;
import jalview.ws.dbsources.Pdb;
+import jalview.ws.utils.UrlDownloadClient;
/**
* Base class with common functionality for JMol, Chimera or other structure
{
pdbseq = afclient.getSequenceRecords(pdbid);
} else {
- pdbseq = pdbclient.getSequenceRecords(pdbid);
+ if (processingEntry.hasRetrievalUrl())
+ {
+ // retrieve from URL to new local tmpfile
+ File tmpFile = File.createTempFile(pdbid,
+ "." + (PDBEntry.Type.MMCIF.toString().equals(
+ processingEntry.getType().toString()) ? "cif"
+ : "pdb"));
+ String fromUrl = processingEntry.getRetrievalUrl();
+ UrlDownloadClient.download(fromUrl, tmpFile);
+
+ // may not need this check ?
+ String file = tmpFile.getAbsolutePath();
+ if (file != null)
+ {
+ pdbseq = EBIAlfaFold.importDownloadedStructureFromUrl(fromUrl,tmpFile,pdbid,null,null,null);
+ }
+ } else {
+ pdbseq = pdbclient.getSequenceRecords(pdbid);
+ }
}
} catch (Exception e)
{
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
+import java.util.Locale;
import java.util.Set;
import javax.swing.JTable;
{
pdbEntry = new PDBEntry();
pdbEntry.setId(pdbIdStr);
- pdbEntry.setType(PDBEntry.Type.MMCIF);
+ boolean hasCif = urlStr.toLowerCase(Locale.ENGLISH).endsWith("cif");
+ boolean probablyPdb = urlStr.toLowerCase(Locale.ENGLISH).contains("pdb");
+ pdbEntry.setType(hasCif ? PDBEntry.Type.MMCIF : probablyPdb ? PDBEntry.Type.PDB : PDBEntry.Type.FILE);
if (!"PDBe".equalsIgnoreCase(typeColumn))
{
pdbEntry.setRetrievalUrl(urlStr);