Classes
lazy_opls_da
Parameters
dataDataFrame containing the dataset.groupsList of class labels for each data sample.working_dirDirectory path for storing output files.feature_namesNames of features, defaults to None.n_componentsNumber of components for OPLS-DA, defaults to 2.scalingScaling method ('pareto'), defaults to 'pareto'.estimatorModel estimator, defaults to 'opls'.kfoldNumber of folds in cross-validation, defaults to 3.random_stateRandom seed, defaults to 94.auto_ncompAutomatically choose the optimal number of components, defaults to True.permutationConduct permutation tests, defaults to True.VIPCalculate VIP scores, defaults to True.linear_regressionConduct linear regression analysis, defaults to True.Returns
fit Method
Fits the OPLS-DA model to the dataset, generates plots, and saves them to the output directory.
Parameters
marker_colorDictionary mapping groups to colors.custom_colorCustom color grouping.custom_shapeCustom shape grouping.symbol_dictDictionary mapping groups to marker symbols.custom_legend_nameCustom for the legend, defaults to ['Group', 'Sub-group'].marker_labelSpecifies marker labels ('class', 'group', or 'sub-group').marker_sizeSize of markers in plots.marker_opacityOpacity level of markers in plots.individual_ellipseOption to display individual ellipses for each group.Returns
Directory and Project Setup =========================== Creates necessary folders in the working directory based on project needs (e.g., for VIP score plots, permutation scores, etc.). Paths are stored in a dictionary (self.path).
Directories Created
Plotting and Saving Data
1. Score Plot: Generates OPLS-DA score plots for each group. 2. Loading Plot: Generates and saves loading plots. 3. S Plot: Generates and saves S-score plots. 4. VIP Score Plot: Generates VIP score plots and saves VIP scores as CSV if VIP=True. 5. Permutation Test Plot: Conducts permutation tests and saves permutation scores as CSV if permutation=True. 6. Volcano Plot (Linear Regression): Generates volcano plot and saves data if linear_regression=True.