annotate all stuff/Commonality and Difference finderMADE 7 TO 7 1-15-2019.R @ 0:23eea82f5192 draft

Uploaded
author jfb
date Wed, 16 Jan 2019 13:55:22 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1 #I should make an SOP for this. Problems we encountered: no x in the xY motif, and the kilodemon
23eea82f5192 Uploaded
jfb
parents:
diff changeset
2 #the output files have both Y and xY, they shouldn't why is that happening? make it not happen
23eea82f5192 Uploaded
jfb
parents:
diff changeset
3 #make sure that accession numbers stay locked to each motif, somehow
23eea82f5192 Uploaded
jfb
parents:
diff changeset
4 #output should look just like the KALIP input
23eea82f5192 Uploaded
jfb
parents:
diff changeset
5
23eea82f5192 Uploaded
jfb
parents:
diff changeset
6 #ff you want ONLY FULL MOTIFS, put "YES" here, please use all caps
23eea82f5192 Uploaded
jfb
parents:
diff changeset
7 FullMotifsOnly_questionmark<-"NO"
23eea82f5192 Uploaded
jfb
parents:
diff changeset
8 #If you want ONLY TRUNCATED MOTIFS, put "YES" here, please use all caps
23eea82f5192 Uploaded
jfb
parents:
diff changeset
9 TruncatedMotifsOnly_questionmark<-"NO"
23eea82f5192 Uploaded
jfb
parents:
diff changeset
10 #if you want to find the overlap, put a "YES" here (all caps), if you want to find the non-overlap, put "NO" (all caps)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
11 Are_You_Looking_For_Commonality<-"NO"
23eea82f5192 Uploaded
jfb
parents:
diff changeset
12
23eea82f5192 Uploaded
jfb
parents:
diff changeset
13
23eea82f5192 Uploaded
jfb
parents:
diff changeset
14 #put the names of your input files here
23eea82f5192 Uploaded
jfb
parents:
diff changeset
15 FirstSubstrateSet<- read.csv("Galaxy63-BTK_PLUS-R1_Substrates.csv", stringsAsFactors=FALSE)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
16 Firstsubbackfreq<- read.csv("Galaxy64-BTK_PLUS-R1_SubstrateBackgroundFrequency.csv", header=FALSE, stringsAsFactors=FALSE)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
17
23eea82f5192 Uploaded
jfb
parents:
diff changeset
18 SecondSubstrateSet<- read.csv("Galaxy65-BTK_PLUS_R2_Substrates.csv", stringsAsFactors=FALSE)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
19 Secondsubbackfreq<- read.csv("Galaxy66-BTK_PLUS_R2_SubstrateBackgroundFrequency.csv", header=FALSE, stringsAsFactors=FALSE)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
20
23eea82f5192 Uploaded
jfb
parents:
diff changeset
21 ThirdSubstrateSet<- read.csv("Galaxy69-BTK_PLUS_R3_Substrates.csv", stringsAsFactors=FALSE)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
22 Thirdsubbackfreq<- read.csv("Galaxy70-BTK_PLUS_R3_SubstrateBackgroundFrequency.csv", header=FALSE, stringsAsFactors=FALSE)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
23
23eea82f5192 Uploaded
jfb
parents:
diff changeset
24 #then put the names of your output files here
23eea82f5192 Uploaded
jfb
parents:
diff changeset
25 Shared_motifs_table<-"180719_GALAXY-BTK-plus-rep-OVLP-7to7-substrates.csv"
23eea82f5192 Uploaded
jfb
parents:
diff changeset
26 Shared_subbackfreq_table<-"180719_GALAXY-BTK-plus-rep-OVLP-7to7-SubBackFreq.csv"
23eea82f5192 Uploaded
jfb
parents:
diff changeset
27
23eea82f5192 Uploaded
jfb
parents:
diff changeset
28 # Shared_motifs_table<-"Shared motifs 7-27-17.csv"
23eea82f5192 Uploaded
jfb
parents:
diff changeset
29 # Shared_subbackfreq_table<-"SubstrateBackgrounFrequency-for-shared-motifs 4 7-27-17.csv"
23eea82f5192 Uploaded
jfb
parents:
diff changeset
30
23eea82f5192 Uploaded
jfb
parents:
diff changeset
31 First_unshared_motifs_table<-"R1 substrates.csv"
23eea82f5192 Uploaded
jfb
parents:
diff changeset
32 First_unshared_subbackfreq<-"R1 SBF.csv"
23eea82f5192 Uploaded
jfb
parents:
diff changeset
33
23eea82f5192 Uploaded
jfb
parents:
diff changeset
34 Second_unshared_motifs_table<-"R2 subs.csv"
23eea82f5192 Uploaded
jfb
parents:
diff changeset
35 Second_unshared_subbackfreq<-"R2 SBf.csv"
23eea82f5192 Uploaded
jfb
parents:
diff changeset
36
23eea82f5192 Uploaded
jfb
parents:
diff changeset
37 Third_unshared_motifs_table<-"R3 subs.csv"
23eea82f5192 Uploaded
jfb
parents:
diff changeset
38 Third_unshared_subbackfreq<-"R3 SBF.csv"
23eea82f5192 Uploaded
jfb
parents:
diff changeset
39
23eea82f5192 Uploaded
jfb
parents:
diff changeset
40 #final note, this code is going to be unworkable if you want to make a Venn diagram of more than 3 circles. I think I'll poke around
23eea82f5192 Uploaded
jfb
parents:
diff changeset
41 #other languages to see if any of them can do it.
23eea82f5192 Uploaded
jfb
parents:
diff changeset
42 ####################################################################################################################################
23eea82f5192 Uploaded
jfb
parents:
diff changeset
43
23eea82f5192 Uploaded
jfb
parents:
diff changeset
44
23eea82f5192 Uploaded
jfb
parents:
diff changeset
45
23eea82f5192 Uploaded
jfb
parents:
diff changeset
46
23eea82f5192 Uploaded
jfb
parents:
diff changeset
47
23eea82f5192 Uploaded
jfb
parents:
diff changeset
48 FirstxY<-rep("xY",times=nrow(FirstSubstrateSet))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
49 FirstSubstrateSet[,11]<-FirstxY
23eea82f5192 Uploaded
jfb
parents:
diff changeset
50
23eea82f5192 Uploaded
jfb
parents:
diff changeset
51 SecondxY<-rep("xY",times=nrow(SecondSubstrateSet))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
52 SecondSubstrateSet[,11]<-SecondxY
23eea82f5192 Uploaded
jfb
parents:
diff changeset
53
23eea82f5192 Uploaded
jfb
parents:
diff changeset
54 ThirdxY<-rep("xY",times=nrow(ThirdSubstrateSet))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
55 ThirdSubstrateSet[,11]<-ThirdxY
23eea82f5192 Uploaded
jfb
parents:
diff changeset
56
23eea82f5192 Uploaded
jfb
parents:
diff changeset
57
23eea82f5192 Uploaded
jfb
parents:
diff changeset
58
23eea82f5192 Uploaded
jfb
parents:
diff changeset
59
23eea82f5192 Uploaded
jfb
parents:
diff changeset
60
23eea82f5192 Uploaded
jfb
parents:
diff changeset
61
23eea82f5192 Uploaded
jfb
parents:
diff changeset
62
23eea82f5192 Uploaded
jfb
parents:
diff changeset
63
23eea82f5192 Uploaded
jfb
parents:
diff changeset
64
23eea82f5192 Uploaded
jfb
parents:
diff changeset
65
23eea82f5192 Uploaded
jfb
parents:
diff changeset
66
23eea82f5192 Uploaded
jfb
parents:
diff changeset
67 ####################################################################################################################################
23eea82f5192 Uploaded
jfb
parents:
diff changeset
68 ####################################################################################################################################
23eea82f5192 Uploaded
jfb
parents:
diff changeset
69 # better version of this code written in C: what happens when two kinases share a motif, but they found that motif in two
23eea82f5192 Uploaded
jfb
parents:
diff changeset
70 # separate proteins thus two separate accession numbers?
23eea82f5192 Uploaded
jfb
parents:
diff changeset
71 # It should actually output the shared motif and BOTH accession numbers. Right now it does not, it only maps out the second
23eea82f5192 Uploaded
jfb
parents:
diff changeset
72 # accession number. So that needs to be fixed BUT you need to keep the commonality between a motif and its accession number
23eea82f5192 Uploaded
jfb
parents:
diff changeset
73 ####################################################################################################################################
23eea82f5192 Uploaded
jfb
parents:
diff changeset
74 ####################################################################################################################################
23eea82f5192 Uploaded
jfb
parents:
diff changeset
75 ####################################################################################################################################
23eea82f5192 Uploaded
jfb
parents:
diff changeset
76 ####################################################################################################################################
23eea82f5192 Uploaded
jfb
parents:
diff changeset
77
23eea82f5192 Uploaded
jfb
parents:
diff changeset
78 #Create the motif sets, deciding wether or not you're looking for truncated or full here
23eea82f5192 Uploaded
jfb
parents:
diff changeset
79 #full only
23eea82f5192 Uploaded
jfb
parents:
diff changeset
80 if (Are_You_Looking_For_Commonality=="YES"){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
81 if (FullMotifsOnly_questionmark=="YES"){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
82 FTLwtmotifs=matrix(,nrow = nrow(FirstSubstrateSet),ncol=1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
83 FTLwtAccessionNumbers=matrix(,nrow = nrow(FirstSubstrateSet),ncol=1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
84 leftspaces<-c()
23eea82f5192 Uploaded
jfb
parents:
diff changeset
85 rightspaces<-c()
23eea82f5192 Uploaded
jfb
parents:
diff changeset
86 for (i in 1:nrow(FirstSubstrateSet)){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
87 FTLwtletters<-FirstSubstrateSet[i,4:18]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
88 FTLwtletters<-FTLwtletters[FTLwtletters !="XXXXX"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
89 FTLwtletters<-paste(FTLwtletters, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
90
23eea82f5192 Uploaded
jfb
parents:
diff changeset
91
23eea82f5192 Uploaded
jfb
parents:
diff changeset
92 YYYmotif <- unlist(strsplit(FTLwtletters, split = ""))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
93 YYYposition <- match(x = "x", table = YYYmotif)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
94 #position itself tells me how much is to the left of that X by what it's number is. x at position 4 tells me that there are
23eea82f5192 Uploaded
jfb
parents:
diff changeset
95 #just 3 letters to the left of x
23eea82f5192 Uploaded
jfb
parents:
diff changeset
96
23eea82f5192 Uploaded
jfb
parents:
diff changeset
97 YYYLettersToTheLeft <- YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
98 #how many letters to the right SHOULD just be length(motif)-position-1 if it's 5 long and x is at 3 then Y is at 4 and there is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
99 #just 1 spot to the right of Y so LettersToTheRight<-1 because 5-3-1=1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
100 YYYLettersToTheRight <- length(YYYmotif) - YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
101 #then sanity check, we're currently looking only at +/-4, but this spot allows for up to +/- 7 as well, just depends on what the
23eea82f5192 Uploaded
jfb
parents:
diff changeset
102 #variable the user puts in is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
103
23eea82f5192 Uploaded
jfb
parents:
diff changeset
104 if (YYYLettersToTheLeft > 6 && YYYLettersToTheRight > 6) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
105 motif<-YYYmotif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
106 #save that motif, which is the Y and +/- 4 amino acids, including truncation
23eea82f5192 Uploaded
jfb
parents:
diff changeset
107 motif<-motif[!motif %in% "x"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
108 motif<-paste(motif, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
109 FTLwtletters<-motif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
110 FTLwtmotifs[i,1]<-FTLwtletters
23eea82f5192 Uploaded
jfb
parents:
diff changeset
111 FTLwtAccessionNumbers[i,1]<-FirstSubstrateSet[i,3]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
112
23eea82f5192 Uploaded
jfb
parents:
diff changeset
113 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
114
23eea82f5192 Uploaded
jfb
parents:
diff changeset
115 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
116 # FTLwtmotifs <- FTLwtmotifs[!is.na(FTLwtmotifs)]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
117 # FTLwtmotifs<-matrix(FTLwtmotifs,ncol = 1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
118 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
119
23eea82f5192 Uploaded
jfb
parents:
diff changeset
120 D835Ymotifs=matrix(,nrow = nrow(SecondSubstrateSet),ncol=1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
121 D835YAccessionNumbers<-matrix(,nrow = nrow(SecondSubstrateSet),ncol = 1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
122
23eea82f5192 Uploaded
jfb
parents:
diff changeset
123 for (i in 1:nrow(SecondSubstrateSet)){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
124 D835letters<-SecondSubstrateSet[i,4:18]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
125 D835letters<-D835letters[D835letters !="XXXXX"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
126 D835letters<-paste(D835letters, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
127
23eea82f5192 Uploaded
jfb
parents:
diff changeset
128
23eea82f5192 Uploaded
jfb
parents:
diff changeset
129 YYYmotif <- unlist(strsplit(D835letters, split = ""))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
130 YYYposition <- match(x = "x", table = YYYmotif)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
131 #position itself tells me how much is to the left of that X by what it's number is. x at position 4 tells me that there are
23eea82f5192 Uploaded
jfb
parents:
diff changeset
132 #just 3 letters to the left of x
23eea82f5192 Uploaded
jfb
parents:
diff changeset
133
23eea82f5192 Uploaded
jfb
parents:
diff changeset
134 YYYLettersToTheLeft <- YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
135 #how many letters to the right SHOULD just be length(motif)-position-1 if it's 5 long and x is at 3 then Y is at 4 and there is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
136 #just 1 spot to the right of Y so LettersToTheRight<-1 because 5-3-1=1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
137 YYYLettersToTheRight <- length(YYYmotif) - YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
138 #then sanity check, we're currently looking only at +/-4, but this spot allows for up to +/- 7 as well, just depends on what the
23eea82f5192 Uploaded
jfb
parents:
diff changeset
139 #variable the user puts in is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
140
23eea82f5192 Uploaded
jfb
parents:
diff changeset
141 if (YYYLettersToTheLeft > 6 && YYYLettersToTheRight > 6) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
142 motif<-YYYmotif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
143 #add blank spaces if the motif has less than 4 letters to the left/right
23eea82f5192 Uploaded
jfb
parents:
diff changeset
144 motif<-c(leftspaces,YYYmotif,rightspaces)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
145 #save that motif, which is the Y and +/- 4 amino acids, including truncation
23eea82f5192 Uploaded
jfb
parents:
diff changeset
146 motif<-motif[!motif %in% "x"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
147 motif<-paste(motif, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
148 D835letters<-motif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
149 D835Ymotifs[i,1]<-D835letters
23eea82f5192 Uploaded
jfb
parents:
diff changeset
150 D835YAccessionNumbers[i,1]<-SecondSubstrateSet[i,3]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
151
23eea82f5192 Uploaded
jfb
parents:
diff changeset
152 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
153 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
154
23eea82f5192 Uploaded
jfb
parents:
diff changeset
155 ITDmotifs=matrix(,nrow = nrow(ThirdSubstrateSet),ncol=1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
156 ITDAccessionNumbers<-matrix(,nrow = nrow(ThirdSubstrateSet))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
157
23eea82f5192 Uploaded
jfb
parents:
diff changeset
158 for (i in 1:nrow(ThirdSubstrateSet)){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
159 ITDletters<-ThirdSubstrateSet[i,4:18]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
160 ITDletters<-ITDletters[ITDletters !="XXXXX"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
161 ITDletters<-paste(ITDletters, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
162 YYYmotif <- unlist(strsplit(ITDletters, split = ""))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
163 YYYposition <- match(x = "x", table = YYYmotif)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
164 #position itself tells me how much is to the left of that X by what it's number is. x at position 4 tells me that there are
23eea82f5192 Uploaded
jfb
parents:
diff changeset
165 #just 3 letters to the left of x
23eea82f5192 Uploaded
jfb
parents:
diff changeset
166
23eea82f5192 Uploaded
jfb
parents:
diff changeset
167 YYYLettersToTheLeft <- YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
168 #how many letters to the right SHOULD just be length(motif)-position-1 if it's 5 long and x is at 3 then Y is at 4 and there is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
169 #just 1 spot to the right of Y so LettersToTheRight<-1 because 5-3-1=1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
170 YYYLettersToTheRight <- length(YYYmotif) - YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
171 #then sanity check, we're currently looking only at +/-4, but this spot allows for up to +/- 7 as well, just depends on what the
23eea82f5192 Uploaded
jfb
parents:
diff changeset
172 #variable the user puts in is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
173
23eea82f5192 Uploaded
jfb
parents:
diff changeset
174 if (YYYLettersToTheLeft > 6 && YYYLettersToTheRight > 6) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
175 motif<-YYYmotif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
176 #add blank spaces if the motif has less than 4 letters to the left/right
23eea82f5192 Uploaded
jfb
parents:
diff changeset
177 motif<-c(leftspaces,YYYmotif,rightspaces)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
178 #save that motif, which is the Y and +/- 4 amino acids, including truncation
23eea82f5192 Uploaded
jfb
parents:
diff changeset
179 motif<-motif[!motif %in% "x"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
180 motif<-paste(motif, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
181 ITDletters<-motif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
182 ITDmotifs[i,1]<-ITDletters
23eea82f5192 Uploaded
jfb
parents:
diff changeset
183 ITDAccessionNumbers[i,1]<-ThirdSubstrateSet[i,3]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
184
23eea82f5192 Uploaded
jfb
parents:
diff changeset
185 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
186 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
187
23eea82f5192 Uploaded
jfb
parents:
diff changeset
188 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
189
23eea82f5192 Uploaded
jfb
parents:
diff changeset
190 ##############################################3
23eea82f5192 Uploaded
jfb
parents:
diff changeset
191 #Truncated only
23eea82f5192 Uploaded
jfb
parents:
diff changeset
192 if (TruncatedMotifsOnly_questionmark=="YES"){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
193 FTLwtmotifs=matrix(,nrow = nrow(FirstSubstrateSet),ncol=1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
194 FTLwtAccessionNumbers=matrix(,nrow = nrow(FirstSubstrateSet),ncol=1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
195
23eea82f5192 Uploaded
jfb
parents:
diff changeset
196 for (i in 1:nrow(FirstSubstrateSet)){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
197 FTLwtletters<-FirstSubstrateSet[i,4:18]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
198 FTLwtletters<-FTLwtletters[FTLwtletters !="XXXXX"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
199 FTLwtletters<-paste(FTLwtletters, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
200
23eea82f5192 Uploaded
jfb
parents:
diff changeset
201
23eea82f5192 Uploaded
jfb
parents:
diff changeset
202 YYYmotif <- unlist(strsplit(FTLwtletters, split = ""))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
203 YYYposition <- match(x = "x", table = YYYmotif)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
204 #position itself tells me how much is to the left of that X by what it's number is. x at position 4 tells me that there are
23eea82f5192 Uploaded
jfb
parents:
diff changeset
205 #just 3 letters to the left of x
23eea82f5192 Uploaded
jfb
parents:
diff changeset
206
23eea82f5192 Uploaded
jfb
parents:
diff changeset
207 YYYLettersToTheLeft <- YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
208 #how many letters to the right SHOULD just be length(motif)-position-1 if it's 5 long and x is at 3 then Y is at 4 and there is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
209 #just 1 spot to the right of Y so LettersToTheRight<-1 because 5-3-1=1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
210 YYYLettersToTheRight <- length(YYYmotif) - YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
211 #then sanity check, we're currently looking only at +/-4, but this spot allows for up to +/- 7 as well, just depends on what the
23eea82f5192 Uploaded
jfb
parents:
diff changeset
212 #variable the user puts in is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
213
23eea82f5192 Uploaded
jfb
parents:
diff changeset
214 if (YYYLettersToTheLeft < 7 | YYYLettersToTheRight < 7) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
215 leftspaces<-rep(" ",times=(7-YYYLettersToTheLeft))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
216 rightspaces<-rep(" ",times=7-(YYYLettersToTheRight))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
217 #add blank spaces if the motif has less than 4 letters to the left/right
23eea82f5192 Uploaded
jfb
parents:
diff changeset
218 motif<-c(leftspaces,YYYmotif,rightspaces)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
219 #save that motif, which is the Y and +/- 4 amino acids, including truncation
23eea82f5192 Uploaded
jfb
parents:
diff changeset
220 motif<-motif[!motif %in% "x"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
221 motif<-paste(motif, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
222 FTLwtletters<-motif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
223 FTLwtmotifs[i,1]<-FTLwtletters
23eea82f5192 Uploaded
jfb
parents:
diff changeset
224 FTLwtAccessionNumbers[i,1]<-FirstSubstrateSet[i,3]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
225 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
226
23eea82f5192 Uploaded
jfb
parents:
diff changeset
227 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
228
23eea82f5192 Uploaded
jfb
parents:
diff changeset
229 D835Ymotifs=matrix(,nrow = nrow(SecondSubstrateSet),ncol=1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
230 D835YAccessionNumbers<-matrix(,nrow = nrow(SecondSubstrateSet),ncol = 1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
231
23eea82f5192 Uploaded
jfb
parents:
diff changeset
232 for (i in 1:nrow(SecondSubstrateSet)){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
233 D835letters<-SecondSubstrateSet[i,4:18]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
234 D835letters<-D835letters[D835letters !="XXXXX"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
235 D835letters<-paste(D835letters, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
236
23eea82f5192 Uploaded
jfb
parents:
diff changeset
237
23eea82f5192 Uploaded
jfb
parents:
diff changeset
238 YYYmotif <- unlist(strsplit(D835letters, split = ""))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
239 YYYposition <- match(x = "x", table = YYYmotif)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
240 #position itself tells me how much is to the left of that X by what it's number is. x at position 4 tells me that there are
23eea82f5192 Uploaded
jfb
parents:
diff changeset
241 #just 3 letters to the left of x
23eea82f5192 Uploaded
jfb
parents:
diff changeset
242
23eea82f5192 Uploaded
jfb
parents:
diff changeset
243 YYYLettersToTheLeft <- YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
244 #how many letters to the right SHOULD just be length(motif)-position-1 if it's 5 long and x is at 3 then Y is at 4 and there is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
245 #just 1 spot to the right of Y so LettersToTheRight<-1 because 5-3-1=1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
246 YYYLettersToTheRight <- length(YYYmotif) - YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
247 #then sanity check, we're currently looking only at +/-4, but this spot allows for up to +/- 7 as well, just depends on what the
23eea82f5192 Uploaded
jfb
parents:
diff changeset
248 #variable the user puts in is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
249
23eea82f5192 Uploaded
jfb
parents:
diff changeset
250 if (YYYLettersToTheLeft < 7 | YYYLettersToTheRight < 7) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
251 leftspaces<-rep(" ",times=(7-YYYLettersToTheLeft))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
252 rightspaces<-rep(" ",times=7-(YYYLettersToTheRight))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
253 #add blank spaces if the motif has less than 4 letters to the left/right
23eea82f5192 Uploaded
jfb
parents:
diff changeset
254 motif<-c(leftspaces,YYYmotif,rightspaces)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
255 #save that motif, which is the Y and +/- 4 amino acids, including truncation
23eea82f5192 Uploaded
jfb
parents:
diff changeset
256 motif<-motif[!motif %in% "x"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
257 motif<-paste(motif, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
258 D835letters<-motif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
259 D835YAccessionNumbers[i,1]<-SecondSubstrateSet[i,3]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
260 D835Ymotifs[i,1]<-D835letters
23eea82f5192 Uploaded
jfb
parents:
diff changeset
261 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
262 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
263
23eea82f5192 Uploaded
jfb
parents:
diff changeset
264 ITDmotifs=matrix(,nrow = nrow(ThirdSubstrateSet),ncol=1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
265 ITDAccessionNumbers<-matrix(,nrow = nrow(ThirdSubstrateSet))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
266
23eea82f5192 Uploaded
jfb
parents:
diff changeset
267 for (i in 1:nrow(ThirdSubstrateSet)){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
268 ITDletters<-ThirdSubstrateSet[i,4:18]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
269 ITDletters<-ITDletters[ITDletters !="XXXXX"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
270 ITDletters<-paste(ITDletters, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
271 YYYmotif <- unlist(strsplit(ITDletters, split = ""))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
272 YYYposition <- match(x = "x", table = YYYmotif)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
273 #position itself tells me how much is to the left of that X by what it's number is. x at position 4 tells me that there are
23eea82f5192 Uploaded
jfb
parents:
diff changeset
274 #just 3 letters to the left of x
23eea82f5192 Uploaded
jfb
parents:
diff changeset
275
23eea82f5192 Uploaded
jfb
parents:
diff changeset
276 YYYLettersToTheLeft <- YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
277 #how many letters to the right SHOULD just be length(motif)-position-1 if it's 5 long and x is at 3 then Y is at 4 and there is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
278 #just 1 spot to the right of Y so LettersToTheRight<-1 because 5-3-1=1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
279 YYYLettersToTheRight <- length(YYYmotif) - YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
280 #then sanity check, we're currently looking only at +/-4, but this spot allows for up to +/- 7 as well, just depends on what the
23eea82f5192 Uploaded
jfb
parents:
diff changeset
281 #variable the user puts in is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
282
23eea82f5192 Uploaded
jfb
parents:
diff changeset
283 if (YYYLettersToTheLeft < 7 | YYYLettersToTheRight < 7) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
284 leftspaces<-rep(" ",times=(7-YYYLettersToTheLeft))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
285 rightspaces<-rep(" ",times=7-(YYYLettersToTheRight))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
286 #add blank spaces if the motif has less than 4 letters to the left/right
23eea82f5192 Uploaded
jfb
parents:
diff changeset
287 motif<-c(leftspaces,YYYmotif,rightspaces)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
288 #save that motif, which is the Y and +/- 4 amino acids, including truncation
23eea82f5192 Uploaded
jfb
parents:
diff changeset
289 motif<-motif[!motif %in% "x"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
290 motif<-paste(motif, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
291 ITDletters<-motif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
292 ITDAccessionNumbers[i,1]<-ThirdSubstrateSet[i,3]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
293 ITDmotifs[i,1]<-ITDletters
23eea82f5192 Uploaded
jfb
parents:
diff changeset
294 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
295 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
296
23eea82f5192 Uploaded
jfb
parents:
diff changeset
297 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
298
23eea82f5192 Uploaded
jfb
parents:
diff changeset
299 ###############################################
23eea82f5192 Uploaded
jfb
parents:
diff changeset
300 #ALL motifs, full and truncated
23eea82f5192 Uploaded
jfb
parents:
diff changeset
301
23eea82f5192 Uploaded
jfb
parents:
diff changeset
302 if (FullMotifsOnly_questionmark!="YES"&&TruncatedMotifsOnly_questionmark!="YES"){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
303 FTLwtmotifs=matrix(,nrow = nrow(FirstSubstrateSet),ncol=1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
304 FTLwtAccessionNumbers=matrix(,nrow = nrow(FirstSubstrateSet),ncol=1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
305
23eea82f5192 Uploaded
jfb
parents:
diff changeset
306 for (i in 1:nrow(FirstSubstrateSet)){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
307 FTLwtletters<-FirstSubstrateSet[i,4:18]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
308 FTLwtletters<-FTLwtletters[FTLwtletters !="XXXXX"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
309 FTLwtletters<-paste(FTLwtletters, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
310 leftspaces<-c()
23eea82f5192 Uploaded
jfb
parents:
diff changeset
311 rightspaces<-c()
23eea82f5192 Uploaded
jfb
parents:
diff changeset
312
23eea82f5192 Uploaded
jfb
parents:
diff changeset
313 YYYmotif <- unlist(strsplit(FTLwtletters, split = ""))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
314 YYYposition <- match(x = "x", table = YYYmotif)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
315 #position itself tells me how much is to the left of that X by what it's number is. x at position 4 tells me that there are
23eea82f5192 Uploaded
jfb
parents:
diff changeset
316 #just 3 letters to the left of x
23eea82f5192 Uploaded
jfb
parents:
diff changeset
317
23eea82f5192 Uploaded
jfb
parents:
diff changeset
318 YYYLettersToTheLeft <- YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
319 #how many letters to the right SHOULD just be length(motif)-position-1 if it's 5 long and x is at 3 then Y is at 4 and there is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
320 #just 1 spot to the right of Y so LettersToTheRight<-1 because 5-3-1=1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
321 YYYLettersToTheRight <- length(YYYmotif) - YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
322 #then sanity check, we're currently looking only at +/-4, but this spot allows for up to +/- 7 as well, just depends on what the
23eea82f5192 Uploaded
jfb
parents:
diff changeset
323 #variable the user puts in is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
324
23eea82f5192 Uploaded
jfb
parents:
diff changeset
325
23eea82f5192 Uploaded
jfb
parents:
diff changeset
326 if (YYYLettersToTheLeft < 7 | YYYLettersToTheRight < 7) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
327 leftspaces<-rep(" ",times=(7-YYYLettersToTheLeft))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
328 rightspaces<-rep(" ",times=7-(YYYLettersToTheRight))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
329 #add blank spaces if the motif has less than 4 letters to the left/right
23eea82f5192 Uploaded
jfb
parents:
diff changeset
330 motif<-c(leftspaces,YYYmotif,rightspaces)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
331 #save that motif, which is the Y and +/- 4 amino acids, including truncation
23eea82f5192 Uploaded
jfb
parents:
diff changeset
332 motif<-motif[!motif %in% "x"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
333 motif<-paste(motif, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
334 FTLwtletters<-motif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
335 FTLwtmotifs[i,1]<-FTLwtletters
23eea82f5192 Uploaded
jfb
parents:
diff changeset
336 FTLwtAccessionNumbers[i,1]<-FirstSubstrateSet[i,3]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
337 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
338
23eea82f5192 Uploaded
jfb
parents:
diff changeset
339 if(YYYLettersToTheLeft>6 && YYYLettersToTheRight>6){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
340 motif<-YYYmotif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
341 #add blank spaces if the motif has less than 4 letters to the left/right
23eea82f5192 Uploaded
jfb
parents:
diff changeset
342 motif<-c(leftspaces,YYYmotif,rightspaces)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
343 #save that motif, which is the Y and +/- 4 amino acids, including truncation
23eea82f5192 Uploaded
jfb
parents:
diff changeset
344 motif<-motif[!motif %in% "x"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
345 motif<-paste(motif, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
346 FTLwtletters<-motif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
347 FTLwtmotifs[i,1]<-FTLwtletters
23eea82f5192 Uploaded
jfb
parents:
diff changeset
348 FTLwtAccessionNumbers[i,1]<-FirstSubstrateSet[i,3]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
349
23eea82f5192 Uploaded
jfb
parents:
diff changeset
350
23eea82f5192 Uploaded
jfb
parents:
diff changeset
351 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
352
23eea82f5192 Uploaded
jfb
parents:
diff changeset
353 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
354
23eea82f5192 Uploaded
jfb
parents:
diff changeset
355 D835Ymotifs=matrix(,nrow = nrow(SecondSubstrateSet),ncol=1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
356 D835YAccessionNumbers<-matrix(,nrow = nrow(SecondSubstrateSet),ncol = 1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
357
23eea82f5192 Uploaded
jfb
parents:
diff changeset
358 for (i in 1:nrow(SecondSubstrateSet)){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
359 D835letters<-SecondSubstrateSet[i,4:18]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
360 D835letters<-D835letters[D835letters !="XXXXX"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
361 D835letters<-paste(D835letters, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
362 leftspaces<-c()
23eea82f5192 Uploaded
jfb
parents:
diff changeset
363 rightspaces<-c()
23eea82f5192 Uploaded
jfb
parents:
diff changeset
364
23eea82f5192 Uploaded
jfb
parents:
diff changeset
365 YYYmotif <- unlist(strsplit(D835letters, split = ""))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
366 YYYposition <- match(x = "x", table = YYYmotif)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
367 #position itself tells me how much is to the left of that X by what it's number is. x at position 4 tells me that there are
23eea82f5192 Uploaded
jfb
parents:
diff changeset
368 #just 3 letters to the left of x
23eea82f5192 Uploaded
jfb
parents:
diff changeset
369
23eea82f5192 Uploaded
jfb
parents:
diff changeset
370 YYYLettersToTheLeft <- YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
371 #how many letters to the right SHOULD just be length(motif)-position-1 if it's 5 long and x is at 3 then Y is at 4 and there is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
372 #just 1 spot to the right of Y so LettersToTheRight<-1 because 5-3-1=1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
373 YYYLettersToTheRight <- length(YYYmotif) - YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
374 #then sanity check, we're currently looking only at +/-4, but this spot allows for up to +/- 7 as well, just depends on what the
23eea82f5192 Uploaded
jfb
parents:
diff changeset
375 #variable the user puts in is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
376 if (YYYLettersToTheLeft < 7 | YYYLettersToTheRight < 7) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
377 leftspaces<-rep(" ",times=(7-YYYLettersToTheLeft))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
378 rightspaces<-rep(" ",times=7-(YYYLettersToTheRight))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
379 #add blank spaces if the motif has less than 4 letters to the left/right
23eea82f5192 Uploaded
jfb
parents:
diff changeset
380 motif<-c(leftspaces,YYYmotif,rightspaces)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
381 #save that motif, which is the Y and +/- 4 amino acids, including truncation
23eea82f5192 Uploaded
jfb
parents:
diff changeset
382 motif<-motif[!motif %in% "x"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
383 motif<-paste(motif, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
384 D835letters<-motif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
385 D835Ymotifs[i,1]<-D835letters
23eea82f5192 Uploaded
jfb
parents:
diff changeset
386 D835YAccessionNumbers[i,1]<-FirstSubstrateSet[i,3]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
387 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
388
23eea82f5192 Uploaded
jfb
parents:
diff changeset
389 if(YYYLettersToTheLeft>6 && YYYLettersToTheRight>6){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
390 motif<-YYYmotif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
391 #add blank spaces if the motif has less than 4 letters to the left/right
23eea82f5192 Uploaded
jfb
parents:
diff changeset
392 motif<-c(leftspaces,YYYmotif,rightspaces)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
393 #save that motif, which is the Y and +/- 4 amino acids, including truncation
23eea82f5192 Uploaded
jfb
parents:
diff changeset
394 motif<-motif[!motif %in% "x"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
395 motif<-paste(motif, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
396 D835letters<-motif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
397 D835Ymotifs[i,1]<-D835letters
23eea82f5192 Uploaded
jfb
parents:
diff changeset
398 D835YAccessionNumbers[i,1]<-FirstSubstrateSet[i,3]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
399 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
400 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
401
23eea82f5192 Uploaded
jfb
parents:
diff changeset
402
23eea82f5192 Uploaded
jfb
parents:
diff changeset
403 ITDmotifs=matrix(,nrow = nrow(ThirdSubstrateSet),ncol=1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
404 ITDAccessionNumbers<-matrix(,nrow = nrow(ThirdSubstrateSet))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
405
23eea82f5192 Uploaded
jfb
parents:
diff changeset
406 for (i in 1:nrow(ThirdSubstrateSet)){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
407 ITDletters<-ThirdSubstrateSet[i,4:18]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
408 ITDletters<-ITDletters[ITDletters !="XXXXX"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
409 ITDletters<-paste(ITDletters, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
410 YYYmotif <- unlist(strsplit(ITDletters, split = ""))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
411 leftspaces<-c()
23eea82f5192 Uploaded
jfb
parents:
diff changeset
412 rightspaces<-c()
23eea82f5192 Uploaded
jfb
parents:
diff changeset
413 YYYposition <- match(x = "x", table = YYYmotif)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
414 #position itself tells me how much is to the left of that X by what it's number is. x at position 4 tells me that there are
23eea82f5192 Uploaded
jfb
parents:
diff changeset
415 #just 3 letters to the left of x
23eea82f5192 Uploaded
jfb
parents:
diff changeset
416
23eea82f5192 Uploaded
jfb
parents:
diff changeset
417 YYYLettersToTheLeft <- YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
418 #how many letters to the right SHOULD just be length(motif)-position-1 if it's 5 long and x is at 3 then Y is at 4 and there is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
419 #just 1 spot to the right of Y so LettersToTheRight<-1 because 5-3-1=1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
420 YYYLettersToTheRight <- length(YYYmotif) - YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
421 #then sanity check, we're currently looking only at +/-4, but this spot allows for up to +/- 7 as well, just depends on what the
23eea82f5192 Uploaded
jfb
parents:
diff changeset
422 #variable the user puts in is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
423 if (YYYLettersToTheLeft < 7 | YYYLettersToTheRight < 7) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
424 leftspaces<-rep(" ",times=(7-YYYLettersToTheLeft))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
425 rightspaces<-rep(" ",times=7-(YYYLettersToTheRight))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
426 #add blank spaces if the motif has less than 4 letters to the left/right
23eea82f5192 Uploaded
jfb
parents:
diff changeset
427 motif<-c(leftspaces,YYYmotif,rightspaces)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
428 #save that motif, which is the Y and +/- 4 amino acids, including truncation
23eea82f5192 Uploaded
jfb
parents:
diff changeset
429 motif<-motif[!motif %in% "x"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
430 motif<-paste(motif, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
431 ITDletters<-motif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
432 ITDmotifs[i,1]<-ITDletters
23eea82f5192 Uploaded
jfb
parents:
diff changeset
433 ITDAccessionNumbers[i,1]<-FirstSubstrateSet[i,3]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
434 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
435
23eea82f5192 Uploaded
jfb
parents:
diff changeset
436 if(YYYLettersToTheLeft>6 && YYYLettersToTheRight>6){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
437 motif<-YYYmotif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
438 #add blank spaces if the motif has less than 4 letters to the left/right
23eea82f5192 Uploaded
jfb
parents:
diff changeset
439 motif<-c(leftspaces,YYYmotif,rightspaces)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
440 #save that motif, which is the Y and +/- 4 amino acids, including truncation
23eea82f5192 Uploaded
jfb
parents:
diff changeset
441 motif<-motif[!motif %in% "x"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
442 motif<-paste(motif, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
443 ITDletters<-motif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
444 ITDmotifs[i,1]<-ITDletters
23eea82f5192 Uploaded
jfb
parents:
diff changeset
445 ITDAccessionNumbers[i,1]<-FirstSubstrateSet[i,3]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
446 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
447 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
448
23eea82f5192 Uploaded
jfb
parents:
diff changeset
449 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
450 #############################################################################################################################
23eea82f5192 Uploaded
jfb
parents:
diff changeset
451 #############################################################################################################################
23eea82f5192 Uploaded
jfb
parents:
diff changeset
452 #############################################################################################################################
23eea82f5192 Uploaded
jfb
parents:
diff changeset
453 #############################################################################################################################
23eea82f5192 Uploaded
jfb
parents:
diff changeset
454 #############################################################################################################################
23eea82f5192 Uploaded
jfb
parents:
diff changeset
455
23eea82f5192 Uploaded
jfb
parents:
diff changeset
456 #now look for either commonality or difference. Actually could you look for both...
23eea82f5192 Uploaded
jfb
parents:
diff changeset
457
23eea82f5192 Uploaded
jfb
parents:
diff changeset
458 if (Are_You_Looking_For_Commonality=="YES"){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
459
23eea82f5192 Uploaded
jfb
parents:
diff changeset
460 columnalheader<-c(as.character(Thirdsubbackfreq[1:36,1]))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
461 columnalheader<-matrix(columnalheader,nrow = 1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
462 write.table(x=columnalheader,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
463 file=Shared_subbackfreq_table,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
464 quote=FALSE, sep=",",
23eea82f5192 Uploaded
jfb
parents:
diff changeset
465 row.names=FALSE,col.names = FALSE, na="", append=TRUE)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
466
23eea82f5192 Uploaded
jfb
parents:
diff changeset
467 FirstOverlapmotifs<-c()
23eea82f5192 Uploaded
jfb
parents:
diff changeset
468 for (i in 1:nrow(ITDmotifs)){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
469 for (j in 1:nrow(D835Ymotifs)){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
470 if (is.na(ITDmotifs[i,1])!=TRUE&&is.na(D835Ymotifs[j,1])!=TRUE){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
471 if (ITDmotifs[i,1]==D835Ymotifs[j,1]){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
472 FirstOverlapmotifs<-c(FirstOverlapmotifs,D835Ymotifs[j,1])
23eea82f5192 Uploaded
jfb
parents:
diff changeset
473 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
474 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
475 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
476 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
477
23eea82f5192 Uploaded
jfb
parents:
diff changeset
478 AllAccessionNumbers<-c()
23eea82f5192 Uploaded
jfb
parents:
diff changeset
479 columnalheader<-c(rep(NA,36))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
480 FinalMatrix<-matrix(data =columnalheader,nrow = 1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
481
23eea82f5192 Uploaded
jfb
parents:
diff changeset
482 FinalMotifs<-c(rep(NA,20))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
483 FinalMotifsMatrix<-matrix(data = FinalMotifs,nrow = 1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
484
23eea82f5192 Uploaded
jfb
parents:
diff changeset
485
23eea82f5192 Uploaded
jfb
parents:
diff changeset
486 for (l in 1:length(FirstOverlapmotifs)) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
487 AccessionNumber<-00000000000
23eea82f5192 Uploaded
jfb
parents:
diff changeset
488 for (k in 1:nrow(FTLwtmotifs)) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
489 AccessionNumber<-0000000000000
23eea82f5192 Uploaded
jfb
parents:
diff changeset
490 if(is.na(FTLwtmotifs[k])!=TRUE){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
491 #I don't remember why, but I felt it necessary to destroy the accession number multiple times to ensure it is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
492 #destroyed immediately after use
23eea82f5192 Uploaded
jfb
parents:
diff changeset
493 if (FirstOverlapmotifs[l] == FTLwtmotifs[k]) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
494 substratematrix<-FirstSubstrateSet[k,1:20]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
495 substratematrix<-as.matrix(substratematrix,nrow=1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
496 FinalMotifsMatrix<-rbind(FinalMotifsMatrix,substratematrix)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
497 #when you find a match between the venn diagrams, save the substrate info you get into a matrix
23eea82f5192 Uploaded
jfb
parents:
diff changeset
498
23eea82f5192 Uploaded
jfb
parents:
diff changeset
499 AccessionNumber <- as.character(FirstSubstrateSet[k, 3])
23eea82f5192 Uploaded
jfb
parents:
diff changeset
500 #then take the accession number
23eea82f5192 Uploaded
jfb
parents:
diff changeset
501
23eea82f5192 Uploaded
jfb
parents:
diff changeset
502 for (m in 1:ncol(Firstsubbackfreq)) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
503 AN <- as.character(Firstsubbackfreq[1, m])
23eea82f5192 Uploaded
jfb
parents:
diff changeset
504 if (grepl(pattern = AN,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
505 x = AccessionNumber,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
506 fixed = TRUE) == TRUE) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
507 outputmatrix <- as.character(Firstsubbackfreq[, m])
23eea82f5192 Uploaded
jfb
parents:
diff changeset
508 outputmatrix <- matrix(outputmatrix, nrow = 1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
509 #with that accession number, find a match in the subbackfreq file and save it here
23eea82f5192 Uploaded
jfb
parents:
diff changeset
510 FinalMatrix<-rbind(FinalMatrix,outputmatrix)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
511 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
512 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
513 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
514 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
515 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
516 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
517
23eea82f5192 Uploaded
jfb
parents:
diff changeset
518
23eea82f5192 Uploaded
jfb
parents:
diff changeset
519 TrueMatrix<-FinalMatrix[!duplicated(FinalMatrix),]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
520 TrueFinalMotifsMatrix<-FinalMotifsMatrix[!duplicated(FinalMotifsMatrix),]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
521
23eea82f5192 Uploaded
jfb
parents:
diff changeset
522 TrueFinalMotifsMatrix<-TrueFinalMotifsMatrix[2:nrow(TrueFinalMotifsMatrix),]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
523 TrueMatrix<-TrueMatrix[2:nrow(TrueMatrix),]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
524
23eea82f5192 Uploaded
jfb
parents:
diff changeset
525 write.table(
23eea82f5192 Uploaded
jfb
parents:
diff changeset
526 x = TrueFinalMotifsMatrix,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
527 file = Shared_motifs_table,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
528 quote = FALSE,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
529 sep = ",",
23eea82f5192 Uploaded
jfb
parents:
diff changeset
530 row.names = FALSE,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
531 col.names = TRUE,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
532 na = "",
23eea82f5192 Uploaded
jfb
parents:
diff changeset
533 append = TRUE
23eea82f5192 Uploaded
jfb
parents:
diff changeset
534 )
23eea82f5192 Uploaded
jfb
parents:
diff changeset
535
23eea82f5192 Uploaded
jfb
parents:
diff changeset
536
23eea82f5192 Uploaded
jfb
parents:
diff changeset
537 write.table(
23eea82f5192 Uploaded
jfb
parents:
diff changeset
538 x = TrueMatrix,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
539 file = Shared_subbackfreq_table,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
540 quote = FALSE,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
541 sep = ",",
23eea82f5192 Uploaded
jfb
parents:
diff changeset
542 row.names = FALSE,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
543 col.names = FALSE,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
544 na = "",
23eea82f5192 Uploaded
jfb
parents:
diff changeset
545 append = TRUE
23eea82f5192 Uploaded
jfb
parents:
diff changeset
546 )
23eea82f5192 Uploaded
jfb
parents:
diff changeset
547 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
548 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
549
23eea82f5192 Uploaded
jfb
parents:
diff changeset
550 if (Are_You_Looking_For_Commonality=="NO"){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
551 if (FullMotifsOnly_questionmark=="YES"){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
552 FTLwtmotifs=rep(NA,times=nrow(FirstSubstrateSet))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
553 FTLwtAccessionNumbers=rep(NA,times=nrow(FirstSubstrateSet))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
554 leftspaces<-c()
23eea82f5192 Uploaded
jfb
parents:
diff changeset
555 rightspaces<-c()
23eea82f5192 Uploaded
jfb
parents:
diff changeset
556 for (i in 1:nrow(FirstSubstrateSet)){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
557 FTLwtletters<-FirstSubstrateSet[i,4:18]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
558 FTLwtletters<-FTLwtletters[FTLwtletters !="XXXXX"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
559 FTLwtletters<-paste(FTLwtletters, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
560
23eea82f5192 Uploaded
jfb
parents:
diff changeset
561
23eea82f5192 Uploaded
jfb
parents:
diff changeset
562 YYYmotif <- unlist(strsplit(FTLwtletters, split = ""))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
563 YYYposition <- match(x = "x", table = YYYmotif)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
564 #position itself tells me how much is to the left of that X by what it's number is. x at position 4 tells me that there are
23eea82f5192 Uploaded
jfb
parents:
diff changeset
565 #just 3 letters to the left of x
23eea82f5192 Uploaded
jfb
parents:
diff changeset
566
23eea82f5192 Uploaded
jfb
parents:
diff changeset
567 YYYLettersToTheLeft <- YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
568 #how many letters to the right SHOULD just be length(motif)-position-1 if it's 5 long and x is at 3 then Y is at 4 and there is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
569 #just 1 spot to the right of Y so LettersToTheRight<-1 because 5-3-1=1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
570 YYYLettersToTheRight <- length(YYYmotif) - YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
571 #then sanity check, we're currently looking only at +/-4, but this spot allows for up to +/- 7 as well, just depends on what the
23eea82f5192 Uploaded
jfb
parents:
diff changeset
572 #variable the user puts in is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
573
23eea82f5192 Uploaded
jfb
parents:
diff changeset
574 if (YYYLettersToTheLeft > 6 && YYYLettersToTheRight > 6) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
575 motif<-YYYmotif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
576 #save that motif, which is the Y and +/- 4 amino acids, including truncation
23eea82f5192 Uploaded
jfb
parents:
diff changeset
577 motif<-motif[!motif %in% "x"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
578 motif<-paste(motif, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
579 FTLwtletters<-motif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
580 FTLwtmotifs[i]<-FTLwtletters
23eea82f5192 Uploaded
jfb
parents:
diff changeset
581 FTLwtAccessionNumbers[i]<-FirstSubstrateSet[i,3]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
582 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
583
23eea82f5192 Uploaded
jfb
parents:
diff changeset
584 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
585 # FTLwtmotifs <- FTLwtmotifs[!is.na(FTLwtmotifs)]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
586 # FTLwtmotifs<-matrix(FTLwtmotifs,ncol = 1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
587 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
588
23eea82f5192 Uploaded
jfb
parents:
diff changeset
589 D835Ymotifs=rep(NA,times=nrow(FirstSubstrateSet))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
590 D835YAccessionNumbers=rep(NA,times=nrow(FirstSubstrateSet))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
591
23eea82f5192 Uploaded
jfb
parents:
diff changeset
592 for (i in 1:nrow(SecondSubstrateSet)){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
593 D835letters<-SecondSubstrateSet[i,4:18]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
594 D835letters<-D835letters[D835letters !="XXXXX"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
595 D835letters<-paste(D835letters, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
596
23eea82f5192 Uploaded
jfb
parents:
diff changeset
597
23eea82f5192 Uploaded
jfb
parents:
diff changeset
598 YYYmotif <- unlist(strsplit(D835letters, split = ""))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
599 YYYposition <- match(x = "x", table = YYYmotif)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
600 #position itself tells me how much is to the left of that X by what it's number is. x at position 4 tells me that there are
23eea82f5192 Uploaded
jfb
parents:
diff changeset
601 #just 3 letters to the left of x
23eea82f5192 Uploaded
jfb
parents:
diff changeset
602
23eea82f5192 Uploaded
jfb
parents:
diff changeset
603 YYYLettersToTheLeft <- YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
604 #how many letters to the right SHOULD just be length(motif)-position-1 if it's 5 long and x is at 3 then Y is at 4 and there is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
605 #just 1 spot to the right of Y so LettersToTheRight<-1 because 5-3-1=1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
606 YYYLettersToTheRight <- length(YYYmotif) - YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
607 #then sanity check, we're currently looking only at +/-4, but this spot allows for up to +/- 7 as well, just depends on what the
23eea82f5192 Uploaded
jfb
parents:
diff changeset
608 #variable the user puts in is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
609
23eea82f5192 Uploaded
jfb
parents:
diff changeset
610 if (YYYLettersToTheLeft > 6 && YYYLettersToTheRight > 6) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
611 motif<-YYYmotif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
612 #add blank spaces if the motif has less than 4 letters to the left/right
23eea82f5192 Uploaded
jfb
parents:
diff changeset
613 motif<-c(leftspaces,YYYmotif,rightspaces)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
614 #save that motif, which is the Y and +/- 4 amino acids, including truncation
23eea82f5192 Uploaded
jfb
parents:
diff changeset
615 motif<-motif[!motif %in% "x"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
616 motif<-paste(motif, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
617 D835letters<-motif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
618 D835Ymotifs[i]<-D835letters
23eea82f5192 Uploaded
jfb
parents:
diff changeset
619 D835YAccessionNumbers[i]<-SecondSubstrateSet[i,3]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
620 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
621 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
622
23eea82f5192 Uploaded
jfb
parents:
diff changeset
623 ITDmotifs=rep(NA,times=nrow(FirstSubstrateSet))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
624 ITDAccessionNumbers=rep(NA,times=nrow(FirstSubstrateSet))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
625
23eea82f5192 Uploaded
jfb
parents:
diff changeset
626 for (i in 1:nrow(ThirdSubstrateSet)){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
627 ITDletters<-ThirdSubstrateSet[i,4:18]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
628 ITDletters<-ITDletters[ITDletters !="XXXXX"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
629 ITDletters<-paste(ITDletters, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
630 YYYmotif <- unlist(strsplit(ITDletters, split = ""))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
631 YYYposition <- match(x = "x", table = YYYmotif)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
632 #position itself tells me how much is to the left of that X by what it's number is. x at position 4 tells me that there are
23eea82f5192 Uploaded
jfb
parents:
diff changeset
633 #just 3 letters to the left of x
23eea82f5192 Uploaded
jfb
parents:
diff changeset
634
23eea82f5192 Uploaded
jfb
parents:
diff changeset
635 YYYLettersToTheLeft <- YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
636 #how many letters to the right SHOULD just be length(motif)-position-1 if it's 5 long and x is at 3 then Y is at 4 and there is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
637 #just 1 spot to the right of Y so LettersToTheRight<-1 because 5-3-1=1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
638 YYYLettersToTheRight <- length(YYYmotif) - YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
639 #then sanity check, we're currently looking only at +/-4, but this spot allows for up to +/- 7 as well, just depends on what the
23eea82f5192 Uploaded
jfb
parents:
diff changeset
640 #variable the user puts in is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
641
23eea82f5192 Uploaded
jfb
parents:
diff changeset
642 if (YYYLettersToTheLeft > 6 && YYYLettersToTheRight > 6) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
643 motif<-YYYmotif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
644 #add blank spaces if the motif has less than 4 letters to the left/right
23eea82f5192 Uploaded
jfb
parents:
diff changeset
645 motif<-c(leftspaces,YYYmotif,rightspaces)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
646 #save that motif, which is the Y and +/- 4 amino acids, including truncation
23eea82f5192 Uploaded
jfb
parents:
diff changeset
647 motif<-motif[!motif %in% "x"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
648 motif<-paste(motif, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
649 ITDletters<-motif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
650 ITDmotifs[i]<-ITDletters
23eea82f5192 Uploaded
jfb
parents:
diff changeset
651 ITDAccessionNumbers[i]<-ThirdSubstrateSet[i,3]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
652
23eea82f5192 Uploaded
jfb
parents:
diff changeset
653 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
654 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
655 names(ITDmotifs)<-ITDAccessionNumbers
23eea82f5192 Uploaded
jfb
parents:
diff changeset
656 names(D835Ymotifs)<-D835YAccessionNumbers
23eea82f5192 Uploaded
jfb
parents:
diff changeset
657 names(FTLwtmotifs)<-FTLwtAccessionNumbers
23eea82f5192 Uploaded
jfb
parents:
diff changeset
658 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
659
23eea82f5192 Uploaded
jfb
parents:
diff changeset
660
23eea82f5192 Uploaded
jfb
parents:
diff changeset
661 ##############################################3
23eea82f5192 Uploaded
jfb
parents:
diff changeset
662 #Truncated only
23eea82f5192 Uploaded
jfb
parents:
diff changeset
663 if (TruncatedMotifsOnly_questionmark=="YES"){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
664 FTLwtmotifs=matrix(,nrow = nrow(FirstSubstrateSet),ncol=1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
665 FTLwtAccessionNumbers=matrix(,nrow = nrow(FirstSubstrateSet),ncol=1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
666
23eea82f5192 Uploaded
jfb
parents:
diff changeset
667 for (i in 1:nrow(FirstSubstrateSet)){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
668 FTLwtletters<-FirstSubstrateSet[i,4:18]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
669 FTLwtletters<-FTLwtletters[FTLwtletters !="XXXXX"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
670 FTLwtletters<-paste(FTLwtletters, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
671
23eea82f5192 Uploaded
jfb
parents:
diff changeset
672
23eea82f5192 Uploaded
jfb
parents:
diff changeset
673 YYYmotif <- unlist(strsplit(FTLwtletters, split = ""))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
674 YYYposition <- match(x = "x", table = YYYmotif)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
675 #position itself tells me how much is to the left of that X by what it's number is. x at position 4 tells me that there are
23eea82f5192 Uploaded
jfb
parents:
diff changeset
676 #just 3 letters to the left of x
23eea82f5192 Uploaded
jfb
parents:
diff changeset
677
23eea82f5192 Uploaded
jfb
parents:
diff changeset
678 YYYLettersToTheLeft <- YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
679 #how many letters to the right SHOULD just be length(motif)-position-1 if it's 5 long and x is at 3 then Y is at 4 and there is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
680 #just 1 spot to the right of Y so LettersToTheRight<-1 because 5-3-1=1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
681 YYYLettersToTheRight <- length(YYYmotif) - YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
682 #then sanity check, we're currently looking only at +/-4, but this spot allows for up to +/- 7 as well, just depends on what the
23eea82f5192 Uploaded
jfb
parents:
diff changeset
683 #variable the user puts in is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
684
23eea82f5192 Uploaded
jfb
parents:
diff changeset
685 if (YYYLettersToTheLeft < 7 | YYYLettersToTheRight < 7) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
686 leftspaces<-rep(" ",times=(7-YYYLettersToTheLeft))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
687 rightspaces<-rep(" ",times=7-(YYYLettersToTheRight))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
688 #add blank spaces if the motif has less than 4 letters to the left/right
23eea82f5192 Uploaded
jfb
parents:
diff changeset
689 motif<-c(leftspaces,YYYmotif,rightspaces)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
690 #save that motif, which is the Y and +/- 4 amino acids, including truncation
23eea82f5192 Uploaded
jfb
parents:
diff changeset
691 motif<-motif[!motif %in% "x"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
692 motif<-paste(motif, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
693 FTLwtletters<-motif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
694 FTLwtmotifs[i,1]<-FTLwtletters
23eea82f5192 Uploaded
jfb
parents:
diff changeset
695 FTLwtAccessionNumbers[i,1]<-FirstSubstrateSet[i,3]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
696 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
697
23eea82f5192 Uploaded
jfb
parents:
diff changeset
698 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
699
23eea82f5192 Uploaded
jfb
parents:
diff changeset
700 D835Ymotifs=matrix(,nrow = nrow(SecondSubstrateSet),ncol=1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
701 D835YAccessionNumbers<-matrix(,nrow = nrow(SecondSubstrateSet),ncol = 1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
702 i=2
23eea82f5192 Uploaded
jfb
parents:
diff changeset
703 for (i in 1:nrow(SecondSubstrateSet)){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
704 D835letters<-SecondSubstrateSet[i,4:18]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
705 D835letters<-D835letters[D835letters !="XXXXX"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
706 D835letters<-paste(D835letters, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
707
23eea82f5192 Uploaded
jfb
parents:
diff changeset
708
23eea82f5192 Uploaded
jfb
parents:
diff changeset
709 YYYmotif <- unlist(strsplit(D835letters, split = ""))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
710 YYYposition <- match(x = "x", table = YYYmotif)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
711 #position itself tells me how much is to the left of that X by what it's number is. x at position 4 tells me that there are
23eea82f5192 Uploaded
jfb
parents:
diff changeset
712 #just 3 letters to the left of x
23eea82f5192 Uploaded
jfb
parents:
diff changeset
713
23eea82f5192 Uploaded
jfb
parents:
diff changeset
714 YYYLettersToTheLeft <- YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
715 #how many letters to the right SHOULD just be length(motif)-position-1 if it's 5 long and x is at 3 then Y is at 4 and there is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
716 #just 1 spot to the right of Y so LettersToTheRight<-1 because 5-3-1=1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
717 YYYLettersToTheRight <- length(YYYmotif) - YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
718 #then sanity check, we're currently looking only at +/-4, but this spot allows for up to +/- 7 as well, just depends on what the
23eea82f5192 Uploaded
jfb
parents:
diff changeset
719 #variable the user puts in is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
720
23eea82f5192 Uploaded
jfb
parents:
diff changeset
721 if (YYYLettersToTheLeft < 7 | YYYLettersToTheRight < 7) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
722 leftspaces<-rep(" ",times=(7-YYYLettersToTheLeft))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
723 rightspaces<-rep(" ",times=7-(YYYLettersToTheRight))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
724 #add blank spaces if the motif has less than 4 letters to the left/right
23eea82f5192 Uploaded
jfb
parents:
diff changeset
725 motif<-c(leftspaces,YYYmotif,rightspaces)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
726 #save that motif, which is the Y and +/- 4 amino acids, including truncation
23eea82f5192 Uploaded
jfb
parents:
diff changeset
727 motif<-motif[!motif %in% "x"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
728 motif<-paste(motif, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
729 D835letters<-motif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
730 D835YAccessionNumbers[i,1]<-SecondSubstrateSet[i,3]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
731 D835Ymotifs[i,1]<-D835letters
23eea82f5192 Uploaded
jfb
parents:
diff changeset
732 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
733 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
734
23eea82f5192 Uploaded
jfb
parents:
diff changeset
735 ITDmotifs=matrix(,nrow = nrow(ThirdSubstrateSet),ncol=1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
736 ITDAccessionNumbers<-matrix(,nrow = nrow(ThirdSubstrateSet))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
737
23eea82f5192 Uploaded
jfb
parents:
diff changeset
738 for (i in 1:nrow(ThirdSubstrateSet)){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
739 ITDletters<-ThirdSubstrateSet[i,4:18]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
740 ITDletters<-ITDletters[ITDletters !="XXXXX"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
741 ITDletters<-paste(ITDletters, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
742 YYYmotif <- unlist(strsplit(ITDletters, split = ""))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
743 YYYposition <- match(x = "x", table = YYYmotif)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
744 #position itself tells me how much is to the left of that X by what it's number is. x at position 4 tells me that there are
23eea82f5192 Uploaded
jfb
parents:
diff changeset
745 #just 3 letters to the left of x
23eea82f5192 Uploaded
jfb
parents:
diff changeset
746
23eea82f5192 Uploaded
jfb
parents:
diff changeset
747 YYYLettersToTheLeft <- YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
748 #how many letters to the right SHOULD just be length(motif)-position-1 if it's 5 long and x is at 3 then Y is at 4 and there is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
749 #just 1 spot to the right of Y so LettersToTheRight<-1 because 5-3-1=1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
750 YYYLettersToTheRight <- length(YYYmotif) - YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
751 #then sanity check, we're currently looking only at +/-4, but this spot allows for up to +/- 7 as well, just depends on what the
23eea82f5192 Uploaded
jfb
parents:
diff changeset
752 #variable the user puts in is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
753
23eea82f5192 Uploaded
jfb
parents:
diff changeset
754 if (YYYLettersToTheLeft < 7 | YYYLettersToTheRight < 7) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
755 leftspaces<-rep(" ",times=(7-YYYLettersToTheLeft))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
756 rightspaces<-rep(" ",times=7-(YYYLettersToTheRight))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
757 #add blank spaces if the motif has less than 4 letters to the left/right
23eea82f5192 Uploaded
jfb
parents:
diff changeset
758 motif<-c(leftspaces,YYYmotif,rightspaces)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
759 #save that motif, which is the Y and +/- 4 amino acids, including truncation
23eea82f5192 Uploaded
jfb
parents:
diff changeset
760 motif<-motif[!motif %in% "x"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
761 motif<-paste(motif, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
762 ITDletters<-motif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
763 ITDAccessionNumbers[i,1]<-ThirdSubstrateSet[i,3]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
764 ITDmotifs[i,1]<-ITDletters
23eea82f5192 Uploaded
jfb
parents:
diff changeset
765 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
766 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
767 names(FTLwtmotifs)<-FTLwtAccessionNumbers
23eea82f5192 Uploaded
jfb
parents:
diff changeset
768 names(D835Ymotifs)<-D835YAccessionNumbers
23eea82f5192 Uploaded
jfb
parents:
diff changeset
769 names(ITDmotifs)<-ITDAccessionNumbers
23eea82f5192 Uploaded
jfb
parents:
diff changeset
770 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
771
23eea82f5192 Uploaded
jfb
parents:
diff changeset
772 ###############################################
23eea82f5192 Uploaded
jfb
parents:
diff changeset
773 #ALL motifs, full and truncated
23eea82f5192 Uploaded
jfb
parents:
diff changeset
774
23eea82f5192 Uploaded
jfb
parents:
diff changeset
775 if (FullMotifsOnly_questionmark!="YES"&&TruncatedMotifsOnly_questionmark!="YES"){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
776 FTLwtmotifs=matrix(,nrow = nrow(FirstSubstrateSet),ncol=1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
777 FTLwtAccessionNumbers=matrix(,nrow = nrow(FirstSubstrateSet),ncol=1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
778
23eea82f5192 Uploaded
jfb
parents:
diff changeset
779 for (i in 1:nrow(FirstSubstrateSet)){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
780 FTLwtletters<-FirstSubstrateSet[i,4:18]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
781 FTLwtletters<-FTLwtletters[FTLwtletters !="XXXXX"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
782 FTLwtletters<-paste(FTLwtletters, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
783 leftspaces<-c()
23eea82f5192 Uploaded
jfb
parents:
diff changeset
784 rightspaces<-c()
23eea82f5192 Uploaded
jfb
parents:
diff changeset
785
23eea82f5192 Uploaded
jfb
parents:
diff changeset
786 YYYmotif <- unlist(strsplit(FTLwtletters, split = ""))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
787 YYYposition <- match(x = "x", table = YYYmotif)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
788 #position itself tells me how much is to the left of that X by what it's number is. x at position 4 tells me that there are
23eea82f5192 Uploaded
jfb
parents:
diff changeset
789 #just 3 letters to the left of x
23eea82f5192 Uploaded
jfb
parents:
diff changeset
790
23eea82f5192 Uploaded
jfb
parents:
diff changeset
791 YYYLettersToTheLeft <- YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
792 #how many letters to the right SHOULD just be length(motif)-position-1 if it's 5 long and x is at 3 then Y is at 4 and there is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
793 #just 1 spot to the right of Y so LettersToTheRight<-1 because 5-3-1=1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
794 YYYLettersToTheRight <- length(YYYmotif) - YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
795 #then sanity check, we're currently looking only at +/-4, but this spot allows for up to +/- 7 as well, just depends on what the
23eea82f5192 Uploaded
jfb
parents:
diff changeset
796 #variable the user puts in is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
797
23eea82f5192 Uploaded
jfb
parents:
diff changeset
798
23eea82f5192 Uploaded
jfb
parents:
diff changeset
799 if (YYYLettersToTheLeft < 7 | YYYLettersToTheRight < 7) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
800 leftspaces<-rep(" ",times=(7-YYYLettersToTheLeft))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
801 rightspaces<-rep(" ",times=7-(YYYLettersToTheRight))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
802 #add blank spaces if the motif has less than 4 letters to the left/right
23eea82f5192 Uploaded
jfb
parents:
diff changeset
803 motif<-c(leftspaces,YYYmotif,rightspaces)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
804 #save that motif, which is the Y and +/- 4 amino acids, including truncation
23eea82f5192 Uploaded
jfb
parents:
diff changeset
805 motif<-motif[!motif %in% "x"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
806 motif<-paste(motif, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
807 FTLwtletters<-motif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
808 FTLwtmotifs[i,1]<-FTLwtletters
23eea82f5192 Uploaded
jfb
parents:
diff changeset
809 FTLwtAccessionNumbers[i,1]<-FirstSubstrateSet[i,3]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
810 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
811
23eea82f5192 Uploaded
jfb
parents:
diff changeset
812 if(YYYLettersToTheLeft>6 && YYYLettersToTheRight>6){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
813 motif<-YYYmotif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
814 #add blank spaces if the motif has less than 4 letters to the left/right
23eea82f5192 Uploaded
jfb
parents:
diff changeset
815 motif<-c(leftspaces,YYYmotif,rightspaces)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
816 #save that motif, which is the Y and +/- 4 amino acids, including truncation
23eea82f5192 Uploaded
jfb
parents:
diff changeset
817 motif<-motif[!motif %in% "x"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
818 motif<-paste(motif, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
819 FTLwtletters<-motif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
820 FTLwtmotifs[i,1]<-FTLwtletters
23eea82f5192 Uploaded
jfb
parents:
diff changeset
821 FTLwtAccessionNumbers[i,1]<-FirstSubstrateSet[i,3]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
822
23eea82f5192 Uploaded
jfb
parents:
diff changeset
823
23eea82f5192 Uploaded
jfb
parents:
diff changeset
824 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
825
23eea82f5192 Uploaded
jfb
parents:
diff changeset
826 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
827
23eea82f5192 Uploaded
jfb
parents:
diff changeset
828 D835Ymotifs=matrix(,nrow = nrow(SecondSubstrateSet),ncol=1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
829 D835YAccessionNumbers<-matrix(,nrow = nrow(SecondSubstrateSet),ncol = 1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
830
23eea82f5192 Uploaded
jfb
parents:
diff changeset
831 for (i in 1:nrow(SecondSubstrateSet)){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
832 D835letters<-SecondSubstrateSet[i,4:18]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
833 D835letters<-D835letters[D835letters !="XXXXX"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
834 D835letters<-paste(D835letters, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
835 leftspaces<-c()
23eea82f5192 Uploaded
jfb
parents:
diff changeset
836 rightspaces<-c()
23eea82f5192 Uploaded
jfb
parents:
diff changeset
837
23eea82f5192 Uploaded
jfb
parents:
diff changeset
838 YYYmotif <- unlist(strsplit(D835letters, split = ""))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
839 YYYposition <- match(x = "x", table = YYYmotif)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
840 #position itself tells me how much is to the left of that X by what it's number is. x at position 4 tells me that there are
23eea82f5192 Uploaded
jfb
parents:
diff changeset
841 #just 3 letters to the left of x
23eea82f5192 Uploaded
jfb
parents:
diff changeset
842
23eea82f5192 Uploaded
jfb
parents:
diff changeset
843 YYYLettersToTheLeft <- YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
844 #how many letters to the right SHOULD just be length(motif)-position-1 if it's 5 long and x is at 3 then Y is at 4 and there is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
845 #just 1 spot to the right of Y so LettersToTheRight<-1 because 5-3-1=1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
846 YYYLettersToTheRight <- length(YYYmotif) - YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
847 #then sanity check, we're currently looking only at +/-4, but this spot allows for up to +/- 7 as well, just depends on what the
23eea82f5192 Uploaded
jfb
parents:
diff changeset
848 #variable the user puts in is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
849 if (YYYLettersToTheLeft < 7 | YYYLettersToTheRight < 7) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
850 leftspaces<-rep(" ",times=(7-YYYLettersToTheLeft))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
851 rightspaces<-rep(" ",times=7-(YYYLettersToTheRight))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
852 #add blank spaces if the motif has less than 4 letters to the left/right
23eea82f5192 Uploaded
jfb
parents:
diff changeset
853 motif<-c(leftspaces,YYYmotif,rightspaces)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
854 #save that motif, which is the Y and +/- 4 amino acids, including truncation
23eea82f5192 Uploaded
jfb
parents:
diff changeset
855 motif<-motif[!motif %in% "x"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
856 motif<-paste(motif, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
857 D835letters<-motif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
858 D835Ymotifs[i,1]<-D835letters
23eea82f5192 Uploaded
jfb
parents:
diff changeset
859 D835YAccessionNumbers[i,1]<-FirstSubstrateSet[i,3]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
860 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
861
23eea82f5192 Uploaded
jfb
parents:
diff changeset
862 if(YYYLettersToTheLeft>6 && YYYLettersToTheRight>6){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
863 motif<-YYYmotif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
864 #add blank spaces if the motif has less than 4 letters to the left/right
23eea82f5192 Uploaded
jfb
parents:
diff changeset
865 motif<-c(leftspaces,YYYmotif,rightspaces)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
866 #save that motif, which is the Y and +/- 4 amino acids, including truncation
23eea82f5192 Uploaded
jfb
parents:
diff changeset
867 motif<-motif[!motif %in% "x"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
868 motif<-paste(motif, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
869 D835letters<-motif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
870 D835Ymotifs[i,1]<-D835letters
23eea82f5192 Uploaded
jfb
parents:
diff changeset
871 D835YAccessionNumbers[i,1]<-FirstSubstrateSet[i,3]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
872 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
873 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
874
23eea82f5192 Uploaded
jfb
parents:
diff changeset
875
23eea82f5192 Uploaded
jfb
parents:
diff changeset
876 ITDmotifs=matrix(,nrow = nrow(ThirdSubstrateSet),ncol=1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
877 ITDAccessionNumbers<-matrix(,nrow = nrow(ThirdSubstrateSet))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
878
23eea82f5192 Uploaded
jfb
parents:
diff changeset
879 for (i in 1:nrow(ThirdSubstrateSet)){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
880 ITDletters<-ThirdSubstrateSet[i,4:18]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
881 ITDletters<-ITDletters[ITDletters !="XXXXX"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
882 ITDletters<-paste(ITDletters, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
883 YYYmotif <- unlist(strsplit(ITDletters, split = ""))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
884 leftspaces<-c()
23eea82f5192 Uploaded
jfb
parents:
diff changeset
885 rightspaces<-c()
23eea82f5192 Uploaded
jfb
parents:
diff changeset
886 YYYposition <- match(x = "x", table = YYYmotif)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
887 #position itself tells me how much is to the left of that X by what it's number is. x at position 4 tells me that there are
23eea82f5192 Uploaded
jfb
parents:
diff changeset
888 #just 3 letters to the left of x
23eea82f5192 Uploaded
jfb
parents:
diff changeset
889
23eea82f5192 Uploaded
jfb
parents:
diff changeset
890 YYYLettersToTheLeft <- YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
891 #how many letters to the right SHOULD just be length(motif)-position-1 if it's 5 long and x is at 3 then Y is at 4 and there is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
892 #just 1 spot to the right of Y so LettersToTheRight<-1 because 5-3-1=1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
893 YYYLettersToTheRight <- length(YYYmotif) - YYYposition - 1
23eea82f5192 Uploaded
jfb
parents:
diff changeset
894 #then sanity check, we're currently looking only at +/-4, but this spot allows for up to +/- 7 as well, just depends on what the
23eea82f5192 Uploaded
jfb
parents:
diff changeset
895 #variable the user puts in is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
896 if (YYYLettersToTheLeft < 7 | YYYLettersToTheRight < 7) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
897 leftspaces<-rep(" ",times=(7-YYYLettersToTheLeft))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
898 rightspaces<-rep(" ",times=7-(YYYLettersToTheRight))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
899 #add blank spaces if the motif has less than 4 letters to the left/right
23eea82f5192 Uploaded
jfb
parents:
diff changeset
900 motif<-c(leftspaces,YYYmotif,rightspaces)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
901 #save that motif, which is the Y and +/- 4 amino acids, including truncation
23eea82f5192 Uploaded
jfb
parents:
diff changeset
902 motif<-motif[!motif %in% "x"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
903 motif<-paste(motif, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
904 ITDletters<-motif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
905 ITDmotifs[i,1]<-ITDletters
23eea82f5192 Uploaded
jfb
parents:
diff changeset
906 ITDAccessionNumbers[i,1]<-FirstSubstrateSet[i,3]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
907 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
908
23eea82f5192 Uploaded
jfb
parents:
diff changeset
909 if(YYYLettersToTheLeft>6 && YYYLettersToTheRight>6){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
910 motif<-YYYmotif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
911 #add blank spaces if the motif has less than 4 letters to the left/right
23eea82f5192 Uploaded
jfb
parents:
diff changeset
912 motif<-c(leftspaces,YYYmotif,rightspaces)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
913 #save that motif, which is the Y and +/- 4 amino acids, including truncation
23eea82f5192 Uploaded
jfb
parents:
diff changeset
914 motif<-motif[!motif %in% "x"]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
915 motif<-paste(motif, sep="", collapse="")
23eea82f5192 Uploaded
jfb
parents:
diff changeset
916 ITDletters<-motif
23eea82f5192 Uploaded
jfb
parents:
diff changeset
917 ITDmotifs[i,1]<-ITDletters
23eea82f5192 Uploaded
jfb
parents:
diff changeset
918 ITDAccessionNumbers[i,1]<-FirstSubstrateSet[i,3]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
919 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
920 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
921 names(FTLwtmotifs)<-FTLwtAccessionNumbers
23eea82f5192 Uploaded
jfb
parents:
diff changeset
922 names(D835Ymotifs)<-D835YAccessionNumbers
23eea82f5192 Uploaded
jfb
parents:
diff changeset
923 names(ITDmotifs)<-ITDAccessionNumbers
23eea82f5192 Uploaded
jfb
parents:
diff changeset
924 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
925
23eea82f5192 Uploaded
jfb
parents:
diff changeset
926
23eea82f5192 Uploaded
jfb
parents:
diff changeset
927 FTLwtmotifsFINAL<-FTLwtmotifs[!FTLwtmotifs %in% D835Ymotifs]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
928 FTLwtmotifsFINAL<-FTLwtmotifsFINAL[!FTLwtmotifsFINAL %in% ITDmotifs]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
929 FTLwtmotifsFINAL<-FTLwtmotifsFINAL[!duplicated(FTLwtmotifsFINAL)]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
930
23eea82f5192 Uploaded
jfb
parents:
diff changeset
931
23eea82f5192 Uploaded
jfb
parents:
diff changeset
932 ITDmotifsFINAL<-ITDmotifs[!ITDmotifs %in% D835Ymotifs]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
933 ITDmotifsFINAL<-ITDmotifsFINAL[!ITDmotifsFINAL %in% FTLwtmotifs]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
934 ITDmotifsFINAL<-ITDmotifsFINAL[!duplicated(ITDmotifsFINAL)]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
935
23eea82f5192 Uploaded
jfb
parents:
diff changeset
936
23eea82f5192 Uploaded
jfb
parents:
diff changeset
937 D835YmotifsFINAL<-D835Ymotifs[!D835Ymotifs %in% FTLwtmotifs]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
938 D835YmotifsFINAL<-D835YmotifsFINAL[!D835YmotifsFINAL %in% ITDmotifs]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
939 D835YmotifsFINAL<-D835YmotifsFINAL[!duplicated(D835YmotifsFINAL)]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
940
23eea82f5192 Uploaded
jfb
parents:
diff changeset
941
23eea82f5192 Uploaded
jfb
parents:
diff changeset
942 columnalheader<-c(rep(NA,35))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
943 FTLFinalMatrix<-matrix(data =columnalheader,nrow = 1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
944
23eea82f5192 Uploaded
jfb
parents:
diff changeset
945 for (k in 1:length(FTLwtmotifsFINAL)) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
946 AN<-00000
23eea82f5192 Uploaded
jfb
parents:
diff changeset
947 #I don't remember why, but I felt it necessary to destroy the accession number multiple times to ensure it is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
948 #destroyed immediately after use
23eea82f5192 Uploaded
jfb
parents:
diff changeset
949 for (m in 1:ncol(Firstsubbackfreq)) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
950 AN <- as.character(Firstsubbackfreq[1, m])
23eea82f5192 Uploaded
jfb
parents:
diff changeset
951 if (grepl(pattern = AN,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
952 x = names(FTLwtmotifsFINAL[k]),
23eea82f5192 Uploaded
jfb
parents:
diff changeset
953 fixed = TRUE) == TRUE) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
954 outputmatrix <- as.character(Firstsubbackfreq[, m])
23eea82f5192 Uploaded
jfb
parents:
diff changeset
955 outputmatrix <- matrix(outputmatrix, nrow = 1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
956 #with that accession number, find a match in the subbackfreq file and save it here
23eea82f5192 Uploaded
jfb
parents:
diff changeset
957 FTLFinalMatrix<-rbind(FTLFinalMatrix,outputmatrix)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
958 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
959 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
960 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
961 FTLFinalMatrix<-FTLFinalMatrix[!duplicated(FTLFinalMatrix),]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
962
23eea82f5192 Uploaded
jfb
parents:
diff changeset
963 columnalheader<-c(rep(NA,35))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
964 ITDFinalMatrix<-matrix(data =columnalheader,nrow = 1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
965
23eea82f5192 Uploaded
jfb
parents:
diff changeset
966 for (k in 1:length(ITDmotifsFINAL)) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
967 AN<-00000
23eea82f5192 Uploaded
jfb
parents:
diff changeset
968 #I don't remember why, but I felt it necessary to destroy the accession number multiple times to ensure it is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
969 #destroyed immediately after use
23eea82f5192 Uploaded
jfb
parents:
diff changeset
970 for (m in 1:ncol(Thirdsubbackfreq)) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
971 AN <- as.character(Thirdsubbackfreq[1, m])
23eea82f5192 Uploaded
jfb
parents:
diff changeset
972 if (grepl(pattern = AN,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
973 x = names(ITDmotifsFINAL[k]),
23eea82f5192 Uploaded
jfb
parents:
diff changeset
974 fixed = TRUE) == TRUE) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
975 outputmatrix <- as.character(Thirdsubbackfreq[, m])
23eea82f5192 Uploaded
jfb
parents:
diff changeset
976 outputmatrix <- matrix(outputmatrix, nrow = 1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
977 #with that accession number, find a match in the subbackfreq file and save it here
23eea82f5192 Uploaded
jfb
parents:
diff changeset
978 ITDFinalMatrix<-rbind(ITDFinalMatrix,outputmatrix)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
979 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
980 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
981 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
982 ITDFinalMatrix<-ITDFinalMatrix[!duplicated(ITDFinalMatrix),]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
983
23eea82f5192 Uploaded
jfb
parents:
diff changeset
984 columnalheader<-c(rep(NA,35))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
985 D835YFinalMatrix<-matrix(data =columnalheader,nrow = 1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
986
23eea82f5192 Uploaded
jfb
parents:
diff changeset
987 for (k in 1:length(D835YmotifsFINAL)) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
988 #I don't remember why, but I felt it necessary to destroy the accession number multiple times to ensure it is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
989 #destroyed immediately after use
23eea82f5192 Uploaded
jfb
parents:
diff changeset
990 for (m in 1:ncol(Secondsubbackfreq)) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
991 AN <- as.character(Secondsubbackfreq[1, m])
23eea82f5192 Uploaded
jfb
parents:
diff changeset
992 if (grepl(pattern = AN,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
993 x = names(D835YmotifsFINAL[k]),
23eea82f5192 Uploaded
jfb
parents:
diff changeset
994 fixed = TRUE) == TRUE) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
995 outputmatrix <- as.character(Secondsubbackfreq[, m])
23eea82f5192 Uploaded
jfb
parents:
diff changeset
996 outputmatrix <- matrix(outputmatrix, nrow = 1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
997 #with that accession number, find a match in the subbackfreq file and save it here
23eea82f5192 Uploaded
jfb
parents:
diff changeset
998 D835YFinalMatrix<-rbind(D835YFinalMatrix,outputmatrix)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
999 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1000 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1001 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1002 D835YFinalMatrix<-D835YFinalMatrix[!duplicated(D835YFinalMatrix),]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1003
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1004 FTLoutputmatrix<-matrix(data=c(FTLwtmotifsFINAL,names(FTLwtmotifsFINAL)),ncol = 2)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1005
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1006
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1007 write.table(x=FTLoutputmatrix,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1008 file=First_unshared_motifs_table,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1009 quote=FALSE, sep=",",
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1010 row.names=FALSE,col.names = FALSE, na="", append=TRUE)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1011
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1012 columnalheader<-c("Accession Numbers",as.character(Thirdsubbackfreq[1:35,1]))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1013 columnalheader<-matrix(columnalheader,nrow = 1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1014 write.table(x=columnalheader,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1015 file=First_unshared_subbackfreq,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1016 quote=FALSE, sep=",",
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1017 row.names=FALSE,col.names = FALSE, na="", append=TRUE)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1018
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1019 write.table(x=FTLFinalMatrix,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1020 file=First_unshared_subbackfreq,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1021 quote=FALSE, sep=",",
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1022 row.names=FALSE,col.names = FALSE, na="", append=TRUE)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1023
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1024 ############################################################################################################
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1025
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1026 D835Youtputmatrix<-matrix(data=c(D835YmotifsFINAL,names(D835YmotifsFINAL)),ncol = 2)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1027
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1028 write.table(x=D835Youtputmatrix,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1029 file=Second_unshared_motifs_table,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1030 quote=FALSE, sep=",",
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1031 row.names=FALSE,col.names = FALSE, na="", append=TRUE)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1032
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1033 columnalheader<-c("Accession Numbers",as.character(Thirdsubbackfreq[1:35,1]))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1034 columnalheader<-matrix(columnalheader,nrow = 1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1035 write.table(x=columnalheader,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1036 file=Second_unshared_subbackfreq,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1037 quote=FALSE, sep=",",
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1038 row.names=FALSE,col.names = FALSE, na="", append=TRUE)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1039
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1040 write.table(x=D835YFinalMatrix,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1041 file=Second_unshared_subbackfreq,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1042 quote=FALSE, sep=",",
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1043 row.names=FALSE,col.names = FALSE, na="", append=TRUE)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1044
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1045 ############################################################################################################
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1046
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1047 ITDoutputmatrix<-matrix(data = c(ITDmotifsFINAL,names(ITDmotifsFINAL)),ncol = 2)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1048
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1049 write.table(x=ITDoutputmatrix,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1050 file=Third_unshared_motifs_table,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1051 quote=FALSE, sep=",",
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1052 row.names=FALSE,col.names = FALSE, na="", append=TRUE)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1053
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1054 columnalheader<-c("Accession Numbers",as.character(Thirdsubbackfreq[1:35,1]))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1055 columnalheader<-matrix(columnalheader,nrow = 1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1056 write.table(x=columnalheader,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1057 file=Third_unshared_subbackfreq,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1058 quote=FALSE, sep=",",
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1059 row.names=FALSE,col.names = FALSE, na="", append=TRUE)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1060
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1061 write.table(x=ITDFinalMatrix,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1062 file=Third_unshared_subbackfreq,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1063 quote=FALSE, sep=",",
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1064 row.names=FALSE,col.names = FALSE, na="", append=TRUE)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1065
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1066 }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1067
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1068 # if (Are_You_Looking_For_Commonality=="NO"){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1069 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1070 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1071 # FTLwtmotifsFULLMATRIX<-cbind(FTLwtmotifs,FTLwtAccessionNumbers)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1072 # ITDmotifsFULLMATRIX<-cbind(ITDmotifs,ITDAccessionNumbers)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1073 # D835YmotifsFULLMATRIX<-cbind(D835Ymotifs,D835YAccessionNumbers)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1074 # # ?duplicated
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1075 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1076 # FTLwtmotifsFINAL<-FTLwtmotifs[!FTLwtmotifs %in% D835Ymotifs]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1077 # FTLwtmotifsFINAL<-FTLwtmotifsFINAL[!FTLwtmotifsFINAL %in% ITDmotifs]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1078 # FTLwtmotifsFINAL<-matrix(data=FTLwtmotifsFINAL, ncol = 1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1079 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1080 # ITDmotifsFINAL<-ITDmotifs[!ITDmotifs %in% D835Ymotifs]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1081 # ITDmotifsFINAL<-ITDmotifsFINAL[!ITDmotifsFINAL %in% FTLwtmotifs]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1082 # ITDmotifsFINAL<-matrix(data=ITDmotifsFINAL, ncol = 1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1083 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1084 # D835YmotifsFINAL<-D835Ymotifs[!D835Ymotifs %in% FTLwtmotifs]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1085 # D835YmotifsFINAL<-D835YmotifsFINAL[!D835YmotifsFINAL %in% ITDmotifs]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1086 # D835YmotifsFINAL<-matrix(data=D835YmotifsFINAL, ncol = 1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1087 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1088 # FTLnondupeAccessionNumbers<-c()
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1089 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1090 # for (z in 1:nrow(FTLwtmotifsFINAL)) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1091 # for (w in 1:nrow(FTLwtmotifsFULLMATRIX)) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1092 # if (is.na(FTLwtmotifsFULLMATRIX[w,1])!=TRUE)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1093 # if (FTLwtmotifsFINAL[z]==FTLwtmotifsFULLMATRIX[w,1]){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1094 # FTLnondupeAccessionNumbers<-c(FTLnondupeAccessionNumbers,FTLwtmotifsFULLMATRIX[w,2])
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1095 # }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1096 # }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1097 # }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1098 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1099 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1100 # #find accession numbers here, put a matrix of those things, amino acid %, but only after I've unduped them
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1101 # FTLnondupeAccessionNumbers<-FTLnondupeAccessionNumbers[!duplicated(FTLnondupeAccessionNumbers)]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1102 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1103 # columnalheader<-c(rep(NA,35))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1104 # FTLFinalMatrix<-matrix(data =columnalheader,nrow = 1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1105 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1106 # for (k in 1:length(FTLnondupeAccessionNumbers)) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1107 # #I don't remember why, but I felt it necessary to destroy the accession number multiple times to ensure it is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1108 # #destroyed immediately after use
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1109 # for (m in 1:ncol(Firstsubbackfreq)) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1110 # AN <- as.character(Firstsubbackfreq[1, m])
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1111 # if (grepl(pattern = AN,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1112 # x = FTLnondupeAccessionNumbers[k],
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1113 # fixed = TRUE) == TRUE) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1114 # outputmatrix <- as.character(Firstsubbackfreq[, m])
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1115 # outputmatrix <- matrix(outputmatrix, nrow = 1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1116 # #with that accession number, find a match in the subbackfreq file and save it here
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1117 # FTLFinalMatrix<-rbind(FTLFinalMatrix,outputmatrix)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1118 # }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1119 # }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1120 # }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1121 # ITDnondupeAccessionNumbers<-c()
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1122 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1123 # for (z in 1:nrow(ITDmotifsFINAL)) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1124 # for (w in 1:nrow(ITDmotifsFULLMATRIX)) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1125 # if (is.na(ITDmotifsFULLMATRIX[w,1])!=TRUE)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1126 # if (ITDmotifsFINAL[z]==ITDmotifsFULLMATRIX[w,1]){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1127 # ITDnondupeAccessionNumbers<-c(ITDnondupeAccessionNumbers,ITDmotifsFULLMATRIX[w,2])
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1128 # }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1129 # }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1130 # }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1131 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1132 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1133 # #find accession numbers here, put a matrix of those things, amino acid %, but only after I've unduped them
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1134 # ITDnondupeAccessionNumbers<-ITDnondupeAccessionNumbers[!duplicated(ITDnondupeAccessionNumbers)]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1135 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1136 # columnalheader<-c(rep(NA,35))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1137 # ITDFinalMatrix<-matrix(data =columnalheader,nrow = 1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1138 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1139 # for (k in 1:length(ITDnondupeAccessionNumbers)) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1140 # #I don't remember why, but I felt it necessary to destroy the accession number multiple times to ensure it is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1141 # #destroyed immediately after use
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1142 # for (m in 1:ncol(Thirdsubbackfreq)) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1143 # AN <- as.character(Thirdsubbackfreq[1, m])
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1144 # if (grepl(pattern = AN,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1145 # x = ITDnondupeAccessionNumbers[k],
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1146 # fixed = TRUE) == TRUE) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1147 # outputmatrix <- as.character(Thirdsubbackfreq[, m])
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1148 # outputmatrix <- matrix(outputmatrix, nrow = 1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1149 # #with that accession number, find a match in the subbackfreq file and save it here
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1150 # ITDFinalMatrix<-rbind(ITDFinalMatrix,outputmatrix)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1151 # }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1152 # }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1153 # }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1154 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1155 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1156 # D835YnondupeAccessionNumbers<-c()
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1157 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1158 # for (z in 1:nrow(D835YmotifsFINAL)) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1159 # for (w in 1:nrow(D835YmotifsFULLMATRIX)) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1160 # if (is.na(D835YmotifsFULLMATRIX[w,1])!=TRUE)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1161 # if (D835YmotifsFINAL[z]==D835YmotifsFULLMATRIX[w,1]){
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1162 # D835YnondupeAccessionNumbers<-c(D835YnondupeAccessionNumbers,D835YmotifsFULLMATRIX[w,2])
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1163 # }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1164 # }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1165 # }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1166 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1167 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1168 # #find accession numbers here, put a matrix of those things, amino acid %, but only after I've unduped them
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1169 # D835YnondupeAccessionNumbers<-D835YnondupeAccessionNumbers[!duplicated(D835YnondupeAccessionNumbers)]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1170 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1171 # columnalheader<-c(rep(NA,35))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1172 # D835YFinalMatrix<-matrix(data =columnalheader,nrow = 1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1173 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1174 # for (k in 1:length(D835YnondupeAccessionNumbers)) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1175 # #I don't remember why, but I felt it necessary to destroy the accession number multiple times to ensure it is
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1176 # #destroyed immediately after use
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1177 # for (m in 1:ncol(Secondsubbackfreq)) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1178 # AN <- as.character(Secondsubbackfreq[1, m])
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1179 # if (grepl(pattern = AN,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1180 # x = D835YnondupeAccessionNumbers[k],
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1181 # fixed = TRUE) == TRUE) {
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1182 # outputmatrix <- as.character(Secondsubbackfreq[, m])
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1183 # outputmatrix <- matrix(outputmatrix, nrow = 1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1184 # #with that accession number, find a match in the subbackfreq file and save it here
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1185 # D835YFinalMatrix<-rbind(D835YFinalMatrix,outputmatrix)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1186 # }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1187 # }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1188 # }
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1189 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1190 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1191 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1192 # # FinalFTLmotifs<-FTLwtmotifsFINAL[!duplicated(FTLwtmotifsFINAL)]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1193 # # FinalFTLAccessionNumbers<-FTLnondupeAccessionNumbers[!duplicated(FTLnondupeAccessionNumbers)]
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1194 # # necessaryNAs<-rep(NA,times=(length(FinalFTLmotifs)-length(FinalFTLAccessionNumbers)))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1195 # # FinalFTLAccessionNumbers<-c(FinalFTLAccessionNumbers,necessaryNAs)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1196 # # TRUEFTLoutputmatrix<-cbind(FinalFTLmotifs,FinalFTLAccessionNumbers)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1197 # # TRUEFTLoutputmatrix
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1198 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1199 # write.table(x=FTLwtmotifsFINAL,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1200 # file=First_unshared_motifs_table,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1201 # quote=FALSE, sep=",",
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1202 # row.names=FALSE,col.names = FALSE, na="", append=TRUE)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1203 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1204 # columnalheader<-c("Accession Numbers",as.character(Thirdsubbackfreq[1:35,1]))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1205 # columnalheader<-matrix(columnalheader,nrow = 1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1206 # write.table(x=columnalheader,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1207 # file=First_unshared_subbackfreq,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1208 # quote=FALSE, sep=",",
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1209 # row.names=FALSE,col.names = FALSE, na="", append=TRUE)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1210 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1211 # write.table(x=FTLFinalMatrix,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1212 # file=First_unshared_subbackfreq,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1213 # quote=FALSE, sep=",",
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1214 # row.names=FALSE,col.names = FALSE, na="", append=TRUE)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1215 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1216 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1217 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1218 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1219 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1220 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1221 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1222 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1223 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1224 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1225 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1226 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1227 # write.table(x=D835YmotifsFINAL,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1228 # file=Second_unshared_motifs_table,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1229 # quote=FALSE, sep=",",
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1230 # row.names=FALSE,col.names = FALSE, na="", append=TRUE)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1231 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1232 # columnalheader<-c("Accession Numbers",as.character(Thirdsubbackfreq[1:35,1]))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1233 # columnalheader<-matrix(columnalheader,nrow = 1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1234 # write.table(x=columnalheader,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1235 # file=Second_unshared_subbackfreq,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1236 # quote=FALSE, sep=",",
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1237 # row.names=FALSE,col.names = FALSE, na="", append=TRUE)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1238 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1239 # write.table(x=D835YFinalMatrix,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1240 # file=Second_unshared_subbackfreq,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1241 # quote=FALSE, sep=",",
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1242 # row.names=FALSE,col.names = FALSE, na="", append=TRUE)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1243 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1244 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1245 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1246 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1247 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1248 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1249 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1250 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1251 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1252 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1253 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1254 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1255 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1256 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1257 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1258 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1259 # write.table(x=ITDmotifsFINAL,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1260 # file=Third_unshared_motifs_table,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1261 # quote=FALSE, sep=",",
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1262 # row.names=FALSE,col.names = FALSE, na="", append=TRUE)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1263 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1264 # columnalheader<-c("Accession Numbers",as.character(Thirdsubbackfreq[1:35,1]))
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1265 # columnalheader<-matrix(columnalheader,nrow = 1)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1266 # write.table(x=columnalheader,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1267 # file=Third_unshared_subbackfreq,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1268 # quote=FALSE, sep=",",
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1269 # row.names=FALSE,col.names = FALSE, na="", append=TRUE)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1270 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1271 # write.table(x=ITDFinalMatrix,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1272 # file=Third_unshared_subbackfreq,
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1273 # quote=FALSE, sep=",",
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1274 # row.names=FALSE,col.names = FALSE, na="", append=TRUE)
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1275 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1276 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1277 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1278 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1279 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1280 #
23eea82f5192 Uploaded
jfb
parents:
diff changeset
1281 # }