Skip to content

Commit

Permalink
Submission commit: reformatted scripts for filename and heading consi…
Browse files Browse the repository at this point in the history
…stency, updated real data and related figures, added YAML files for all 360 models
  • Loading branch information
johnomics committed Dec 11, 2013
1 parent bdda788 commit 408593b
Show file tree
Hide file tree
Showing 294 changed files with 6,513 additions and 58,679 deletions.
9 changes: 9 additions & 0 deletions Figure_2.R
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))
Expand Down
11 changes: 6 additions & 5 deletions plot_sim_accuracy.r → Figure_3.R
100644 → 100755
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")
Expand All @@ -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))

Expand Down
Binary file added Figure_3.pdf
Binary file not shown.
12 changes: 6 additions & 6 deletions plot_ABBABABBA_pattern_loci.r → Figure_4.R
100644 → 100755
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))
Expand Down
Binary file added Figure_4.pdf
Binary file not shown.
19 changes: 10 additions & 9 deletions plot_D_and_f_by_S_WG.r → Figure_5.R
100644 → 100755
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 ###############

Expand Down Expand Up @@ -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")
Expand All @@ -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)

Expand All @@ -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))

Expand Down
Binary file added Figure_5.pdf
Binary file not shown.
Binary file modified Figure_6.pdf
Binary file not shown.
11 changes: 10 additions & 1 deletion Figure_6_S5.R
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)
Expand Down Expand Up @@ -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"))
Expand Down
9 changes: 9 additions & 0 deletions Figure_7.R
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)
Expand Down
10 changes: 10 additions & 0 deletions Figure_S1_S2.R
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)
Expand Down
9 changes: 9 additions & 0 deletions Figure_S3_S4.R
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)
Expand Down
Binary file modified Figure_S5.pdf
Binary file not shown.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 408593b

Please sign in to comment.