-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Submission commit: reformatted scripts for filename and heading consi…
…stency, updated real data and related figures, added YAML files for all 360 models
- Loading branch information
Showing
294 changed files
with
6,513 additions
and
58,679 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
#!/usr/bin/env Rscript | ||
|
||
# Figure_2.R | ||
# Generate the plots (but not the tree diagram) for Figure 2 as a PDF file | ||
|
||
# Written for "Evaluating statistics for the identification of introgressed loci" | ||
# by Simon H. Martin, John W. Davey and Chris D. Jiggins | ||
# Simon Martin: [email protected] | ||
# John Davey: [email protected] | ||
# November-December 2013 | ||
|
||
library(optparse) | ||
suppressMessages(library(ggplot2)) | ||
suppressMessages(library(reshape)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
#!/usr/bin/env Rscript | ||
# plot_sim_accuracy.r | ||
# Plot accuracy for all models with oldest split at 2MYA | ||
|
||
# Figure_3.R | ||
# Plot accuracy for all models with oldest split at 2 MYA for Figure 3 as PDF file | ||
|
||
# Written for "Evaluating statistics for the identification of introgressed loci" | ||
# by Simon H. Martin, John W. Davey and Chris D. Jiggins | ||
# John Davey: [email protected] | ||
# Simon Martin: [email protected] | ||
# John Davey: [email protected] | ||
# November-December 2013 | ||
|
||
|
||
models<-read.delim("model_files_win10000_size5000_ne1000000_2013-11-29.partition.summary.tsv") | ||
models<-read.delim("model_files_win10000_size5000.partition.summary.tsv") | ||
|
||
|
||
mf_models <- subset(models, Stat == "mfD0") | ||
|
@@ -28,7 +29,7 @@ splits <- round(seq(0.2,2,0.2),1) | |
for (i in 1:length(splits)) gradCols[i] <- rgb(1-(splits[i]/2),1-(splits[i]/2),1-(splits[i]/2),1) | ||
|
||
|
||
pdf(file = "model_accuracy_plots.pdf", width = 7, height = 10) | ||
pdf(file = "Figure_3.pdf", width = 7, height = 10) | ||
|
||
par(mfrow = c(3,2), mar = c(5.5,4,1.5,1)) | ||
|
||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
#!/usr/bin/env Rscript | ||
|
||
# plot_ABBABABA_pattern_loci.r | ||
# generate plots across BD and Yb bac walk regions - Figure 4. | ||
# Figure_4.R | ||
# Generate plots across BD and Yb bac walk regions for Figure 4 as a PDF file | ||
|
||
# Written for "Evaluating statistics for the identification of introgressed loci" | ||
# by Simon H. Martin, John W. Davey and Chris D. Jiggins | ||
# John Davey: [email protected] | ||
# Simon Martin: [email protected] | ||
# John Davey: [email protected] | ||
# November-December 2013 | ||
|
||
|
||
#input data | ||
|
||
yb <- read.csv("Yb.ABBABABA_dxy_S.minExD0.5.w5m1s1000.csv") | ||
yb <- read.csv("Heliconius_HmB_windows.csv") | ||
yb <- subset(yb, is.na(D) == F & is.na(mf) == F & sitesOverMinExD >= 1000) | ||
|
||
|
||
bd <- read.csv("BD.ABBABABA_dxy_S.minExD0.5.w5m1s1000.csv") | ||
bd <- read.csv("Heliconius_HmYb_windows.csv") | ||
bd <- subset(bd, is.na(D) == F & is.na(mf) == F & sitesOverMinExD >= 1000) | ||
|
||
pdf(file = "/home/simon/Images/ABBABABA_sim_paper/plots_acrosss_BD_Yb_filtered.pdf", width = 12, height = 7) | ||
pdf("Figure_4.pdf", width = 12, height = 7) | ||
|
||
|
||
par(mfrow = c(4,2), mar = c(2.5,2,0.5,1)) | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
#!/usr/bin/env Rscript | ||
|
||
# plot_D_and_f_by_S.r | ||
# Plots for whole genome Heliconius data - Figure 5 | ||
# Figure_5.R | ||
# Plots for whole genome Heliconius data for Figure 5 as a PDF file | ||
|
||
# Written for "Evaluating statistics for the identification of introgressed loci" | ||
# by Simon H. Martin, John W. Davey and Chris D. Jiggins | ||
# John Davey: [email protected] | ||
# Simon Martin: [email protected] | ||
# John Davey: [email protected] | ||
# November-December 2013 | ||
|
||
|
||
# This script requires the file Hmel1-1_hox_RAD_matepair_chromosomes_Zupdated.agp | ||
# Available in Data Dryad repository http://datadryad.org/resource/doi:10.5061/dryad.dk712 | ||
|
||
############## Functions ############### | ||
|
||
|
@@ -53,7 +54,8 @@ as.chromosomes <- function(table,agp,chromNames,gap = 0) { | |
|
||
########### input data ################ | ||
|
||
#agp file carrys chromosome information for mapped scaffolds | ||
# agp file carries chromosome information for mapped scaffolds | ||
# Available in Data Dryad repository http://datadryad.org/resource/doi:10.5061/dryad.dk712 | ||
agp <- read.delim("Hmel1-1_hox_RAD_matepair_chromosomes_Zupdated.agp", as.is = T, sep = "\t", header = F) | ||
|
||
names(agp) = c("chromosome", "start", "end", "order", "DN", "scaffold", "one", "length", "ori", "rec") | ||
|
@@ -65,11 +67,10 @@ chromNames <- c("chr1","chr2","chr3","chr4","chr5","chr6","chr7","chr8","chr9"," | |
|
||
#input data | ||
|
||
ABBA_table <- read.csv("set31.Zupdated.autoscafs.union.SPiDxyDf.w5m1s5.csv", as.is = T) | ||
ABBA_table_Z <- read.csv("set31.Zupdated.chrZscafs.union.SPiDxyDf.w5m1s5.csv", as.is = T) | ||
ABBA_table <- read.csv("Heliconius_autosome_windows.csv", as.is = T) | ||
ABBA_table_Z <- read.csv("Heliconius_Zchromosome_windows.csv", as.is = T) | ||
ABBA_table <- rbind(ABBA_table, ABBA_table_Z) | ||
|
||
|
||
#filter for windows with enough sites above the minimum data cutoff | ||
ABBA_table <- subset(ABBA_table, sitesOverMinExD >= 1000) | ||
|
||
|
@@ -84,7 +85,7 @@ bdsub <- subset(ABBA_table, scaffold == "HE670865" & position >= 300000 & positi | |
###### plotting D and f against number of segregating sites | ||
|
||
|
||
pdf(file = "D_and_f_against_s.pdf", width = 3.3, height = 9.5) | ||
pdf(file = "Figure_5.pdf", width = 3.3, height = 9.5) | ||
|
||
par(mfrow = c(3,1), mar = c(3,3,1,1)) | ||
|
||
|
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
#!/usr/bin/env Rscript | ||
|
||
# Figure_6_S5.R | ||
# Generate the plots for Figure 6 and Figure S5 as PDF files | ||
|
||
# Written for "Evaluating statistics for the identification of introgressed loci" | ||
# by Simon H. Martin, John W. Davey and Chris D. Jiggins | ||
# Simon Martin: [email protected] | ||
# John Davey: [email protected] | ||
# November-December 2013 | ||
|
||
suppressMessages(library(ggplot2)) | ||
suppressMessages(library(reshape)) | ||
library(plyr) | ||
|
@@ -143,7 +152,7 @@ grid.text("D",x=0.025,y=0.99,just=c("left","top"),vp=viewport(layout.pos.row=2,l | |
dev.off() | ||
|
||
# Figure S5 - real data | ||
real<-read.delim("Heliconius_genome_windows.dxy.summary.tsv",stringsAsFactors=FALSE) | ||
real<-read.delim("Heliconius_autosome_windows.dxy.summary.tsv",stringsAsFactors=FALSE) | ||
|
||
real.dxy<-get.dxy.df(real) | ||
real.dxy$Stat<-factor(real.dxy$Stat,levels=c("D","mfD0")) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
#!/usr/bin/env Rscript | ||
|
||
# Figure_7.R | ||
# Generate the plot for Figure 7 as a PDF file | ||
|
||
# Written for "Evaluating statistics for the identification of introgressed loci" | ||
# by Simon H. Martin, John W. Davey and Chris D. Jiggins | ||
# Simon Martin: [email protected] | ||
# John Davey: [email protected] | ||
# November-December 2013 | ||
|
||
library(optparse) | ||
suppressMessages(library(ggplot2)) | ||
library(plyr) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
#!/usr/bin/env Rscript | ||
|
||
# Figure_S1_S2.R | ||
# Generate the plots for Figures S1 and S2 as PDF files | ||
|
||
# Written for "Evaluating statistics for the identification of introgressed loci" | ||
# by Simon H. Martin, John W. Davey and Chris D. Jiggins | ||
# Simon Martin: [email protected] | ||
# John Davey: [email protected] | ||
# November-December 2013 | ||
|
||
|
||
library(optparse) | ||
suppressMessages(library(ggplot2)) | ||
library(plyr) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
#!/usr/bin/env Rscript | ||
|
||
# Figure_S3_S4.R | ||
# Generate the plots for Figures S3 and S4 as PDF files | ||
|
||
# Written for "Evaluating statistics for the identification of introgressed loci" | ||
# by Simon H. Martin, John W. Davey and Chris D. Jiggins | ||
# Simon Martin: [email protected] | ||
# John Davey: [email protected] | ||
# November-December 2013 | ||
|
||
suppressMessages(library(ggplot2)) | ||
suppressMessages(library(reshape)) | ||
library(plyr) | ||
|
Binary file not shown.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.