pg-sui 1.6.16a3__py3-none-any.whl → 1.7.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pg_sui-1.6.16a3.dist-info → pg_sui-1.7.0.dist-info}/METADATA +26 -30
- {pg_sui-1.6.16a3.dist-info → pg_sui-1.7.0.dist-info}/RECORD +29 -33
- pgsui/__init__.py +0 -8
- pgsui/_version.py +2 -2
- pgsui/cli.py +577 -125
- pgsui/data_processing/config.py +1 -2
- pgsui/data_processing/containers.py +203 -530
- pgsui/data_processing/transformers.py +44 -20
- pgsui/impute/deterministic/imputers/mode.py +475 -182
- pgsui/impute/deterministic/imputers/ref_allele.py +454 -147
- pgsui/impute/supervised/imputers/hist_gradient_boosting.py +4 -3
- pgsui/impute/supervised/imputers/random_forest.py +3 -2
- pgsui/impute/unsupervised/base.py +1269 -534
- pgsui/impute/unsupervised/callbacks.py +28 -33
- pgsui/impute/unsupervised/imputers/autoencoder.py +870 -841
- pgsui/impute/unsupervised/imputers/vae.py +931 -787
- pgsui/impute/unsupervised/loss_functions.py +156 -202
- pgsui/impute/unsupervised/models/autoencoder_model.py +7 -49
- pgsui/impute/unsupervised/models/vae_model.py +40 -221
- pgsui/impute/unsupervised/nn_scorers.py +53 -13
- pgsui/utils/classification_viz.py +240 -97
- pgsui/utils/misc.py +201 -3
- pgsui/utils/plotting.py +73 -58
- pgsui/utils/pretty_metrics.py +2 -6
- pgsui/utils/scorers.py +39 -0
- pgsui/impute/unsupervised/imputers/nlpca.py +0 -1666
- pgsui/impute/unsupervised/imputers/ubp.py +0 -1660
- pgsui/impute/unsupervised/models/nlpca_model.py +0 -206
- pgsui/impute/unsupervised/models/ubp_model.py +0 -200
- {pg_sui-1.6.16a3.dist-info → pg_sui-1.7.0.dist-info}/WHEEL +0 -0
- {pg_sui-1.6.16a3.dist-info → pg_sui-1.7.0.dist-info}/entry_points.txt +0 -0
- {pg_sui-1.6.16a3.dist-info → pg_sui-1.7.0.dist-info}/licenses/LICENSE +0 -0
- {pg_sui-1.6.16a3.dist-info → pg_sui-1.7.0.dist-info}/top_level.txt +0 -0
|
@@ -209,8 +209,9 @@ class ImputeHistGradientBoosting(BaseImputer):
|
|
|
209
209
|
X_int = self.pgenc.genotypes_012
|
|
210
210
|
self.X012_ = X_int.astype(float)
|
|
211
211
|
self.X012_[self.X012_ < 0] = np.nan # Ensure missing are NaN
|
|
212
|
-
self.
|
|
213
|
-
self.
|
|
212
|
+
self.ploidy = self.cfg.io.ploidy
|
|
213
|
+
self.is_haploid = self.ploidy == 1
|
|
214
|
+
self.num_classes_ = 2 if self.is_haploid else 3
|
|
214
215
|
self.n_samples_, self.n_features_ = X_int.shape
|
|
215
216
|
|
|
216
217
|
# Split
|
|
@@ -296,7 +297,7 @@ class ImputeHistGradientBoosting(BaseImputer):
|
|
|
296
297
|
This method applies the trained imputer to the entire dataset, filling in missing genotype values. It ensures that any remaining missing values after imputation are set to -9, and decodes the imputed 0/1/2 genotypes back to their original format.
|
|
297
298
|
|
|
298
299
|
Returns:
|
|
299
|
-
np.ndarray: (n_samples, n_loci)
|
|
300
|
+
np.ndarray: (n_samples, n_loci) IUPAC strings (single-character codes).
|
|
300
301
|
|
|
301
302
|
Raises:
|
|
302
303
|
NotFittedError: If fit() has not been called prior to transform().
|
|
@@ -185,7 +185,8 @@ class ImputeRandomForest(BaseImputer):
|
|
|
185
185
|
X_int = self.pgenc.genotypes_012
|
|
186
186
|
self.X012_ = X_int.astype(float)
|
|
187
187
|
self.X012_[self.X012_ < 0] = np.nan # Ensure missing are NaN
|
|
188
|
-
self.
|
|
188
|
+
self.ploidy = self.cfg.io.ploidy
|
|
189
|
+
self.is_haploid = self.ploidy == 1
|
|
189
190
|
self.num_classes_ = 2 if self.is_haploid_ else 3
|
|
190
191
|
self.n_samples_, self.n_features_ = X_int.shape
|
|
191
192
|
|
|
@@ -273,7 +274,7 @@ class ImputeRandomForest(BaseImputer):
|
|
|
273
274
|
This method applies the trained imputer to the entire dataset, filling in missing genotype values. It ensures that any remaining missing values after imputation are set to -9, and decodes the imputed 0/1/2 genotypes back to their original format.
|
|
274
275
|
|
|
275
276
|
Returns:
|
|
276
|
-
np.ndarray: (n_samples, n_loci)
|
|
277
|
+
np.ndarray: (n_samples, n_loci) IUPAC strings (single-character codes).
|
|
277
278
|
"""
|
|
278
279
|
if not self.is_fit_:
|
|
279
280
|
msg = "Imputer has not been fit; call fit() before transform()."
|