--- /dev/null
+package jalview.datamodel;\r
+\r
+/**\r
+ * A set of feature property constants used by jalview\r
+ * @author JimP\r
+ *\r
+ */\r
+public class FeatureProperties\r
+{\r
+\r
+ public static final String EXONPOS = "exon number";\r
+ public static final String EXONPRODUCT = "product";\r
+ /**\r
+ * lookup feature type for a particular database to see if its a coding region feature\r
+ * @param dbrefsource\r
+ * @param string\r
+ * @return\r
+ */\r
+ public static boolean isCodingFeature(String dbrefsource, String type)\r
+ {\r
+ return ((dbrefsource==null || dbrefsource.equalsIgnoreCase(DBRefSource.EMBL))\r
+ && type.equalsIgnoreCase("CDS"));\r
+ }\r
+}\r
package jalview.datamodel.xdb.embl;
import jalview.datamodel.DBRefEntry;
+import jalview.datamodel.DBRefSource;
+import jalview.datamodel.FeatureProperties;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
;
}
}
- if (feature.getName().equalsIgnoreCase("CDS"))
+ if (FeatureProperties.isCodingFeature(DBRefSource.EMBL, "CDS"))
{
// extract coding region(s)
jalview.datamodel.Mapping map = null;
sf.setFeatureGroup(jalview.datamodel.DBRefSource.EMBL);
sf.setDescription("Exon " + (1 + xint) + " for protein '"
+ prname + "' EMBLCDS:" + prid);
+ sf.setValue(FeatureProperties.EXONPOS, new Integer(1+xint));
+ sf.setValue(FeatureProperties.EXONPRODUCT, prname);
if (vals != null && vals.size() > 0)
{
Enumeration kv = vals.elements();
DBRefEntry ref = (DBRefEntry) dbr.next();
ref.setSource(jalview.util.DBRefUtils.getCanonicalName(ref
.getSource()));
+ // Hard code the kind of protein product accessions that EMBL cite
if (ref.getSource().equals(
jalview.datamodel.DBRefSource.UNIPROT))
{