-
Notifications
You must be signed in to change notification settings - Fork 0
/
script_scatter_Tmk3Putida.R
80 lines (55 loc) · 2.88 KB
/
script_scatter_Tmk3Putida.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#analysis effect exudates of Tmk3 over psuedomonas putida
heat=read.table("/Users/manuel/Documents/posdoc_berkeley/barseq_results/tabla_putida.txt", header=TRUE, row.names = 1, sep="\t")
heat[,"SumSpend"]= rowSums(heat[,c("R","S", "T")])/3
heat[,"control"]=rowSums(heat[,c("D", "F", "G", "H")])/4
genesFitdowntmk3=rownames(heat)[heat$SumSpend < -1 & heat$control > -1]
genesFituptmk3=rownames(heat)[heat$SumSpend > 1 & heat$control < 1]
genesFitComple=rownames(heat)[heat$SumSpend < 1 & heat$control < -1.5 & heat$SumSpend > -1]
length(genesFitdowntmk3)
length(genesFituptmk3)
length(genesFitComple)
fitneneg=heat[genesFitdowntmk3,]
fitneposi=heat[genesFituptmk3,]
fitneComple=heat[genesFitComple,]
genes_interIron=c("PP_4755",
"PP_1224",
"PP_1898",
"PP_2378",
"PP_1082",
"PP_1083")
genes_interABC=c(
"PP_5327",
"PP_5328",
"PP_1779",
"PP_1778"
)
genes_interFA=c("PP_3425",
"PP_3426",
"PP_3427",
"PP_3428")
fitnenegNamesIron=heat[genes_interIron,]
fitnenegNamesFA=heat[genes_interFA,]
fitnenegNamesABC=heat[genes_interABC,]
#general scatter plot
plot( heat$SumSpend, heat$control, col="darkgray", xlim = c(-5,2), ylim = c(-5,1), cex = 0.7,pch=19,
xlab = "T. atroviride Tmk3-Spent media", ylab= "Without Fungus", main = "Pseudomonas putida")
points(fitneneg$SumSpend, fitneneg$control, col="purple", pch=19,cex = 0.7 )
points(fitneposi$SumSpend, fitneposi$control, col="red", pch=19,cex = 0.7 )
points(fitneComple$SumSpend, fitneComple$control, col="blue", pch=19, cex = 0.7 )
#points for annotation
points(fitnenegNamesFA$SumSpend,fitnenegNamesFA$control, col="coral3", pch=19, cex = 1.2 )
points(fitnenegNamesABC$SumSpend,fitnenegNamesABC$control, col="green", pch=19, cex = 1.2 )
points(fitnenegNamesIron$SumSpend,fitnenegNamesIron$control, col="brown", pch=19, cex = 1.2 )
#text for ids
text(fitneneg$SumSpend, fitneneg$control, labels = row.names(fitneneg),col="black", cex=0.5, pos=3 )
text(fitneposi$SumSpend,fitneposi$control,labels = row.names(fitneposi),col="black", cex=0.5, pos=3 )
text(fitnenegNamesFA$SumSpend,fitnenegNamesFA$control,labels = row.names(fitnenegNamesFA),col="black", cex=0.5, pos=3 )
text(fitnenegNamesABC$SumSpend,fitnenegNamesABC$control, labels = row.names(fitnenegNamesABC),col="black", cex=0.5, pos=3 )
text(fitnenegNamesIron$SumSpend,fitnenegNamesIron$control, labels = row.names(fitnenegNamesIron),col="black", cex=0.5, pos=3 )
text(fitneComple$SumSpend,fitneComple$control, labels = row.names(fitneComple),col="black", cex=0.5, pos=3 )
legend(-3, -3, legend=c("Negative Fitness","Recovered","Fusaric acid resistance", "ABC", "Iron"),
col=c("purple","blue","coral3", "green", "brown"), pch=19, cex=1.2 )
abline(h=0, col="black", lty=2, lwd=1)
abline(v=0, col="black", lty=2, lwd=1)
abline(-0.01,1)
Exporter as a PDF using 7X7