Get a pairwise 20x20 distance matrix for all pairs of amino acids
Source:R/hla_divergence.R
amino_distance_matrix.Rd
By default, we return the amino acid distance matrix by Grantham 1974 (doi:10.1126/science.185.4154.862).
Arguments
- method
"grantham"
for the Grantham 1974 matrix or"uniform"
for a matrix with ones on the non-diagonal.
Examples
# By default, the Grantham 1974 matrix
amino_distance_matrix("grantham")
#> A R N D C Q E G H I L K M F P S T W Y
#> A 0 112 111 126 195 91 107 60 86 94 96 106 84 113 27 99 58 148 112
#> R 112 0 86 96 180 43 54 125 29 97 102 26 91 97 103 110 71 101 77
#> N 111 86 0 23 139 46 42 80 68 149 153 94 142 158 91 46 65 174 143
#> D 126 96 23 0 154 61 45 94 81 168 172 101 160 177 108 65 85 181 160
#> C 195 180 139 154 0 154 170 159 174 198 198 202 196 205 169 112 149 215 194
#> Q 91 43 46 61 154 0 29 87 24 109 113 53 101 116 76 68 42 130 99
#> E 107 54 42 45 170 29 0 98 40 134 138 56 126 140 93 80 65 152 122
#> G 60 125 80 94 159 87 98 0 98 135 138 127 127 153 42 56 59 184 147
#> H 86 29 68 81 174 24 40 98 0 94 99 32 87 100 77 89 47 115 83
#> I 94 97 149 168 198 109 134 135 94 0 5 102 10 21 95 142 89 61 33
#> L 96 102 153 172 198 113 138 138 99 5 0 107 15 22 98 145 92 61 36
#> K 106 26 94 101 202 53 56 127 32 102 107 0 95 102 103 121 78 110 85
#> M 84 91 142 160 196 101 126 127 87 10 15 95 0 28 87 135 81 67 36
#> F 113 97 158 177 205 116 140 153 100 21 22 102 28 0 114 155 103 40 22
#> P 27 103 91 108 169 76 93 42 77 95 98 103 87 114 0 74 38 147 110
#> S 99 110 46 65 112 68 80 56 89 142 145 121 135 155 74 0 58 177 144
#> T 58 71 65 85 149 42 65 59 47 89 92 78 81 103 38 58 0 128 92
#> W 148 101 174 181 215 130 152 184 115 61 61 110 67 40 147 177 128 0 37
#> Y 112 77 143 160 194 99 122 147 83 33 36 85 36 22 110 144 92 37 0
#> V 64 96 133 152 192 96 121 109 84 29 32 97 21 50 68 124 69 88 55
#> V
#> A 64
#> R 96
#> N 133
#> D 152
#> C 192
#> Q 96
#> E 121
#> G 109
#> H 84
#> I 29
#> L 32
#> K 97
#> M 21
#> F 50
#> P 68
#> S 124
#> T 69
#> W 88
#> Y 55
#> V 0
# All ones, and zeros on the diagonal
amino_distance_matrix("uniform")
#> A R N D C Q E G H I L K M F P S T W Y V
#> A 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
#> R 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
#> N 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
#> D 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
#> C 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
#> Q 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1
#> E 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1
#> G 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1
#> H 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1
#> I 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1
#> L 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1
#> K 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1
#> M 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1
#> F 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1
#> P 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1
#> S 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1
#> T 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1
#> W 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1
#> Y 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1
#> V 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0