-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPCplot.R
107 lines (84 loc) · 4.74 KB
/
PCplot.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#Principal Component Coordinate Plots with Reaction Fluxes
path=setwd("C:/Users/Supreeta/OneDrive/Synechococcus code/reformatted/PCA/data")
setwd(path)
getwd()
#Load data
#First Principal Component
PC1_ATP<-c(4.209151305,-15.5830367,-16.03098279,70.97298819,23.09314501,-3.760537561,
-13.90438594,-14.82566588,0.054822229,3.832197411,-3.624949755,-4.126794139,-15.19131192,
4.166260837,4.216263217,3.887700223,4.343747753,-16.02380615,4.053639307,4.439649915,
4.397976395,-16.39817579,-16.65343317,4.455538021)
IODP<-c(0.463357409,0.018513407,0,1.700444474,0.826604949,0.328622089,
0.057913747,0.031798956,0.414181027,0.463357777,0.341856682,0.330639145,
0,0.463357777,0.469460123,0.463357409,0.463357777,0,0.469459756,0.463357777,
0.463357777,0,0,0.463357777)
#Plot scatter
require(stats)
fit_ATP1 <- lm(IODP~PC1_ATP)
ATP1_plot <- plot(PC1_ATP,IODP,xlab="PC1",ylab="IODP flux",pch=19,col="chartreuse4",axes = TRUE)
cor=(PC1_ATPIODP)
abline(fit_ATP1)
PC1_P1<-c(4.714122998,-16.35714137,-17.62020956,74.89657725,24.53656596,-3.726889147,
-14.81100283,-15.95357678,0.929897257,4.714122998,-3.287530905,-3.720282086,
-18.65374495,4.714122998,5.052337196,4.714122998,4.714122998,-16.89094847,
5.052337196,4.714122998,4.714122998,-18.42155503,-18.73781772,4.714122998)
ASPTA1<-c(0.109628418,0.004311016,0.002525045,0.412163883,0.193439599,
0.07632137,0.013646949,0.007490777,0.079617602,0.109628418,0.070743061,
0.077427732,0.00101661,0.109628418,0.109157353,0.109628418,0.109628418,
0,0.109157353,0.109628418,0.109628418,0.001146519,0.000989354,0.109628418)
fit_P11 <- lm(ASPTA1~PC1_P1)
P11_plot <- plot(PC1_P1,ASPTA1,xlab="PC1",ylab="ASPTA1 flux",pch=19,col="red4",axes = TRUE)
cor=(PC1_P1,ASPTA1)
abline(fit_P11)
PC1_P2<-c(4.866497736,-16.157781470,-17.697463030,74.001528880,24.495729510,-3.529644030,
-14.604424610,-15.752136840,1.082572141,4.866497736,-3.112786479,-3.551716299,
-19.213798750,4.866497736,5.202667795,4.866497736,4.866497736,-16.700828920,
5.202667795,4.866497736,4.866497736,-19.382768840,-19.213798750,4.866497736)
PDH<-c(0.595090717,0.019676868,0.000306695,2.160657616,1.050992195,0.420322223,
0.075474108,0.04143182,0.462341517,0.595090717,0.430413001,0.429562818,0,
0.595090717,0.598653693,0.595090717,0.595090717,0,0.598653693,0.595090717,
0.595090717,0,0,0.595090717)
fit_P21 <- lm(PDH~PC1_P2)
P21_plot <- plot(PC1_P2,PDH,xlab="PC1",ylab="PDH flux",pch=19,col="blue4",axes = TRUE)
cor=(PC1_P2,PDH)
abline(fit_P21)
#Second Principal Component
PC2_ATP<-c(1.946707377,-4.524748215,-4.868280525,-11.38935912,1.073211878,5.016295069,
-1.105704944,3.626240288,3.855670188,1.710384883,-0.76231101,0.909009831,
-4.547056281,7.127847653,1.827171687,2.292223043,6.050247769,-4.942394194,
-0.983920755,5.861397511,5.973816386,-5.423614115,-17.00870077,8.285866363)
ILEABC<-c(0.019278716,0.000771149,0,0,0.033737753,0.013495101,0.002412196,0.001324491,
0.017232676,0.019278716,0.014040226,0.013756752,0,0.019278716,0.019278716,0.019278716,
0.019278716,0,0,0.019278716,0.019278716,0,0,0.019278716)
fit_ATP2 <- lm(ILEABC~PC2_ATP)
ATP2_plot <- plot(PC2_ATP,ILEABC,xlab="PC2",ylab="ILEABC flux",pch=19,col="chartreuse4",axes = TRUE)
cor=(PC2_ATP,ILEABC)
abline(fit_ATP2)
PC2_P1<-c(-4.097697897,-0.324968117,1.531902967,13.04524619,0.055892568,-2.003748592,
-0.600089707,-0.408522024,-8.886650336,-4.097697897,-3.442943113,-2.236603523,
13.27407195,-4.097697897,-3.503151571,-4.097697897,-4.097697897,-0.242041558,
-3.503151571,-4.097697897,-4.097697897,16.11878013,13.90755948,-4.097697897)
NADPQ<-c(0,0,0.000639924,0,0,0,0,0,0,0,0,0,0.008778263,0,0,0,0,0,0,0,0,
0.008918922,0.008778339,0)
fit_P12 <- lm(NADPQ~PC2_P1)
P12_plot <- plot(PC2_P1,NADPQ,xlab="PC2",ylab="NADPQ flux",pch=19,col="red4",axes = TRUE)
cor=(PC2_P1,NADPQ)
abline(fit_P12)
PC2_P2<-c(-4.083596235,-2.491363155,1.611148992,13.63346217,0.520007565,-3.003038996,
-2.625385659,-2.538759973,-6.851538916,-4.083596235,-3.887321154,-3.047858066,
16.37420577,-4.083596235,-3.58894208,-4.083596235,-4.083596235,-2.397929075,
-3.58894208,-4.083596235,-4.083596235,18.17681877,16.37420577,-4.083596235)
GARFT<-c(0,0,0,0.000122624,0,0,0,0,0,0,0,0,0.000185518,0,0,0,0,0,0,0,0,
0.000188165,0.000185518,0)
CA2T3<-c(0.000203945,0,0,0.000734204,0.000356905,0.000142762,0,0,0.000182301,
0.000203945,0.000148529,0.00014553,0.001513016,0.000203945,0.000203945,
0.000203945,0.000203945,0,0.000203945,0.000203945,0.000203945,0.00151133,
0.001513016,0.000203945)
fit_P22 <- lm(GARFT~PC2_P2)
P22_plot <- plot(PC2_P2,GARFT,xlab="PC2",ylab="GARFT flux",pch=19,col="blue4",axes = TRUE)
cor=(PC2_P2,GARFT)
abline(fit_P22)
fit_P22 <- lm(CA2T3~PC2_P2)
P22_plot <- plot(PC2_P2,CA2T3,xlab="PC2",ylab="CA2T3 flux",pch=19,col="blue4",axes = TRUE)
cor=(PC2_P2,CA2T3)
abline(fit_P22)