This repository has been archived by the owner on Jul 15, 2024. It is now read-only.
forked from rbsmith896/rbsmith_bsf_paternity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCOMP_plotting.R
155 lines (117 loc) · 6.8 KB
/
COMP_plotting.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
TOPLOT <- plot1a
x <- c(2, 3, 4, 5, 10,25,50,100)
#x <- as.integer(rownames(plot2))
plot(x = x, y = TOPLOT$sire1, type = "b", ylim = c(0,1), xlim = c(2,100), log = "x",col = "red", xaxt='n',
xlab = "Sample Size (log scale)", ylab = "Proportion containing MP", main = "Proportion of samples containing MP\nEqual sire proportions")
points(x = x, y = TOPLOT$sires2, type = "b", col = "blue")
points(x = x, y = TOPLOT$sires3, type = "b", col = "green")
points(x = x, y = TOPLOT$sires4, type = "b", col = "magenta")
legend(40, .5, legend=c("2 Sires", "3 Sires", "4 Sires"),
col=c("blue","green","magenta"), lty = 1, cex=0.8)
axis(1, at=x)
TOPLOT <- plot1b
x <- c(2, 3, 4, 5, 10,25,50,100)
#x <- as.integer(rownames(plot2))
plot(x = x, y = TOPLOT$sire1, type = "b", ylim = c(0,1), xlim = c(2,100), log = "x",col = "red", xaxt='n',
xlab = "Sample Size (log scale)", ylab = "Proportion containing MP", main = "Proportion of samples containing MP\nUnequal sire proportions")
points(x = x, y = TOPLOT$sires2, type = "b", col = "blue")
points(x = x, y = TOPLOT$sires3, type = "b", col = "green")
points(x = x, y = TOPLOT$sires4, type = "b", col = "magenta")
legend(40, .5, legend=c("2 Sires", "3 Sires", "4 Sires"),
col=c("blue","green","magenta"), lty = 1, cex=0.8)
axis(1, at=x)
TOPLOT <- rbind(plot2a_ls,plot2a)
x <- c(2, 3, 4, 5, 10,25,50,100)
plot(x = x, y = TOPLOT$sires2, type = "b", ylim = c(0,1), col = "blue", log = "x", xaxt='n',
xlab = "Sample Size (log scale)", ylab = "Proportion of iterations called positive for MP",
main = "Effect of Sample Size and Sire Number on Proportion of MP Calls\nEqual Sire, Equal Allele Proportions")
points(x = x, y = TOPLOT$sire1, type = "b", col = "red")
points(x = x, y = TOPLOT$sires3, type = "b", col = "green")
points(x = x, y = TOPLOT$sires4, type = "b", col = "magenta")
abline(h = .8, col = "gray")
legend(2, .95, legend=c("1 Sire","2 Sires", "3 Sires", "4 Sires"),
col=c("red","blue","green","magenta"), lty = 1, cex=0.8)
TOPLOT <- rbind(plot2a_ls,plot2a)
x <- c(2, 3, 4, 5, 10,25,50,100)
plot(x = x, y = TOPLOT$sires2, type = "b", ylim = c(0,1), col = "blue", log = "x", xaxt='n',
xlab = "Sample Size (log scale)", ylab = "Proportion of iterations called positive for MP",
main = "Effect of Sample Size and Sire Number on Proportion of MP Calls\nEqual Sire, Equal Allele Proportions")
points(x = x, y = TOPLOT$sire1, type = "b", col = "red")
points(x = x, y = TOPLOT$sires3, type = "b", col = "green")
points(x = x, y = TOPLOT$sires4, type = "b", col = "magenta")
abline(h = .8, col = "gray")
legend(2, .95, legend=c("1 Sire","2 Sires", "3 Sires", "4 Sires"),
col=c("red","blue","green","magenta"), lty = 1, cex=0.8)
axis(1, at=x)
TOPLOT <- rbind(plot3b_smalls,plot3b)
x <- c(2, 3, 4, 5, 10,25,50,100)
plot(x = x, y = TOPLOT$sires2, type = "b", ylim = c(0,1), col = "blue", log = "x", xaxt='n',
xlab = "Sample Size (log scale)", ylab = "Proportion of iterations called positive for MP",
main = "Effect of Sample Size and Sire Number on Proportion of MP Calls\nUnequal Sire, Equal Allele Proportions")
points(x = x, y = TOPLOT$sire1, type = "b", col = "red")
points(x = x, y = TOPLOT$sires3, type = "b", col = "green")
points(x = x, y = TOPLOT$sires4, type = "b", col = "magenta")
abline(h = .8, col = "gray")
legend(2, .95, legend=c("1 Sire","2 Sires", "3 Sires", "4 Sires"),
col=c("red","blue","green","magenta"), lty = 1, cex=0.8)
axis(1, at=x)
TOPLOT <- rbind(plot3c_smalls,plot3c_bigs)
x <- c(2, 3, 4, 5, 10,25,50,100)
plot(x = x, y = TOPLOT$sires2, type = "b", ylim = c(0,1), col = "blue", log = "x", xaxt='n',
xlab = "Sample Size (log scale)", ylab = "Proportion of iterations called positive for MP",
main = "Effect of Sample Size and Sire Number on Proportion of MP Calls\nEqual Sire, Unequal Allele Proportions")
points(x = x, y = TOPLOT$sire1, type = "b", col = "red")
points(x = x, y = TOPLOT$sires3, type = "b", col = "green")
points(x = x, y = TOPLOT$sires4, type = "b", col = "magenta")
abline(h = .8, col = "gray")
legend(2, .95, legend=c("1 Sire","2 Sires", "3 Sires", "4 Sires"),
col=c("red","blue","green","magenta"), lty = 1, cex=0.8)
axis(1, at=x)
TOPLOT <- plot3d
x <- c(2, 3, 4, 5, 10,25,50,100)
plot(x = x, y = TOPLOT$sires2, type = "b", ylim = c(0,1), col = "blue", log = "x", xaxt='n',
xlab = "Sample Size (log scale)", ylab = "Proportion of iterations called positive for MP",
main = "Effect of Sample Size and Sire Number on Proportion of MP Calls\nUnequal Sire, Unequal Allele Proportions")
points(x = x, y = TOPLOT$sire1, type = "b", col = "red")
points(x = x, y = TOPLOT$sires3, type = "b", col = "green")
points(x = x, y = TOPLOT$sires4, type = "b", col = "magenta")
abline(h = .8, col = "gray")
legend(2, .95, legend=c("1 Sire","2 Sires", "3 Sires", "4 Sires"),
col=c("red","blue","green","magenta"), lty = 1, cex=0.8)
axis(1, at=x)
TOPLOT <- rbind(plot4_ls,plot4)
x <- c(1-.55, 1-.6, 1-.65, 1-.7, 1-.75, 1-.8, 1-.85, 1-.9, 1-.95, 1-.99)
plot(x = x, y = TOPLOT$sires2, type = "b", ylim = c(0,1), col = "blue", xaxt='n',
xlab = "Target Type I error in full sib calls", ylab = "Proportion of iterations called positive for MP",
main = "Effect of Relationship Coefficient Cutoff on Proportion of MP Calls")
points(x = x, y = TOPLOT$sire1, type = "b", col = "red")
points(x = x, y = TOPLOT$sires3, type = "b", col = "green")
points(x = x, y = TOPLOT$sires4, type = "b", col = "magenta")
abline(h = .8, col = "gray")
legend(.35, .4, legend=c("1 Sire","2 Sires", "3 Sires", "4 Sires"),
col=c("red","blue","green","magenta"), lty = 1, cex=0.8)
axis(1, at=x)
TOPLOT <- plot5
x <- c(2,3,4,5,6)
plot(x = x, y = TOPLOT$sires2, type = "b", ylim = c(0,1), col = "blue", xaxt='n',
xlab = "Number of Alleles per Locus", ylab = "Proportion of iterations called positive for MP",
main = "Effect of Allelic Richness on Proportion of MP Calls")
points(x = x, y = TOPLOT$sire1, type = "b", col = "red")
points(x = x, y = TOPLOT$sires3, type = "b", col = "green")
points(x = x, y = TOPLOT$sires4, type = "b", col = "magenta")
abline(h = .8, col = "gray")
legend(5.5, .5, legend=c("1 Sire","2 Sires", "3 Sires", "4 Sires"),
col=c("red","blue","green","magenta"), lty = 1, cex=0.8)
axis(1, at=x)
TOPLOT <- plot6
x <- c(5,10,15,20,25)
plot(x = x, y = TOPLOT$sires2, type = "b", ylim = c(0,1), col = "blue", xaxt='n',
xlab = "Number of Loci", ylab = "Proportion of iterations called positive for MP",
main = "Effect of Locus Number on Proportion of MP Calls")
points(x = x, y = TOPLOT$sire1, type = "b", col = "red")
points(x = x, y = TOPLOT$sires3, type = "b", col = "green")
points(x = x, y = TOPLOT$sires4, type = "b", col = "magenta")
abline(h = .8, col = "gray")
legend(22, .6, legend=c("1 Sire","2 Sires", "3 Sires", "4 Sires"),
col=c("red","blue","green","magenta"), lty = 1, cex=0.8)
axis(1, at=x)