Ken Furudate

In [ ]:
library(reshape2)
library(ggplot2)
In [ ]:
in_f1 = "IHC_anaalysis_data.txt"      
In [ ]:
set.seed(42)
data <- read.table(in_f1, header=TRUE, sep="\t", quote="", stringsAsFactors = FALSE)
data
Out[ ]:
CK.AE1.AE3 a.SMA CK.AE1.AE3_a.SMA LNM
0 50.800 17.896 68.696 1
1 51.138 12.219 63.357 1
2 51.920 10.376 62.296 1
3 45.817 14.654 60.471 1
4 50.199 6.594 56.793 1
5 4.950 13.950 18.900 1
6 17.048 24.294 41.342 1
7 17.204 21.989 39.193 1
8 20.511 23.337 43.848 1
9 10.073 32.444 42.517 1
10 30.124 24.396 54.520 1
11 31.361 34.622 65.983 1
12 28.746 20.564 49.310 1
13 40.906 9.388 50.294 1
14 23.314 28.110 51.424 1
15 15.852 27.751 43.603 1
16 33.734 8.526 42.260 1
17 31.716 30.495 62.211 1
18 17.453 22.046 39.499 1
19 32.300 22.138 54.438 1
20 26.158 15.920 42.078 1
21 17.630 19.142 36.772 1
22 20.534 21.042 41.576 1
23 15.294 16.121 31.415 1
24 14.525 27.614 42.139 1
25 52.467 7.045 59.512 0
26 36.840 9.919 46.759 0
27 19.042 9.230 28.272 0
28 38.902 16.056 54.958 0
29 40.497 13.096 53.593 0
30 18.166 18.758 36.924 0
31 30.708 21.999 52.707 0
32 25.214 19.729 44.943 0
33 42.100 19.877 61.977 0
34 38.812 7.316 46.128 0
35 41.365 20.475 61.840 0
36 38.094 8.995 47.089 0
37 41.903 11.346 53.249 0
38 45.951 11.153 57.104 0
39 22.689 16.065 38.754 0
40 56.912 7.876 64.788 0
41 43.110 4.935 48.045 0
42 40.183 7.668 47.851 0
43 43.616 10.371 53.987 0
44 48.991 9.150 58.141 0
45 33.200 6.590 39.790 0
46 28.831 6.900 35.731 0
47 4.636 12.787 17.423 0
48 20.294 8.009 28.303 0
49 29.020 9.064 38.084 0

IHC analysis.png

In [ ]:
data.melt <- reshape2::melt(data, 
                            id.vars="LNM", 
                            value.name="Positive_areas_per_unit_area", 
                            na.rm=TRUE, 
                            stringsAsFactors = FALSE
                            )
data.melt$LNM <- as.character(data.melt$LNM)
head(data.melt)
  LNM   variable Positive_areas_per_unit_area
1   1 CK.AE1.AE3                       50.800
2   1 CK.AE1.AE3                       51.138
3   1 CK.AE1.AE3                       51.920
4   1 CK.AE1.AE3                       45.817
5   1 CK.AE1.AE3                       50.199
6   1 CK.AE1.AE3                        4.950
In [ ]:
anot_cols <- c("#0977a9", "#ab162c")
select.col_names <- c("CK.AE1.AE3_a.SMA", "CK.AE1.AE3", "a.SMA")

for (i in 1:length(select.col_names)){
	col_ <- select.col_names[i]
	print(col_)
	mat_ <- data.melt[data.melt$variable==col_,]
  ggplot()+theme_set(theme_classic(base_size = 30, base_family = "Arial"))
	p <- ggplot(mat_,
				aes(x=LNM, 
            y=Positive_areas_per_unit_area), 
				    fill=LNM
            ) +
        stat_boxplot(geom = "errorbar", 
                     width = 0.2
                    ) +
        geom_boxplot(aes(fill=LNM), 
                     outlier.colour=NA, alpha=1.0
                    ) +
        geom_jitter(aes(col=LNM), 
                    position=position_jitter(0.2), 
                    shape=16, 
                    alpha=0.9, 
                    color="Black"
                    ) +
		    labs(title=select.col_names[i], x="", y="Positive areas per unit area (%)") +
				theme(plot.title = element_text(hjust = 0.5)) +
		    scale_fill_manual(values=anot_cols) +
		    scale_colour_manual(values=anot_cols) +
		    scale_x_discrete(limits=c("0", "1"),
				                labels=c("LNM(-)", "LNM(+)")
                        )
	print(p)

	res_ = wilcox.test(mat_$Positive_areas_per_unit_area~mat_$LNM,
					  alternative = "two.sided",
					  paired=F,
					  conf.int=T,
					  conf.level=0.95,
					  exact=F
					  )
	print(res_)
}
[1] "CK.AE1.AE3_a.SMA"

	Wilcoxon rank sum test with continuity correction

data:  mat_$Positive_areas_per_unit_area by mat_$LNM
W = 298, p-value = 0.7859
alternative hypothesis: true location shift is not equal to 0
95 percent confidence interval:
 -7.34898  5.90594
sample estimates:
difference in location 
             -1.194962 

[1] "CK.AE1.AE3"

	Wilcoxon rank sum test with continuity correction

data:  mat_$Positive_areas_per_unit_area by mat_$LNM
W = 417, p-value = 0.0436
alternative hypothesis: true location shift is not equal to 0
95 percent confidence interval:
  0.2740564 16.6909518
sample estimates:
difference in location 
              8.777978 

[1] "a.SMA"

	Wilcoxon rank sum test with continuity correction

data:  mat_$Positive_areas_per_unit_area by mat_$LNM
W = 111, p-value = 9.62e-05
alternative hypothesis: true location shift is not equal to 0
95 percent confidence interval:
 -12.92498  -4.50804
sample estimates:
difference in location 
             -8.745957 

In [ ]: