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
a7e1a091
Commit
a7e1a091
authored
16 years ago
by
edgrif
Browse files
Options
Downloads
Patches
Plain Diff
replace references to features style ptr with calls find names style.
parent
be83daf1
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/include/ZMap/zmapGFF.h
+5
-3
5 additions, 3 deletions
src/include/ZMap/zmapGFF.h
src/zmapGFF/zmapGFF2Dumper.c
+30
-21
30 additions, 21 deletions
src/zmapGFF/zmapGFF2Dumper.c
with
35 additions
and
24 deletions
src/include/ZMap/zmapGFF.h
+
5
−
3
View file @
a7e1a091
...
...
@@ -28,9 +28,9 @@
* of ZMapFeatureStruct's, one for each GFF source.
*
* HISTORY:
* Last edited:
Nov 4 09:49
200
8
(
rds
)
* Last edited:
Feb 3 13:36
200
9
(
edgrif
)
* Created: Sat May 29 13:18:32 2004 (edgrif)
* CVS info: $Id: zmapGFF.h,v 1.1
4
200
8-11
-0
5
1
2:12:44 rds
Exp $
* CVS info: $Id: zmapGFF.h,v 1.1
5
200
9-02
-0
3
1
3:48:12 edgrif
Exp $
*-------------------------------------------------------------------
*/
#ifndef ZMAP_GFF_H
...
...
@@ -88,6 +88,8 @@ gboolean zMapGFFTerminated(ZMapGFFParser parser) ;
void
zMapGFFSetFreeOnDestroy
(
ZMapGFFParser
parser
,
gboolean
free_on_destroy
)
;
void
zMapGFFDestroyParser
(
ZMapGFFParser
parser
)
;
gboolean
zMapGFFDump
(
ZMapFeatureAny
dump_set
,
GIOChannel
*
file
,
GError
**
error_out
);
gboolean
zMapGFFDump
(
ZMapFeatureAny
dump_set
,
GData
*
styles
,
GIOChannel
*
file
,
GError
**
error_out
);
gboolean
zMapGFFDumpRegion
(
ZMapFeatureAny
dump_set
,
GData
*
styles
,
ZMapSpan
region_span
,
GIOChannel
*
file
,
GError
**
error_out
)
;
#endif
/* ZMAP_GFF_H */
This diff is collapsed.
Click to expand it.
src/zmapGFF/zmapGFF2Dumper.c
+
30
−
21
View file @
a7e1a091
...
...
@@ -26,15 +26,15 @@
*
* Exported functions: See ZMap/zmapGFF.h
* HISTORY:
* Last edited:
Nov 24 15:17
200
8
(
rds
)
* Last edited:
Feb 3 13:39
200
9
(
edgrif
)
* Created: Mon Nov 14 13:21:14 2005 (edgrif)
* CVS info: $Id: zmapGFF2Dumper.c,v 1.1
4
200
8-11-24
1
5
:4
1:07 rds
Exp $
* CVS info: $Id: zmapGFF2Dumper.c,v 1.1
5
200
9-02-03
1
3
:4
7:53 edgrif
Exp $
*-------------------------------------------------------------------
*/
#include
<ZMap/zmapUtils.h>
#include
<ZMap/zmapFeature.h>
#include
<ZMap/zmapGFF.h>
#define GFF_SEPARATOR "\t"
#define GFF_SEQ "%s"
...
...
@@ -85,6 +85,8 @@ typedef struct
/* Fields are: <sequence> <source> <feature> <start> <end> <score> <strand> <frame> <attributes> */
typedef
struct
_GFFDumpDataStruct
{
GData
*
styles
;
const
char
*
gff_sequence
;
/* The sequence name. e.g. 16.12345-23456 */
char
*
gff_source
;
/* The source e.g. augustus, TrEMBL, trf, polya_site */
char
*
gff_feature
;
/* The feature type e.g. Sequence, intron, exon, CDS, coding_exon, misc_feature */
...
...
@@ -100,16 +102,18 @@ typedef struct _GFFDumpDataStruct
}
GFFDumpDataStruct
;
/* Functions to dump the header section of gff files */
static
gboolean
dump_full_header
(
ZMapFeatureAny
feature_any
,
GIOChannel
*
file
,
GError
**
error_out
,
const
char
**
sequence_in_out
);
static
gboolean
dump_full_header
(
ZMapFeatureAny
feature_any
,
GIOChannel
*
file
,
GError
**
error_out
,
const
char
**
sequence_in_out
)
;
static
ZMapFeatureContextExecuteStatus
get_type_seq_header_cb
(
GQuark
key
,
gpointer
data
,
gpointer
user_data
,
char
**
err_out
);
char
**
err_out
)
;
/* Functions to dump the body of the data */
/* ZMapFeatureDumpFeatureFunc to dump gff. writes lines into gstring buffer... */
static
gboolean
dump_gff_cb
(
ZMapFeatureAny
feature_any
,
static
gboolean
dump_gff_cb
(
ZMapFeatureAny
feature_any
,
GData
*
styles
,
GString
*
gff_string
,
GError
**
error
,
gpointer
user_data
);
...
...
@@ -207,16 +211,17 @@ static DumpGFFAttrFunc text_funcs_G[] = {
* sequences.
*
* */
gboolean
zMapGFFDump
(
ZMapFeatureAny
dump_set
,
GIOChannel
*
file
,
GError
**
error_out
)
gboolean
zMapGFFDump
(
ZMapFeatureAny
dump_set
,
GData
*
styles
,
GIOChannel
*
file
,
GError
**
error_out
)
{
gboolean
result
=
TRUE
;
result
=
zMapGFFDumpRegion
(
dump_set
,
NULL
,
file
,
error_out
);
result
=
zMapGFFDumpRegion
(
dump_set
,
styles
,
NULL
,
file
,
error_out
);
return
result
;
}
gboolean
zMapGFFDumpRegion
(
ZMapFeatureAny
dump_set
,
ZMapSpan
region_span
,
GIOChannel
*
file
,
GError
**
error_out
)
gboolean
zMapGFFDumpRegion
(
ZMapFeatureAny
dump_set
,
GData
*
styles
,
ZMapSpan
region_span
,
GIOChannel
*
file
,
GError
**
error_out
)
{
const
char
*
sequence
=
NULL
;
gboolean
result
=
TRUE
;
...
...
@@ -238,16 +243,17 @@ gboolean zMapGFFDumpRegion(ZMapFeatureAny dump_set, ZMapSpan region_span, GIOCha
gff_data
.
transcript
=
transcript_funcs_G
;
gff_data
.
homol
=
homol_funcs_G
;
gff_data
.
text
=
text_funcs_G
;
gff_data
.
styles
=
styles
;
/* This might get overwritten later, but as DumpToFile uses
* Subset, there's a chance it wouldn't get set at all */
gff_data
.
gff_sequence
=
sequence
;
if
(
region_span
)
result
=
zMapFeatureContextRangeDumpToFile
((
ZMapFeatureAny
)
dump_set
,
region_span
,
result
=
zMapFeatureContextRangeDumpToFile
((
ZMapFeatureAny
)
dump_set
,
styles
,
region_span
,
dump_gff_cb
,
&
gff_data
,
file
,
error_out
)
;
else
result
=
zMapFeatureContextDumpToFile
((
ZMapFeatureAny
)
dump_set
,
dump_gff_cb
,
&
gff_data
,
file
,
error_out
)
;
result
=
zMapFeatureContextDumpToFile
((
ZMapFeatureAny
)
dump_set
,
styles
,
dump_gff_cb
,
&
gff_data
,
file
,
error_out
)
;
}
return
result
;
...
...
@@ -256,7 +262,7 @@ gboolean zMapGFFDumpRegion(ZMapFeatureAny dump_set, ZMapSpan region_span, GIOCha
/*!
* \brief Dump a list of ZMapFeatureAny. sequence can be NULL
*/
gboolean
zMapGFFDumpList
(
GList
*
dump_list
,
char
*
sequence
,
GIOChannel
*
file
,
GError
**
error_out
)
gboolean
zMapGFFDumpList
(
GList
*
dump_list
,
GData
*
styles
,
char
*
sequence
,
GIOChannel
*
file
,
GError
**
error_out
)
{
const
char
*
int_sequence
=
NULL
;
gboolean
result
=
FALSE
;
...
...
@@ -284,14 +290,14 @@ gboolean zMapGFFDumpList(GList *dump_list, char *sequence, GIOChannel *file, GEr
* Subset, there's a chance it wouldn't get set at all */
gff_data
.
gff_sequence
=
int_sequence
;
result
=
zMapFeatureListDumpToFile
(
dump_list
,
dump_gff_cb
,
&
gff_data
,
result
=
zMapFeatureListDumpToFile
(
dump_list
,
styles
,
dump_gff_cb
,
&
gff_data
,
file
,
error_out
)
;
}
return
result
;
}
gboolean
zMapGFFDumpForeachList
(
ZMapFeatureAny
first_feature
,
GIOChannel
*
file
,
GError
**
error_out
,
gboolean
zMapGFFDumpForeachList
(
ZMapFeatureAny
first_feature
,
GData
*
styles
,
GIOChannel
*
file
,
GError
**
error_out
,
char
*
sequence
,
GFunc
*
list_func_out
,
gpointer
*
list_data_out
)
{
const
char
*
int_sequence
=
NULL
;
...
...
@@ -321,7 +327,7 @@ gboolean zMapGFFDumpForeachList(ZMapFeatureAny first_feature, GIOChannel *file,
* Subset, there's a chance it wouldn't get set at all */
gff_data
->
gff_sequence
=
int_sequence
;
result
=
zMapFeatureListForeachDumperCreate
(
dump_gff_cb
,
gff_data
,
g_free
,
result
=
zMapFeatureListForeachDumperCreate
(
dump_gff_cb
,
styles
,
gff_data
,
g_free
,
file
,
error_out
,
list_func_out
,
list_data_out
)
;
}
...
...
@@ -446,6 +452,7 @@ static ZMapFeatureContextExecuteStatus get_type_seq_header_cb(GQuark key,
}
static
gboolean
dump_gff_cb
(
ZMapFeatureAny
feature_any
,
GData
*
styles
,
GString
*
gff_string
,
GError
**
error
,
gpointer
user_data
)
...
...
@@ -469,13 +476,15 @@ static gboolean dump_gff_cb(ZMapFeatureAny feature_any,
case
ZMAPFEATURE_STRUCT_FEATURE
:
{
ZMapFeature
feature
=
(
ZMapFeature
)
feature_any
;
ZMapFeatureTypeStyle
style
;
/* Fields are: <seqname> <source> <feature> <start> <end> <score> <strand> <frame> */
style
=
zMapFindStyle
(
gff_data
->
styles
,
feature
->
style_id
)
;
/* Output a record for the whole feature. */
if
(
!
(
gff_data
->
gff_source
=
zMapStyleGetGFFSource
(
feature
->
style
)))
gff_data
->
gff_source
=
zMapStyleGetName
(
feature
->
style
);
if
(
!
(
gff_data
->
gff_feature
=
zMapStyleGetGFFFeature
(
feature
->
style
)))
/* Output a record for the whole feature, fields are:
* <seqname> <source> <feature> <start> <end> <score> <strand> <frame> */
if
(
!
(
gff_data
->
gff_source
=
zMapStyleGetGFFSource
(
style
)))
gff_data
->
gff_source
=
zMapStyleGetName
(
style
);
if
(
!
(
gff_data
->
gff_feature
=
zMapStyleGetGFFFeature
(
style
)))
gff_data
->
gff_feature
=
(
char
*
)
g_quark_to_string
(
feature
->
ontology
);
/* Obligatory fields. */
...
...
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