diff --git a/src/zmapGFF/zmapGFF2parser.c b/src/zmapGFF/zmapGFF2parser.c index 780cc045bc6e68761bbc321cd82f491bb9c249ab..35ba965522bed9b83aefb4b604535631c4ae9a7b 100755 --- a/src/zmapGFF/zmapGFF2parser.c +++ b/src/zmapGFF/zmapGFF2parser.c @@ -26,9 +26,9 @@ * * Exported functions: See ZMap/zmapGFF.h * HISTORY: - * Last edited: Jul 8 10:28 2004 (edgrif) + * Last edited: Jul 14 11:45 2004 (edgrif) * Created: Fri May 28 14:25:12 2004 (edgrif) - * CVS info: $Id: zmapGFF2parser.c,v 1.6 2004-07-08 09:35:34 edgrif Exp $ + * CVS info: $Id: zmapGFF2parser.c,v 1.7 2004-07-14 12:53:44 edgrif Exp $ *------------------------------------------------------------------- */ @@ -97,7 +97,7 @@ ZMapGFFParser zMapGFFCreateParser(gboolean parse_only) parser->done_sequence_region = FALSE ; parser->sequence_name = NULL ; - parser->sequence_start = parser->sequence_end = 0 ; + parser->features_start = parser->features_end = 0 ; if (!parser->parse_only) { @@ -213,11 +213,35 @@ ZMapFeatureContext zmapGFFGetFeatures(ZMapGFFParser parser) if (!parser->parse_only) { - feature_context = g_new(ZMapFeatureContextStruct, 1) ; + feature_context = g_new0(ZMapFeatureContextStruct, 1) ; feature_context->sequence = g_strdup(parser->sequence_name) ; - feature_context->start = parser->sequence_start ; - feature_context->end = parser->sequence_end ; + +#ifdef ED_G_NEVER_INCLUDE_THIS_CODE + feature_context->start = parser->features_start ; + feature_context->end = parser->features_end ; +#endif /* ED_G_NEVER_INCLUDE_THIS_CODE */ + + /* This is a COMPLETE HACK......we just set all the mapping stuff to have fictitious + * coords for now....in the future it must all be filled in with calls to get the mapping from + * the requested sequence to the parent etc. etc.... + * We assume that we only ask for complete clones.... + * */ + { + int tmp_start = 100000 ; + int clone_length = parser->features_end - parser->features_start + 1 ; + + feature_context->sequence_to_parent.c1 = parser->features_start ; + feature_context->sequence_to_parent.c2 = parser->features_end ; + feature_context->sequence_to_parent.p1 = tmp_start ; + feature_context->sequence_to_parent.p2 + = feature_context->sequence_to_parent.p1 + clone_length ; + + feature_context->features_to_sequence.p1 = parser->features_start ; + feature_context->features_to_sequence.p2 = parser->features_end ; + feature_context->features_to_sequence.c1 = parser->features_start ; + feature_context->features_to_sequence.c2 = parser->features_end ; + } g_datalist_init(&(feature_context->features)) ; @@ -421,8 +445,8 @@ static gboolean parseHeaderLine(ZMapGFFParser parser, char *line) else { parser->sequence_name = g_strdup(&sequence_name[0]) ; - parser->sequence_start = start ; - parser->sequence_end = end ; + parser->features_start = start ; + parser->features_end = end ; parser->done_sequence_region = TRUE ; } diff --git a/src/zmapGFF/zmapGFF_P.h b/src/zmapGFF/zmapGFF_P.h index 6d92314a275a32850de6ca735e251b79d7106b08..c3b26730cc28623d5a07ec79a36b1757c6e992f4 100755 --- a/src/zmapGFF/zmapGFF_P.h +++ b/src/zmapGFF/zmapGFF_P.h @@ -25,9 +25,9 @@ * Description: * Exported functions: See XXXXXXXXXXXXX.h * HISTORY: - * Last edited: Jun 21 11:47 2004 (edgrif) + * Last edited: Jul 14 10:57 2004 (edgrif) * Created: Sat May 29 13:18:32 2004 (edgrif) - * CVS info: $Id: zmapGFF_P.h,v 1.3 2004-06-22 12:24:36 edgrif Exp $ + * CVS info: $Id: zmapGFF_P.h,v 1.4 2004-07-14 12:54:02 edgrif Exp $ *------------------------------------------------------------------- */ #ifndef ZMAP_GFF_P_H @@ -114,7 +114,7 @@ typedef struct ZMapGFFParserStruct_ gboolean done_sequence_region ; char *sequence_name ; - int sequence_start, sequence_end ; + int features_start, features_end ; GData *feature_sets ; /* A list of ZMapGFFParserFeatureSetStruct. There is one of these structs per