Skip to content

Commit 5a1feb7

Browse files
committed
Update r_makeFigsGenetics.R
1 parent fcf094c commit 5a1feb7

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

R/r_makeFigsGenetics.R

+17-9
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ par(mar=c(5,6,4,1)+.1) #fix left cutoff
3838
#par(mar=c(7,6,6,1)+.1) #added some bottom and top to fit long y axis title (not working)
3939
barplot(test_vals,xlab = "Migration Rate", ylab="Introgression Detected (# Data Sets)",cex.axis=1.7,cex.names=1.2,cex.lab=2.2)
4040
dev.off()
41+
test_vals # for excel plotting
4142

4243

4344
###
@@ -116,10 +117,13 @@ myPlot <- ggerrorplot(values, x = "Statistic", y = "D.or.p.Value", ylab = "Dgen
116117
ggsave(filename=paste(paperPath,"fig_fig7b.pdf",sep=""), plot=myPlot)
117118

118119

120+
121+
119122
###
120-
# wabi fig 7 NEW S3 EMBEDDING SCENARIO updated dgen
123+
# wabi fig 7c updated dgen
121124
###
122-
fileToRead = paste(figsPath,"fig7b/fig_fig7b.txt",sep="")
125+
126+
fileToRead = paste(figsPath,"fig7/fig_fig7.txt",sep="")
123127
test_values = read.csv(fileToRead, header=TRUE)
124128

125129
#do a lil renaming
@@ -129,18 +133,18 @@ test_values[,2] = gsub("Dstat", "D-statistic", test_values[,2])
129133
test_valuesBars = aggregate(as.integer(trimws(test_values$Significant)=="TRUE"), by=list(test_values$Statistic), FUN=sum)
130134
test_vals <- test_valuesBars$x
131135
names(test_vals) <- test_valuesBars$Group.1
132-
pdf(paste(paperPath,"fig_fig7cNewNetWithS3.pdf",sep=""))
136+
pdf(paste(paperPath,"fig_fig7c.pdf",sep=""))
133137
par(mar=c(5,6,4,1)+.1) #fix left cutoff
134138
barplot(test_vals,xlab = "Statistic Type", ylab="Number Of Significant p Values",cex.axis=1.7,cex.names=1.2,cex.lab=2.2)
135-
#, ylim=c(0,20)
136139
dev.off()
140+
test_vals #to make excel
141+
137142

138143

139144
###
140-
# wabi fig 7c updated dgen
145+
# wabi fig 7 NEW S3 EMBEDDING SCENARIO updated dgen
141146
###
142-
143-
fileToRead = paste(figsPath,"fig7/fig_fig7.txt",sep="")
147+
fileToRead = paste(figsPath,"fig7b/fig_fig7b.txt",sep="")
144148
test_values = read.csv(fileToRead, header=TRUE)
145149

146150
#do a lil renaming
@@ -150,10 +154,14 @@ test_values[,2] = gsub("Dstat", "D-statistic", test_values[,2])
150154
test_valuesBars = aggregate(as.integer(trimws(test_values$Significant)=="TRUE"), by=list(test_values$Statistic), FUN=sum)
151155
test_vals <- test_valuesBars$x
152156
names(test_vals) <- test_valuesBars$Group.1
153-
pdf(paste(paperPath,"fig_fig7c.pdf",sep=""))
157+
pdf(paste(paperPath,"fig_fig7cNewNetWithS3.pdf",sep=""))
154158
par(mar=c(5,6,4,1)+.1) #fix left cutoff
155-
barplot(test_vals,xlab = "Statistic Type", ylab="Number Of Significant p Values",cex.axis=1.7,cex.names=1.2,cex.lab=2.2)
159+
#barplot(test_vals,xlab = "Statistic Type", ylab="Number Of Significant p Values",cex.axis=1.7,cex.names=1.2,cex.lab=2.2)
160+
barplot(test_vals,xlab = "Statistic Type", ylab="Number Of Significant p Values",cex.axis=1.7,cex.names=1.2,cex.lab=2.2, ylim=c(0,20))
156161
dev.off()
162+
test_vals #to make excel
163+
164+
157165

158166

159167
####

0 commit comments

Comments
 (0)