Skip to content

Commit

Permalink
Fixed an issue where Blosum-62 scores weren't organized alphabetically
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-nord committed Jun 22, 2023
1 parent 4a87ba5 commit 0022305
Showing 1 changed file with 40 additions and 40 deletions.
80 changes: 40 additions & 40 deletions src/BasicBio.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@ static float MBB_INF = 1.0/0.0;
static float MBB_NINF = -1.0/0.0;

static float MBB_BLOSUM62[441] = {
4.0, -1.0, -2.0, -2.0, 0.0, -1.0, -1.0, 0.0, -2.0, -1.0, -1.0, -1.0, -1.0, -2.0, -1.0, 1.0, 0.0, -3.0, -2.0, 0.0, 0.0,
-1.0, 5.0, 0.0, -2.0, -3.0, 1.0, 0.0, -2.0, 0.0, -3.0, -2.0, 2.0, -1.0, -3.0, -2.0, -1.0, -1.0, -3.0, -2.0, -3.0, 0.0,
-2.0, 0.0, 6.0, 1.0, -3.0, 0.0, 0.0, 0.0, 1.0, -3.0, -3.0, 0.0, -2.0, -3.0, -2.0, 1.0, 0.0, -4.0, -2.0, -3.0, 0.0,
-2.0, -2.0, 1.0, 6.0, -3.0, 0.0, 2.0, -1.0, -1.0, -3.0, -4.0, -1.0, -3.0, -3.0, -1.0, 0.0, -1.0, -4.0, -3.0, -3.0, 0.0,
0.0, -3.0, -3.0, -3.0, 9.0, -3.0, -4.0, -3.0, -3.0, -1.0, -1.0, -3.0, -1.0, -2.0, -3.0, -1.0, -1.0, -2.0, -2.0, -1.0, 0.0,
-1.0, 1.0, 0.0, 0.0, -3.0, 5.0, 2.0, -2.0, 0.0, -3.0, -2.0, 1.0, 0.0, -3.0, -1.0, 0.0, -1.0, -2.0, -1.0, -2.0, 0.0,
-1.0, 0.0, 0.0, 2.0, -4.0, 2.0, 5.0, -2.0, 0.0, -3.0, -3.0, 1.0, -2.0, -3.0, -1.0, 0.0, -1.0, -3.0, -2.0, -2.0, 0.0,
0.0, -2.0, 0.0, -1.0, -3.0, -2.0, -2.0, 6.0, -2.0, -4.0, -4.0, -2.0, -3.0, -3.0, -2.0, 0.0, -2.0, -2.0, -3.0, -3.0, 0.0,
-2.0, 0.0, 1.0, -1.0, -3.0, 0.0, 0.0, -2.0, 8.0, -3.0, -3.0, -1.0, -2.0, -1.0, -2.0, -1.0, -2.0, -2.0, 2.0, -3.0, 0.0,
-1.0, -3.0, -3.0, -3.0, -1.0, -3.0, -3.0, -4.0, -3.0, 4.0, 2.0, -3.0, 1.0, 0.0, -3.0, -2.0, -1.0, -3.0, -1.0, 3.0, 0.0,
-1.0, -2.0, -3.0, -4.0, -1.0, -2.0, -3.0, -4.0, -3.0, 2.0, 4.0, -2.0, 2.0, 0.0, -3.0, -2.0, -1.0, -2.0, -1.0, 1.0, 0.0,
-1.0, 2.0, 0.0, -1.0, -3.0, 1.0, 1.0, -2.0, -1.0, -3.0, -2.0, 5.0, -1.0, -3.0, -1.0, 0.0, -1.0, -3.0, -2.0, -2.0, 0.0,
-1.0, -1.0, -2.0, -3.0, -1.0, 0.0, -2.0, -3.0, -2.0, 1.0, 2.0, -1.0, 5.0, 0.0, -2.0, -1.0, -1.0, -1.0, -1.0, 1.0, 0.0,
-2.0, -3.0, -3.0, -3.0, -2.0, -3.0, -3.0, -3.0, -1.0, 0.0, 0.0, -3.0, 0.0, 6.0, -4.0, -2.0, -2.0, 1.0, 3.0, -1.0, 0.0,
-1.0, -2.0, -2.0, -1.0, -3.0, -1.0, -1.0, -2.0, -2.0, -3.0, -3.0, -1.0, -2.0, -4.0, 7.0, -1.0, -1.0, -4.0, -3.0, -2.0, 0.0,
1.0, -1.0, 1.0, 0.0, -1.0, 0.0, 0.0, 0.0, -1.0, -2.0, -2.0, 0.0, -1.0, -2.0, -1.0, 4.0, 1.0, -3.0, -2.0, -2.0, 0.0,
0.0, -1.0, 0.0, -1.0, -1.0, -1.0, -1.0, -2.0, -2.0, -1.0, -1.0, -1.0, -1.0, -2.0, -1.0, 1.0, 5.0, -2.0, -2.0, 0.0, 0.0,
-3.0, -3.0, -4.0, -4.0, -2.0, -2.0, -3.0, -2.0, -2.0, -3.0, -2.0, -3.0, -1.0, 1.0, -4.0, -3.0, -2.0, 11.0, 2.0, -3.0, 0.0,
-2.0, -2.0, -2.0, -3.0, -2.0, -1.0, -2.0, -3.0, 2.0, -1.0, -1.0, -2.0, -1.0, 3.0, -3.0, -2.0, -2.0, 2.0, 7.0, -1.0, 0.0,
0.0, -3.0, -3.0, -3.0, -1.0, -2.0, -2.0, -3.0, -3.0, 3.0, 1.0, -2.0, 1.0, -1.0, -2.0, -2.0, 0.0, -3.0, -1.0, 4.0, 0.0,
4.0, 0.0, -2.0, -1.0, -2.0, 0.0, -2.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 1.0, -1.0, -2.0, -3.0, -2.0, 0.0,
0.0, 9.0, -3.0, -4.0, -2.0, -3.0, -3.0, -1.0, -3.0, -1.0, -1.0, -3.0, -3.0, -3.0, -3.0, -1.0, -1.0, -1.0, -2.0, -2.0, 0.0,
-2.0, -3.0, 6.0, 2.0, -3.0, -1.0, -1.0, -3.0, -1.0, -4.0, -3.0, 1.0, -1.0, 0.0, -2.0, 0.0, 1.0, -3.0, -4.0, -3.0, 0.0,
-1.0, -4.0, 2.0, 5.0, -3.0, -2.0, 0.0, -3.0, 1.0, -3.0, -2.0, 0.0, -1.0, 2.0, 0.0, 0.0, 0.0, -3.0, -3.0, -2.0, 0.0,
-2.0, -2.0, -3.0, -3.0, 6.0, -3.0, -1.0, 0.0, -3.0, 0.0, 0.0, -3.0, -4.0, -3.0, -3.0, -2.0, -2.0, -1.0, 1.0, 3.0, 0.0,
0.0, -3.0, -1.0, -2.0, -3.0, 6.0, -2.0, -4.0, -2.0, -4.0, -3.0, -2.0, -2.0, -2.0, -2.0, 0.0, 1.0, 0.0, -2.0, -3.0, 0.0,
-2.0, -3.0, 1.0, 0.0, -1.0, -2.0, 8.0, -3.0, -1.0, -3.0, -2.0, 1.0, -2.0, 0.0, 0.0, -1.0, 0.0, -2.0, -2.0, 2.0, 0.0,
-1.0, -1.0, -3.0, -3.0, 0.0, -4.0, -3.0, 4.0, -3.0, 2.0, 1.0, -3.0, -3.0, -3.0, -3.0, -2.0, -2.0, 1.0, -3.0, -1.0, 0.0,
-1.0, -3.0, -1.0, 1.0, -3.0, -2.0, -1.0, -3.0, 5.0, -2.0, -1.0, 0.0, -1.0, 1.0, 2.0, 0.0, 0.0, -3.0, -3.0, -2.0, 0.0,
-1.0, -1.0, -4.0, -3.0, 0.0, -4.0, -3.0, 2.0, -2.0, 4.0, 2.0, -3.0, -3.0, -2.0, -2.0, -2.0, -2.0, 3.0, -2.0, -1.0, 0.0,
-1.0, -1.0, -3.0, -2.0, 0.0, -3.0, -2.0, 1.0, -1.0, 2.0, 5.0, -2.0, -2.0, 0.0, -1.0, -1.0, -1.0, -2.0, -1.0, -1.0, 0.0,
-2.0, -3.0, 1.0, 0.0, -3.0, 0.0, -1.0, -3.0, 0.0, -3.0, -2.0, 6.0, -2.0, 0.0, 0.0, 1.0, 0.0, -3.0, -4.0, -2.0, 0.0,
-1.0, -3.0, -1.0, -1.0, -4.0, -2.0, -2.0, -3.0, -1.0, -3.0, -2.0, -1.0, 7.0, -1.0, -2.0, -1.0, 1.0, -2.0, -4.0, -3.0, 0.0,
-1.0, -3.0, 0.0, 2.0, -3.0, -2.0, 0.0, -3.0, 1.0, -2.0, 0.0, 0.0, -1.0, 5.0, 1.0, 0.0, 0.0, -2.0, -2.0, -1.0, 0.0,
-1.0, -3.0, -2.0, 0.0, -3.0, -2.0, 0.0, -3.0, 2.0, -2.0, -1.0, 0.0, -2.0, 1.0, 5.0, -1.0, -1.0, -3.0, -3.0, -2.0, 0.0,
1.0, -1.0, 0.0, 0.0, -2.0, 0.0, -1.0, -2.0, 0.0, -2.0, -1.0, 1.0, -1.0, 0.0, -1.0, 4.0, 1.0, -2.0, -3.0, -2.0, 0.0,
-1.0, -1.0, 1.0, 0.0, -2.0, 1.0, 0.0, -2.0, 0.0, -2.0, -1.0, 0.0, 1.0, 0.0, -1.0, 1.0, 4.0, -2.0, -3.0, -2.0, 0.0,
0.0, -1.0, -3.0, -2.0, -1.0, -3.0, -3.0, 3.0, -2.0, 1.0, 1.0, -3.0, -2.0, -2.0, -3.0, -2.0, -2.0, 4.0, -3.0, -1.0, 0.0,
-3.0, -2.0, -4.0, -3.0, 1.0, -2.0, -2.0, -3.0, -3.0, -2.0, -1.0, -4.0, -4.0, -2.0, -3.0, -3.0, -3.0, -3.0, 11.0, 2.0, 0.0,
-2.0, -2.0, -3.0, -2.0, 3.0, -3.0, 2.0, -1.0, -2.0, -1.0, -1.0, -2.0, -3.0, -1.0, -2.0, -2.0, -2.0, -1.0, 2.0, 7.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
};

