git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-2473 removed unused fields in JalviewDialog
[jalview.git]
/
src
/
jalview
/
ws
/
dbsources
/
Pdb.java
diff --git
a/src/jalview/ws/dbsources/Pdb.java
b/src/jalview/ws/dbsources/Pdb.java
index
0aae38f
..
982c399
100644
(file)
--- a/
src/jalview/ws/dbsources/Pdb.java
+++ b/
src/jalview/ws/dbsources/Pdb.java
@@
-38,9
+38,9
@@
import jalview.structure.StructureImportSettings;
import jalview.util.MessageManager;
import jalview.ws.ebi.EBIFetchClient;
import jalview.util.MessageManager;
import jalview.ws.ebi.EBIFetchClient;
+import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.ArrayList;
import java.util.List;
-import java.util.Vector;
import com.stevesoft.pat.Regex;
import com.stevesoft.pat.Regex;
@@
-142,12
+142,19
@@
public class Pdb extends EbiFileRetrievedProxy
stopQuery();
return null;
}
stopQuery();
return null;
}
+
+ /*
+ * ensure that an mmCIF format structure file is saved with extension.cif,
+ * because the Chimera "open" command recognises this extension
+ */
Type pdbFileFormat = StructureImportSettings
.getDefaultStructureFileFormat();
Type pdbFileFormat = StructureImportSettings
.getDefaultStructureFileFormat();
- String ext = "." + pdbFileFormat.getExtension();
+ String ext = pdbFileFormat.getExtension();
+ String fetchFormat = pdbFileFormat.getFormat();
+
EBIFetchClient ebi = new EBIFetchClient();
EBIFetchClient ebi = new EBIFetchClient();
- file = ebi.fetchDataAsFile("pdb:" + id, pdbFileFormat.getFormat(), ext)
- .getAbsolutePath();
+ File tmpFile = ebi.fetchDataAsFile("pdb:" + id, fetchFormat, ext);
+ file = tmpFile.getAbsolutePath();
stopQuery();
if (file == null)
{
stopQuery();
if (file == null)
{
@@
-155,9
+162,9
@@
public class Pdb extends EbiFileRetrievedProxy
}
try
{
}
try
{
- // convert Type.PDB/MMCIF to FileFormat.PDB/MMCIF
- // todo get rid of Type?
- FileFormatI fileFormat = FileFormat.valueOf(pdbFileFormat.toString());
+ // todo get rid of Type and use FileFormatI instead?
+ FileFormatI fileFormat = (pdbFileFormat == Type.PDB) ? FileFormat.PDB
+ : FileFormat.MMCif;
pdbAlignment = new FormatAdapter().readFile(file,
DataSourceType.FILE, fileFormat);
if (pdbAlignment != null)
pdbAlignment = new FormatAdapter().readFile(file,
DataSourceType.FILE, fileFormat);
if (pdbAlignment != null)