import jalview.datamodel.SequenceI;
import jalview.datamodel.StructureViewerModel;
import jalview.datamodel.StructureViewerModel.StructureData;
+import jalview.fts.service.alphafold.AlphafoldRestClient;
import jalview.gui.ImageExporter.ImageWriterI;
import jalview.gui.StructureViewer.ViewerType;
import jalview.structure.StructureCommand;
import jalview.util.Platform;
import jalview.ws.dbsources.EBIAlfaFold;
import jalview.ws.dbsources.Pdb;
+import jalview.ws.utils.UrlDownloadClient;
public class AppJmol extends StructureViewerBase
{
// todo: extract block as method and pull up (also ChimeraViewFrame)
// retrieve the pdb and store it locally
AlignmentI pdbseq = null;
- pdbid = jmb.getPdbEntry(pi).getId();
+ PDBEntry strucEntry = jmb.getPdbEntry(pi);
+ pdbid = strucEntry.getId();
long hdl = pdbid.hashCode() - System.currentTimeMillis();
setProgressMessage(MessageManager
.formatMessage("status.fetching_pdb", new String[]
{
pdbseq = afclient.getSequenceRecords(pdbid);
} else {
- pdbseq = pdbclient.getSequenceRecords(pdbid);
+ if (strucEntry.hasRetrievalUrl())
+ {
+ File tmpFile = File.createTempFile(pdbid, "cif");
+ String fromUrl = strucEntry.getRetrievalUrl();
+ UrlDownloadClient.download(fromUrl, tmpFile);
+
+ // may not need this check ?
+ file = tmpFile.getAbsolutePath();
+ if (file != null)
+ {
+ pdbseq = EBIAlfaFold.importDownloadedStructureFromUrl(fromUrl,tmpFile,pdbid,null,null,null);
+ }
+ } else {
+ pdbseq = pdbclient.getSequenceRecords(pdbid);
+ }
}
} catch (OutOfMemoryError oomerror)
{