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
3d19c9e1
Commit
3d19c9e1
authored
15 years ago
by
edgrif
Browse files
Options
Downloads
Patches
Plain Diff
handle NULL return from dna routines.
parent
357293aa
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/zmapWindow/zmapWindowFeature.c
+26
-21
26 additions, 21 deletions
src/zmapWindow/zmapWindowFeature.c
src/zmapWindow/zmapWindowMenus.c
+42
-37
42 additions, 37 deletions
src/zmapWindow/zmapWindowMenus.c
with
68 additions
and
58 deletions
src/zmapWindow/zmapWindowFeature.c
+
26
−
21
View file @
3d19c9e1
...
...
@@ -28,9 +28,9 @@
*
* Exported functions: See zmapWindow_P.h
* HISTORY:
* Last edited:
Oct
1
6
1
4
:17 2009 (edgrif)
* Last edited:
Nov
1
8
1
6
:17 2009 (edgrif)
* Created: Mon Jan 9 10:25:40 2006 (edgrif)
* CVS info: $Id: zmapWindowFeature.c,v 1.16
5
2009-1
0
-1
6
1
3
:2
6:13
edgrif Exp $
* CVS info: $Id: zmapWindowFeature.c,v 1.16
6
2009-1
1
-1
8
1
6
:2
9:39
edgrif Exp $
*-------------------------------------------------------------------
*/
...
...
@@ -666,12 +666,13 @@ FooCanvasGroup *zmapWindowFeatureItemsMakeGroup(ZMapWindow window, GList *featur
* there's no falling over phase values and stop codons... */
char
*
zmapWindowFeatureTranscriptFASTA
(
ZMapFeature
feature
,
gboolean
spliced
,
gboolean
cds_only
)
{
ZMapFeatureContext
context
;
char
*
peptide_fasta
=
NULL
;
char
*
peptide_fasta
=
NULL
;
ZMapFeatureContext
context
;
if
((
feature
->
type
==
ZMAPSTYLE_MODE_TRANSCRIPT
)
&&
((
context
=
(
ZMapFeatureContext
)
zMapFeatureGetParentGroup
((
ZMapFeatureAny
)
feature
,
ZMAPFEATURE_STRUCT_CONTEXT
))))
if
((
feature
->
type
==
ZMAPSTYLE_MODE_TRANSCRIPT
)
&&
((
context
=
(
ZMapFeatureContext
)
zMapFeatureGetParentGroup
((
ZMapFeatureAny
)
feature
,
ZMAPFEATURE_STRUCT_CONTEXT
))))
{
ZMapPeptide
peptide
;
char
*
dna
,
*
seq_name
=
NULL
,
*
gene_name
=
NULL
;
...
...
@@ -679,23 +680,27 @@ char *zmapWindowFeatureTranscriptFASTA(ZMapFeature feature, gboolean spliced, gb
seq_name
=
(
char
*
)
g_quark_to_string
(
context
->
original_id
);
gene_name
=
(
char
*
)
g_quark_to_string
(
feature
->
original_id
);
dna
=
zMapFeatureGetTranscriptDNA
(
context
,
feature
,
spliced
,
cds_only
)
;
/* Adjust for when its known that the start exon is incomplete.... */
if
(
feature
->
feature
.
transcript
.
flags
.
start_not_found
)
start_incr
=
feature
->
feature
.
transcript
.
start_phase
-
1
;
/* Phase values are 1 <= phase <= 3 */
if
((
dna
=
zMapFeatureGetTranscriptDNA
(
feature
,
spliced
,
cds_only
)))
{
/* Adjust for when its known that the start exon is incomplete.... */
if
(
feature
->
feature
.
transcript
.
flags
.
start_not_found
)
start_incr
=
feature
->
feature
.
transcript
.
start_phase
-
1
;
/* Phase values are 1 <= phase <= 3 */
peptide
=
zMapPeptideCreate
(
seq_name
,
gene_name
,
(
dna
+
start_incr
),
NULL
,
TRUE
)
;
peptide
=
zMapPeptideCreate
(
seq_name
,
gene_name
,
(
dna
+
start_incr
),
NULL
,
TRUE
)
;
/* Note that we do not include the "Stop" in the peptide length, is this the norm ? */
pep_length
=
zMapPeptideLength
(
peptide
)
;
if
(
zMapPeptideHasStopCodon
(
peptide
))
pep_length
--
;
/* Note that we do not include the "Stop" in the peptide length, is this the norm ? */
pep_length
=
zMapPeptideLength
(
peptide
)
;
if
(
zMapPeptideHasStopCodon
(
peptide
))
pep_length
--
;
peptide_fasta
=
zMapFASTAString
(
ZMAPFASTA_SEQTYPE_AA
,
seq_name
,
"Protein"
,
gene_name
,
pep_length
,
zMapPeptideSequence
(
peptide
));
peptide_fasta
=
zMapFASTAString
(
ZMAPFASTA_SEQTYPE_AA
,
seq_name
,
"Protein"
,
gene_name
,
pep_length
,
zMapPeptideSequence
(
peptide
));
g_free
(
dna
)
;
}
}
return
peptide_fasta
;
...
...
This diff is collapsed.
Click to expand it.
src/zmapWindow/zmapWindowMenus.c
+
42
−
37
View file @
3d19c9e1
...
...
@@ -27,9 +27,9 @@
* Exported functions: ZMap/zmapWindows.h
*
* HISTORY:
* Last edited:
Jul 3
16:
54
2009 (
rds
)
* Last edited:
Nov 18
16:
17
2009 (
edgrif
)
* Created: Thu Mar 10 07:56:27 2005 (edgrif)
* CVS info: $Id: zmapWindowMenus.c,v 1.6
2
2009-
07-27 03:15:13 rds
Exp $
* CVS info: $Id: zmapWindowMenus.c,v 1.6
3
2009-
11-18 16:30:02 edgrif
Exp $
*-------------------------------------------------------------------
*/
...
...
@@ -410,14 +410,18 @@ static void dnaMenuCB(int menu_item_id, gpointer callback_data)
}
else
if
(
feature
->
type
==
ZMAPSTYLE_MODE_TRANSCRIPT
)
{
dna
=
zMapFeatureGetTranscriptDNA
(
context
,
feature
,
spliced
,
cds
)
;
dna
=
zMapFeatureGetTranscriptDNA
(
feature
,
spliced
,
cds
)
;
}
else
{
dna
=
zMapFeatureGetFeatureDNA
(
context
,
feature
)
;
dna
=
zMapFeatureGetFeatureDNA
(
feature
)
;
}
if
(
dna
)
if
(
!
dna
)
{
zMapWarning
(
"%s"
,
"No DNA available"
)
;
}
else
{
/* Would be better to have the dna functions calculate and return this.... */
seq_len
=
strlen
(
dna
)
;
...
...
@@ -644,46 +648,47 @@ static void peptideMenuCB(int menu_item_id, gpointer callback_data)
molecule_type
=
"Protein"
;
gene_name
=
(
char
*
)
g_quark_to_string
(
feature
->
original_id
)
;
dna
=
zMapFeatureGetTranscriptDNA
(
menu_data
->
window
->
feature_context
,
feature
,
spliced
,
cds
)
;
/* Adjust for when its known that the start exon is incomplete.... */
if
(
feature
->
feature
.
transcript
.
flags
.
start_not_found
)
start_incr
=
feature
->
feature
.
transcript
.
start_phase
-
1
;
/* Phase values are 1 <= phase <= 3 */
if
((
dna
=
zMapFeatureGetTranscriptDNA
(
feature
,
spliced
,
cds
)
))
{
/* Adjust for when its known that the start exon is incomplete.... */
if
(
feature
->
feature
.
transcript
.
flags
.
start_not_found
)
start_incr
=
feature
->
feature
.
transcript
.
start_phase
-
1
;
/* Phase values are 1 <= phase <= 3 */
peptide
=
zMapPeptideCreate
(
seq_name
,
gene_name
,
(
dna
+
start_incr
),
NULL
,
TRUE
)
;
peptide
=
zMapPeptideCreate
(
seq_name
,
gene_name
,
(
dna
+
start_incr
),
NULL
,
TRUE
)
;
/* Note that we do not include the "Stop" in the peptide length, is this the norm ? */
pep_length
=
zMapPeptideLength
(
peptide
)
;
if
(
zMapPeptideHasStopCodon
(
peptide
))
pep_length
--
;
/* Note that we do not include the "Stop" in the peptide length, is this the norm ? */
pep_length
=
zMapPeptideLength
(
peptide
)
;
if
(
zMapPeptideHasStopCodon
(
peptide
))
pep_length
--
;
if
(
menu_item_id
==
ZMAPCDS
||
menu_item_id
==
ZMAPTRANSCRIPT
||
menu_item_id
==
ZMAPUNSPLICED
)
{
char
*
title
;
char
*
peptide_fasta
;
if
(
menu_item_id
==
ZMAPCDS
||
menu_item_id
==
ZMAPTRANSCRIPT
||
menu_item_id
==
ZMAPUNSPLICED
)
{
char
*
title
;
char
*
peptide_fasta
;
peptide_fasta
=
zMapFASTAString
(
ZMAPFASTA_SEQTYPE_AA
,
seq_name
,
molecule_type
,
gene_name
,
pep_length
,
zMapPeptideSequence
(
peptide
))
;
peptide_fasta
=
zMapFASTAString
(
ZMAPFASTA_SEQTYPE_AA
,
seq_name
,
molecule_type
,
gene_name
,
pep_length
,
zMapPeptideSequence
(
peptide
))
;
title
=
g_strdup_printf
(
"%s%s%s"
,
seq_name
,
gene_name
?
":"
:
""
,
gene_name
?
gene_name
:
""
)
;
zMapGUIShowText
(
title
,
peptide_fasta
,
FALSE
)
;
g_free
(
title
)
;
title
=
g_strdup_printf
(
"%s%s%s"
,
seq_name
,
gene_name
?
":"
:
""
,
gene_name
?
gene_name
:
""
)
;
zMapGUIShowText
(
title
,
peptide_fasta
,
FALSE
)
;
g_free
(
title
)
;
g_free
(
peptide_fasta
)
;
}
else
{
dumpFASTA
(
menu_data
->
window
,
ZMAPFASTA_SEQTYPE_AA
,
zMapPeptideSequence
(
peptide
),
seq_name
,
pep_length
,
molecule_type
,
gene_name
)
;
}
g_free
(
peptide_fasta
)
;
}
else
{
dumpFASTA
(
menu_data
->
window
,
ZMAPFASTA_SEQTYPE_AA
,
zMapPeptideSequence
(
peptide
),
seq_name
,
pep_length
,
molecule_type
,
gene_name
)
;
}
zMapPeptideDestroy
(
peptide
)
;
zMapPeptideDestroy
(
peptide
)
;
g_free
(
dna
)
;
g_free
(
dna
)
;
}
g_free
(
menu_data
)
;
...
...
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