Commit 8953eaff1bf653b09805a78ffb84c4aa0b4699e7
1 parent
6a58f94d23
Exists in
master
Don't use this code
changed more ifs to else ifs
Showing
1 changed file
with
11 additions
and
11 deletions
 
Show diff stats
RAutoClDs.R
| ... | ... | @@ -235,7 +235,7 @@ THEFT <- function(){ | 
| 235 | 235 | read_delim(delim="\t",col_names = c("ID","Symbol"), comment = "!") | 
| 236 | 236 | |
| 237 | 237 | } | 
| 238 | - if(clfileex == 0){ | |
| 238 | + else if(clfileex == 0){ | |
| 239 | 239 | ##Lets Create a clean version | 
| 240 | 240 | |
| 241 | 241 | ##Gene ID to Gene Name | 
| ... | ... | @@ -259,7 +259,7 @@ THEFT <- function(){ | 
| 259 | 259 | read_delim(delim="\t",col_names = TRUE, comment = "!", skip = idlocgpl) %>% | 
| 260 | 260 | dplyr::select(.,ID,grep("Symbol|^ORF\\s*$|^gene_assignment\\s*$",colnames(.))) | 
| 261 | 261 | } | 
| 262 | - if(IDF == 0){ | |
| 262 | + else if(IDF == 0){ | |
| 263 | 263 | #No information on this particular GPL file | 
| 264 | 264 | idLOCGPL <- genena %>% | 
| 265 | 265 | read_delim(delim="\t",col_names = FALSE, comment = "!", n_max = 1000) %>% | 
| ... | ... | @@ -273,7 +273,7 @@ THEFT <- function(){ | 
| 273 | 273 | dplyr::select(.,ID,grep("Symbol|^ORF\\s*$|^gene_assignment\\s*$",colnames(.))) | 
| 274 | 274 | } | 
| 275 | 275 | } | 
| 276 | - if(fileex == 0){ | |
| 276 | + else if(fileex == 0){ | |
| 277 | 277 | #We must create a file that we can access for later use | 
| 278 | 278 | idLOCGPL <- genena %>% | 
| 279 | 279 | read_delim(delim="\t",col_names = FALSE, comment = "!", n_max = 1000) %>% | 
| ... | ... | @@ -288,7 +288,7 @@ THEFT <- function(){ | 
| 288 | 288 | dplyr::select(.,ID,grep("Symbol|^ORF\\s*$|^gene_assignment\\s*$",colnames(.))) | 
| 289 | 289 | } | 
| 290 | 290 | } | 
| 291 | - if(soft == FALSE){ | |
| 291 | + else if(soft == FALSE){ | |
| 292 | 292 | geneIDNam <- genena %>% | 
| 293 | 293 | read_delim(delim="\t",comment = "#")%>% | 
| 294 | 294 | dplyr::select(.,ID,grep("Symbol|^ORF\\s*$|^gene_assignment\\s*$",colnames(.))) | 
| ... | ... | @@ -391,7 +391,7 @@ THEFT <- function(){ | 
| 391 | 391 | NuRDATN[,j] <- RAWDATNUM[,which(RAWDATID==rownames(tabRDATID)[j])] | 
| 392 | 392 | } | 
| 393 | 393 | ##Averaging duplicates and putting them in their new homes | 
| 394 | - if(tabRDATID[j] > 1){ | |
| 394 | + else if(tabRDATID[j] > 1){ | |
| 395 | 395 | NuRDATN[,j] <- rowMeans(RAWDATNUM[,which(RAWDATID==rownames(tabRDATID)[j])],na.rm = TRUE) | 
| 396 | 396 | } | 
| 397 | 397 | j <- j + 1 | 
| ... | ... | @@ -461,7 +461,7 @@ THEFT <- function(){ | 
| 461 | 461 | } | 
| 462 | 462 | |
| 463 | 463 | #CHOOSE A DATA FILE TO CLEAN OR SEVERAL DATA FILES TO CLEAN | 
| 464 | - if(numDAT == 2){ | |
| 464 | + else if(numDAT == 2){ | |
| 465 | 465 | #All the files you want to analyze | 
| 466 | 466 | ANDIS <- select.list(choices = list.files()[GSEfileloc],multiple = TRUE, title = "Choose the file/files you want to analyze:") | 
| 467 | 467 | if(length(ANDIS) == 0){ | 
| ... | ... | @@ -524,7 +524,7 @@ THEFT <- function(){ | 
| 524 | 524 | read_delim(delim="\t",col_names = c("ID","Symbol"), comment = "!") | 
| 525 | 525 | |
| 526 | 526 | } | 
| 527 | - if(clfileex == 0){ | |
| 527 | + else if(clfileex == 0){ | |
| 528 | 528 | ##Lets Create a clean version | 
| 529 | 529 | |
| 530 | 530 | ##Gene ID to Gene Name | 
| ... | ... | @@ -548,7 +548,7 @@ THEFT <- function(){ | 
| 548 | 548 | read_delim(delim="\t",col_names = TRUE, comment = "!", skip = idlocgpl) %>% | 
| 549 | 549 | dplyr::select(.,ID,grep("Symbol|^ORF\\s*$|^gene_assignment\\s*$",colnames(.))) | 
| 550 | 550 | } | 
| 551 | - if(IDF == 0){ | |
| 551 | + else if(IDF == 0){ | |
| 552 | 552 | #No information on this particular GPL file | 
| 553 | 553 | idLOCGPL <- genena %>% | 
| 554 | 554 | read_delim(delim="\t",col_names = FALSE, comment = "!", n_max = 1000) %>% | 
| ... | ... | @@ -562,7 +562,7 @@ THEFT <- function(){ | 
| 562 | 562 | dplyr::select(.,ID,grep("Symbol|^ORF\\s*$|^gene_assignment\\s*$",colnames(.))) | 
| 563 | 563 | } | 
| 564 | 564 | } | 
| 565 | - if(fileex == 0){ | |
| 565 | + else if(fileex == 0){ | |
| 566 | 566 | #We must create a file that we can access for later use | 
| 567 | 567 | idLOCGPL <- genena %>% | 
| 568 | 568 | read_delim(delim="\t",col_names = FALSE, comment = "!", n_max = 1000) %>% | 
| ... | ... | @@ -577,7 +577,7 @@ THEFT <- function(){ | 
| 577 | 577 | dplyr::select(.,ID,grep("Symbol|^ORF\\s*$|^gene_assignment\\s*$",colnames(.))) | 
| 578 | 578 | } | 
| 579 | 579 | } | 
| 580 | - if(soft == FALSE){ | |
| 580 | + else if(soft == FALSE){ | |
| 581 | 581 | geneIDNam <- genena %>% | 
| 582 | 582 | read_delim(delim="\t",comment = "#")%>% | 
| 583 | 583 | dplyr::select(.,ID,grep("Symbol|^ORF\\s*$|^gene_assignment\\s*$",colnames(.))) | 
| ... | ... | @@ -680,7 +680,7 @@ THEFT <- function(){ | 
| 680 | 680 | NuRDATN[,j] <- RAWDATNUM[,which(RAWDATID==rownames(tabRDATID)[j])] | 
| 681 | 681 | } | 
| 682 | 682 | ##Averaging duplicates and putting them in their new homes | 
| 683 | - if(tabRDATID[j] > 1){ | |
| 683 | + else if(tabRDATID[j] > 1){ | |
| 684 | 684 | NuRDATN[,j] <- rowMeans(RAWDATNUM[,which(RAWDATID==rownames(tabRDATID)[j])],na.rm = TRUE) | 
| 685 | 685 | } | 
| 686 | 686 | j <- j + 1 |