X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fapi%2FDBRefEntryI.java;h=701acb663ce60ad3b3e5fe30fa5d437f5b40a210;hb=168ef5a045478ef56a5d9f8c71fbddb53a6b8a58;hp=731c25895417568cabe3acb9b86a8b770d960920;hpb=1503bcb2b548b7f6bc11bcbf081455ab94839099;p=jalview.git diff --git a/src/jalview/api/DBRefEntryI.java b/src/jalview/api/DBRefEntryI.java index 731c258..701acb6 100644 --- a/src/jalview/api/DBRefEntryI.java +++ b/src/jalview/api/DBRefEntryI.java @@ -1,19 +1,97 @@ package jalview.api; +import jalview.datamodel.Mapping; + +//JBPComment: this is a datamodel API - so it should be in datamodel (it's a peer of SequenceI) public interface DBRefEntryI { public boolean equalRef(DBRefEntryI entry); + /** + * + * @return Source DB name for this entry + */ public String getSource(); - public String getVersion(); - + /** + * + * @return Accession Id for this entry + */ public String getAccessionId(); + /** + * + * @param accessionId + * Accession Id for this entry + */ public void setAccessionId(String accessionId); + /** + * + * @param source + * Source DB name for this entry + */ public void setSource(String source); + /** + * + * @return Source DB version for this entry + */ + public String getVersion(); + + /** + * + * @param version + * Source DB version for this entry + */ 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. + * + * @return null or a valid mapping. + */ + public Mapping getMap(); + + /** + * Answers true if this object is either equivalent to, or can be 'improved' + * by, the given entry. Specifically, answers true if + * + * + * @param otherEntry + * @return + */ + public boolean updateFrom(DBRefEntryI otherEntry); + + /** + * Method to distinguish between direct and indirect database references + * + * 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 + * + * The only way a dbref's mappings can be fully verified is via the local + * sequence frame, so rather than use isPrimary directly, please use + * SequenceI.getPrimaryDbRefs() + * + * @return true if this reference provides a primary accession for the + * associated sequence object + */ + public boolean isPrimary(); }