Hi,
I noticed that OpenMStoMSstatsFormat and dataProcess remove features
with few measurements (in less than 3 runs) although the option is set
to False. I have 3 replicates per condition so I want to keep features
present in 2 runs. I am working with the output of quantms and MSstats v4.8.2
When reading the input file prior to MSstats I see features present in 1 or 2 runs.
> data <- read.csv("secretome/quantms/noMBR/proteomicslfq/sdrf_openms_design_msstats_in.csv", header = TRUE, sep = ',')
> data %>% group_by(PeptideSequence, PrecursorCharge) %>% summarise(RunCount = sum(!is.na(Intensity))) %>% ungroup() %>% count(RunCount) %>% mutate(Frequency = n / sum(n))
`summarise()` has grouped output by 'PeptideSequence'. You can override using the `.groups` argument.
# A tibble: 6 × 3
RunCount n Frequency
<int> <int> <dbl>
1 1 2000 0.380
2 2 978 0.186
3 3 125 0.0237
4 4 374 0.0710
5 5 659 0.125
6 6 1128 0.214
Now if I read this in msstats
> data_msstats <- OpenMStoMSstatsFormat(data, useUniquePeptide = TRUE, removeFewMeasurements=FALSE, removeProtein_with1Feature = FALSE,
+ summaryforMultipleRows = max, use_log_file = FALSE)
INFO [2023-06-02 12:32:34] ** Raw data from OpenMS imported successfully.
INFO [2023-06-02 12:32:36] ** Raw data from OpenMS cleaned successfully.
INFO [2023-06-02 12:32:36] ** Using annotation extracted from quantification data.
INFO [2023-06-02 12:32:36] ** Run labels were standardized to remove symbols such as '.' or '%'.
INFO [2023-06-02 12:32:36] ** The following options are used:
- Features will be defined by the columns: PeptideSequence, PrecursorCharge, FragmentIon, ProductCharge
- Shared peptides will be removed.
- Proteins with single feature will not be removed
. - Features with less than 3 measurements across runs will be kept.
INFO [2023-06-02 12:32:37] ** Features with all missing measurements across runs are removed.
INFO [2023-06-02 12:32:37] ** Shared peptides are removed.
INFO [2023-06-02 12:32:37] ** Multiple measurements in a feature and a run are summarized by summaryforMultipleRows: max
INFO [2023-06-02 12:32:37] ** Features with all missing measurements across runs are removed.
INFO [2023-06-02 12:32:37] ** Run annotation merged with quantification data.
INFO [2023-06-02 12:32:37] ** Features with one or two measurements across runs are removed.
INFO [2023-06-02 12:32:37] ** Fractionation handled.
INFO [2023-06-02 12:32:38] ** Updated quantification data to make balanced design. Missing values are marked by NA
INFO [2023-06-02 12:32:38] ** Finished preprocessing. The dataset is ready to be processed by the dataProcess function.
> data_msstats %>% group_by(PeptideSequence, PrecursorCharge) %>% summarise(RunCount = sum(!is.na(Intensity))) %>% ungroup() %>% count(RunCount) %>% mutate(Frequency = n / sum(n))
`summarise()` has grouped output by 'PeptideSequence'. You can override using the `.groups` argument.
# A tibble: 4 × 3
RunCount n Frequency
<int> <int> <dbl>
1 3 125 0.0547
2 4 374 0.164
3 5 659 0.288
4 6 1128 0.493
So MSstats only kept features present in >3 runs. The log output says first that
Features with less than 3 measurements across runs will be kept.
and then
INFO [2023-06-02 12:32:37] ** Features with one or two measurements across runs are removed.
I
tried the dataProcess function giving as input the data and not the
data_msstats dataframe but the same filtering is applied again and prints that these features are removed.
> processed.quant <- MSstats::dataProcess(raw = data,
+ normalization = "equalizeMedians",
+ featureSubset = "all",
+ summaryMethod = 'TMP',
+ censoredInt = "NA",
+ MBimpute = TRUE,
+ use_log_file = FALSE)
INFO [2023-06-02 12:35:40] ** Features with one or two measurements across runs are removed.
INFO [2023-06-02 12:35:40] ** Fractionation handled.
INFO [2023-06-02 12:35:40] ** Updated quantification data to make balanced design. Missing values are marked by NA
INFO [2023-06-02 12:35:40] ** Log2 intensities under cutoff = 15.542 were considered as censored missing values.
INFO [2023-06-02 12:35:40] ** Log2 intensities = NA were considered as censored missing values.
INFO [2023-06-02 12:35:40] ** Use all features that the dataset originally has.
Checked again that there are no proteins with more than 3 missing values (I have 6 samples in total).
> sampleQuant <- quantification(processed.quant, use_log_file = FALSE)
> table(rowSums(is.na(sampleQuant[, 2:7])))
0 1 2 3
416 112 69 28