Skip to contents

Level2Functions: A class providing level 2 functionalities

Level2Functions: A class providing level 2 functionalities

Details

This class provides various level 2 functionalities, including methods to check dataframes and spline parameters.

See also

InputControl

Check Data Matrix

Super classes

SplineOmics::Level4Functions -> SplineOmics::Level3Functions -> Level2Functions

Methods

Inherited methods


Method check_data()

This function checks the validity of the data matrix, ensuring that it is a matrix, contains only numeric values, has no missing values, and all elements are non-negative. Additionally, it verifies that no rows or columns are entirely zeros.

Usage

Level2Functions$check_data(data, data_meta_index = NULL)

Arguments

data

A dataframe containing numeric values.

data_meta_index

An optional parameter specifying the index of the data for error messages. Default is NA.

Returns

Returns TRUE if all checks pass. Stops execution and returns an error message if any check fails.

Check Metadata


Method check_meta()

This function checks the validity of the metadata dataframe, ensuring it contains the 'Time' column, does not contain missing values, and that the specified condition column is valid and of the appropriate type. Additionally, it checks for an optional batch effect column and prints messages regarding its use.

Usage

Level2Functions$check_meta(
  meta,
  condition,
  meta_batch_column = NULL,
  meta_batch2_column = NULL,
  data_meta_index = NULL
)

Arguments

meta

A dataframe containing the metadata, including the 'Time' column.

condition

A single character string specifying the column name in the meta dataframe to be checked.

meta_batch_column

An optional parameter specifying the column name in the meta dataframe used to remove the batch effect. Default is NA.

meta_batch2_column

An optional parameter specifying the column name in the meta dataframe used to remove the batch effect. Default is NA.

data_meta_index

An optional parameter specifying the index of the data/meta pair for error messages. Default is NA.

Returns

Returns TRUE if all checks pass. Stops execution and returns an error message if any check fails.

Check Dataframe


Method check_dataframe()

Validates that the dataframe contains all required columns with the correct data types.

Usage

Level2Functions$check_dataframe(df)

Arguments

df

A dataframe to check.

Returns

TRUE if the dataframe is valid, otherwise an error is thrown.

Check Spline Parameters Generally


Method check_spline_params_generally()

Validates the general structure and contents of spline parameters.

Usage

Level2Functions$check_spline_params_generally(spline_params)

Arguments

spline_params

A list of spline parameters.

Returns

No return value, called for side effects.

Check Spline Parameters Mode Dependent


Method check_spline_params_mode_dependent()

Validates the spline parameters depending on the specified mode.

Usage

Level2Functions$check_spline_params_mode_dependent(
  spline_params,
  mode,
  meta,
  condition
)

Arguments

spline_params

A list of spline parameters.

mode

A character string specifying the mode ('integrated' or 'isolated').

meta

A dataframe containing metadata.

condition

A character string specifying the condition.

Returns

No return value, called for side effects.

Check Columns in Spline Test Configurations


Method check_columns_spline_test_configs()

Validates that the spline test configurations contain the required columns in the correct order.

Usage

Level2Functions$check_columns_spline_test_configs(spline_test_configs)

Arguments

spline_test_configs

A dataframe containing spline test configurations.

Returns

No return value, called for side effects.


Method check_spline_type_column()

Validates that the 'spline_type' column in the spline test configurations contains only 'n' or 'b'.

Usage

Level2Functions$check_spline_type_column(spline_test_configs)

Arguments

spline_test_configs

A dataframe containing spline test configurations.

Returns

No return value, called for side effects.


Method check_spline_type_params()

Validates the parameters for each row in the spline test configurations based on the spline type.

Usage

Level2Functions$check_spline_type_params(spline_test_configs)

Arguments

spline_test_configs

A dataframe containing spline test configurations.

Returns

TRUE if all checks pass, otherwise an error is thrown.


Method check_max_and_min_dof()

Validates the degrees of freedom (DoF) for each row in the spline test configurations based on the metadata.

Usage

Level2Functions$check_max_and_min_dof(spline_test_configs, metas)

Arguments

spline_test_configs

A dataframe containing spline test configurations.

metas

A list of metadata corresponding to the data matrices.

Returns

No return value, called for side effects.


Method check_columns()

Usage

Level2Functions$check_columns(df, expected_cols)

Arguments

df

A dataframe to check.

expected_cols

A character vector of expected column names.

Returns

This function does not return a value. It stops execution if the dataframe columns or their classes do not match the expected structure.


Method clone()

The objects of this class are cloneable with this method.

Usage

Level2Functions$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.