{
Viewer viewer = null;
- public JmolParser(boolean addAlignmentAnnotations, boolean predictSecStr,
- boolean externalSecStr, String inFile, String type)
+ public JmolParser(String inFile, String type)
throws IOException
{
super(inFile, type);
}
- public JmolParser(boolean addAlignmentAnnotations, boolean predictSecStr,
- boolean externalSecStr, FileParse fp) throws IOException
+ public JmolParser(FileParse fp) throws IOException
{
super(fp);
}
import jalview.datamodel.AlignmentI;
import jalview.datamodel.AlignmentView;
import jalview.datamodel.PDBEntry.Type;
+import jalview.ext.jmol.JmolParser;
import jalview.structure.StructureImportSettings;
import jalview.util.MessageManager;
alignFile = new JPredFile(inFile, type);
((JPredFile) alignFile).removeNonSequences();
}
- else if (format.equals("PDB"))
- {
-
- StructureImportSettings.addSettings(annotFromStructure,
- localSecondaryStruct, serviceSecondaryStruct);
- alignFile = new jalview.ext.jmol.JmolParser(annotFromStructure,
- localSecondaryStruct, serviceSecondaryStruct, inFile,
- type);
- ((StructureFile) alignFile).setDbRefType(format);
- }
- else if (format.equalsIgnoreCase("mmCIF"))
+ else if (format.equals("PDB") || format.equalsIgnoreCase("mmCIF"))
{
StructureImportSettings.addSettings(annotFromStructure,
localSecondaryStruct, serviceSecondaryStruct);
- alignFile = new jalview.ext.jmol.JmolParser(annotFromStructure,
- localSecondaryStruct, serviceSecondaryStruct, inFile, type);
+ alignFile = new JmolParser(inFile, type);
((StructureFile) alignFile).setDbRefType(format);
}
else if (format.equals("STH"))
{
StructureImportSettings.addSettings(annotFromStructure,
localSecondaryStruct, serviceSecondaryStruct);
- alignFile = new jalview.ext.jmol.JmolParser(annotFromStructure,
- localSecondaryStruct, serviceSecondaryStruct, source);
+ alignFile = new JmolParser(source);
}
else
{
{
StructureImportSettings.addSettings(annotFromStructure,
localSecondaryStruct, serviceSecondaryStruct);
- alignFile = new jalview.ext.jmol.JmolParser(annotFromStructure,
- localSecondaryStruct, serviceSecondaryStruct, source);
+ alignFile = new JmolParser(source);
((StructureFile) alignFile).setDbRefType(Type.MMCIF);
}
else if (format.equals("STH"))
Class cl = Class.forName("jalview.ext.jmol.JmolParser");
if (cl != null)
{
- final Constructor constructor = cl.getConstructor(new Class[] {
- boolean.class, boolean.class, boolean.class, FileParse.class });
- final Object[] args = new Object[] { visibleChainAnnotation,
- predictSecondaryStructure, externalSecondaryStructure,
- new FileParse(getDataName(), type) };
+ final Constructor constructor = cl
+ .getConstructor(new Class[] { FileParse.class });
+ final Object[] args = new Object[] { new FileParse(getDataName(),
+ type) };
StructureImportSettings.setShowSeqFeatures(false);
StructureImportSettings.setVisibleChainAnnotation(false);
import jalview.datamodel.PDBEntry;
import jalview.datamodel.SearchResults;
import jalview.datamodel.SequenceI;
+import jalview.ext.jmol.JmolParser;
import jalview.gui.IProgressIndicator;
import jalview.io.AppletFormatAdapter;
import jalview.io.StructureFile;
boolean isMapUsingSIFTs = SiftsSettings.isMapWithSifts();
try
{
- pdb = new jalview.ext.jmol.JmolParser(addTempFacAnnot, parseSecStr,
- secStructServices, pdbFile, protocol);
+ pdb = new JmolParser(pdbFile, protocol);
if (pdb.getId() != null && pdb.getId().trim().length() > 0
&& AppletFormatAdapter.FILE.equals(protocol))
import static org.testng.AssertJUnit.assertSame;
import static org.testng.AssertJUnit.assertTrue;
+import jalview.bin.Cache;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceI;
import jalview.io.AppletFormatAdapter;
+import jalview.structure.StructureImportSettings;
import java.io.IOException;
import java.util.List;
+import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
public class PDBfileTest
pf.addAnnotations(al);
return al.getAlignmentAnnotation();
}
+
+ //@formatter:on
+
+ @BeforeMethod(alwaysRun = true)
+ public void setUp()
+ {
+ Cache.loadProperties("test/jalview/io/testProps.jvprops");
+ Cache.applicationProperties.setProperty("STRUCT_FROM_PDB",
+ Boolean.TRUE.toString());
+ Cache.applicationProperties.setProperty("ADD_TEMPFACT_ANN",
+ Boolean.TRUE.toString());
+ Cache.applicationProperties.setProperty("ADD_SS_ANN",
+ Boolean.TRUE.toString());
+ StructureImportSettings.setDefaultStructureFileFormat("PDB");
+ }
}
{
PDBfile mctest = new PDBfile(false, false, false, pdbStr,
AppletFormatAdapter.FILE);
- JmolParser jtest = new JmolParser(false, false, false, pdbStr,
- jalview.io.AppletFormatAdapter.FILE);
+ JmolParser jtest = new JmolParser(pdbStr, AppletFormatAdapter.FILE);
Vector<SequenceI> seqs = jtest.getSeqs(), mcseqs = mctest.getSeqs();
assertTrue(
PDBfile mctest = new PDBfile(false, false, false,
pastePDBDataWithChainBreak,
AppletFormatAdapter.PASTE);
- boolean annotFromStructure = false;
- boolean localSecondaryStruct = false;
- boolean serviceSecondaryStruct = false;
- JmolParser jtest = new JmolParser(annotFromStructure,
- localSecondaryStruct, serviceSecondaryStruct,
- pastePDBDataWithChainBreak,
- jalview.io.AppletFormatAdapter.PASTE);
+ JmolParser jtest = new JmolParser(pastePDBDataWithChainBreak,
+ AppletFormatAdapter.PASTE);
Vector<SequenceI> seqs = jtest.getSeqs();
Vector<SequenceI> mcseqs = mctest.getSeqs();
{
PDBfile mctest = new PDBfile(false, false, false, pdbWithAltLoc,
AppletFormatAdapter.PASTE);
- boolean annotFromStructure = false;
- boolean localSecondaryStruct = false;
- boolean serviceSecondaryStruct = false;
- JmolParser jtest = new JmolParser(annotFromStructure,
- localSecondaryStruct, serviceSecondaryStruct, pdbWithAltLoc,
- jalview.io.AppletFormatAdapter.PASTE);
+ JmolParser jtest = new JmolParser(pdbWithAltLoc,
+ AppletFormatAdapter.PASTE);
Vector<SequenceI> seqs = jtest.getSeqs();
Vector<SequenceI> mcseqs = mctest.getSeqs();
{
mctest = new PDBfile(false, false, false, testFile,
AppletFormatAdapter.FILE);
- jtest = new JmolParser(false, false, false, testFile,
- jalview.io.AppletFormatAdapter.FILE);
+ jtest = new JmolParser(testFile, AppletFormatAdapter.FILE);
} catch (IOException e)
{
System.err.println("Exception thrown while parsing : " + pdbStr);