-
Notifications
You must be signed in to change notification settings - Fork 0
/
4-sQTL_Summary_Fat_examples.r
23 lines (17 loc) · 2.07 KB
/
4-sQTL_Summary_Fat_examples.r
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
rm(list=ls());options(stringsAsFactors=FALSE)
Fat_2trpts = read.table("Fat_2trpts.txt", header=T)
Fat_res1_1 = subset(Fat_2trpts, is.na(Fat_2trpts[,"G_logP_AD"]) & !is.na(Fat_2trpts[,"T1_logP_AD"]) & !is.na(Fat_2trpts[,"T2_logP_AD"]) & Fat_2trpts[,"T1_chr"]==Fat_2trpts[,"T2_chr"]) # Find examples of antagonistic T-eQTL, which located in the same chromosome #
Fat_res1_2 = subset(Fat_2trpts, is.na(Fat_2trpts[,"G_logP_AD"]) & !is.na(Fat_2trpts[,"T1_logP_AD"]) & !is.na(Fat_2trpts[,"T2_logP_AD"]) & Fat_2trpts[,"T1_chr"]!=Fat_2trpts[,"T2_chr"]) # Find exmapes of antagonistic T-eQTL, which located in different chromosomes #
Fat_res2_1 = subset(Fat_2trpts, !is.na(Fat_2trpts[,"G_logP_AD"]) & !is.na(Fat_2trpts[,"T1_logP_AD"]) & !is.na(Fat_2trpts[,"T2_logP_AD"]) & Fat_2trpts[,"T1_chr"]==Fat_2trpts[,"T2_chr"] & Fat_2trpts[,"G_chr"]==Fat_2trpts[,"T1_chr"]) # Find examples of synergistic T-eQTL, which located in the same chromosome, and also for the G-eQTL #
Fat_res2_2 = subset(Fat_2trpts, !is.na(Fat_2trpts[,"G_logP_AD"]) & !is.na(Fat_2trpts[,"T1_logP_AD"]) & !is.na(Fat_2trpts[,"T2_logP_AD"]) & Fat_2trpts[,"T1_chr"]==Fat_2trpts[,"T2_chr"] & Fat_2trpts[,"G_chr"]!=Fat_2trpts[,"T1_chr"]) # Find examples of synergistic T-eQTL, which located in the same chromosome, but not for the G-eQTL #
Fat_res2_3 = subset(Fat_2trpts, !is.na(Fat_2trpts[,"G_logP_AD"]) & !is.na(Fat_2trpts[,"T1_logP_AD"]) & !is.na(Fat_2trpts[,"T2_logP_AD"]) & Fat_2trpts[,"T1_chr"]!=Fat_2trpts[,"T2_chr"]) # Find examples of synergistic T-eQTL, which located in different chromosomes, and could be the same as the G-eQTL #
Fat_res = rbind(Fat_res1_1[order(Fat_res1_1[,"T1_logP_AD"],decreasing=T),],
colnames(Fat_2trpts),
Fat_res1_2[order(Fat_res1_2[,"T1_logP_AD"],decreasing=T),],
colnames(Fat_2trpts),
Fat_res2_1[order(Fat_res2_1[,"G_logP_AD"],decreasing=T),],
colnames(Fat_2trpts),
Fat_res2_2[order(Fat_res2_2[,"G_logP_AD"],decreasing=T),],
colnames(Fat_2trpts),
Fat_res2_3[order(Fat_res2_3[,"G_logP_AD"],decreasing=T),])
write.table(Fat_res, file="Fat_examples.txt", row.names=F, col.name=T, quote=F)