-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Function structure discussed here: #2
The first step in functions is to check that the input is in correct format. The function could be in this format:
.check_formula <- function(x, formula, features){
}
The function could:
- Extract variables from
formula - Check with what slot the left hand side (LHS) of formula matches.
- Give error if it does not match with anything
- Give error if it matches with multiple slots: "This variable name is ambiguous; it can be found from x and y. Rename variables."
- Check if right-hand side (RHS) variables (predictors) are present.
- if LHS specifies
assay: they must be present in colData - if LHS specifies
colData: they must be present in colData - if LHS specifies
rowData: they must be in rowData - Give errors if they match with multiple variables.
- if LHS specifies
featuresis applicable only when LHS spcifies assay. It must select rows by their name or index.
You can add these to utils.R.
To harmonize input check messages for generic variables, you can copy-paste input checks from miaTime: https://github.com/microbiome/miaTime/blob/3f90283afeed3475082b64726eed357f73e06a09/R/utils.R#L7
Metadata
Metadata
Assignees
Labels
No labels