# Function to normalize the scores per class # The scores of each class are normalized by dividing the score values for the maximum score of that class # Input: # S : matrix with the raw non normalized scores. Rows are examples (proteins), columns are the classes (GO terms) # Output: # A score matrix with the same dimensions of S, but with scores max/normalized separately for each class. normalize.max <- function(S){ max.class <- apply(S,2,max); for(i in 1:ncol(S)){ S[,i] <- S[,i]/max.class[i] } return(S); }