Skip to content

Commit

Permalink
Added align.c/blFreeMDM()
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Martin authored and Andrew Martin committed May 2, 2018
1 parent 891b3f7 commit e610677
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 9 deletions.
33 changes: 27 additions & 6 deletions src/align.c
Expand Up @@ -3,11 +3,11 @@
\file align.c
\version V3.6
\date 04.01.16
\version V3.7
\date 02.05.18
\brief Perform Needleman & Wunsch sequence alignment
\copyright (c) UCL / Dr. Andrew C. R. Martin 1993-2016
\copyright (c) UCL / Dr. Andrew C. R. Martin 1993-2018
\author Dr. Andrew C. R. Martin
\par
Institute of Structural & Molecular Biology,
Expand Down Expand Up @@ -83,6 +83,7 @@
- V3.6 04.01.16 Added special calls to blCalcMDMScore() and
blCalcMDMScoreUC() to silence warnings. Warnings now
go to stderr
- V3.7 02.05.18 Added blFreeMDM()
*************************************************************************/
/* Doxygen
Expand All @@ -106,6 +107,10 @@
Read mutation data matrix into static global arrays for use by
alignment code
#FUNCTION blFreeMDM()
Free the memory containing the mutation data matrix allocated by
blReadMDM()
#FUNCTION blCalcMDMScore()
Calculates a score for comparing two amino acids using a mutation
data matrix
Expand Down Expand Up @@ -160,9 +165,9 @@ typedef struct
/************************************************************************/
/* Globals
*/
static int **sMDMScore;
static char *sMDM_AAList;
static int sMDMSize = 0;
static int **sMDMScore = NULL;
static char *sMDM_AAList = NULL;
static int sMDMSize = 0;

/************************************************************************/
/* Prototypes
Expand Down Expand Up @@ -996,6 +1001,22 @@ BOOL blReadMDM(char *mdmfile)
}


/************************************************************************/
/*>void blFreeMDM(void)
--------------------
*//**
Frees the memory allocated by blReadMDM()
- 02.05.18 Original By: ACRM
*/
void blFreeMDM(void)
{
FREE(sMDM_AAList);
blFreeArray2D((char **)sMDMScore, sMDMSize, sMDMSize);
sMDMSize = 0;
}


/************************************************************************/
/*>static int SearchForBest(int **matrix, int length1, int length2,
int *BestI, int *BestJ, char *seq1,
Expand Down
8 changes: 5 additions & 3 deletions src/seq.h
Expand Up @@ -3,11 +3,11 @@
\file seq.h
\version V2.16
\date 30.11.15
\version V2.17
\date 02.05.18
\brief Header file for sequence handling
\copyright (c) UCL / Dr. Andrew C. R. Martin 1991-2015
\copyright (c) UCL / Dr. Andrew C. R. Martin 1991-2018
\author Dr. Andrew C. R. Martin
\par
Institute of Structural & Molecular Biology,
Expand Down Expand Up @@ -69,6 +69,7 @@
- V2.15 11.06.15 Added blWriteOneStringPIR()
- V2.16 30.11.15 Added wrapper macros for blDoPDB2SeqByChain() and
prototype
- V2.17 02.05.18 Added blFreeMDM()
*************************************************************************/
#ifndef _SEQ_H
Expand Down Expand Up @@ -147,6 +148,7 @@ int blAffinealignuc(char *seq1, int length1, char *seq2, int length2,
char *align1, char *align2, int *align_len);
int blCalcMDMScoreUC(char resa, char resb);
BOOL blReadMDM(char *mdmfile);
void blFreeMDM(void);
int blZeroMDM(void);
char blDNAtoAA(char *dna);
int blTrueSeqLen(char *sequence);
Expand Down

0 comments on commit e610677

Please sign in to comment.