Expand All @@ -38,27 +38,27 @@ static int MBB_AMINO_INDEX[26]=
// A B C D E F G H I J K L M N O P Q R S T U V W X Y Z //

static char MBB_CODON_TABLE[64]=
{'K','N','K','N', // AA-
'T','T','T','T', // AC-
'R','S','R','S', // AG-
'I','I','M','I', // AT-
'Q','H','Q','H', // CA-
'P','P','P','P', // CC-
'R','R','R','R', // CG-
'L','L','L','L', // CT-
'E','D','E','D', // GA-
'A','A','A','A', // GC-
'G','G','G','G', // GG-
'V','V','V','V', // GT-
'*','Y','*','Y', // TA-
'S','S','S','S', // TC-
'*','C','W','C', // TG-
'L','F','L','F'};// TT-
{'K', 'N', 'K', 'N', // AA-
'T', 'T', 'T', 'T', // AC-
'R', 'S', 'R', 'S', // AG-
'I', 'I', 'M', 'I', // AT-
'Q', 'H', 'Q', 'H', // CA-
'P', 'P', 'P', 'P', // CC-
'R', 'R', 'R', 'R', // CG-
'L', 'L', 'L', 'L', // CT-
'E', 'D', 'E', 'D', // GA-
'A', 'A', 'A', 'A', // GC-
'G', 'G', 'G', 'G', // GG-
'V', 'V', 'V', 'V', // GT-
'*', 'Y', '*', 'Y', // TA-
'S', 'S', 'S', 'S', // TC-
'*', 'C', 'W', 'C', // TG-
'L', 'F', 'L', 'F'};// TT-

int MBB_MinInt(int a, int b);
int MBB_MaxInt(int a, int b);
float MBB_MinFloat(float a, float b);
float MBB_MaxFloat(float a, float b);
int MBB_MinInt(int a, int b);
int MBB_MaxInt(int a, int b);
float MBB_MinFloat(float a, float b);
float MBB_MaxFloat(float a, float b);

void MBB_SortInts(int * Vals, int * Index, int num_vals);
void MBB_SortFloats(float * Vals, int * Index, int num_vals);
Expand Down

0 comments on commit 0022305

Please sign in to comment.