forked from m-moni/COVID-19
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInnerJoint.R
66 lines (42 loc) · 1.66 KB
/
InnerJoint.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
setwd("~/Documents/Well_Come_Trust_Project/Rotterdam/GEFOS/Result")
snpsList<-read.delim("SNP_Gene_10+16Gene_1MB_up_down_stream_WCT_sorted.txt", header=TRUE, sep="\t", strip.white=TRUE)
head(snpsList)
dim(snpsList)
Gefos<-read.delim("Homologus.txt", header=TRUE, sep="\t", strip.white=TRUE)
MergesnpsList <- merge(snpsList,Gefos,by="Region")
head(MergesnpsList)
dim(MergesnpsList)
write.table(MergesnpsList, "MergesnpsList.txt", sep="\t", row.names = F)
#Gefos<-read.delim("AOGC_only_chr.ALL.assoc", header=TRUE, sep="",, strip.white=TRUE)
#head(Gefos)
#dim(Gefos)
Gefos<-read.delim("GEFOS2.FNBMD.MEN.GC.txt", header=TRUE, sep="\t",, strip.white=TRUE)
Gefos<-read.delim("GEFOS2.FNBMD.WOMEN.GC.txt", header=TRUE, sep="")
Gefos<-read.delim("GEFOS2.FNBMD.POOLED.GC.txt", header=TRUE, sep="")
head(Gefos)
dim(Gefos)
colnames(Gefos)[1]<-"SNP"
#class(Gefos)
#snpsList<-MergesnpsList
snpsList<-Gene_250KB
head(snpsList)
##InnerJoin
Merge <- merge(snpsList,Gefos,by="SNP")
head(Merge)
dim(Merge)
write.table(Merge, "GEFOS2.FNBMD.MEN.GC_10+16Gene_250KB_up_down_stream_WCT_sorted.txt", sep="\t", row.names = F)
require(graphics)
x<-p.adjust(p=Gefos$P.value, method = "bonferroni", n = length(Gefos$P.value))
head(x)
x
.............
#############
#PName<-read.delim("mmuPathIdPathName.txt", header=TRUE, sep="\t",, strip.white=TRUE)
#Merge <- merge(PName,data,by="pathwayId..mmu00010.")
#head(Merge)
tab5rows <- read.table("snp142.txt", sep="\t", nrows = 10, ncolumns = 10)
classes <- sapply(tab5rows, class)
tabAll <- read.table("snp142.txt", , colClasses = classes)
df <- read.table(pipe("cut -f1,2,3,4,5 snp142.txt"))
head(df)
write.table(df, "Allsnp152.txt", sep="\t", row.names = F)