i would like to ask a very specific question regarding the possibility of combining arrayWeights() from limma with duplicateCorrelation(), in order to increase power for differential expression: (is this possible) and especially appropriate ? Without describing again any specific experimental information for an illustrative example, im posting a link to a specific experimental question that i would like to implement it if it is "valid" (Possible methodologies for constructing multi-level comparisons in limma)
Or alternatively, it is "more wise" to implement it in limma with a different model construction(along with some general assumptions based on various diagnostic plots and experimental design) without using duplicate correlation ??
Thank you for your consideration on this matter !!
In ?duplicateCorrelation() help function it has an argument named weights:
But in the description it mentions
weights
"an optional numeric matrix of the same dimension as object containing weights for each spot. If smaller than object then it will be filled out the same size".
Thus, it needs a different argument than from the object that is produced from arrayWeights(), or it is plaucible to use it also here ??
Note the second sentence: "If smaller than 'object' then it will be filled out the same size." This is what will happen if you pass array weights to duplicateCorrelation.
thank you very much for the code provided !! Yes, my data are microarray data-regarding the interpretation of the code i can continue as usual after fit to construct my specific contrasts and move along right ?
you are trully an inspiration !! Im posting again because i would like to ask for a small feedback regarding the interpretation of my results. When i used only duplicatedCorrelation() without arrayWeights(), i didnt get any DE with an FDR < 0.05. When i incorporated your above code, it return 1424 DE genes with FDR < 0.05(from the 9884 tested). Thus, in your opinion the big number of DE genes i get now is "valid" ?? I mean, of course my comparison is metastatic cancer samples vs their respective control ones (6 vs 6), but could in the first case the zero number of DE genes attributed to sample quality and also through duplicateCorrelation which could absorved these important differences ?
Here's the total code:
condition <- factor(eset.2$Disease, levels=c("Normal","Cancer"))
pairs <- factor(rep(1:30, each = 2)) # the blocking factor regarding the total number of patients
metastatic <- factor(eset.2$Meta_factor)
f <- paste(condition, metastatic, sep=".")
f <- factor(f)
design1 <- model.matrix(~0 +f)
colnames(design1) <- levels(f)
arrayWeights does not accept a correlation and blocking structure, and I'm not sure if this is a limitation of the method or simply has not been implemented. But regardless, this means that your only option right now is to run arrayWeights first and pass those weights to duplicateCorrelation (and all other downstream analyses).
If it were possible to use the duplicate correlation in arrayWeights, then I'm still not sure which of the two methods should be run first, or if something more complicated would be required, such as alternately iterating both methods until convergence.
thank you both for your comment and valuable answer !! Unfortunaly, -(and thats why i posted the link to my previous post describing the specific example of my experimental design)-, i had to use duplicateCorrelation for designing a specific contrast-but as i didn't get any DE genes, that's why i thought of the possibility of combining both methodologies. Thus, i will have to stick and try what you proposed: first create design matrix and then arrayWeights, and then pass arrayWeights in the duplicateCorrelation and see the outcome.
In ?duplicateCorrelation() help function it has an argument named weights:
But in the description it mentions
weights
"an optional numeric matrix of the same dimension as object containing weights for each spot. If smaller than object then it will be filled out the same size".
Thus, it needs a different argument than from the object that is produced from arrayWeights(), or it is plaucible to use it also here ??
Any confirmation on this would be beneficial !!
To use duplicateCorrelation() with array weights, you need to expand the array weights to observation weights using asMatrixWeights(), see below.
Note the second sentence: "If smaller than 'object' then it will be filled out the same size." This is what will happen if you pass array weights to
duplicateCorrelation
.