From 23c12388658b08e4bbda2ebfdad286d881689366 Mon Sep 17 00:00:00 2001 From: tcofoegbu Date: Thu, 5 Nov 2015 12:58:32 +0000 Subject: [PATCH] JAL-1942 JAL-1479 refactored SequenceI.getDBRef/SequenceI.setDBRef to SequenceI.getDBRefs/SequenceI.setDBRefs --- src/MCview/PDBfile.java | 3 ++- src/jalview/datamodel/Sequence.java | 6 +++--- src/jalview/datamodel/SequenceGroup.java | 2 +- src/jalview/datamodel/SequenceI.java | 2 +- test/jalview/analysis/AlignmentUtilsTests.java | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/MCview/PDBfile.java b/src/MCview/PDBfile.java index a7ecc52..58611e2 100755 --- a/src/MCview/PDBfile.java +++ b/src/MCview/PDBfile.java @@ -25,6 +25,7 @@ import jalview.datamodel.Alignment; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; import jalview.datamodel.DBRefEntry; +import jalview.datamodel.DBRefSource; import jalview.datamodel.PDBEntry; import jalview.datamodel.SequenceI; import jalview.io.FileParse; @@ -312,7 +313,7 @@ public class PDBfile extends jalview.io.AlignFile DBRefEntry sourceDBRef = new DBRefEntry(); sourceDBRef.setAccessionId(id); - sourceDBRef.setSource("PDB"); + sourceDBRef.setSource(DBRefSource.PDB); sourceDBRef.setStartRes(pdbSequence.getStart()); sourceDBRef.setEndRes(pdbSequence.getEnd()); pdbSequence.setSourceDBRef(sourceDBRef); diff --git a/src/jalview/datamodel/Sequence.java b/src/jalview/datamodel/Sequence.java index fd710bd..ac2f9c1 100755 --- a/src/jalview/datamodel/Sequence.java +++ b/src/jalview/datamodel/Sequence.java @@ -912,7 +912,7 @@ public class Sequence extends ASequence implements SequenceI } @Override - public void setDBRef(DBRefEntry[] dbref) + public void setDBRefs(DBRefEntry[] dbref) { dbrefs = dbref; } @@ -1080,8 +1080,8 @@ public class Sequence extends ASequence implements SequenceI datasetSequence.setDescription(getDescription()); setSequenceFeatures(null); // move database references onto dataset sequence - datasetSequence.setDBRef(getDBRefs()); - setDBRef(null); + datasetSequence.setDBRefs(getDBRefs()); + setDBRefs(null); datasetSequence.setPDBId(getAllPDBEntries()); setPDBId(null); datasetSequence.updatePDBIds(); diff --git a/src/jalview/datamodel/SequenceGroup.java b/src/jalview/datamodel/SequenceGroup.java index d79a5f7..0e8fa17 100755 --- a/src/jalview/datamodel/SequenceGroup.java +++ b/src/jalview/datamodel/SequenceGroup.java @@ -209,7 +209,7 @@ public class SequenceGroup implements AnnotatedCollectionI if (seqs[ipos] != null) { seqs[ipos].setDescription(seq.getDescription()); - seqs[ipos].setDBRef(seq.getDBRefs()); + seqs[ipos].setDBRefs(seq.getDBRefs()); seqs[ipos].setSequenceFeatures(seq.getSequenceFeatures()); if (seq.getDatasetSequence() != null) { diff --git a/src/jalview/datamodel/SequenceI.java b/src/jalview/datamodel/SequenceI.java index 50f88f3..f1cba43 100755 --- a/src/jalview/datamodel/SequenceI.java +++ b/src/jalview/datamodel/SequenceI.java @@ -298,7 +298,7 @@ public interface SequenceI extends ASequenceI public void setVamsasId(String id); - public void setDBRef(DBRefEntry[] dbs); + public void setDBRefs(DBRefEntry[] dbs); public DBRefEntry[] getDBRefs(); diff --git a/test/jalview/analysis/AlignmentUtilsTests.java b/test/jalview/analysis/AlignmentUtilsTests.java index 9756849..74e4940 100644 --- a/test/jalview/analysis/AlignmentUtilsTests.java +++ b/test/jalview/analysis/AlignmentUtilsTests.java @@ -988,7 +988,7 @@ public class AlignmentUtilsTests assertTrue(AlignmentUtils.haveCrossRef(seq2, seq1)); // now the other way round - seq1.setDBRef(null); + seq1.setDBRefs(null); seq2.addDBRef(new DBRefEntry("EMBL", "1", "A12345")); assertTrue(AlignmentUtils.haveCrossRef(seq1, seq2)); assertTrue(AlignmentUtils.haveCrossRef(seq2, seq1)); -- 1.7.10.2