File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -133,6 +133,13 @@ def _g123_gwss(
133133 chunks = chunks ,
134134 )
135135
136+ if gt .shape [0 ] < window_size :
137+ raise ValueError (
138+ f"Not enough sites ({ gt .shape [0 ]} ) for window size "
139+ f"({ window_size } ). Please reduce the window size or "
140+ f"use different site selection criteria."
141+ )
142+
136143 with self ._spinner ("Compute G123" ):
137144 g123 = allel .moving_statistic (gt , statistic = _garud_g123 , size = window_size )
138145 x = allel .moving_statistic (pos , statistic = np .mean , size = window_size )
@@ -240,6 +247,12 @@ def _g123_calibration(
240247
241248 calibration_runs : Dict [str , np .ndarray ] = dict ()
242249 for window_size in self ._progress (window_sizes , desc = "Compute G123" ):
250+ if gt .shape [0 ] < window_size :
251+ raise ValueError (
252+ f"Not enough sites ({ gt .shape [0 ]} ) for window size "
253+ f"({ window_size } ). Please reduce the window size or "
254+ f"use different site selection criteria."
255+ )
243256 g123 = allel .moving_statistic (gt , statistic = _garud_g123 , size = window_size )
244257 calibration_runs [str (window_size )] = g123
245258
Original file line number Diff line number Diff line change @@ -2260,7 +2260,7 @@ def init_hap_sites(self):
22602260 path = path ,
22612261 contigs = self .contigs ,
22622262 snp_sites = self .snp_sites ,
2263- p_site = np .random .random ( ),
2263+ p_site = np .random .uniform ( 0.5 , 1.0 ),
22642264 )
22652265
22662266 def init_haplotypes (self ):
You can’t perform that action at this time.
0 commit comments