add_conditional_nas | R Documentation |
This will hopefully handle a troubling corner case in Volker's data: He primarily wants to find proteins which are found in one condition, but _not_ in another. However, due to the unknown unknown problem in DIA acquisition, answering this question is difficult. If one uses a normal expressionset or msnset or whatever, one of two things will happen: either the 0/NA proteins will be entirely removed/ignored, or they will lead to spurious 'significant' calls. MSstats, to its credit, does a lot to try to handle these cases; but in the case Volker is most interested, it will exclude the interesting proteins entirely.
add_conditional_nas(expt, fact = "condition", method = "NA")
expt |
Expressionset to examine. |
fact |
Experimental design factor to use. |
method |
Specify whether to leave the NAs as NA, or replace them with the mean of all non-NA values. |
So, here is what I am going to do: Iterate through each element of the chosen experimental design factor, check if all samples for that condition are 0, if so; leave them. If not all the samples have 0 for the given condition, then replace the zero entries with NA. This should allow for stuff like rowMeans(na.rm = TRUE) to provide useful information.
Finally, this will add columns to the annotations which tell the number of observations for each protein after doing this.
New expressionset with some, but not all, 0s replaced with NA.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.