Builds PLS model from training dataset and predicts second dataset Writes out predicted.scores of the second dataset Plots original PLS, projected samples only, and projected samples ontop of original PLS
1 2 3 4 5 6 7 8 9 | PCA_from_file_and_predict_second_dataset(file, file2, sample.names,
sample.type, y.response, sample.names2 = NULL, sample.type2 = NULL,
train_string, test_string, title = "PCA", comp.x = "PC1",
comp.y = "PC2", comps = 2, labels = F, saveplot = T,
savetype = ".png", w = 8, h = 6, legendname = "default",
scale = F, center = T, plot_both = T, colpalette = NULL,
shape.palette = NULL, ellipses = T, conf = 0.9, varimax = F,
varimax.comp = 2, output_folder = "./", TCGA = F, threshold = 3,
rotate = F, do.legend = T)
|
file |
file for X matirx |
file2 |
file for test data matrix |
sample.names |
Vector of sample names in X matrix |
sample.type |
vector of sample groups |
y.response |
numeric vector of response values in same order as samples |
sample.names2 |
Vector of sample names in 2nd dataset, if needed |
sample.type2 |
Vector of sample types in 2nd dataset, if needed |
train_string |
string of training data to insert in file name of predicted scores |
test_string |
string of data being tested to insert in file name of predicted scores |
title |
title of the plot |
comp.x, comp.y |
comps to display |
labels |
label the plot, default = T |
saveplot |
whether to save the plot, default is F |
savetype |
the type of plot to save,options are ".pdf" or ".png" |
w |
is width of plot to be saved |
h |
is height of plot to be saved |
legendname |
is the legend name |
scale |
default=T |
plot_both |
if true plots both training and test set in color |
colpalette |
allows you to put in a color palette of form c("#F87660", "#39B600",....etc) to manually assign colors |
shape.palette |
allows you to put in a shape palette of form c(1, 3,....etc) to manually assign shapes |
varimax |
If T performs Varimax rotation, |
varimax.comp |
# of varimax components, kind of hacky, keep this # the same as # of comps. Will fix later. |
output_folder |
the folder to output to, default is ./ i.e. current folder |
TCGA |
predicted files are from TCGA, barcodes separated by periods, so remove normal samples, default is FALSE |
rotate |
rotates graph along y axis |
comp |
number of components to compute |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.