git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f7d70c3
)
JAL-1919 updated PDBSequenceFetcherTest and JMol parser config settings to enable...
author
tcofoegbu
<tcnofoegbu@dundee.ac.uk>
Thu, 30 Jun 2016 09:46:51 +0000
(10:46 +0100)
committer
tcofoegbu
<tcnofoegbu@dundee.ac.uk>
Thu, 30 Jun 2016 09:46:51 +0000
(10:46 +0100)
src/MCview/PDBChain.java
patch
|
blob
|
history
src/jalview/bin/Cache.java
patch
|
blob
|
history
src/jalview/ext/jmol/JmolParser.java
patch
|
blob
|
history
src/jalview/io/AppletFormatAdapter.java
patch
|
blob
|
history
src/jalview/structure/StructureViewSettings.java
patch
|
blob
|
history
src/jalview/ws/dbsources/Pdb.java
patch
|
blob
|
history
test/jalview/ws/PDBSequenceFetcherTest.java
patch
|
blob
|
history
diff --git
a/src/MCview/PDBChain.java
b/src/MCview/PDBChain.java
index
3b84ee3
..
073772a
100755
(executable)
--- a/
src/MCview/PDBChain.java
+++ b/
src/MCview/PDBChain.java
@@
-357,18
+357,6
@@
public class PDBChain
else
{
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));
// Make a new Residue object with the new atoms vector
residues.addElement(new Residue(resAtoms, resNumber - 1, count));
@@
-378,7
+366,6
@@
public class PDBChain
SequenceFeature sf = new SequenceFeature("RESNUM", tmpat.resName
+ ":" + tmpat.resNumIns + " " + pdbid + id, "", offset
+ count, offset + count, pdbid);
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
resFeatures.addElement(sf);
resAnnotation.addElement(new Annotation(tmpat.tfactor));
// Keep totting up the sequence
diff --git
a/src/jalview/bin/Cache.java
b/src/jalview/bin/Cache.java
index
38aa55f
..
dde67de
100755
(executable)
--- a/
src/jalview/bin/Cache.java
+++ b/
src/jalview/bin/Cache.java
@@
-21,7
+21,7
@@
package jalview.bin;
import jalview.datamodel.DBRefSource;
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;
import jalview.ws.dbsources.das.api.DasSourceRegistryI;
import jalview.ws.dbsources.das.datamodel.DasSourceRegistry;
import jalview.ws.sifts.SiftsSettings;
@@
-426,7
+426,8
@@
public class Cache
System.out
.println("Jalview Version: " + codeVersion + codeInstallation);
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
"DEFAULT_STRUCTURE_FORMAT", DEFAULT_STRUCTURE_FORMAT));
// jnlpVersion will be null if we're using InstallAnywhere
// Dont do this check if running in headless mode
diff --git
a/src/jalview/ext/jmol/JmolParser.java
b/src/jalview/ext/jmol/JmolParser.java
index
0cbd620
..
31ed1b7
100644
(file)
--- a/
src/jalview/ext/jmol/JmolParser.java
+++ b/
src/jalview/ext/jmol/JmolParser.java
@@
-206,6
+206,12
@@
public class JmolParser extends StructureFile implements JmolStatusListener
List<Atom> significantAtoms = new ArrayList<Atom>();
for (org.jmol.modelset.Atom atom : ms.at)
{
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"))
{
if (atom.getAtomName().equalsIgnoreCase("CA")
|| atom.getAtomName().equalsIgnoreCase("P"))
{
diff --git
a/src/jalview/io/AppletFormatAdapter.java
b/src/jalview/io/AppletFormatAdapter.java
index
1a639f1
..
42a8ead
100755
(executable)
--- a/
src/jalview/io/AppletFormatAdapter.java
+++ b/
src/jalview/io/AppletFormatAdapter.java
@@
-280,7
+280,8
@@
public class AppletFormatAdapter
{
// TODO obtain config value from preference settings.
// Set value to 'true' to test PDB processing with Jmol: JAL-1213
{
// 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,
if (isParseWithJMOL)
{
StructureViewSettings.addSettings(annotFromStructure,
@@
-291,6
+292,8
@@
public class AppletFormatAdapter
}
else
{
}
else
{
+ StructureViewSettings.addSettings(annotFromStructure,
+ localSecondaryStruct, serviceSecondaryStruct);
StructureViewSettings.setShowSeqFeatures(true);
alignFile = new MCview.PDBfile(annotFromStructure,
localSecondaryStruct, serviceSecondaryStruct, inFile,
StructureViewSettings.setShowSeqFeatures(true);
alignFile = new MCview.PDBfile(annotFromStructure,
localSecondaryStruct, serviceSecondaryStruct, inFile,
diff --git
a/src/jalview/structure/StructureViewSettings.java
b/src/jalview/structure/StructureViewSettings.java
index
2fcb3e5
..
5880d0f
100644
(file)
--- a/
src/jalview/structure/StructureViewSettings.java
+++ b/
src/jalview/structure/StructureViewSettings.java
@@
-1,5
+1,7
@@
package jalview.structure;
package jalview.structure;
+import jalview.datamodel.DBRefSource;
+
public class StructureViewSettings
{
private String dbRefType;
public class StructureViewSettings
{
private String dbRefType;
@@
-24,6
+26,8
@@
public class StructureViewSettings
private static boolean showSeqFeatures = true;
private static boolean showSeqFeatures = true;
+ private static String currentDefaultFormat = DBRefSource.PDB;
+
public static void addSettings(boolean addAlignmentAnnotations,
boolean predictSecStr, boolean externalSecStr)
{
public static void addSettings(boolean addAlignmentAnnotations,
boolean predictSecStr, boolean externalSecStr)
{
@@
-76,4
+80,14
@@
public class StructureViewSettings
StructureViewSettings.showSeqFeatures = showSeqFeatures;
}
StructureViewSettings.showSeqFeatures = showSeqFeatures;
}
+ public static String getCurrentDefaultFormat()
+ {
+ return currentDefaultFormat;
+ }
+
+ public static void setCurrentDefaultFormat(String currentDefaultFormat)
+ {
+ StructureViewSettings.currentDefaultFormat = currentDefaultFormat;
+ }
+
}
}
diff --git
a/src/jalview/ws/dbsources/Pdb.java
b/src/jalview/ws/dbsources/Pdb.java
index
b0b5e92
..
d3a6238
100644
(file)
--- a/
src/jalview/ws/dbsources/Pdb.java
+++ b/
src/jalview/ws/dbsources/Pdb.java
@@
-30,6
+30,7
@@
import jalview.datamodel.PDBEntry;
import jalview.datamodel.SequenceI;
import jalview.io.FormatAdapter;
import jalview.io.PDBFeatureSettings;
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;
import jalview.util.MessageManager;
import jalview.ws.ebi.EBIFetchClient;
@@
-54,8
+55,6
@@
public class Pdb extends EbiFileRetrievedProxy
public static final String FEATURE_RES_NUM = "RESNUM";
public static final String FEATURE_RES_NUM = "RESNUM";
- private static String currentDefaultFormat = DBRefSource.PDB;
-
/*
* (non-Javadoc)
*
/*
* (non-Javadoc)
*
@@
-133,11
+132,13
@@
public class Pdb extends EbiFileRetrievedProxy
stopQuery();
return null;
}
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,
: ".xml";
EBIFetchClient ebi = new EBIFetchClient();
file = ebi.fetchDataAsFile("pdb:" + id,
- getCurrentDefaultFormat().toLowerCase(), ext)
+ StructureViewSettings.getCurrentDefaultFormat().toLowerCase(),
+ ext)
.getAbsolutePath();
stopQuery();
if (file == null)
.getAbsolutePath();
stopQuery();
if (file == null)
@@
-149,7
+150,7
@@
public class Pdb extends EbiFileRetrievedProxy
pdbAlignment = new FormatAdapter().readFile(file,
jalview.io.AppletFormatAdapter.FILE,
pdbAlignment = new FormatAdapter().readFile(file,
jalview.io.AppletFormatAdapter.FILE,
- getCurrentDefaultFormat());
+ StructureViewSettings.getCurrentDefaultFormat());
if (pdbAlignment != null)
{
List<SequenceI> toremove = new ArrayList<SequenceI>();
if (pdbAlignment != null)
{
List<SequenceI> toremove = new ArrayList<SequenceI>();
@@
-264,15
+265,6
@@
public class Pdb extends EbiFileRetrievedProxy
return 0;
}
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
/**
* Returns a descriptor for suitable feature display settings with
diff --git
a/test/jalview/ws/PDBSequenceFetcherTest.java
b/test/jalview/ws/PDBSequenceFetcherTest.java
index
b560f01
..
27d2643
100644
(file)
--- a/
test/jalview/ws/PDBSequenceFetcherTest.java
+++ b/
test/jalview/ws/PDBSequenceFetcherTest.java
@@
-25,6
+25,7
@@
import static org.testng.AssertJUnit.assertTrue;
import jalview.bin.Cache;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.SequenceI;
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;
import jalview.ws.seqfetcher.DbSourceProxy;
import java.util.List;
@@
-60,6
+61,10
@@
public class PDBSequenceFetcherTest
@Test(groups = { "Network" }, enabled = true)
public void testRnaSeqRetrieve() throws Exception
{
@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);
List<DbSourceProxy> sps = sf.getSourceProxy("PDB");
AlignmentI response = sps.get(0).getSequenceRecords("2GIS");
assertTrue(response != null);
@@
-81,6
+86,8
@@
public class PDBSequenceFetcherTest
{
Cache.applicationProperties.setProperty("STRUCT_FROM_PDB",
Boolean.TRUE.toString());
{
Cache.applicationProperties.setProperty("STRUCT_FROM_PDB",
Boolean.TRUE.toString());
+ StructureViewSettings.setCurrentDefaultFormat("PDB");
+
testRetrieveProteinSeqFromPDB();
}
testRetrieveProteinSeqFromPDB();
}
@@
-88,7
+95,8
@@
public class PDBSequenceFetcherTest
public void testmmCifSeqRetrieve() throws Exception
{
Cache.applicationProperties.setProperty("STRUCT_FROM_PDB",
public void testmmCifSeqRetrieve() throws Exception
{
Cache.applicationProperties.setProperty("STRUCT_FROM_PDB",
- Boolean.FALSE.toString());
+ Boolean.TRUE.toString());
+ StructureViewSettings.setCurrentDefaultFormat("mmCIF");
testRetrieveProteinSeqFromPDB();
}
testRetrieveProteinSeqFromPDB();
}