Biological replicates and Diablo

Hi MaxBladen,
Thank you for your answer. I will try to clarify my design:

Yes exactly, I have 78 samples

Each of the five sample of a strain originally came from one unique strain. but they were each transplanted into a different bottle for growth before the experiment. They are of the same genotype but they are independent samples (each was measured only once during experiment)

yes, for example all replicates of strains 1 to 9 (~45 samples) are in the first category and all replicates of strains 10 to 16 are in the other category. I would like to identify genes and metabolites that distinguish the two categories, but I would like to take into account the “non-independence” of the replicates in each category so as not to overestimate links between genes and metabolites for example.

Sorry for that, I tried to adapt this answer to my case withinVariation() on part of dataset - #2 by MaxBladen, but I understand now that it is not adapted, thank you :slight_smile:
so taking into account your answers, I arrived at something like this:

rna<-t(read.table("rna",header=T,row.names=1)) #dim=78 600
metabolites<-t(read.table("metabolites",header=T,row.names=1)) #dim=78 400
samples_in_strains<-c(rep(1:4,each=5),rep(5,each=4),rep(6:15,each=5),rep(16,each=4))
design=data.frame(sp=samples_in_strains,row.names=rownames(rna))
categories<-c(rep("A",each=44),rep("B",each=34))
Y=as.factor(categories)
Xw_rna<-withinVariation(rna,design=design)
Xw_metabo<-withinVariation(metabolites,design=design)
X<-list(mRNA=Xw_rna,metabolite=Xw_metabo)
list.keepX<-list(mRNA=c(60,60),metabolite=c(30,30))
test<-block.splsda(X,Y,keepX=list.keepX)

However, on the PlotIndiv, my samples are not separated into two categories at all, everything is mixed up, do you think this is from the code or from my data?

Thank you !