Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zmap
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
zmap
Commits
ad751bc9
Commit
ad751bc9
authored
18 years ago
by
edgrif
Browse files
Options
Downloads
Patches
Plain Diff
fix bad bug in parsing gaps array...meant we didn't !
parent
dfb225ac
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/zmapGFF/zmapGFF2parser.c
+29
-23
29 additions, 23 deletions
src/zmapGFF/zmapGFF2parser.c
with
29 additions
and
23 deletions
src/zmapGFF/zmapGFF2parser.c
+
29
−
23
View file @
ad751bc9
...
...
@@ -26,9 +26,9 @@
*
* Exported functions: See ZMap/zmapGFF.h
* HISTORY:
* Last edited:
Sep 29
1
0
:46 2006 (edgrif)
* Last edited:
Oct 16
1
1
:46 2006 (edgrif)
* Created: Fri May 28 14:25:12 2004 (edgrif)
* CVS info: $Id: zmapGFF2parser.c,v 1.5
8
2006-
09-29 09:56
:2
5
edgrif Exp $
* CVS info: $Id: zmapGFF2parser.c,v 1.5
9
2006-
10-16 10:49
:2
7
edgrif Exp $
*-------------------------------------------------------------------
*/
...
...
@@ -730,7 +730,26 @@ static gboolean parseBodyLine(ZMapGFFParser parser, char *line)
attributes
[
GFF_MAX_FREETEXT_CHARS
+
1
]
=
{
'\0'
},
comments
[
GFF_MAX_FREETEXT_CHARS
+
1
]
=
{
'\0'
}
;
int
start
=
0
,
end
=
0
,
fields
=
0
;
double
score
=
0
;
char
*
format_str
=
"%50s%50s%50s%d%d%50s%50s%50s %1000[^#] %1000c"
;
char
*
format_str
=
"%50s%50s%50s%d%d%50s%50s%50s %5000[^#] %5000c"
;
#ifdef ED_G_NEVER_INCLUDE_THIS_CODE
/* I'd like to do this to keep everything in step but haven't quite got the right incantation... */
char
*
format_str
=
"%"
ZMAP_MAKESTRING
(
GFF_MAX_FIELD_CHARS
)
"s"
"%"
ZMAP_MAKESTRING
(
GFF_MAX_FIELD_CHARS
)
"s"
"%"
ZMAP_MAKESTRING
(
GFF_MAX_FIELD_CHARS
)
"s"
"%d%d"
"%"
ZMAP_MAKESTRING
(
GFF_MAX_FIELD_CHARS
)
"s"
"%"
ZMAP_MAKESTRING
(
GFF_MAX_FIELD_CHARS
)
"s"
"%"
ZMAP_MAKESTRING
(
GFF_MAX_FIELD_CHARS
)
"s"
" %"
ZMAP_MAKESTRING
(
GFF_MAX_FREETEXT_CHARS
)
"[^#]"
" %"
ZMAP_MAKESTRING
(
GFF_MAX_FREETEXT_CHARS
)
"c"
;
#endif
/* ED_G_NEVER_INCLUDE_THIS_CODE */
fields
=
sscanf
(
line
,
format_str
,
&
sequence
[
0
],
&
source
[
0
],
&
feature_type
[
0
],
...
...
@@ -1110,8 +1129,12 @@ static gboolean makeNewFeature(ZMapGFFParser parser, NameFindType name_find,
{
/* I am not sure if we ever have target_strand, target_phase from GFF output.... */
if
(
feature_style
->
opts
.
parse_gaps
&&
((
gaps_onwards
=
strstr
(
attributes
,
"
Gaps "
))
!=
NULL
))
((
gaps_onwards
=
strstr
(
attributes
,
"
\t
Gaps "
))
!=
NULL
))
{
if
(
g_ascii_strcasecmp
(
"em:cb183150.1"
,
feature_name
)
==
0
)
printf
(
"found it
\n
"
)
;
gaps
=
g_array_new
(
FALSE
,
FALSE
,
sizeof
(
ZMapAlignBlockStruct
));
gaps_onwards
+=
6
;
/* skip over Gaps tag and pass "1 12 12 122, ..." incl "" not terminated */
loadGaps
(
gaps_onwards
,
gaps
);
...
...
@@ -1147,23 +1170,6 @@ static gboolean makeNewFeature(ZMapGFFParser parser, NameFindType name_find,
}
/* *************************************************************
* Not entirely sure of the wisdom of this (mainly performance
* concerns), but everywhere else we have start < end!. previously
* loadGaps didn't even fill in the strand or apply the start < end
* idiom and gaps array required a test when iterating through
* it (the GArray). The GArray will now be ordered as it almost
* certainly should be to fit with the start < end idiom. RDS
*/
static
int
sortGapsByTarget
(
gconstpointer
a
,
gconstpointer
b
)
{
ZMapAlignBlock
alignA
=
(
ZMapAlignBlock
)
a
,
alignB
=
(
ZMapAlignBlock
)
b
;
return
(
alignA
->
t1
==
alignB
->
t1
?
0
:
(
alignA
->
t1
>
alignB
->
t1
?
1
:
-
1
));
}
/* This reads any gaps which are present on the gff line.
* They are preceded by a Gaps tag, and are presented as
* space-delimited groups of 4, consecutive groups being
...
...
@@ -1211,8 +1217,8 @@ static gboolean loadGaps(char *gapsPos, GArray *gaps)
break
;
/* anything other than 4 is not a gap */
}
}
/* Sort the array of gaps. performance hit? */
g_array_sort
(
gaps
,
sortGapsByTarget
)
;
zMapFeatureSortGaps
(
gaps
)
;
return
valid
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment