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-2344 corrected conversion of Type enum to FileFormat
[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
a07331a
..
68dda88
100644
(file)
--- a/
src/jalview/ws/dbsources/Pdb.java
+++ b/
src/jalview/ws/dbsources/Pdb.java
@@
-1,6
+1,7
@@
+
/*
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b2)
- * Copyright (C) 2015 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
*
* This file is part of Jalview.
*
@@
-28,6
+29,9
@@
import jalview.datamodel.DBRefSource;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.PDBEntry.Type;
import jalview.datamodel.SequenceI;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.PDBEntry.Type;
import jalview.datamodel.SequenceI;
+import jalview.io.DataSourceType;
+import jalview.io.FileFormat;
+import jalview.io.FileFormatI;
import jalview.io.FormatAdapter;
import jalview.io.PDBFeatureSettings;
import jalview.structure.StructureImportSettings;
import jalview.io.FormatAdapter;
import jalview.io.PDBFeatureSettings;
import jalview.structure.StructureImportSettings;
@@
-137,13
+141,12
@@
public class Pdb extends EbiFileRetrievedProxy
stopQuery();
return null;
}
stopQuery();
return null;
}
- String ext = StructureImportSettings.getDefaultStructureFileFormat()
- .equalsIgnoreCase(Type.MMCIF.toString()) ? ".cif" : ".xml";
+ Type pdbFileFormat = StructureImportSettings
+ .getDefaultStructureFileFormat();
+ String ext = "." + pdbFileFormat.getExtension();
EBIFetchClient ebi = new EBIFetchClient();
EBIFetchClient ebi = new EBIFetchClient();
- file = ebi.fetchDataAsFile(
- "pdb:" + id,
- StructureImportSettings.getDefaultStructureFileFormat()
- .toLowerCase(), ext).getAbsolutePath();
+ file = ebi.fetchDataAsFile("pdb:" + id, pdbFileFormat.getFormat(), ext)
+ .getAbsolutePath();
stopQuery();
if (file == null)
{
stopQuery();
if (file == null)
{
@@
-151,10
+154,12
@@
public class Pdb extends EbiFileRetrievedProxy
}
try
{
}
try
{
-
+ // todo get rid of Type and use FileFormatI instead?
+ // todo get rid of "ext" and just use "tmp"?
+ FileFormatI fileFormat = pdbFileFormat == Type.PDB ? FileFormat.PDB
+ : FileFormat.MMCif;
pdbAlignment = new FormatAdapter().readFile(file,
pdbAlignment = new FormatAdapter().readFile(file,
- jalview.io.AppletFormatAdapter.FILE,
- StructureImportSettings.getDefaultStructureFileFormat());
+ DataSourceType.FILE, fileFormat);
if (pdbAlignment != null)
{
List<SequenceI> toremove = new ArrayList<SequenceI>();
if (pdbAlignment != null)
{
List<SequenceI> toremove = new ArrayList<SequenceI>();