@@ -97,7 +97,7 @@ def get_toy_ts():
97
97
Note that there are two sets of matrices, one for each haplotype.
98
98
"""
99
99
_fwd_matrix_text_1 = """
100
- m,h,probRec,probNoRec,noErrProb,errProb,refAl,queryAl,shift,scale,sum,fwdVal
100
+ m,h,probRec,probNoRec,noErrProb,errProb,refAl,queryAl,shift,scale,sum,val
101
101
0,0,0.000000,1.000000,0.999900,0.000100,1,0,0.000000,1.000000,0.000100,0.000100
102
102
0,1,0.000000,1.000000,0.999900,0.000100,0,0,0.000000,1.000000,1.000000,0.999900
103
103
0,2,0.000000,1.000000,0.999900,0.000100,1,0,0.000000,1.000000,1.000100,0.000100
@@ -117,7 +117,7 @@ def get_toy_ts():
117
117
"""
118
118
119
119
_bwd_matrix_text_1 = """
120
- m,h,probRec,probNoRec,noErrProb,errProb,refAl,queryAl,shift,scale,sum,bwdVal
120
+ m,h,probRec,probNoRec,noErrProb,errProb,refAl,queryAl,shift,scale,sum,val
121
121
2,0,1.000000,0.000000,0.999900,0.000100,1,0,0.000000,0.250000,0.250050,0.250000
122
122
2,1,1.000000,0.000000,0.999900,0.000100,0,0,0.000000,0.250000,0.250050,0.250000
123
123
2,2,1.000000,0.000000,0.999900,0.000100,1,0,0.000000,0.250000,0.250050,0.250000
@@ -133,7 +133,7 @@ def get_toy_ts():
133
133
"""
134
134
135
135
_fwd_matrix_text_2 = """
136
- m,h,probRec,probNoRec,noErrProb,errProb,refAl,queryAl,shift,scale,sum,fwdVal
136
+ m,h,probRec,probNoRec,noErrProb,errProb,refAl,queryAl,shift,scale,sum,val
137
137
0,0,0.000000,1.000000,0.999900,0.000100,1,1,0.000000,1.000000,0.999900,0.999900
138
138
0,1,0.000000,1.000000,0.999900,0.000100,0,1,0.000000,1.000000,1.000000,0.000100
139
139
0,2,0.000000,1.000000,0.999900,0.000100,1,1,0.000000,1.000000,1.999900,0.999900
@@ -153,7 +153,7 @@ def get_toy_ts():
153
153
"""
154
154
155
155
_bwd_matrix_text_2 = """
156
- m,h,probRec,probNoRec,noErrProb,errProb,refAl,queryAl,shift,scale,sum,bwdVal
156
+ m,h,probRec,probNoRec,noErrProb,errProb,refAl,queryAl,shift,scale,sum,val
157
157
2,0,1.000000,0.000000,0.999900,0.000100,1,1,0.000000,0.250000,0.749950,0.250000
158
158
2,1,1.000000,0.000000,0.999900,0.000100,0,1,0.000000,0.250000,0.749950,0.250000
159
159
2,2,1.000000,0.000000,0.999900,0.000100,1,1,0.000000,0.250000,0.749950,0.250000
@@ -178,7 +178,13 @@ def convert_to_pd_df(matrix_text):
178
178
assert all (df .probRec + df .probNoRec == 1 )
179
179
# Check that non-mismatch and mismatch probabilities sum to 1
180
180
assert all (df .noErrProb + df .errProb == 1 )
181
- return df
181
+ matrix = df .val .to_numpy ().reshape (
182
+ (
183
+ 4 ,
184
+ 4 ,
185
+ )
186
+ ) # size (m, h)
187
+ return matrix
182
188
183
189
184
190
def get_forward_backward_matrices ():
0 commit comments