From d48ae6f29746b720adbbd23c043d832153e72419 Mon Sep 17 00:00:00 2001
From: tjc <tjc@ee4ac58c-ac51-4696-9907-e4b3aa274f04>
Date: Tue, 2 Feb 2010 10:13:43 +0000
Subject: [PATCH] when changing groups of featurelocs check they are not
 partial

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@13143 ee4ac58c-ac51-4696-9907-e4b3aa274f04
---
 uk/ac/sanger/artemis/chado/IBatisDAO.java | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/uk/ac/sanger/artemis/chado/IBatisDAO.java b/uk/ac/sanger/artemis/chado/IBatisDAO.java
index 3c68fc3e5..c62bb08f6 100644
--- a/uk/ac/sanger/artemis/chado/IBatisDAO.java
+++ b/uk/ac/sanger/artemis/chado/IBatisDAO.java
@@ -878,11 +878,25 @@ public class IBatisDAO extends GmodDAO
         FeatureLoc thisFeatureLoc = (FeatureLoc) featureLocs.get(i);
         int thisSrcFeatureId = 
           thisFeatureLoc.getFeatureBySrcFeatureId().getFeatureId();
+        
         if(srcFeatureId != thisSrcFeatureId)
         {
-          thisFeatureLoc.setFmin(thisFeatureLoc.getFmin()+diffFmin);
-          thisFeatureLoc.setFmax(thisFeatureLoc.getFmax()+diffFmax);
-          sqlMap.update("updateFeatureLoc", thisFeatureLoc);
+          // check to see if the featureloc fmin/fmax are marked as partial
+          // if they are then ignore as they are likely to be the end of
+          // a contig
+          boolean changed = false;
+          if(!thisFeatureLoc.isFminPartial())
+          {
+            thisFeatureLoc.setFmin(thisFeatureLoc.getFmin()+diffFmin);
+            changed = true;
+          }
+          if(!thisFeatureLoc.isFmaxPartial())
+          {
+            thisFeatureLoc.setFmax(thisFeatureLoc.getFmax()+diffFmax);
+            changed = true;
+          }
+          if(changed)
+            sqlMap.update("updateFeatureLoc", thisFeatureLoc);
         }
       }
     }
-- 
GitLab