From 1fe15a0bb2006a51a24f4757c89337d99db4ad26 Mon Sep 17 00:00:00 2001 From: jprocter Date: Fri, 18 Jan 2013 15:52:17 +0000 Subject: [PATCH] JAL-1238 tier index indicating distance of a source from the primary source for that database - level 0 sources are the only ones that should be used to validate sequences. --- src/jalview/ws/dbsources/EmblCdsSouce.java | 6 ++++++ src/jalview/ws/dbsources/EmblSource.java | 6 ++++++ src/jalview/ws/dbsources/GeneDbSource.java | 5 +++++ src/jalview/ws/dbsources/Pdb.java | 5 +++++ src/jalview/ws/dbsources/PfamFull.java | 5 +++++ src/jalview/ws/dbsources/PfamSeed.java | 5 +++++ src/jalview/ws/dbsources/RfamFull.java | 5 +++++ src/jalview/ws/dbsources/RfamSeed.java | 5 +++++ src/jalview/ws/dbsources/Uniprot.java | 6 ++++++ .../ws/dbsources/das/datamodel/DasSequenceSource.java | 11 +++++++++++ src/jalview/ws/dbsources/das/datamodel/JalviewSource.java | 7 +++++++ src/jalview/ws/seqfetcher/DbSourceProxy.java | 7 +++++++ 12 files changed, 73 insertions(+) diff --git a/src/jalview/ws/dbsources/EmblCdsSouce.java b/src/jalview/ws/dbsources/EmblCdsSouce.java index 78f2477..0940f40 100644 --- a/src/jalview/ws/dbsources/EmblCdsSouce.java +++ b/src/jalview/ws/dbsources/EmblCdsSouce.java @@ -83,4 +83,10 @@ public class EmblCdsSouce extends EmblXmlSource implements DbSourceProxy return "EMBL (CDS)"; } + @Override + public int getTier() + { + return 0; + } + } diff --git a/src/jalview/ws/dbsources/EmblSource.java b/src/jalview/ws/dbsources/EmblSource.java index 4495be1..c7be59a 100644 --- a/src/jalview/ws/dbsources/EmblSource.java +++ b/src/jalview/ws/dbsources/EmblSource.java @@ -114,4 +114,10 @@ public class EmblSource extends EmblXmlSource implements DbSourceProxy { return "EMBL"; // getDbSource(); } + + @Override + public int getTier() + { + return 0; + } } diff --git a/src/jalview/ws/dbsources/GeneDbSource.java b/src/jalview/ws/dbsources/GeneDbSource.java index 125a295..81c8ea3 100644 --- a/src/jalview/ws/dbsources/GeneDbSource.java +++ b/src/jalview/ws/dbsources/GeneDbSource.java @@ -118,4 +118,9 @@ public class GeneDbSource extends EmblXmlSource implements DbSourceProxy { return "GeneDB"; // getDbSource(); } + @Override + public int getTier() + { + return 0; + } } diff --git a/src/jalview/ws/dbsources/Pdb.java b/src/jalview/ws/dbsources/Pdb.java index b432dff..b96a65c 100644 --- a/src/jalview/ws/dbsources/Pdb.java +++ b/src/jalview/ws/dbsources/Pdb.java @@ -209,4 +209,9 @@ public class Pdb extends EbiFileRetrievedProxy implements DbSourceProxy return "PDB"; // getDbSource(); } + @Override + public int getTier() + { + return 0; + } } diff --git a/src/jalview/ws/dbsources/PfamFull.java b/src/jalview/ws/dbsources/PfamFull.java index 75d4559..077b929 100644 --- a/src/jalview/ws/dbsources/PfamFull.java +++ b/src/jalview/ws/dbsources/PfamFull.java @@ -65,4 +65,9 @@ public class PfamFull extends Pfam implements DbSourceProxy return null; } + @Override + public int getTier() + { + return 0; + } } diff --git a/src/jalview/ws/dbsources/PfamSeed.java b/src/jalview/ws/dbsources/PfamSeed.java index cab4999..cb00a1d 100644 --- a/src/jalview/ws/dbsources/PfamSeed.java +++ b/src/jalview/ws/dbsources/PfamSeed.java @@ -62,4 +62,9 @@ public class PfamSeed extends Pfam implements DbSourceProxy return "PF03760"; } + @Override + public int getTier() + { + return 0; + } } diff --git a/src/jalview/ws/dbsources/RfamFull.java b/src/jalview/ws/dbsources/RfamFull.java index 3703e41..e20527a 100644 --- a/src/jalview/ws/dbsources/RfamFull.java +++ b/src/jalview/ws/dbsources/RfamFull.java @@ -70,4 +70,9 @@ public class RfamFull extends Rfam implements DbSourceProxy return null; } + @Override + public int getTier() + { + return 0; + } } diff --git a/src/jalview/ws/dbsources/RfamSeed.java b/src/jalview/ws/dbsources/RfamSeed.java index eb3c2c3..75fa62b 100644 --- a/src/jalview/ws/dbsources/RfamSeed.java +++ b/src/jalview/ws/dbsources/RfamSeed.java @@ -69,4 +69,9 @@ public class RfamSeed extends Rfam implements DbSourceProxy return null; } + @Override + public int getTier() + { + return 0; + } } diff --git a/src/jalview/ws/dbsources/Uniprot.java b/src/jalview/ws/dbsources/Uniprot.java index 48f8649..1b967c4 100644 --- a/src/jalview/ws/dbsources/Uniprot.java +++ b/src/jalview/ws/dbsources/Uniprot.java @@ -294,4 +294,10 @@ public class Uniprot extends DbSourceProxyImpl implements DbSourceProxy { return "Uniprot"; // getDbSource(); } + + @Override + public int getTier() + { + return 0; + } } diff --git a/src/jalview/ws/dbsources/das/datamodel/DasSequenceSource.java b/src/jalview/ws/dbsources/das/datamodel/DasSequenceSource.java index 95ff7d0..7bb6436 100644 --- a/src/jalview/ws/dbsources/das/datamodel/DasSequenceSource.java +++ b/src/jalview/ws/dbsources/das/datamodel/DasSequenceSource.java @@ -70,6 +70,11 @@ public class DasSequenceSource extends DbSourceProxyImpl implements protected MultipleConnectionPropertyProviderI connprops = null; /** + * DAS sources are tier 1 - if we have a direct DB connection then we should prefer it + */ + private int tier=1; + + /** * create a new DbSource proxy for a DAS 1 source * * @param dbnbame @@ -334,4 +339,10 @@ public class DasSequenceSource extends DbSourceProxyImpl implements { return coordsys; } + + @Override + public int getTier() + { + return tier; + } } diff --git a/src/jalview/ws/dbsources/das/datamodel/JalviewSource.java b/src/jalview/ws/dbsources/das/datamodel/JalviewSource.java index eb9d807..f68a005 100644 --- a/src/jalview/ws/dbsources/das/datamodel/JalviewSource.java +++ b/src/jalview/ws/dbsources/das/datamodel/JalviewSource.java @@ -366,4 +366,11 @@ public class JalviewSource implements jalviewSourceI return isLaterThan(getVersion().getCreated(), other.getVersion() .getCreated()); } + + @Override + public boolean isReferenceSource() + { + // TODO check source object for indication that we are the primary for a DAS coordinate system + return false; + } } diff --git a/src/jalview/ws/seqfetcher/DbSourceProxy.java b/src/jalview/ws/seqfetcher/DbSourceProxy.java index cc9997f..e4b76b9 100644 --- a/src/jalview/ws/seqfetcher/DbSourceProxy.java +++ b/src/jalview/ws/seqfetcher/DbSourceProxy.java @@ -134,4 +134,11 @@ public interface DbSourceProxy * @return true if the source has this property */ public boolean isA(Object dbsourceproperty); + + /** + * Tier for this data source + * + * @return 0 - primary datasource, 1 - das primary source, 2 - secondary + */ + public int getTier(); } -- 1.7.10.2