Make scores
Arguments
- input.df
data.frame, table with only snps that are to be included. Must have "marker.ID" column
- cols
character, vector of column names indicating which variables to included in the score
- directions
numeric, a vector indicating which direction is to be considered more indicative of an association. 1 indicates higher is better, -1 indicates lower is better. The order should correspond with the order in cols.
- weights
numeric, a vector indicating weights for the variables. These must add up to 1.
Value
A table with a score for each marker based on aggregating the variables indicated.
Variables are first made negative if indicated by
directionsvector.Min/max normalization is applied to put all variables on same scale.
A weighted mean based on the
weightsvector is taken of the normalized variables and output as the final score.
Examples
gwas.df <- read.csv(system.file(
"extdata",
"PanvarExample_GLM_GWASresults.csv",
package = "panvaR"))
# use direction to specify which direction in each variable indicates
# greater predicted impact
scores.out <- make_scores(
input.df = gwas.df,
cols = c("EFF", "PVAL"),
directions = c(1, -1),
weights = c(.5, .5))