-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlistFinder2.R
46 lines (26 loc) · 895 Bytes
/
listFinder2.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
library(readxl)
targetdata <-
read.csv("Rdatafiles/downregulatedwusgenes_cyclo.csv",
header = TRUE,
sep = ',')
targets <- targetdata[2]
targetsul <- unlist(targets)
targetEntry <- as.character(targetsul)
resultsdata <-
read_excel("Rdatafiles/coreMotifOutputDOWN_cyclo.xlsx")
results <- resultsdata[2]
resultsul <- unlist(results)
resultsEntry <- as.character(resultsul)
foundlist <-list()
notfoundlist <-list()
for(j in 1:length(targetEntry))
{
searchresult<-grep(targetEntry[j], resultsEntry)
#find target gene in Arabidopsis gene list
if (length(searchresult > 0))
foundlist<-append(foundlist,targetEntry[j])
else
notfoundlist<-append(notfoundlist,targetEntry[j])
}
lapply(foundlist, write, "foundlistdown.txt", append=TRUE, ncolumns=1000)
lapply(notfoundlist, write, "notfoundlistdown.txt", append=TRUE, ncolumns=1000)