* The Jalview Authors are detailed in the 'AUTHORS' file.
-->
<mapping>
- <class name="jalview.datamodel.UniprotFile">
+ <class name="jalview.datamodel.xdb.uniprot.UniprotFile">
<map-to xml="uniprot"/>
- <field name="UniprotEntries" type="jalview.datamodel.UniprotEntry" collection="vector">
+ <field name="UniprotEntries" type="jalview.datamodel.xdb.uniprot.UniprotEntry" collection="vector">
<bind-xml name="entry"/>
</field>
</class>
- <class name="jalview.datamodel.UniprotEntry">
+ <class name="jalview.datamodel.xdb.uniprot.UniprotEntry">
<field name="name" type="string" collection="vector"/>
<field name="accession" type="string" collection="vector"/>
- <field name="protein" type="jalview.datamodel.UniprotProteinName"/>
- <field name="UniprotSequence" type="jalview.datamodel.UniprotSequence">
+ <field name="protein" type="jalview.datamodel.xdb.uniprot.UniprotProteinName"/>
+ <field name="UniprotSequence" type="jalview.datamodel.xdb.uniprot.UniprotSequence">
<bind-xml name="sequence"/>
</field>
- <field name="feature" type="jalview.datamodel.SequenceFeature" collection="vector"/>
+ <field name="feature" type="jalview.datamodel.xdb.uniprot.UniprotFeature" collection="vector"/>
<field name="dbReference" type="jalview.datamodel.PDBEntry" collection="vector"/>
</class>
- <class name="jalview.datamodel.UniprotProteinName">
+ <class name="jalview.datamodel.xdb.uniprot.UniprotProteinName">
<field name="name" collection="vector" type="string">
<bind-xml name="fullName" location="recommendedName" node="element"/>
</field>
</class>
<!-- uniprot protein name is now a collection of collections - the INCLUDES and CONTAINS entries of the uniprot
record. This means this doesn't exist anymore...
- <class name="jalview.datamodel.UniprotProteinName">
+ <class name="jalview.datamodel.xdb.uniprot.UniprotProteinName">
<field name="name" type="string" collection="vector">
<bind-xml name="name"/>
</field>
</class>
-->
- <class name="jalview.datamodel.SequenceFeature">
+ <class name="jalview.datamodel.xdb.uniprot.UniprotFeature">
<field name="type">
<bind-xml node="attribute"/>
</field>
</field>
</class>
- <class name="jalview.datamodel.UniprotSequence">
+ <class name="jalview.datamodel.xdb.uniprot.UniprotSequence">
<field name="content" type="string">
<bind-xml name="sequence" node="text"/>
</field>
* along with Jalview. If not, see <http://www.gnu.org/licenses/>.
* The Jalview Authors are detailed in the 'AUTHORS' file.
*/
-package jalview.datamodel;
+package jalview.datamodel.xdb.uniprot;
+
+import jalview.datamodel.PDBEntry;
import java.util.Vector;
Vector<String> accession;
- Vector<SequenceFeature> feature;
+ Vector<UniprotFeature> feature;
Vector<PDBEntry> dbrefs;
accession = items;
}
- public void setFeature(Vector<SequenceFeature> items)
+ public void setFeature(Vector<UniprotFeature> items)
{
feature = items;
}
- public Vector<SequenceFeature> getFeature()
+ public Vector<UniprotFeature> getFeature()
{
return feature;
}
--- /dev/null
+package jalview.datamodel.xdb.uniprot;
+
+/**
+ * A data model class for binding from Uniprot XML via uniprot_mapping.xml
+ */
+public class UniprotFeature
+{
+ private String type;
+
+ private String description;
+
+ private String status;
+
+ private int begin;
+
+ private int end;
+
+ public String getType()
+ {
+ return type;
+ }
+
+ public void setType(String t)
+ {
+ this.type = t;
+ }
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public void setDescription(String d)
+ {
+ this.description = d;
+ }
+
+ public String getStatus()
+ {
+ return status;
+ }
+
+ public void setStatus(String s)
+ {
+ this.status = s;
+ }
+
+ public int getBegin()
+ {
+ return begin;
+ }
+
+ public void setBegin(int b)
+ {
+ this.begin = b;
+ }
+
+ public int getEnd()
+ {
+ return end;
+ }
+
+ public void setEnd(int e)
+ {
+ this.end = e;
+ }
+
+ public int getPosition()
+ {
+ return begin;
+ }
+
+ public void setPosition(int p)
+ {
+ this.begin = p;
+ this.end = p;
+ }
+}
* along with Jalview. If not, see <http://www.gnu.org/licenses/>.
* The Jalview Authors are detailed in the 'AUTHORS' file.
*/
-package jalview.datamodel;
+package jalview.datamodel.xdb.uniprot;
import java.util.Vector;
* along with Jalview. If not, see <http://www.gnu.org/licenses/>.
* The Jalview Authors are detailed in the 'AUTHORS' file.
*/
-package jalview.datamodel;
+package jalview.datamodel.xdb.uniprot;
import java.util.Vector;
* along with Jalview. If not, see <http://www.gnu.org/licenses/>.
* The Jalview Authors are detailed in the 'AUTHORS' file.
*/
-package jalview.datamodel;
+package jalview.datamodel.xdb.uniprot;
/**
* Data model for the sequence returned by a Uniprot query
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
-import jalview.datamodel.UniprotEntry;
-import jalview.datamodel.UniprotFile;
+import jalview.datamodel.xdb.uniprot.UniprotEntry;
+import jalview.datamodel.xdb.uniprot.UniprotFeature;
+import jalview.datamodel.xdb.uniprot.UniprotFile;
import jalview.ws.ebi.EBIFetchClient;
import jalview.ws.seqfetcher.DbSourceProxyImpl;
}
}
-
}
sequence.setPDBId(onlyPdbEntries);
if (entry.getFeature() != null)
{
- for (SequenceFeature sf : entry.getFeature())
+ for (UniprotFeature uf : entry.getFeature())
{
- SequenceFeature copy = new SequenceFeature(sf, sf.getBegin(),
- sf.getEnd(), "Uniprot");
+ SequenceFeature copy = new SequenceFeature(uf.getType(),
+ uf.getDescription(), uf.getStatus(), uf.getBegin(),
+ uf.getEnd(), "Uniprot");
sequence.addSequenceFeature(copy);
}
}
public void testIsColored_simpleColour()
{
FeatureColour fc = new FeatureColour(Color.RED);
- assertTrue(fc.isColored(new SequenceFeature()));
+ assertTrue(fc
+ .isColored(new SequenceFeature("Cath", "", 1, 2, 0f, null)));
}
@Test(groups = { "Functional" })
{
FeatureColour fc = new FeatureColour();
fc.setColourByLabel(true);
- assertTrue(fc.isColored(new SequenceFeature()));
+ assertTrue(fc
+ .isColored(new SequenceFeature("Cath", "", 1, 2, 0f, null)));
}
@Test(groups = { "Functional" })
public void testGetColor_simpleColour()
{
FeatureColour fc = new FeatureColour(Color.RED);
- assertEquals(Color.RED, fc.getColor(new SequenceFeature()));
+ assertEquals(Color.RED,
+ fc.getColor(new SequenceFeature("Cath", "", 1, 2, 0f, null)));
}
@Test(groups = { "Functional" })
import static org.testng.AssertJUnit.assertNull;
import jalview.datamodel.PDBEntry;
-import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
-import jalview.datamodel.UniprotEntry;
+import jalview.datamodel.xdb.uniprot.UniprotEntry;
+import jalview.datamodel.xdb.uniprot.UniprotFeature;
import jalview.gui.JvOptionPane;
import java.io.Reader;
/*
* Check sequence features
*/
- Vector<SequenceFeature> features = entry.getFeature();
+ Vector<UniprotFeature> features = entry.getFeature();
assertEquals(3, features.size());
- SequenceFeature sf = features.get(0);
+ UniprotFeature sf = features.get(0);
assertEquals("signal peptide", sf.getType());
assertNull(sf.getDescription());
assertNull(sf.getStatus());
- assertEquals(1, sf.getPosition());
assertEquals(1, sf.getBegin());
assertEquals(18, sf.getEnd());
sf = features.get(1);
xref = xrefs.get(2);
assertEquals("AE007869", xref.getId());
assertEquals("EMBL", xref.getType());
- assertEquals("AAK85932.1",
- xref.getProperty("protein sequence ID"));
- assertEquals("Genomic_DNA",
- xref.getProperty("molecule type"));
+ assertEquals("AAK85932.1", xref.getProperty("protein sequence ID"));
+ assertEquals("Genomic_DNA", xref.getProperty("molecule type"));
}
@Test(groups = { "Functional" })