Skip to content
Snippets Groups Projects
Commit e58d5a56 authored by edgrif's avatar edgrif
Browse files

add function to test whether an alignment is gapped.

parent d12a8b7c
No related branches found
No related tags found
No related merge requests found
...@@ -25,9 +25,9 @@ ...@@ -25,9 +25,9 @@
* Description: Data structures describing a sequence feature. * Description: Data structures describing a sequence feature.
* *
* HISTORY: * HISTORY:
* Last edited: Aug 11 09:47 2010 (edgrif) * Last edited: Aug 17 08:35 2010 (edgrif)
* Created: Fri Jun 11 08:37:19 2004 (edgrif) * Created: Fri Jun 11 08:37:19 2004 (edgrif)
* CVS info: $Id: zmapFeature.h,v 1.178 2010-08-11 08:47:36 edgrif Exp $ * CVS info: $Id: zmapFeature.h,v 1.179 2010-08-18 09:16:53 edgrif Exp $
*------------------------------------------------------------------- *-------------------------------------------------------------------
*/ */
#ifndef ZMAP_FEATURE_H #ifndef ZMAP_FEATURE_H
...@@ -782,6 +782,7 @@ gboolean zMapFeatureAddAlignmentData(ZMapFeature feature, ...@@ -782,6 +782,7 @@ gboolean zMapFeatureAddAlignmentData(ZMapFeature feature,
ZMapPhase target_phase, ZMapPhase target_phase,
GArray *gaps, unsigned int align_error, GArray *gaps, unsigned int align_error,
gboolean has_local_sequence) ; gboolean has_local_sequence) ;
gboolean zMapFeatureAlignmentIsGapped(ZMapFeature feature) ;
gboolean zMapFeatureAddAssemblyPathData(ZMapFeature feature, gboolean zMapFeatureAddAssemblyPathData(ZMapFeature feature,
int length, ZMapStrand strand, GArray *path) ; int length, ZMapStrand strand, GArray *path) ;
gboolean zMapFeatureSetCoords(ZMapStrand strand, int *start, int *end, gboolean zMapFeatureSetCoords(ZMapStrand strand, int *start, int *end,
......
...@@ -28,9 +28,9 @@ ...@@ -28,9 +28,9 @@
* *
* Exported functions: See zmapView_P.h * Exported functions: See zmapView_P.h
* HISTORY: * HISTORY:
* Last edited: Aug 5 15:01 2010 (edgrif) * Last edited: Aug 17 08:42 2010 (edgrif)
* Created: Fri Jul 16 13:05:58 2004 (edgrif) * Created: Fri Jul 16 13:05:58 2004 (edgrif)
* CVS info: $Id: zmapFeature.c,v 1.132 2010-08-09 09:04:30 edgrif Exp $ * CVS info: $Id: zmapFeature.c,v 1.133 2010-08-18 09:16:53 edgrif Exp $
*------------------------------------------------------------------- *-------------------------------------------------------------------
*/ */
...@@ -832,6 +832,35 @@ gboolean zMapFeatureAddAlignmentData(ZMapFeature feature, ...@@ -832,6 +832,35 @@ gboolean zMapFeatureAddAlignmentData(ZMapFeature feature,
return result ; return result ;
} }
/* Returns TRUE if alignment is gapped, FALSE otherwise. NOTE that sometimes
* we are passed data for an alignment feature which must represent a gapped
* alignment but we are not passed the gap data. This test all this. */
gboolean zMapFeatureAlignmentIsGapped(ZMapFeature feature)
{
gboolean result = FALSE ;
zMapAssert(zMapFeatureIsValidFull(feature, ZMAPFEATURE_STRUCT_FEATURE)) ;
if (feature->type == ZMAPSTYLE_MODE_ALIGNMENT)
{
int ref_length, match_length ;
ref_length = (feature->x2 - feature->x1) + 1 ;
match_length = (feature->feature.homol.y2 - feature->feature.homol.y1) + 1 ;
if (feature->feature.homol.type != ZMAPHOMOL_N_HOMOL)
match_length *= 3 ;
if (ref_length != match_length)
result = TRUE ;
}
return result ;
}
/*! /*!
* Adds assembly path data to a feature. * Adds assembly path data to a feature.
* */ * */
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment