@@ -67,27 +67,27 @@ def __init__(
67
67
68
68
def get_quality_scores (
69
69
self ,
70
- run_read_length : int ,
71
70
model_read_length : int ,
71
+ length : int ,
72
72
rng
73
73
) -> np .ndarray :
74
74
"""
75
- Takes a read_length and rng and returns an array of quality scores
75
+ Takes a length and rng and returns an array of quality scores
76
76
77
- :param run_read_length: The desired length of the quality score array
78
77
:param model_read_length: the original read length for the model
78
+ :param length: The desired length of the quality score array
79
79
:param rng: random number generator.
80
80
:return: An array of quality scores.
81
81
"""
82
82
if self .uniform_quality_score :
83
- return np .array ([self .uniform_quality_score ] * run_read_length )
83
+ return np .array ([self .uniform_quality_score ] * length )
84
84
else :
85
- if run_read_length == model_read_length :
85
+ if length == model_read_length :
86
86
quality_index_map = np .arange (model_read_length )
87
87
else :
88
88
# This is basically a way to evenly spread the distribution across the number of bases in the read
89
89
quality_index_map = np .array (
90
- [max ([0 , model_read_length * n // run_read_length ]) for n in range (run_read_length )]
90
+ [max ([0 , model_read_length * n // length ]) for n in range (length )]
91
91
)
92
92
93
93
temp_qual_array = []
@@ -206,7 +206,7 @@ def get_sequencing_errors(
206
206
# This is to prevent deletion error collisions and to keep there from being too many indel errors.
207
207
if 0 < index < self .read_length - max (
208
208
self .deletion_len_model ) and total_indel_length > self .read_length // 4 :
209
- error_type = self . rng .choice (a = list (self .variant_probs ), p = list (self .variant_probs .values ()))
209
+ error_type = rng .choice (a = list (self .variant_probs ), p = list (self .variant_probs .values ()))
210
210
211
211
# Deletion error
212
212
if error_type == Deletion :
@@ -227,7 +227,7 @@ def get_sequencing_errors(
227
227
elif error_type == Insertion :
228
228
insertion_length = self .get_insertion_length ()
229
229
insertion_reference = reference_segment [index ]
230
- insert_string = '' .join (self . rng .choice (ALLOWED_NUCL , size = insertion_length ))
230
+ insert_string = '' .join (rng .choice (ALLOWED_NUCL , size = insertion_length ))
231
231
insertion_alternate = insertion_reference + insert_string
232
232
introduced_errors .append (
233
233
ErrorContainer (Insertion , index , insertion_length , insertion_reference , insertion_alternate )
0 commit comments