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
850037db
Commit
850037db
authored
15 years ago
by
edgrif
Browse files
Options
Downloads
Patches
Plain Diff
add function to return a list of features with same name from a feature set.
parent
69324c7f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/include/ZMap/zmapFeature.h
+3
-3
3 additions, 3 deletions
src/include/ZMap/zmapFeature.h
src/zmapFeature/zmapFeature.c
+37
-3
37 additions, 3 deletions
src/zmapFeature/zmapFeature.c
with
40 additions
and
6 deletions
src/include/ZMap/zmapFeature.h
+
3
−
3
View file @
850037db
...
...
@@ -25,9 +25,9 @@
* Description: Data structures describing a sequence feature.
*
* HISTORY:
* Last edited:
Nov
1
8
1
6:11
2009 (edgrif)
* Last edited:
Dec
1
4
1
0:23
2009 (edgrif)
* Created: Fri Jun 11 08:37:19 2004 (edgrif)
* CVS info: $Id: zmapFeature.h,v 1.16
6
2009-1
1
-1
8
1
6:27:10
edgrif Exp $
* CVS info: $Id: zmapFeature.h,v 1.16
7
2009-1
2
-1
6
1
0:54:35
edgrif Exp $
*-------------------------------------------------------------------
*/
#ifndef ZMAP_FEATURE_H
...
...
@@ -748,7 +748,7 @@ void zMapFeatureSetDestroy(ZMapFeatureSet feature_set, gboolean free_data) ;
void
zMapFeatureSetStyle
(
ZMapFeatureSet
feature_set
,
ZMapFeatureTypeStyle
style
)
;
char
*
zMapFeatureSetGetName
(
ZMapFeatureSet
feature_set
)
;
GList
*
zMapFeatureSetGetRangeFeatures
(
ZMapFeatureSet
feature_set
,
int
start
,
int
end
)
;
GList
*
zMapFeatureSetGetNamedFeatures
(
ZMapFeatureSet
feature_set
,
GQuark
original_id
)
;
/* *********************
...
...
This diff is collapsed.
Click to expand it.
src/zmapFeature/zmapFeature.c
+
37
−
3
View file @
850037db
...
...
@@ -27,9 +27,9 @@
*
* Exported functions: See zmapView_P.h
* HISTORY:
* Last edited:
Sep
1
0
1
6:11
2009 (edgrif)
* Last edited:
Dec
1
4
1
1:20
2009 (edgrif)
* Created: Fri Jul 16 13:05:58 2004 (edgrif)
* CVS info: $Id: zmapFeature.c,v 1.11
8
2009-
09-24 12:43:23
edgrif Exp $
* CVS info: $Id: zmapFeature.c,v 1.11
9
2009-
12-16 10:54:35
edgrif Exp $
*-------------------------------------------------------------------
*/
...
...
@@ -123,6 +123,7 @@ typedef struct _HackForForcingStyleModeStruct
typedef
struct
{
GQuark
original_id
;
int
start
,
end
;
GList
*
feature_list
;
}
FindFeaturesRangeStruct
,
*
FindFeaturesRange
;
...
...
@@ -172,7 +173,7 @@ static void addFeatureModeCB(gpointer key, gpointer data, gpointer user_data) ;
static
void
logMemCalls
(
gboolean
alloc
,
ZMapFeatureAny
feature_any
)
;
static
void
findFeaturesRangeCB
(
gpointer
key
,
gpointer
value
,
gpointer
user_data
)
;
static
void
findFeaturesNameCB
(
gpointer
key
,
gpointer
value
,
gpointer
user_data
)
;
static
gboolean
merge_debug_G
=
FALSE
;
...
...
@@ -1117,6 +1118,8 @@ GList *zMapFeatureSetGetRangeFeatures(ZMapFeatureSet feature_set, int start, int
g_hash_table_foreach
(
feature_set
->
features
,
findFeaturesRangeCB
,
&
find_data
)
;
feature_list
=
find_data
.
feature_list
;
return
feature_list
;
}
...
...
@@ -1133,6 +1136,37 @@ static void findFeaturesRangeCB(gpointer key, gpointer value, gpointer user_data
}
GList
*
zMapFeatureSetGetNamedFeatures
(
ZMapFeatureSet
feature_set
,
GQuark
original_id
)
{
GList
*
feature_list
=
NULL
;
FindFeaturesRangeStruct
find_data
=
{
0
}
;
find_data
.
original_id
=
original_id
;
find_data
.
feature_list
=
NULL
;
g_hash_table_foreach
(
feature_set
->
features
,
findFeaturesNameCB
,
&
find_data
)
;
feature_list
=
find_data
.
feature_list
;
return
feature_list
;
}
/* A GHFunc() to add a feature to a list if it within a given range */
static
void
findFeaturesNameCB
(
gpointer
key
,
gpointer
value
,
gpointer
user_data
)
{
FindFeaturesRange
find_data
=
(
FindFeaturesRange
)
user_data
;
ZMapFeature
feature
=
(
ZMapFeature
)
value
;
if
(
feature
->
original_id
==
find_data
->
original_id
)
find_data
->
feature_list
=
g_list_append
(
find_data
->
feature_list
,
feature
)
;
return
;
}
void
zMapFeatureSetDestroy
(
ZMapFeatureSet
feature_set
,
gboolean
free_data
)
{
gboolean
result
;
...
...
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