I have the following microarray gene expression data for one gene let us say. BTW - have similar data for the same subjects across 17000 genes, so I am looking for a generalized solution.

structure(list(subjectId = c(1L, 1L, 2L, 2L, 3L, 3L, 4L, 4L, 
5L, 5L, 6L, 6L, 7L, 7L, 8L, 8L, 9L, 9L, 10L, 10L, 11L, 11L, 12L, 
12L, 13L, 13L, 14L, 14L, 15L, 15L, 16L, 16L, 17L, 17L, 18L, 18L, 
19L, 19L, 20L, 20L, 21L, 21L, 22L, 22L, 23L, 23L, 24L, 24L, 25L, 
25L, 26L, 26L, 27L, 27L, 28L, 28L, 29L, 29L, 30L, 30L, 31L, 31L, 
32L, 32L, 33L, 33L, 34L, 34L, 35L, 35L, 36L, 36L, 37L, 37L, 38L, 
38L, 39L, 39L, 40L, 40L, 41L, 41L, 42L, 42L, 43L, 43L, 44L, 44L, 
45L, 45L, 46L, 46L, 47L, 47L, 48L, 48L, 49L, 49L, 50L, 50L, 51L, 
51L, 52L, 52L, 53L, 53L, 54L, 54L, 55L, 55L, 56L, 56L, 57L, 57L, 
58L, 58L, 59L, 59L, 60L, 60L, 61L, 61L), specimen_type = c("tumor", 
"normal", "tumor", "normal", "tumor", "normal", "tumor", "normal", 
"tumor", "normal", "tumor", "normal", "tumor", "normal", "tumor", 
"normal", "tumor", "normal", "tumor", "normal", "tumor", "normal", 
"tumor", "normal", "tumor", "normal", "tumor", "normal", "tumor", 
"normal", "tumor", "normal", "tumor", "normal", "tumor", "normal", 
"tumor", "normal", "tumor", "normal", "tumor", "normal", "tumor", 
"normal", "tumor", "normal", "tumor", "normal", "tumor", "normal", 
"tumor", "normal", "tumor", "normal", "tumor", "normal", "tumor", 
"normal", "tumor", "normal", "tumor", "normal", "tumor", "normal", 
"tumor", "normal", "tumor", "normal", "tumor", "normal", "tumor", 
"normal", "tumor", "normal", "tumor", "normal", "tumor", "normal", 
"tumor", "normal", "tumor", "normal", "tumor", "normal", "tumor", 
"normal", "tumor", "normal", "tumor", "normal", "tumor", "normal", 
"tumor", "normal", "tumor", "normal", "tumor", "normal", "tumor", 
"normal", "tumor", "normal", "tumor", "normal", "tumor", "normal", 
"tumor", "normal", "tumor", "normal", "tumor", "normal", "tumor", 
"normal", "tumor", "normal", "tumor", "normal", "tumor", "normal", 
"tumor", "normal"), log2_ratio = c(-2.7595, -3.12275, -3.1005, 
-2.8935, -3.01725, -2.0075, -1.98575, -1.778, -2.637, -2.4925, 
-2.795, -1.5565, -3.11175, -3.0635, -2.73875, -2.568, -2.5235, 
-2.01425, -2.30875, -2.55275, -2.82075, -2.84825, -3.05475, -3.117, 
-3.04425, -2.4045, -3.24125, -2.2845, -2.9165, -3.02025, -2.7415, 
-2.2085, -3.27475, -2.16325, -2.21325, -2.53325, -2.21625, -1.19075, 
-2.81375, -2.54475, -3.043, -2.53775, -2.53325, -2.8535, -2.495, 
-3.07275, -2.77375, -2.3305, -2.6795, -2.25675, -2.6475, -2.4115, 
-3.09975, -2.26175, 1.69675, -2.29725, -3.1775, -2.67475, -3.15, 
-2.808, -2.7965, -2.26825, -2.43175, -2.44175, -3.08675, -2.3425, 
1.268, -2.42125, 2.98175, -2.4815, 1.64275, -1.029, -2.9145, 
-2.80075, -2.9415, -2.71, -2.9045, -2.6085, -2.5085, -3.017, 
-2.8415, -2.767, -2.315, -3.261, -2.9915, -2.77675, -2.8115, 
-2.4095, -3.4475, -3.2485, -2.546, -2.52975, -2.7895, -2.9905, 
-3.01925, -2.482, -3.056, -1.3125, -2.7135, -2.28675, -2.88075, 
-3.25625, -2.96425, -2.65275, -2.4685, -2.7695, -2.29025, -2.889, 
-2.58825, -2.00475, -3.26425, -2.516, -2.4455, -2.88925, -2.671, 
-2.369, -3.154, -2.42375, -2.145, -3.249, 1.988, -1.40775)), row.names = c(NA, 
-122L), vars = list(specimen_type_code), labels = structure(list(
    specimen_type_code = c("PRIMARY TUMOR", "SOLID TISSUE NORMAL"
    )), class = "data.frame", row.names = c(NA, -2L), vars = list(
    specimen_type_code), drop = TRUE, .Names = "specimen_type_code"), indices = list(
    c(0L, 2L, 4L, 6L, 8L, 10L, 12L, 14L, 16L, 18L, 20L, 22L, 
    24L, 26L, 28L, 30L, 32L, 34L, 36L, 38L, 40L, 42L, 44L, 46L, 
    48L, 50L, 52L, 54L, 56L, 58L, 60L, 62L, 64L, 66L, 68L, 70L, 
    72L, 74L, 76L, 78L, 80L, 82L, 84L, 86L, 88L, 90L, 92L, 94L, 
    96L, 98L, 100L, 102L, 104L, 106L, 108L, 110L, 112L, 114L, 
    116L, 118L, 120L), c(1L, 3L, 5L, 7L, 9L, 11L, 13L, 15L, 17L, 
    19L, 21L, 23L, 25L, 27L, 29L, 31L, 33L, 35L, 37L, 39L, 41L, 
    43L, 45L, 47L, 49L, 51L, 53L, 55L, 57L, 59L, 61L, 63L, 65L, 
    67L, 69L, 71L, 73L, 75L, 77L, 79L, 81L, 83L, 85L, 87L, 89L, 
    91L, 93L, 95L, 97L, 99L, 101L, 103L, 105L, 107L, 109L, 111L, 
    113L, 115L, 117L, 119L, 121L)), drop = TRUE, group_sizes = c(61L, 
61L), biggest_group_size = 61L, .Names = c("subjectId", "specimen_type", 
"log2_ratio"), class = c("grouped_df", "tbl_df", "tbl", "data.frame"

You can see from the plot that five of the subjects have what can be considered 'outlier' values for the 'tumor' case:

ggplot(df, aes(x = specimen_type, y = log2_ratio, group = subjectId)) + geom_point() + geom_line() + theme_bw() + ylab('log2 ratio') + xlab('')

Below is the plot (note: each line represents a single subject):

enter image description here

I am trying to run paired t-tests for each gene's difference in differential expression between normal and tumor case across the 61 subjects for which I have data. However, I am concerned that these outliers (perhaps due to measurement errors, or some other reason) skew my results.

Are there best practices to use in handling such data and techniques for removing these types of outliers (all values belonging to such subjects)?

I can use a z-score threshold easily, but not sure if that is the best or even the right way.

  • 1
    $\begingroup$ Please post the plot. No need to assume that everyone interested uses R and should run your code. $\endgroup$
    – Nick Cox
    May 26, 2016 at 19:30
  • $\begingroup$ Sorry about that....use R so much, don't even think about it. $\endgroup$ May 26, 2016 at 19:48
  • $\begingroup$ How did you calculate your log fold change? It is awkward. Why it is lower than 0 in the most of the cases? $\endgroup$ May 26, 2016 at 19:58
  • $\begingroup$ No idea since I did not calculate it. It is data coming from TCGA study. I am similarly struggling to explain why for many genes half subjects show log fold change that is higher for turmor vs. normal, but for half others it is lower for tumor vs. normal. $\endgroup$ May 26, 2016 at 20:07
  • $\begingroup$ @user3949008 you should ask. You do not understand your data. If you do not want to do it - you can use non-parametric tests for comparison between means, but I recommend you to understand what kind of data you work with. For your case - half lower than 0 and half higher than 0 is absolutely normal if null hypothesis (means are equal) is true. $\endgroup$ May 26, 2016 at 20:10


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.