Dear MSstats support,
I have a question regarding subject nesting in MSstats: My data contains two groups of subjects. (A) patient group (B) control group. From each individual in group A two biopsies were taken, (i) from a diseased tissue (ii) from a matched normal tissue. For individuals from group B a single biopsy was taken. I analysed the data in two ways: I started by ignoring the individual level and simply used the run name as BioReplicate id. This should lead to a statistical analysis treating each run as independent sample.
'data.frame': 1715433 obs. of 10 variables:
$ ProteinName : Factor w/ 2516 levels "1433B_HUMAN",..: 2395 2395 2395 2395 2395 2395 2395 2395 2395 2395 ...
$ PeptideSequence : Factor w/ 19585 levels "_[-131]MAALRPLVKPK_",..: 13085 13085 13085 13085 13085 13085 12547 12547 12547 12547 ...
$ PrecursorCharge : Factor w/ 8 levels "2","3","4","5",..: 1 1 1 1 1 1 1 1 1 1 ...
$ FragmentIon : Factor w/ 433 levels "a10H2O","a10H3PO4",..: 433 287 255 153 429 291 417 421 413 399 ...
$ ProductCharge : int 1 1 1 1 1 1 1 1 1 1 ...
$ IsotopeLabelType: Factor w/ 1 level "L": 1 1 1 1 1 1 1 1 1 1 ...
$ Condition : Factor w/ 3 levels "ko","l","nl": 1 1 1 1 1 1 1 1 1 1 ...
$ BioReplicate : Factor w/ 15 levels "20160609_06_classicDIA_37757",..: 1 1 1 1 1 1 1 1 1 1 ...
$ Run : Factor w/ 15 levels "20160609_06_classicDIA_37757",..: 1 1 1 1 1 1 1 1 1 1 ...
$ Intensity : num 6001 3629 24347 742 12315 ...
> table(input.df$BioReplicate, input.df$Condition)
ko l nl
20160609_06_classicDIA_37757 112436 0 0
20160609_07_classicDIA_37750 0 0 112317
20160609_08_classicDIA_37755 0 107410 0
20160609_09_classicDIA_37753 0 114483 0
20160609_10_classicDIA_37749 0 112705 0
20160609_11_classicDIA_37756 0 0 113566
20160609_12_classicDIA_37762 110959 0 0
20160609_14_classicDIA_37748 0 0 117743
20160609_15_classicDIA_37751 0 119712 0
20160609_16_classicDIA_37747 0 115626 0
20160609_17_classicDIA_37766 114848 0 0
20160609_18_classicDIA_37752 0 0 115898
20160609_19_classicDIA_37754 0 0 119652
20160609_20_classicDIA_37759 117787 0 0
20160609_22_classicDIA_37763 110291 0 0
> table(input.df$Run, input.df$Condition)
ko l nl
20160609_06_classicDIA_37757 112436 0 0
20160609_07_classicDIA_37750 0 0 112317
20160609_08_classicDIA_37755 0 107410 0
20160609_09_classicDIA_37753 0 114483 0
20160609_10_classicDIA_37749 0 112705 0
20160609_11_classicDIA_37756 0 0 113566
20160609_12_classicDIA_37762 110959 0 0
20160609_14_classicDIA_37748 0 0 117743
20160609_15_classicDIA_37751 0 119712 0
20160609_16_classicDIA_37747 0 115626 0
20160609_17_classicDIA_37766 114848 0 0
20160609_18_classicDIA_37752 0 0 115898
20160609_19_classicDIA_37754 0 0 119652
20160609_20_classicDIA_37759 117787 0 0
20160609_22_classicDIA_37763 110291 0 0
Next, I used subject ids to populate the BioReplicate column in the input df. This lead to the following:
> str(input.df)
'data.frame': 1715433 obs. of 10 variables:
$ ProteinName : Factor w/ 2516 levels "1433B_HUMAN",..: 2395 2395 2395 2395 2395 2395 2395 2395 2395 2395 ...
$ PeptideSequence : Factor w/ 19585 levels "_[-131]MAALRPLVKPK_",..: 13085 13085 13085 13085 13085 13085 12547 12547 12547 12547 ...
$ PrecursorCharge : Factor w/ 8 levels "2","3","4","5",..: 1 1 1 1 1 1 1 1 1 1 ...
$ FragmentIon : Factor w/ 433 levels "a10H2O","a10H3PO4",..: 433 287 255 153 429 291 417 421 413 399 ...
$ ProductCharge : int 1 1 1 1 1 1 1 1 1 1 ...
$ IsotopeLabelType: Factor w/ 1 level "L": 1 1 1 1 1 1 1 1 1 1 ...
$ Condition : Factor w/ 3 levels "ko","l","nl": 1 1 1 1 1 1 1 1 1 1 ...
$ BioReplicate : Factor w/ 10 levels "ZETH_21","ZETH_22",..: 8 8 8 8 8 8 8 8 8 8 ...
$ Run : Factor w/ 15 levels "20160609_06_classicDIA_37757",..: 1 1 1 1 1 1 1 1 1 1 ...
$ Intensity : num 6001 3629 24347 742 12315 ...
> table(input.df$BioReplicate, input.df$Condition)
ko l nl
ZETH_21 0 112705 112317
ZETH_22 0 119712 115898
ZETH_23 0 114483 119652
ZETH_24 110959 0 0
ZETH_25 117787 0 0
ZETH_26 0 115626 117743
ZETH_27 0 107410 113566
ZETH_28 112436 0 0
ZETH_29 114848 0 0
ZETH_30 110291 0 0
> table(input.df$Run, input.df$Condition)
ko l nl
20160609_06_classicDIA_37757 112436 0 0
20160609_07_classicDIA_37750 0 0 112317
20160609_08_classicDIA_37755 0 107410 0
20160609_09_classicDIA_37753 0 114483 0
20160609_10_classicDIA_37749 0 112705 0
20160609_11_classicDIA_37756 0 0 113566
20160609_12_classicDIA_37762 110959 0 0
20160609_14_classicDIA_37748 0 0 117743
20160609_15_classicDIA_37751 0 119712 0
20160609_16_classicDIA_37747 0 115626 0
20160609_17_classicDIA_37766 114848 0 0
20160609_18_classicDIA_37752 0 0 115898
20160609_19_classicDIA_37754 0 0 119652
20160609_20_classicDIA_37759 117787 0 0
20160609_22_classicDIA_37763 110291 0 0
One can see that individual 21, 22, 23, 26, 27 belong to the patient group, because they provide features coming from condition l and nl. Next, I generated the following comparisons:
> comparisions
ko l nl
l vs ko -1 1 0
nl vs ko -1 0 1
l vs nl 0 1 -1
and compared the results for nested vs. non nested input data. My expectation was that only the comparison l vs nl is affected, but I see that all three comparisons are effected. Can anyone explain me why?
Greetings,
Tobi