X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fapi%2FDBRefEntryI.java;h=52ee381454316a90ba1cd0b3d268c1c5bf688204;hb=fecb7871ff2ec644c4f3c9ea513df7c0fce30514;hp=490b21a4cf15db4ffd42bf7743afd8b266e229c0;hpb=b92809e042da3d7445392119c159ef8730b8a136;p=jalview.git
diff --git a/src/jalview/api/DBRefEntryI.java b/src/jalview/api/DBRefEntryI.java
index 490b21a..52ee381 100644
--- a/src/jalview/api/DBRefEntryI.java
+++ b/src/jalview/api/DBRefEntryI.java
@@ -48,30 +48,47 @@ public interface DBRefEntryI
public void setVersion(String version);
/**
+ * access a mapping, if present that can be used to map positions from the
+ * associated dataset sequence to the DBRef's sequence frame.
*
- * @param startRes
- * index of start residue in the source DB
+ * @return null or a valid mapping.
*/
- public void setStartRes(int startRes);
-
- /**
- *
- * @return index of start residue in the source DB
- */
- public int getStartRes();
+ public Mapping getMap();
/**
+ * Answers true if this object is either equivalent to, or can be 'improved'
+ * by, the given entry. Specifically, answers true if
+ *
+ * - source and accession are identical
+ * - version is identical, or this version is of the format "someSource:0",
+ * in which case the version for the other entry replaces it
+ * - mappings are not compared but if this entry has no mapping, replace
+ * with that for the other entry
+ *
*
- * @param endRes
- * index of end residue in the source DB
+ * @param otherEntry
+ * @return
*/
- public void setEndRes(int endRes);
+ public boolean updateFrom(DBRefEntryI otherEntry);
/**
- *
- * @return index of end residue in the source DB
+ * Answers true if the ref looks like a primary (direct) database reference.
+ * The only way a dbref's mappings can be fully verified is via the local
+ * sequence frame, so rather than use isPrimaryCandidate directly, please use
+ * SequenceI.getPrimaryDbRefs().
+ * Primary references indicate the local sequence data directly corresponds
+ * with the database record. All other references are secondary. Direct
+ * references indicate that part or all of the local sequence data can be
+ * mapped with another sequence, enabling annotation transfer.
+ * Cross-references indicate the local sequence data can be corresponded to
+ * some other linear coordinate system via a transformation.
+ * This method is also sufficient to distinguish direct DBRefEntry mappings
+ * from other relationships - e.g. coding relationships (imply a 1:3/3:1
+ * mapping), but not transcript relationships, which imply a (possibly
+ * non-contiguous) 1:1 mapping.
+ *
+ * @return true if this reference provides a primary accession for the
+ * associated sequence object
*/
- public int getEndRes();
-
- public Mapping getMap();
+ public boolean isPrimaryCandidate();
}