From 6c26eb3b6be8e49d49c3c4c617789bb713cc37bb Mon Sep 17 00:00:00 2001
From: edgrif <edgrif>
Date: Thu, 17 Dec 2009 14:47:02 +0000
Subject: [PATCH] add data/funcs to support reporting the index of a feature
 subpart (exon etc).

---
 src/zmapControl/zmapControlWindowInfoPanel.c | 11 ++++++-----
 src/zmapWindow/zmapWindow.c                  | 10 ++++++----
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/src/zmapControl/zmapControlWindowInfoPanel.c b/src/zmapControl/zmapControlWindowInfoPanel.c
index a18075f1a..1eddf407a 100755
--- a/src/zmapControl/zmapControlWindowInfoPanel.c
+++ b/src/zmapControl/zmapControlWindowInfoPanel.c
@@ -27,9 +27,9 @@
  *
  * Exported functions: See zmapControl_P.h
  * HISTORY:
- * Last edited: Oct 14 10:44 2009 (edgrif)
+ * Last edited: Dec 17 11:15 2009 (edgrif)
  * Created: Tue Jul 18 10:02:04 2006 (edgrif)
- * CVS info:   $Id: zmapControlWindowInfoPanel.c,v 1.23 2009-12-15 13:49:10 mh17 Exp $
+ * CVS info:   $Id: zmapControlWindowInfoPanel.c,v 1.24 2009-12-17 14:47:02 edgrif Exp $
  *-------------------------------------------------------------------
  */
 
@@ -184,7 +184,9 @@ void zmapControlInfoPanelSetText(ZMap zmap, ZMapInfoPanelLabels labels, ZMapFeat
 	    }
 
 	  if (feature_desc->sub_feature_start)
-	    text[3] = g_strdup_printf("%s, %s%s%s%s%s%s%s%s",
+	    text[3] = g_strdup_printf("%s %s: %s, %s%s%s%s%s%s%s%s",
+				      feature_desc->sub_feature_term,
+				      feature_desc->sub_feature_index,
 				      feature_desc->sub_feature_start,
 				      feature_desc->sub_feature_end,
 				      (feature_desc->sub_feature_query_start ? "  <-  " : ""),
@@ -267,8 +269,7 @@ void zmapControlInfoPanelSetText(ZMap zmap, ZMapInfoPanelLabels labels, ZMapFeat
 	    tooltip[2] = "Feature start, end (length)" ;
 
 	  if (feature_desc->sub_feature_term)
-	    tooltip[3] = g_strdup_printf("%s:  start, end (length)", 
-					 feature_desc->sub_feature_term) ;
+	    tooltip[3] = g_strdup("sub_feature_type  index:   start, end  (length)") ;
 
 	  tooltip[4] = "Frame" ;
 	  tooltip[5] = "Score" ;
diff --git a/src/zmapWindow/zmapWindow.c b/src/zmapWindow/zmapWindow.c
index 16924889f..551b52b06 100755
--- a/src/zmapWindow/zmapWindow.c
+++ b/src/zmapWindow/zmapWindow.c
@@ -26,9 +26,9 @@
  *              
  * Exported functions: See ZMap/zmapWindow.h
  * HISTORY:
- * Last edited: Dec 16 11:07 2009 (edgrif)
+ * Last edited: Dec 17 10:38 2009 (edgrif)
  * Created: Thu Jul 24 14:36:27 2003 (edgrif)
- * CVS info:   $Id: zmapWindow.c,v 1.297 2009-12-16 11:07:34 edgrif Exp $
+ * CVS info:   $Id: zmapWindow.c,v 1.298 2009-12-17 14:47:32 edgrif Exp $
  *-------------------------------------------------------------------
  */
 
@@ -1250,7 +1250,7 @@ void zMapWindowUpdateInfoPanel(ZMapWindow     window,
   ZMapStrand query_strand = ZMAPSTRAND_NONE;
   char *feature_term, *sub_feature_term;
   int feature_total_length, feature_start, feature_end, feature_length, query_start, query_end ;
-  int sub_feature_start, sub_feature_end, sub_feature_length;
+  int sub_feature_index, sub_feature_start, sub_feature_end, sub_feature_length;
   int query_length ;
 
   select.type = ZMAPWINDOW_SELECT_SINGLE;
@@ -1356,9 +1356,10 @@ void zMapWindowUpdateInfoPanel(ZMapWindow     window,
   if (sub_feature)		/* If sub_feature == NULL we'll only get the same as previous! */
     {
       feature_start = feature_end = feature_length = query_start = query_end =
-	sub_feature_start = sub_feature_end = sub_feature_length = query_length = 0;
+	sub_feature_index = sub_feature_start = sub_feature_end = sub_feature_length = query_length = 0 ;
       
       if (zMapFeatureGetInfo((ZMapFeatureAny)feature, sub_feature,
+			     "index",  &sub_feature_index,
 			     "start",  &sub_feature_start,
 			     "end",    &sub_feature_end,
 			     "length", &sub_feature_length,
@@ -1373,6 +1374,7 @@ void zMapWindowUpdateInfoPanel(ZMapWindow     window,
 	    }
 
 
+	  select.feature_desc.sub_feature_index  = g_strdup_printf("%d", sub_feature_index) ;
 	  select.feature_desc.sub_feature_start  = g_strdup_printf("%d", sub_feature_start) ;
 	  select.feature_desc.sub_feature_end    = g_strdup_printf("%d", sub_feature_end) ;
 	  select.feature_desc.sub_feature_length = g_strdup_printf("%d", sub_feature_length) ;
-- 
GitLab