2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
23 import jalview.datamodel.Mapping;
25 //JBPComment: this is a datamodel API - so it should be in datamodel (it's a peer of SequenceI)
27 public interface DBRefEntryI
29 public boolean equalRef(DBRefEntryI entry);
33 * @return Source DB name for this entry
35 public String getSource();
39 * @return Accession Id for this entry
41 public String getAccessionId();
46 * Accession Id for this entry
48 public void setAccessionId(String accessionId);
53 * Source DB name for this entry
55 public void setSource(String source);
59 * @return Source DB version for this entry
61 public String getVersion();
66 * Source DB version for this entry
68 public void setVersion(String version);
71 * access a mapping, if present that can be used to map positions from the
72 * associated dataset sequence to the DBRef's sequence frame.
74 * @return null or a valid mapping.
76 public Mapping getMap();
79 * Answers true if this object is either equivalent to, or can be 'improved'
80 * by, the given entry. Specifically, answers true if
82 * <li>source and accession are identical</li>
83 * <li>version is identical, or this version is of the format "someSource:0",
84 * in which case the version for the other entry replaces it</li>
85 * <li>mappings are not compared but if this entry has no mapping, replace
86 * with that for the other entry</li>
92 public boolean updateFrom(DBRefEntryI otherEntry);
95 * Answers true if the ref looks like a primary (direct) database reference. <br>
96 * The only way a dbref's mappings can be fully verified is via the local
97 * sequence frame, so rather than use isPrimaryCandidate directly, please use
98 * SequenceI.getPrimaryDbRefs(). <br>
99 * Primary references indicate the local sequence data directly corresponds
100 * with the database record. All other references are secondary. Direct
101 * references indicate that part or all of the local sequence data can be
102 * mapped with another sequence, enabling annotation transfer.
103 * Cross-references indicate the local sequence data can be corresponded to
104 * some other linear coordinate system via a transformation. <br>
105 * This method is also sufficient to distinguish direct DBRefEntry mappings
106 * from other relationships - e.g. coding relationships (imply a 1:3/3:1
107 * mapping), but not transcript relationships, which imply a (possibly
108 * non-contiguous) 1:1 mapping.
110 * @return true if this reference provides a primary accession for the
111 * associated sequence object
113 public boolean isPrimaryCandidate();