-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtraitinput.R
55 lines (51 loc) · 2.04 KB
/
traitinput.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
###PFC
traitData = read.csv("Ethanol BXD phenotypes_tester.csv",header=TRUE, sep=",");
dim(traitData)
names(traitData)
# remove columns that hold information we do not need.
allTraits = traitData[, -c(2)];
dim(allTraits)
names(allTraits)
# Form a data frame analogous to expression data that will hold the clinical traits.
pfcSamples = rownames(datExpr_0);
strains= allTraits$Strain
traitRows0 = match(pfcSamples, strains);
datTraits0 = allTraits[traitRows0, -1];
rownames(datTraits0) = allTraits[traitRows0, 1];
save(datExpr_0, datTraits0, file = "PFC_Anxiety_dataInput.RData")
#--------------------------------------------------------
##NAC
traitData = read.csv("Ethanol BXD phenotypes_tester.csv",header=TRUE, sep=",");
dim(traitData)
names(traitData)
# remove columns that hold information we do not need.
allTraits = traitData[, -c(2)];
dim(allTraits)
names(allTraits)
# Form a data frame analogous to expression data that will hold the clinical traits.
datExpr_1_corr=datExpr_1[-c(27,30), ]
##datExpr_1_corr=datExpr_1[-c(19,22), ]
nacSamples = rownames(datExpr_1_corr);
strains= allTraits$Strain
traitRows1 = match(nacSamples, strains);
datTraits1 = allTraits[traitRows1, -1];
rownames(datTraits1) = allTraits[traitRows1, 1];
save(datExpr_1, datTraits1, file = "NAC_Anxiety_dataInput.RData")
##------------------------------------------------------
##VTA
traitData = read.csv("Ethanol BXD phenotypes_tester.csv",header=TRUE, sep=",");
dim(traitData)
names(traitData)
# remove columns that hold information we do not need.
allTraits = traitData[, -c(2)];
dim(allTraits)
names(allTraits)
# Form a data frame analogous to expression data that will hold the clinical traits.
datExpr_2_corr=datExpr_2[-c(27,30), ]
nacSamples = rownames(datExpr_2_corr);
strains= allTraits$Strain
traitRows2 = match(nacSamples, strains);
datTraits2 = allTraits[traitRows2, -1];
rownames(datTraits2) = allTraits[traitRows2, 1];
save(datExpr_2, datTraits2, file = "VTA_Anxiety_dataInput.RData")
##------------------------------------------------------