X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fapi%2FDBRefEntryI.java;h=ed6358eec9823c3d4edd6dd45e68e45e6b05fb6d;hb=427b5193ff4e96cf2a28cf72c1857a1ab5250201;hp=32387813a65dae73e9aa880cef1f6eb9fc246e8c;hpb=a21b84a669a9620f6943b9b5054e8756cb6f0687;p=jalview.git
diff --git a/src/jalview/api/DBRefEntryI.java b/src/jalview/api/DBRefEntryI.java
index 3238781..ed6358e 100644
--- a/src/jalview/api/DBRefEntryI.java
+++ b/src/jalview/api/DBRefEntryI.java
@@ -1,27 +1,117 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see .
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
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);
- public void setStartRes(int startRes);
+ /**
+ * 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();
- public int getStartRes();
+ /**
+ * 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 otherEntry
+ * @return
+ */
+ public boolean updateFrom(DBRefEntryI otherEntry);
- public void setEndRes(int endRes);
+ /**
+ * 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 boolean isPrimaryCandidate();
- public int getEndRes();
+ public boolean isCanonical();
}