Code Monkey home page Code Monkey logo

cavefish2017's Introduction

Cavefish2017

Scripts and data from "The Importance of Selection in the Evolution of Blindness in Cavefish"

DOI

Cavefish.nb

Mathematica notebook verifying the analysis of our deterministic model.

Figures

This directory contains R scripts used to analyze the model in the paper and create descriptive figures.

Simulations

This directory contains R and Python scripts for finite-population simulations. The scripts contain comments describing their function and usage.

Data

This directory contains summarized results of the finite-population simulations.

KAlleles

This directory contains summarized results of the k-allele simulations after 10,000 generations. The following statistics are reported:

  • q: average cave-adaptive allele frequency
  • a: average fitness in the population
  • f: average phenotype in the population
  • l: average genetic load in the population

Each file contains a table in which the each cell corresponds to a specific migration (row) x selection (column) parameter set. Row labels and column labels are in quotes. Each cell is the average of 100 simulations. The file names contain both the population size (n=1000), the number of loci (k = 1,2,4,6,12), and the statistic reported.

The following code was used to generated the summary files from the simulation output.

library(data.table)
library(reshape2)

# Read the simulation results, which are really, really big
d = fread("/tmp/k-allele-sim.csv")

# For each k, extract the results from generation 10000
# For each statistic, construct a migration x selection table.
# Save results
for(kk in c(1,2,4,6,12)) {
	a = subset(d, k == kk & g == 10000)
	for(v in c("q","a","f","l")) {
		qq = acast(a,m~s,value.var=v,mean)
		fn = sprintf("drift-n1000-k%02d-%s.txt",kk,v)
		write.table(qq,fn)
	}
}

n1000

This directory contains summarized results of the single-allele drift simulations with n = 1000. Allele frequencies were recorded after 2500, 5000, 7500, and 10000 generations (when simulations were run for a total of 10000 generations), or after 1,250,000, 2,500,000, 3,500,000, and 5,000,000 generations (when simulations were run for a total of 5,000,000 generations). Each file is named with the number of generations. Files labeled with mk are results from simulations where the connection between the surface and cave populations was intermittant, with the probability of switching between connected and disconnected is 0.1 and is a markov process. The statistics are reported as described above.

The following code was used to generate the summary files for fully connect population from the simulation output. Other outputs were similarly generated.

library(reshape2)
a <- read.csv("drift_sims_log_connected_u6.csv")
qq = acast(a,m~s,value.var="q1",mean)
write.table(qq,"drift-2500.txt")
qq = acast(a,m~s,value.var="q2",mean)
write.table(qq,"drift-5000.txt")
qq = acast(a,m~s,value.var="q3",mean)
write.table(qq,"drift-7500.txt")
qq = acast(a,m~s,value.var="q",mean)
write.table(qq,"drift-10000.txt")

n100

This directory contains summarized results of the single-allele drift simulations as described above, but with n = 100.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.