I have a large metabolomics dataset, 6000 samples and 3300 features. For the samples the only thing that differentiates each sample from the rest is that one gene was knocked out, which will not affect most of the metabolites. The features are metabolite concentrations.
There are some 'known'/measured batch and technical variables such as different Mass Spec runs, differential growth of the bacteria in the samples. However, I also want to adjust for the unknown variables.
It has been suggested that I perform PCA then throw out the first few principal components. However, I'm not sure how I can use the PCA information to predict values for the original features using the remaining principal components.
df.pca <- prcomp(as.matrix(df.rw), center = TRUE, scale. = TRUE) df.pca.x.minus12<-df.pca$x[,-c(1,2)]
How to predict values of the original 3300 features after removing the first 2 components?