- // tricky - this test really needs to search the sequence's set of dbrefs to
- // see if there is a primary reference that derived this reference.
- String ucv = version.toUpperCase();
- for (String primsrc : Arrays.asList(DBRefSource.allSources()))
- {
- if (ucv.startsWith(primsrc.toUpperCase()))
- {
- // by convention, many secondary references inherit the primary
- // reference's
- // source string as a prefix for any version information from the
- // secondary reference.
- return false;
- }
- }
- return true;
+
+ return DBRefSource.isPrimaryCandidate(ucversion);
+ }
+
+ /**
+ * stores the upper-case canonical name of the source for use in
+ * Sequence.getPrimaryDBRefs().
+ *
+ * @author Bob Hanson
+ *
+ * @return
+ */
+ public String getCanonicalSourceName()
+ {
+ return (canonicalSourceName == null
+ ? (canonicalSourceName = DBRefUtils
+ .getCanonicalName(this.source))
+ : canonicalSourceName);
+ }
+
+ /**
+ *
+ * @param canonical
+ */
+ public void setCanonical(boolean canonical)
+ {
+ isCanonicalAccession = canonical;
+ }
+
+ /**
+ *
+ * @return true if this is the primary canonical accession for the database
+ * source
+ */
+ public boolean isCanonical()
+ {
+ // TODO Auto-generated method stub
+ return isCanonicalAccession;