else
{
- // boolean baseDetected = false;
- // for (Atom resAtom : resAtoms)
- // {
- // if (resAtom.insCode == ' ')
- // {
- // baseDetected = true;
- // }
- // }
- // if (!baseDetected)
- // {
- // continue;
- // }
// Make a new Residue object with the new atoms vector
residues.addElement(new Residue(resAtoms, resNumber - 1, count));
SequenceFeature sf = new SequenceFeature("RESNUM", tmpat.resName
+ ":" + tmpat.resNumIns + " " + pdbid + id, "", offset
+ count, offset + count, pdbid);
- // MCview.PDBChain.PDBFILEFEATURE);
resFeatures.addElement(sf);
resAnnotation.addElement(new Annotation(tmpat.tfactor));
// Keep totting up the sequence
package jalview.bin;
import jalview.datamodel.DBRefSource;
-import jalview.ws.dbsources.Pdb;
+import jalview.structure.StructureViewSettings;
import jalview.ws.dbsources.das.api.DasSourceRegistryI;
import jalview.ws.dbsources.das.datamodel.DasSourceRegistry;
import jalview.ws.sifts.SiftsSettings;
System.out
.println("Jalview Version: " + codeVersion + codeInstallation);
- Pdb.setCurrentDefaultFormat(jalview.bin.Cache.getDefault(
+ StructureViewSettings.setCurrentDefaultFormat(jalview.bin.Cache
+ .getDefault(
"DEFAULT_STRUCTURE_FORMAT", DEFAULT_STRUCTURE_FORMAT));
// jnlpVersion will be null if we're using InstallAnywhere
// Dont do this check if running in headless mode
List<Atom> significantAtoms = new ArrayList<Atom>();
for (org.jmol.modelset.Atom atom : ms.at)
{
+ System.out.println("Seq Id : " + atom.getSeqID());
+ System.out.println("To String : " + atom.toString());
+ if (atom.isHetero())
+ {
+ continue;
+ }
if (atom.getAtomName().equalsIgnoreCase("CA")
|| atom.getAtomName().equalsIgnoreCase("P"))
{
{
// TODO obtain config value from preference settings.
// Set value to 'true' to test PDB processing with Jmol: JAL-1213
- boolean isParseWithJMOL = false;
+ boolean isParseWithJMOL = !StructureViewSettings
+ .getCurrentDefaultFormat().equalsIgnoreCase("PDB");
if (isParseWithJMOL)
{
StructureViewSettings.addSettings(annotFromStructure,
}
else
{
+ StructureViewSettings.addSettings(annotFromStructure,
+ localSecondaryStruct, serviceSecondaryStruct);
StructureViewSettings.setShowSeqFeatures(true);
alignFile = new MCview.PDBfile(annotFromStructure,
localSecondaryStruct, serviceSecondaryStruct, inFile,
package jalview.structure;
+import jalview.datamodel.DBRefSource;
+
public class StructureViewSettings
{
private String dbRefType;
private static boolean showSeqFeatures = true;
+ private static String currentDefaultFormat = DBRefSource.PDB;
+
public static void addSettings(boolean addAlignmentAnnotations,
boolean predictSecStr, boolean externalSecStr)
{
StructureViewSettings.showSeqFeatures = showSeqFeatures;
}
+ public static String getCurrentDefaultFormat()
+ {
+ return currentDefaultFormat;
+ }
+
+ public static void setCurrentDefaultFormat(String currentDefaultFormat)
+ {
+ StructureViewSettings.currentDefaultFormat = currentDefaultFormat;
+ }
+
}
import jalview.datamodel.SequenceI;
import jalview.io.FormatAdapter;
import jalview.io.PDBFeatureSettings;
+import jalview.structure.StructureViewSettings;
import jalview.util.MessageManager;
import jalview.ws.ebi.EBIFetchClient;
public static final String FEATURE_RES_NUM = "RESNUM";
- private static String currentDefaultFormat = DBRefSource.PDB;
-
/*
* (non-Javadoc)
*
stopQuery();
return null;
}
- String ext = getCurrentDefaultFormat().equalsIgnoreCase("mmcif") ? ".cif"
+ String ext = StructureViewSettings.getCurrentDefaultFormat()
+ .equalsIgnoreCase("mmcif") ? ".cif"
: ".xml";
EBIFetchClient ebi = new EBIFetchClient();
file = ebi.fetchDataAsFile("pdb:" + id,
- getCurrentDefaultFormat().toLowerCase(), ext)
+ StructureViewSettings.getCurrentDefaultFormat().toLowerCase(),
+ ext)
.getAbsolutePath();
stopQuery();
if (file == null)
pdbAlignment = new FormatAdapter().readFile(file,
jalview.io.AppletFormatAdapter.FILE,
- getCurrentDefaultFormat());
+ StructureViewSettings.getCurrentDefaultFormat());
if (pdbAlignment != null)
{
List<SequenceI> toremove = new ArrayList<SequenceI>();
return 0;
}
- public static String getCurrentDefaultFormat()
- {
- return currentDefaultFormat;
- }
-
- public static void setCurrentDefaultFormat(String currentDefaultFomart)
- {
- Pdb.currentDefaultFormat = currentDefaultFomart;
- }
/**
* Returns a descriptor for suitable feature display settings with
import jalview.bin.Cache;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.SequenceI;
+import jalview.structure.StructureViewSettings;
import jalview.ws.seqfetcher.DbSourceProxy;
import java.util.List;
@Test(groups = { "Network" }, enabled = true)
public void testRnaSeqRetrieve() throws Exception
{
+ Cache.applicationProperties.setProperty("STRUCT_FROM_PDB",
+ Boolean.TRUE.toString());
+ Cache.applicationProperties.setProperty("DEFAULT_STRUCTURE_FORMAT",
+ "PDB");
List<DbSourceProxy> sps = sf.getSourceProxy("PDB");
AlignmentI response = sps.get(0).getSequenceRecords("2GIS");
assertTrue(response != null);
{
Cache.applicationProperties.setProperty("STRUCT_FROM_PDB",
Boolean.TRUE.toString());
+ StructureViewSettings.setCurrentDefaultFormat("PDB");
+
testRetrieveProteinSeqFromPDB();
}
public void testmmCifSeqRetrieve() throws Exception
{
Cache.applicationProperties.setProperty("STRUCT_FROM_PDB",
- Boolean.FALSE.toString());
+ Boolean.TRUE.toString());
+ StructureViewSettings.setCurrentDefaultFormat("mmCIF");
testRetrieveProteinSeqFromPDB();
}