Commit 39af88c5afa802b437df13de8a2b280baab041f2

Authored by Efrain Gonzalez
1 parent 8bfefd7afe
Exists in master

fixed issue with spaces and choosing the second name (UNTESTED)

Showing 1 changed file with 9 additions and 27 deletions   Show diff stats
1 #Libraries required to run the code 1 #Libraries required to run the code
2 library(pryr) 2 library(pryr)
3 library(MASS) 3 library(MASS)
4 library(dplyr) 4 library(dplyr)
5 library(tidyr) 5 library(tidyr)
6 library(readr) 6 library(readr)
7 library(stringr) 7 library(stringr)
8 8
9 9
10 #Necessary Functions 10 #Necessary Functions
11 #1#Function for handling the changing of row names and column names 11 #1#Function for handling the changing of row names and column names
12 chngrownm <- function(mat){ 12 chngrownm <- function(mat){
13 row <- dim(mat)[1] 13 row <- dim(mat)[1]
14 col <- dim(mat)[2] 14 col <- dim(mat)[2]
15 j <- 1 15 j <- 1
16 x <- 1 16 x <- 1
17 p <- 1 17 p <- 1
18 a <- 1 18 a <- 1
19 b <- 1 19 b <- 1
20 g <- 1 20 g <- 1
21 for(j in 1:col){ 21 for(j in 1:col){
22 if("!Sample_source_name_ch1"==mat[1,j]){ 22 if("!Sample_source_name_ch1"==mat[1,j]){
23 colnames(mat)[j] <- "Brain_Region" 23 colnames(mat)[j] <- "Brain_Region"
24 } 24 }
25 if("!Sample_title" == mat[1,j]){ 25 if("!Sample_title" == mat[1,j]){
26 colnames(mat)[j] <- "Title" 26 colnames(mat)[j] <- "Title"
27 } 27 }
28 if("!Sample_geo_accession" == mat[1,j]){ 28 if("!Sample_geo_accession" == mat[1,j]){
29 colnames(mat)[j] <- "ID_REF" 29 colnames(mat)[j] <- "ID_REF"
30 } else{ 30 } else{
31 if(grepl("Sex|gender|Gender|sex",mat[2,j])==TRUE){ 31 if(grepl("Sex|gender|Gender|sex",mat[2,j])==TRUE){
32 colnames(mat)[j] <- paste0("Sex",x) 32 colnames(mat)[j] <- paste0("Sex",x)
33 x = x + 1 33 x = x + 1
34 } 34 }
35 if(grepl("postmorteminterval|PMI|pmi",mat[2,j])==TRUE){ 35 if(grepl("postmorteminterval|PMI|pmi",mat[2,j])==TRUE){
36 colnames(mat)[j] <- paste0("PMI",p) 36 colnames(mat)[j] <- paste0("PMI",p)
37 p = p + 1 37 p = p + 1
38 } 38 }
39 if(grepl("age|Age|AGE",mat[2,j])==TRUE){ 39 if(grepl("age|Age|AGE",mat[2,j])==TRUE){
40 colnames(mat)[j] <- paste0("Age",a) 40 colnames(mat)[j] <- paste0("Age",a)
41 a = a + 1 41 a = a + 1
42 } 42 }
43 if(grepl("braak|b&b",mat[2,j])==TRUE){ 43 if(grepl("braak|b&b",mat[2,j])==TRUE){
44 colnames(mat)[j] <- paste0("Braak",b) 44 colnames(mat)[j] <- paste0("Braak",b)
45 b = b + 1 45 b = b + 1
46 } 46 }
47 if(grepl("group|disease|control|AD|normal|diagnosis|Alzheimer|Control",mat[2,j])==TRUE){ 47 if(grepl("group|disease|control|AD|normal|diagnosis|Alzheimer|Control",mat[2,j])==TRUE){
48 colnames(mat)[j] <- paste0("Group",g) 48 colnames(mat)[j] <- paste0("Group",g)
49 g = g + 1 49 g = g + 1
50 } 50 }
51 51
52 } 52 }
53 j = j + 1 53 j = j + 1
54 } 54 }
55 mat 55 mat
56 } 56 }
57 57
58 #2#Function for reorganizing information within the columns 58 #2#Function for reorganizing information within the columns
59 cinfo <- function(mat){ 59 cinfo <- function(mat){
60 col <- dim(mat)[2] 60 col <- dim(mat)[2]
61 j <-2 61 j <-2
62 for(j in 2:col){ 62 for(j in 2:col){
63 if(grepl("Group",colnames(mat)[j]) == TRUE){ 63 if(grepl("Group",colnames(mat)[j]) == TRUE){
64 mat[,j] <- gsub(".+:\\s|\\s.+;.+","",mat[,j]) 64 mat[,j] <- gsub(".+:\\s|\\s.+;.+","",mat[,j])
65 } 65 }
66 if(grepl("Age",colnames(mat)[j])==TRUE){ 66 if(grepl("Age",colnames(mat)[j])==TRUE){
67 mat[,j] <- gsub("\\D","",mat[,j])%>% 67 mat[,j] <- gsub("\\D","",mat[,j])%>%
68 as.integer() 68 as.integer()
69 } 69 }
70 if(grepl("Sex",colnames(mat)[j])==TRUE){ 70 if(grepl("Sex",colnames(mat)[j])==TRUE){
71 mat[,j] <- gsub(".+:\\s","",mat[,j]) 71 mat[,j] <- gsub(".+:\\s","",mat[,j])
72 } 72 }
73 if(grepl("PMI",colnames(mat)[j])==TRUE){ 73 if(grepl("PMI",colnames(mat)[j])==TRUE){
74 mat[,j] <- gsub("[^0-9\\.]","",mat[,j])%>% 74 mat[,j] <- gsub("[^0-9\\.]","",mat[,j])%>%
75 as.numeric() 75 as.numeric()
76 } 76 }
77 if(grepl("Braak",colnames(mat)[j])==TRUE){ 77 if(grepl("Braak",colnames(mat)[j])==TRUE){
78 mat[,j]<-gsub(".+:\\s","",mat[,j])%>% 78 mat[,j]<-gsub(".+:\\s","",mat[,j])%>%
79 as.roman()%>% 79 as.roman()%>%
80 as.integer() 80 as.integer()
81 } 81 }
82 j=j+1 82 j=j+1
83 } 83 }
84 mat 84 mat
85 } 85 }
86 86
87 #3#Function for labeling the gene IDs without names 87 #3#Function for labeling the gene IDs without names
88 NAFIXING <- function(GIDNAM){ 88 NAFIXING <- function(GIDNAM){
89 row <- dim(GIDNAM)[1] 89 row <- dim(GIDNAM)[1]
90 i <- 1 90 i <- 1
91 for(i in 1:row){ 91 for(i in 1:row){
92 if(grepl("^NA\\s*$",GIDNAM[i,2])==TRUE||is.na(GIDNAM[i,2])==TRUE){ 92 if(grepl("^NA\\s*$",GIDNAM[i,2])==TRUE||is.na(GIDNAM[i,2])==TRUE){
93 GIDNAM[i,2] <- GIDNAM[i,1] 93 GIDNAM[i,2] <- GIDNAM[i,1]
94 } 94 }
95 i <- i + 1 95 i <- i + 1
96 } 96 }
97 GIDNAM 97 GIDNAM
98 } 98 }
99 99
100 ##4#Function for changing the gene ID to gene name
101 ##cgeneID <- function(GeneName,DATA){
102 ## colGene <- dim(GeneName)[2]
103 ## j <- 1
104 ## for(j in 1:colGene){
105 ## chngsreq <- grep(GeneName[1,j],DATA[1,])
106 ## if(sum(chngsreq) > 0){
107 ## #DATA[1,chngsreq] <- gsub(GeneName[1,j],GeneName[2,j],DATA[1,chngsreq])
108 ## DATA[1,chngsreq] <- gsub(paste0("^",GeneName[1,j]),GeneName[2,j],DATA[1,chngsreq])
109 ## }
110 ## j = j+1
111 ## }
112 ## DATA
113 ##}
114 #4#Function for changing the gene ID to gene name 100 #4#Function for changing the gene ID to gene name
115 cgeneID <- function(GeneName,DATA){ 101 cgeneID <- function(GeneName,DATA){
116 colGene <- dim(GeneName)[2] 102 colGene <- dim(GeneName)[2]
117 j <- 1 103 j <- 1
118 for(j in 1:colGene){ 104 for(j in 1:colGene){
119 chngsreq <- grep(paste0("^",GeneName[1,j],"$"),DATA[1,]) 105 chngsreq <- grep(paste0("^",GeneName[1,j],"$"),DATA[1,])
120 if(is.na(sum(chngsreq))==FALSE){ 106 if(is.na(sum(chngsreq))==FALSE){
121 if(sum(chngsreq) > 0){ 107 if(sum(chngsreq) > 0){
122 DATA[1,chngsreq] <- gsub(paste0("^",GeneName[1,j]),GeneName[2,j],DATA[1,chngsreq]) 108 DATA[1,chngsreq] <- gsub(paste0("^",GeneName[1,j]),GeneName[2,j],DATA[1,chngsreq])
123 } 109 }
124 } 110 }
125 #if(sum(chngsreq) > 0){ 111 j = j+1
126 ##DATA[1,chngsreq] <- gsub(GeneName[1,j],GeneName[2,j],DATA[1,chngsreq])
127 #DATA[1,chngsreq] <- gsub(paste0("^",GeneName[1,j]),GeneName[2,j],DATA[1,chngsreq])
128 #}
129 j = j+1
130 } 112 }
131 DATA 113 DATA
132 } 114 }
133 115
134 #5#Function for adjusting the gene names 116 #5#Function for adjusting the gene names
135 gcnames <- function(DiData,usecol=1){ 117 gcnames <- function(DiData,usecol=1){
136 nuruns <- dim(DiData)[2] 118 nuruns <- dim(DiData)[2]
137 i = 1 119 i = 1
138 nwnam <- rep("0",length.out=nuruns) 120 nwnam <- rep("0",length.out=nuruns)
139 for(i in 1:nuruns){ 121 for(i in 1:nuruns){
140 if(length(strsplit(colnames(DiData)[i],"///")[[1]]) >= usecol){ 122 if(length(strsplit(colnames(DiData)[i],"///")[[1]]) >= usecol){
141 nwnam[i]=strsplit(colnames(DiData)[i],"///")[[1]][usecol] 123 nwnam[i]=str_trim(strsplit(colnames(DiData)[i],"///")[[1]][usecol])
142 } else{ 124 } else{
143 nwnam[i]=strsplit(colnames(DiData)[i],"///")[[1]][1] 125 nwnam[i]=str_trim(strsplit(colnames(DiData)[i],"///")[[1]][1])
144 } 126 }
145 127
146 } 128 }
147 nwnam 129 nwnam
148 130
149 } 131 }
150 132
151 133
152 134
153 #The Rest of this code will be used every time you want to change a data set 135 #The Rest of this code will be used every time you want to change a data set
154 136
155 #Getting the series matrix file 137 #Getting the series matrix file
156 print("Choose the series matrix file that you want to Analyze") 138 print("Choose the series matrix file that you want to Analyze")
157 alz <- file.choose() 139 alz <- file.choose()
158 140
159 #Getting the GPL file 141 #Getting the GPL file
160 print("Choose the GPL file that correlates with the above series matrix file") 142 print("Choose the GPL file that correlates with the above series matrix file")
161 genena <- file.choose() 143 genena <- file.choose()
162 144
163 145
164 #Set working directory based on the directory of the series matrix file Currently only works for windows 146 #Set working directory based on the directory of the series matrix file Currently only works for windows
165 ##strsplit(alz,"[\\]") %>% 147 ##strsplit(alz,"[\\]") %>%
166 ## .[[1]] %>% 148 ## .[[1]] %>%
167 ## .[-length(.)] %>% 149 ## .[-length(.)] %>%
168 ## paste(.,collapse="/") %>% 150 ## paste(.,collapse="/") %>%
169 ## setwd() 151 ## setwd()
170 152
171 #Find out if it is a soft GPL file or not 153 #Find out if it is a soft GPL file or not
172 soft <- strsplit(genena,"[\\|/]") %>% 154 soft <- strsplit(genena,"[\\|/]") %>%
173 .[[1]] %>% 155 .[[1]] %>%
174 .[length(.)] %>% 156 .[length(.)] %>%
175 grepl("soft|annot",.) 157 grepl("soft|annot",.)
176 158
177 #Working with the wordy part of the document 159 #Working with the wordy part of the document
178 alzword <- alz %>% 160 alzword <- alz %>%
179 read_delim(delim ="\t",comment = "!Series",col_names = FALSE)%>% 161 read_delim(delim ="\t",comment = "!Series",col_names = FALSE)%>%
180 filter(grepl("!Sample",X1))%>% 162 filter(grepl("!Sample",X1))%>%
181 filter(!grepl("!Sample_contact",X1)) 163 filter(!grepl("!Sample_contact",X1))
182 164
183 ##Changing row names and column names: 165 ##Changing row names and column names:
184 ALZWORD <- t(alzword) 166 ALZWORD <- t(alzword)
185 rownames(ALZWORD)=NULL 167 rownames(ALZWORD)=NULL
186 colnames(ALZWORD) <- colnames(ALZWORD,do.NULL=FALSE) 168 colnames(ALZWORD) <- colnames(ALZWORD,do.NULL=FALSE)
187 ALZWORD <- chngrownm(ALZWORD)[-1,] 169 ALZWORD <- chngrownm(ALZWORD)[-1,]
188 ALZWORD <- ALZWORD%>% 170 ALZWORD <- ALZWORD%>%
189 as.data.frame()%>% 171 as.data.frame()%>%
190 dplyr::select(-starts_with("col")) 172 dplyr::select(-starts_with("col"))
191 173
192 ##Reorganizing information within the columns 174 ##Reorganizing information within the columns
193 ALZWORDF <- cinfo(ALZWORD) 175 ALZWORDF <- cinfo(ALZWORD)
194 176
195 177
196 #Working with Actual Data part of file 178 #Working with Actual Data part of file
197 alzdat <- alz %>% 179 alzdat <- alz %>%
198 read_delim(delim="\t",col_names=TRUE,comment = "!",skip=1) 180 read_delim(delim="\t",col_names=TRUE,comment = "!",skip=1)
199 ALZDAT <- t(alzdat[,-1]) 181 ALZDAT <- t(alzdat[,-1])
200 rownames(ALZDAT)=NULL 182 rownames(ALZDAT)=NULL
201 183
202 ##Is there a clean version of the GPL file available? 184 ##Is there a clean version of the GPL file available?
203 gplnum <- strsplit(genena,"[\\|/]") %>% 185 gplnum <- strsplit(genena,"[\\|/]") %>%
204 .[[1]] %>% 186 .[[1]] %>%
205 .[length(.)] %>% 187 .[length(.)] %>%
206 gsub("\\D","",.) 188 gsub("\\D","",.)
207 clfileex <- sum(grepl(paste0("Clean_GPL",gplnum),list.files())) 189 clfileex <- sum(grepl(paste0("Clean_GPL",gplnum),list.files()))
208 if(clfileex >= 1){ 190 if(clfileex >= 1){
209 #use the clean version 191 #use the clean version
210 geneIDNam <- paste0("Clean_GPL",gplnum,".txt") %>% 192 geneIDNam <- paste0("Clean_GPL",gplnum,".txt") %>%
211 read_delim(delim="\t",col_names = c("ID","Symbol"), comment = "!") 193 read_delim(delim="\t",col_names = c("ID","Symbol"), comment = "!")
212 194
213 } 195 }
214 if(clfileex == 0){ 196 if(clfileex == 0){
215 ##Lets Create a clean version 197 ##Lets Create a clean version
216 198
217 ##Gene ID to Gene Name 199 ##Gene ID to Gene Name
218 ###geneIDNam <- genena %>% 200 ###geneIDNam <- genena %>%
219 ### read_delim(delim="\t",comment = "#")%>% 201 ### read_delim(delim="\t",comment = "#")%>%
220 ### dplyr::select(.,ID,grep("Symbol|ORF",colnames(.))) 202 ### dplyr::select(.,ID,grep("Symbol|ORF",colnames(.)))
221 ###problems with the above for soft files 203 ###problems with the above for soft files
222 if(soft == TRUE){ 204 if(soft == TRUE){
223 #gplnum <- strsplit(genena,"[\\|/]") %>% 205 #gplnum <- strsplit(genena,"[\\|/]") %>%
224 # .[[1]] %>% 206 # .[[1]] %>%
225 # .[length(.)] %>% 207 # .[length(.)] %>%
226 # gsub("\\D","",.) 208 # gsub("\\D","",.)
227 #Check to see if there is already a file containing information on soft files 209 #Check to see if there is already a file containing information on soft files
228 fileex <- sum(grepl("GPL_ID_LOC.txt",list.files())) 210 fileex <- sum(grepl("GPL_ID_LOC.txt",list.files()))
229 if(fileex == 1){ 211 if(fileex == 1){
230 #Check to see if this GPL soft file has been used before 212 #Check to see if this GPL soft file has been used before
231 IDF <- read_delim("GPL_ID_LOC.txt",delim = "\t",col_names = TRUE) %>% 213 IDF <- read_delim("GPL_ID_LOC.txt",delim = "\t",col_names = TRUE) %>%
232 .$GPL_FILE_NUM%>% 214 .$GPL_FILE_NUM%>%
233 grepl(gplnum,.) %>% 215 grepl(gplnum,.) %>%
234 sum() 216 sum()
235 if(IDF == 1){ 217 if(IDF == 1){
236 IDLOCAL <- read_delim("GPL_ID_LOC.txt",delim = "\t",col_names = TRUE) %>% 218 IDLOCAL <- read_delim("GPL_ID_LOC.txt",delim = "\t",col_names = TRUE) %>%
237 .$GPL_FILE_NUM%>% 219 .$GPL_FILE_NUM%>%
238 grep(gplnum,.) 220 grep(gplnum,.)
239 idlocgpl <- read_delim("GPL_ID_LOC.txt",delim = "\t",col_names = TRUE) %>% 221 idlocgpl <- read_delim("GPL_ID_LOC.txt",delim = "\t",col_names = TRUE) %>%
240 .$LOC_ID %>% 222 .$LOC_ID %>%
241 .[IDLOCAL] 223 .[IDLOCAL]
242 geneIDNam <- genena %>% 224 geneIDNam <- genena %>%
243 read_delim(delim="\t",col_names = TRUE, comment = "!", skip = idlocgpl) %>% 225 read_delim(delim="\t",col_names = TRUE, comment = "!", skip = idlocgpl) %>%
244 dplyr::select(.,ID,grep("Symbol|^ORF\\s*$|^gene_assignment\\s*$",colnames(.))) 226 dplyr::select(.,ID,grep("Symbol|^ORF\\s*$|^gene_assignment\\s*$",colnames(.)))
245 } 227 }
246 if(IDF == 0){ 228 if(IDF == 0){
247 #No information on this particular GPL file 229 #No information on this particular GPL file
248 idLOCGPL <- genena %>% 230 idLOCGPL <- genena %>%
249 read_delim(delim="\t",col_names = FALSE, comment = "!", n_max = 1000) %>% 231 read_delim(delim="\t",col_names = FALSE, comment = "!", n_max = 1000) %>%
250 t(.) %>% 232 t(.) %>%
251 .[1,] %>% 233 .[1,] %>%
252 grep("^ID\\s*$",.) %>% 234 grep("^ID\\s*$",.) %>%
253 -1 235 -1
254 cbind(as.integer(gplnum),as.integer(idLOCGPL)) %>% 236 cbind(as.integer(gplnum),as.integer(idLOCGPL)) %>%
255 cat(file="GPL_ID_LOC.txt",sep = "\t", fill = TRUE, append = TRUE) 237 cat(file="GPL_ID_LOC.txt",sep = "\t", fill = TRUE, append = TRUE)
256 geneIDNam <- genena %>% 238 geneIDNam <- genena %>%
257 read_delim(delim="\t",col_names = TRUE, comment = "!", skip = idLOCGPL) %>% 239 read_delim(delim="\t",col_names = TRUE, comment = "!", skip = idLOCGPL) %>%
258 dplyr::select(.,ID,grep("Symbol|^ORF\\s*$|^gene_assignment\\s*$",colnames(.))) 240 dplyr::select(.,ID,grep("Symbol|^ORF\\s*$|^gene_assignment\\s*$",colnames(.)))
259 } 241 }
260 } 242 }
261 if(fileex == 0){ 243 if(fileex == 0){
262 #We must create a file that we can access for later use 244 #We must create a file that we can access for later use
263 idLOCGPL <- genena %>% 245 idLOCGPL <- genena %>%
264 read_delim(delim="\t",col_names = FALSE, comment = "!", n_max = 1000) %>% 246 read_delim(delim="\t",col_names = FALSE, comment = "!", n_max = 1000) %>%
265 t(.) %>% 247 t(.) %>%
266 .[1,] %>% 248 .[1,] %>%
267 grep("^ID\\s*$",.) %>% 249 grep("^ID\\s*$",.) %>%
268 -1 250 -1
269 Firstval <- cbind(as.integer(gplnum),as.integer(idLOCGPL)) 251 Firstval <- cbind(as.integer(gplnum),as.integer(idLOCGPL))
270 colnames(Firstval) <- c("GPL_FILE_NUM","LOC_ID") 252 colnames(Firstval) <- c("GPL_FILE_NUM","LOC_ID")
271 write.table(Firstval,file = "GPL_ID_LOC.txt", sep = "\t",row.names = FALSE, col.names = TRUE) 253 write.table(Firstval,file = "GPL_ID_LOC.txt", sep = "\t",row.names = FALSE, col.names = TRUE)
272 geneIDNam <- genena %>% 254 geneIDNam <- genena %>%
273 read_delim(delim="\t",col_names = TRUE, comment = "!", skip = idLOCGPL) %>% 255 read_delim(delim="\t",col_names = TRUE, comment = "!", skip = idLOCGPL) %>%
274 dplyr::select(.,ID,grep("Symbol|^ORF\\s*$|^gene_assignment\\s*$",colnames(.))) 256 dplyr::select(.,ID,grep("Symbol|^ORF\\s*$|^gene_assignment\\s*$",colnames(.)))
275 } 257 }
276 } 258 }
277 if(soft == FALSE){ 259 if(soft == FALSE){
278 geneIDNam <- genena %>% 260 geneIDNam <- genena %>%
279 read_delim(delim="\t",comment = "#")%>% 261 read_delim(delim="\t",comment = "#")%>%
280 dplyr::select(.,ID,grep("Symbol|^ORF\\s*$|^gene_assignment\\s*$",colnames(.))) 262 dplyr::select(.,ID,grep("Symbol|^ORF\\s*$|^gene_assignment\\s*$",colnames(.)))
281 } 263 }
282 264
283 ##Labeling the gene IDs without names 265 ##Labeling the gene IDs without names
284 geneIDNam <- NAFIXING(geneIDNam) 266 geneIDNam <- NAFIXING(geneIDNam)
285 267
286 ##remove the whitespace 268 ##remove the whitespace
287 geneIDNam <- t(rbind(str_trim(t(geneIDNam)[1,]),str_trim(t(geneIDNam)[2,]))) 269 geneIDNam <- t(rbind(str_trim(t(geneIDNam)[1,]),str_trim(t(geneIDNam)[2,])))
288 270
289 ##Here is the clean version 271 ##Here is the clean version
290 write.table(geneIDNam,file = paste0("Clean_GPL",gplnum,".txt"),sep = "\t",row.names = FALSE, col.names = FALSE) 272 write.table(geneIDNam,file = paste0("Clean_GPL",gplnum,".txt"),sep = "\t",row.names = FALSE, col.names = FALSE)
291 } 273 }
292 274
293 275
294 276
295 ##Changing the gene ID to gene name 277 ##Changing the gene ID to gene name
296 ALZDAT1 <- cgeneID(t(geneIDNam),t(alzdat)) 278 ALZDAT1 <- cgeneID(t(geneIDNam),t(alzdat))
297 colnames(ALZDAT) = ALZDAT1[1,] 279 colnames(ALZDAT) = ALZDAT1[1,]
298 280
299 281
300 ##Adjusting the column names aka the gene names 282 ##Adjusting the column names aka the gene names
301 colnames(ALZDAT) <- gcnames(ALZDAT) 283 colnames(ALZDAT) <- gcnames(ALZDAT)
302 284
303 285
304 #Full Data 286 #Full Data
305 Fullalzdw <- ALZDAT %>% 287 Fullalzdw <- ALZDAT %>%
306 as.data.frame() %>% 288 as.data.frame() %>%
307 cbind(ALZWORDF,.) 289 cbind(ALZWORDF,.)
308 290
309 291
310 #nfna <- strsplit(alz,"[\\|/]") %>% 292 #nfna <- strsplit(alz,"[\\|/]") %>%
311 # .[[1]] %>% 293 # .[[1]] %>%
312 # .[length(.)] %>% 294 # .[length(.)] %>%
313 # gsub("\\D","",.) %>% 295 # gsub("\\D","",.) %>%
314 # c("GSE",.,"after.txt") %>% 296 # c("GSE",.,"after.txt") %>%
315 # paste(collapse = "") 297 # paste(collapse = "")
316 #write.matrix(Fullalzdw,file = nfna,sep = "\t") 298 #write.matrix(Fullalzdw,file = nfna,sep = "\t")
317 299
318 #Perfect for excel viewing 300 #Perfect for excel viewing
319 nfnaex <- strsplit(alz,"[\\]") %>% 301 nfnaex <- strsplit(alz,"[\\]") %>%
320 .[[1]] %>% 302 .[[1]] %>%
321 .[length(.)] %>% 303 .[length(.)] %>%
322 gsub("\\D","",.) %>% 304 gsub("\\D","",.) %>%
323 c("GSE",.,"aftexcel.txt") %>% 305 c("GSE",.,"aftexcel.txt") %>%
324 paste(collapse = "") 306 paste(collapse = "")
325 write.table(t(Fullalzdw), file = nfnaex, sep = "\t") 307 write.table(t(Fullalzdw), file = nfnaex, sep = "\t")
326 308
327 309
328 310
329 311
330 312
331 313