*/
package jalview.bin;
-import jalview.datamodel.DBRefSource;
import jalview.structure.StructureImportSettings;
import jalview.ws.dbsources.das.api.DasSourceRegistryI;
import jalview.ws.dbsources.das.datamodel.DasSourceRegistry;
private final static String DEFAULT_FAIL_SAFE_PID_THRESHOLD = "30";
- private final static String DEFAULT_STRUCTURE_FORMAT = DBRefSource.PDB;
+ private final static String DEFAULT_STRUCTURE_FORMAT = StructureImportSettings.MMCIF;
+
+ private final static String DEFAULT_PDB_FILE_PARSER = StructureImportSettings.JMOL_PARSER;
/**
* Initialises the Jalview Application Log
System.out
.println("Jalview Version: " + codeVersion + codeInstallation);
- StructureImportSettings.setCurrentDefaultFormat(jalview.bin.Cache
+ StructureImportSettings.setDefaultStructureFileFormat(jalview.bin.Cache
.getDefault(
"DEFAULT_STRUCTURE_FORMAT", DEFAULT_STRUCTURE_FORMAT));
-
+ StructureImportSettings
+ .setDefaultPDBFileParser(jalview.bin.Cache.getDefault(
+ "DEFAULT_PDB_FILE_PARSER", DEFAULT_PDB_FILE_PARSER));
StructureImportSettings.setProcessHETATMs(jalview.bin.Cache.getDefault(
"PROCESS_HETATM", false));
// jnlpVersion will be null if we're using InstallAnywhere
public static String PDB = "PDB";
/**
- * mmCIF Entry Code
- */
- public static String MMCIF = "mmCIF";
-
- /**
* EMBL ID
*/
public static String EMBL = "EMBL";
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.Annotation;
-import jalview.datamodel.DBRefSource;
import jalview.datamodel.SequenceI;
import jalview.io.FileParse;
import jalview.io.StructureFile;
@Override
public void parse() throws IOException
{
- String dataName = getDataName();
- if (dataName.endsWith(".cif"))
- {
- setDbRefType(DBRefSource.MMCIF);
- }
- else
- {
- setDbRefType(DBRefSource.PDB);
- }
setChains(new Vector<PDBChain>());
Viewer jmolModel = getJmolData();
jmolModel.openReader(getDataName(), getDataName(), getReader());
{
// TODO obtain config value from preference settings.
// Set value to 'true' to test PDB processing with Jmol: JAL-1213
- boolean isParseWithJMOL = !StructureImportSettings
- .getCurrentDefaultFormat().equalsIgnoreCase("PDB");
+ boolean isParseWithJMOL = StructureImportSettings
+ .getDefaultPDBFileParser().equalsIgnoreCase(
+ StructureImportSettings.JMOL_PARSER);
if (isParseWithJMOL)
{
StructureImportSettings.addSettings(annotFromStructure,
localSecondaryStruct, serviceSecondaryStruct, inFile,
type);
}
+ ((StructureFile) alignFile).setDbRefType(format);
}
else if (format.equals("mmCIF"))
{
localSecondaryStruct, serviceSecondaryStruct);
alignFile = new jalview.ext.jmol.JmolParser(annotFromStructure,
localSecondaryStruct, serviceSecondaryStruct, inFile, type);
+ ((StructureFile) alignFile).setDbRefType(format);
}
else if (format.equals("STH"))
{
alignFile = new MCview.PDBfile(annotFromStructure,
localSecondaryStruct, serviceSecondaryStruct, source);
}
+ ((StructureFile) alignFile)
+ .setDbRefType(StructureImportSettings.PDB);
}
else if (format.equals("mmCIF"))
{
localSecondaryStruct, serviceSecondaryStruct);
alignFile = new jalview.ext.jmol.JmolParser(annotFromStructure,
localSecondaryStruct, serviceSecondaryStruct, source);
+ ((StructureFile) alignFile)
+ .setDbRefType(StructureImportSettings.MMCIF);
}
else if (format.equals("STH"))
{
private static boolean processHETATMs = false;
- private static String currentDefaultFormat = DBRefSource.PDB;
+ public static final String JMOL_PARSER = "JMolParser";
+ public static final String JALVIEW_PARSER = "JalViewParser";
+
+ public static final String MMCIF = "mmCIF";
+
+ public static final String PDB = "PDB";
+
+ /**
+ * Determines the default file format for structure files to be downloaded
+ * from the PDB sequence fetcher. Possible options include: PDB|mmCIF
+ */
+ private static String defaultStructureFileFormat = DBRefSource.PDB;
+
+ /**
+ * Determines the parser used for parsing PDB format file. Possible options
+ * are : JMolParser|JalveiwParser
+ */
+ private static String defaultPDBFileParser = JMOL_PARSER;
public static void addSettings(boolean addAlignmentAnnotations,
boolean predictSecStr, boolean externalSecStr)
{
StructureImportSettings.showSeqFeatures = showSeqFeatures;
}
- public static String getCurrentDefaultFormat()
+ public static String getDefaultStructureFileFormat()
{
- return currentDefaultFormat;
+ return defaultStructureFileFormat;
}
- public static void setCurrentDefaultFormat(String currentDefaultFormat)
+ public static void setDefaultStructureFileFormat(
+ String defaultStructureFileFormat)
{
- StructureImportSettings.currentDefaultFormat = currentDefaultFormat;
+ StructureImportSettings.defaultStructureFileFormat = defaultStructureFileFormat;
}
public static boolean isProcessHETATMs()
StructureImportSettings.processHETATMs = processHETATMs;
}
+ public static String getDefaultPDBFileParser()
+ {
+ return defaultPDBFileParser;
+ }
+
+ public static void setDefaultPDBFileParser(String defaultPDBFileParser)
+ {
+ StructureImportSettings.defaultPDBFileParser = defaultPDBFileParser;
+ }
+
}
stopQuery();
return null;
}
- String ext = StructureImportSettings.getCurrentDefaultFormat()
+ String ext = StructureImportSettings.getDefaultStructureFileFormat()
.equalsIgnoreCase("mmcif") ? ".cif"
: ".xml";
EBIFetchClient ebi = new EBIFetchClient();
file = ebi.fetchDataAsFile("pdb:" + id,
- StructureImportSettings.getCurrentDefaultFormat().toLowerCase(),
+ StructureImportSettings.getDefaultStructureFileFormat().toLowerCase(),
ext)
.getAbsolutePath();
stopQuery();
pdbAlignment = new FormatAdapter().readFile(file,
jalview.io.AppletFormatAdapter.FILE,
- StructureImportSettings.getCurrentDefaultFormat());
+ StructureImportSettings.getDefaultStructureFileFormat());
if (pdbAlignment != null)
{
List<SequenceI> toremove = new ArrayList<SequenceI>();
Boolean.TRUE.toString());
Cache.applicationProperties.setProperty("ADD_SS_ANN",
Boolean.TRUE.toString());
+ StructureImportSettings.setDefaultStructureFileFormat("PDB");
+ StructureImportSettings
+ .setDefaultPDBFileParser(StructureImportSettings.JALVIEW_PARSER);
}
@Test(groups = { "Functional" })
al = af.getViewport().getAlignment();
pdbId = al.getSequenceAt(0).getDatasetSequence().getAllPDBEntries()
.get(0).getId();
- StructureImportSettings.setCurrentDefaultFormat("PDB");
+ StructureImportSettings.setDefaultStructureFileFormat("PDB");
+ StructureImportSettings
+ .setDefaultPDBFileParser(StructureImportSettings.JALVIEW_PARSER);
}
@Test(groups = { "Functional" })
{
Cache.applicationProperties.setProperty("STRUCT_FROM_PDB",
Boolean.TRUE.toString());
- StructureImportSettings.setCurrentDefaultFormat("PDB");
+ StructureImportSettings.setDefaultStructureFileFormat("PDB");
+ StructureImportSettings
+ .setDefaultPDBFileParser(StructureImportSettings.JALVIEW_PARSER);
testRetrieveProteinSeqFromPDB();
}
{
Cache.applicationProperties.setProperty("STRUCT_FROM_PDB",
Boolean.TRUE.toString());
- StructureImportSettings.setCurrentDefaultFormat("mmCIF");
+ StructureImportSettings.setDefaultStructureFileFormat("mmCIF");
testRetrieveProteinSeqFromPDB();
}