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
d2551907
Commit
d2551907
authored
18 years ago
by
edgrif
Browse files
Options
Downloads
Patches
Plain Diff
fix encode/decode of dna so it copes with embedded '-' padding chars.
parent
26fb6495
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/zmapUtils/zmapPeptide.c
+32
-14
32 additions, 14 deletions
src/zmapUtils/zmapPeptide.c
with
32 additions
and
14 deletions
src/zmapUtils/zmapPeptide.c
+
32
−
14
View file @
d2551907
...
...
@@ -27,9 +27,9 @@
*
* Exported functions: See ZMap/zmapPeptide.h
* HISTORY:
* Last edited:
Nov
7
1
3:40
200
6
(edgrif)
* Last edited:
Mar
5
1
2:55
200
7
(edgrif)
* Created: Mon Mar 13 11:43:42 2006 (edgrif)
* CVS info: $Id: zmapPeptide.c,v 1.
5
200
6-11-08 09:24:5
0 edgrif Exp $
* CVS info: $Id: zmapPeptide.c,v 1.
6
200
7-03-05 13:05:4
0 edgrif Exp $
*-------------------------------------------------------------------
*/
...
...
@@ -185,16 +185,25 @@ char complementBase[] =
{
0
,
T_
,
A_
,
W_
,
C_
,
Y_
,
M_
,
H_
,
G_
,
K_
,
R_
,
D_
,
S_
,
B_
,
V_
,
N_
}
;
/* I have added a '-' to ASCII position 45 for '-' which is used to pad incomplete
* sequences. If you don't have this then on encountering a '-' the code will
* insert a NULL char which terminates the sequence as C string !
*
* I've also added '-' to dnaDecodeChar[] which is populated in the function
* that uses it....why it does that is an acedb mystery... */
char
dnaEncodeChar
[]
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
A_
,
B_
,
C_
,
D_
,
0
,
0
,
G_
,
H_
,
0
,
0
,
K_
,
0
,
M_
,
N_
,
0
,
0
,
0
,
R_
,
S_
,
T_
,
U_
,
V_
,
W_
,
0
,
Y_
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
A_
,
B_
,
C_
,
D_
,
0
,
0
,
G_
,
H_
,
0
,
0
,
K_
,
0
,
M_
,
N_
,
0
,
0
,
0
,
R_
,
S_
,
T_
,
U_
,
V_
,
W_
,
0
,
Y_
,
0
,
0
,
0
,
0
,
0
,
0
,
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
'-'
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
A_
,
B_
,
C_
,
D_
,
0
,
0
,
G_
,
H_
,
0
,
0
,
K_
,
0
,
M_
,
N_
,
0
,
0
,
0
,
R_
,
S_
,
T_
,
U_
,
V_
,
W_
,
0
,
Y_
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
A_
,
B_
,
C_
,
D_
,
0
,
0
,
G_
,
H_
,
0
,
0
,
K_
,
0
,
M_
,
N_
,
0
,
0
,
0
,
R_
,
S_
,
T_
,
U_
,
V_
,
W_
,
0
,
Y_
,
0
,
0
,
0
,
0
,
0
,
0
,
}
;
char
dnaDecodeChar
[
1
<<
4
]
=
{
0
};
...
...
@@ -475,6 +484,7 @@ ZMapPeptide zMapPeptideCreate(char *sequence_name, char *gene_name,
pep
->
peptide
=
doDNATranslation
(
translation_table
,
dna_array
,
FALSE
,
include_stop
)
;
return
pep
;
}
...
...
@@ -493,6 +503,8 @@ ZMapPeptide zMapPeptideCreateSafely(char *sequence_name, char *gene_name,
return
pep
;
}
int
zMapPeptideLength
(
ZMapPeptide
peptide
)
{
int
length
;
...
...
@@ -791,10 +803,11 @@ static void printTranslationTable(KEY genetic_code_key, GArray *translationTable
* dna to this format before translating it. */
static
void
dnaEncodeString
(
char
*
cp
)
{
--
cp
;
while
(
*++
cp
)
*
cp
=
dnaEncodeChar
[((
int
)
*
cp
)
&
0x7f
]
;
{
*
cp
=
dnaEncodeChar
[((
int
)
*
cp
)
&
0x7f
]
;
}
return
;
}
...
...
@@ -820,8 +833,13 @@ static void dnaDecodeString(char *cp)
dnaDecodeChar
[
N_
]
=
'n'
;
dnaDecodeChar
[
45
]
=
'-'
;
/* Needed for padded sequences. */
--
cp
;
while
(
*++
cp
)
*
cp
=
dnaDecodeChar
[((
int
)
*
cp
)];
{
*
cp
=
dnaDecodeChar
[((
int
)
*
cp
)];
}
return
;
}
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