### Load gene expression data for the training set
data(trainingData)
### Show group variable for the TRAINING set
table(trainingGroup)
### Compute the scores using all features (a matrix will be returned)
scores <- SWAP.CalculateSignedScore(matTraining, trainingGroup, FilterFunc=NULL, )
### Show scores
class(scores)
dim(scores$score)
### Get the scores for a couple of features
diag(scores$score[ 1:3 , 5:7 ])
### Compute the scores using the default filtering function for 20 features
scores <- SWAP.CalculateSignedScore(matTraining, trainingGroup, featureNo=20)
### Show scores
dim(scores$score)
### Creating some random pairs
set.seed(123)
somePairs <- matrix(sample(rownames(matTraining), 25, replace=FALSE), ncol=2)
### Compute the scores for restricted pairs (a vector will be returned)
scores <- SWAP.CalculateSignedScore(matTraining, trainingGroup,
FilterFunc = NULL, RestrictedPairs = somePairs )
### Show scores
class(scores$score)
length(scores$score)
Run the code above in your browser using DataLab