public class DBRefEntry implements DBRefEntryI
{
String source = "", version = "", accessionId = "";
+
/**
* maps from associated sequence to the database sequence's coordinate system
*/
}
-
public DBRefEntry(String source, String version, String accessionId)
{
this(source, version, accessionId, null);
String otherAccession = other.getAccessionId();
if ((accessionId == null && otherAccession != null)
|| (accessionId != null && otherAccession == null)
- || (accessionId != null && !accessionId.equalsIgnoreCase(otherAccession)))
+ || (accessionId != null && !accessionId
+ .equalsIgnoreCase(otherAccession)))
{
return false;
}
* otherwise the versions have to match
*/
String otherVersion = other.getVersion();
-
+
if ((version == null || version.equals("0") || version.endsWith(":0"))
&& otherVersion != null)
{
return accessionId;
}
-
@Override
public void setAccessionId(String accessionId)
{
this.accessionId = accessionId;
}
-
@Override
public void setSource(String source)
{
this.source = source;
}
-
@Override
public void setVersion(String version)
{
this.version = version;
}
-
@Override
public Mapping getMap()
{
public String toString()
{
return getSrcAccString();
+ }
@Override
public boolean isPrimary()
{
return false;
}
+ // check map is really 1:1, no shifts allowed.
+ if (map.getMap().getFromHighest() != map.getMap().getToHighest()
+ && map.getMap().getFromLowest() != map.getMap().getToLowest()
+ && !Arrays.equals(
+ map.getMap().getFromRanges().toArray(new int[0][]),
+ map.getMap().getToRanges().toArray(new int[0][])))
+ {
+ return false;
+ }
}
if (version == null)
{
}
return true;
}
- }
}