Skip to content

Commit

Permalink
remove constants and expose run parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
tlnagy committed May 3, 2016
1 parent 4d72dab commit b14990c
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions src/run.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,35 @@ include("selection.jl")
include("sequencing.jl")
include("analysis.jl")

const N = 500 # number of target genes
const coverage = 5 # number of guides per gene
const representation = 1000 # Number of cells with each guide
const moi = 0.25 # multiplicity of infection
const σ = 1.0 # std dev expected for cells during facs sorting (in phenotype units)

function run_exp()

guides, guide_freqs = construct_library(N, coverage)

cell_count = N*coverage*representation
N = 500 # number of target genes
coverage = 5 # number of guides per gene
representation = 100 # Number of cells with each guide
moi = 0.25 # multiplicity of infection
σ = 1.0 # std dev expected for cells during facs sorting (in phenotype units)
bin_info = Dict(:bin1 => (0.0, 1/3), :bin2 => (2/3, 1.0))

function run_facs_crispri(num_genes::Int64,
coverage::Int64,
representation::Int64,
moi::Float64,
σ::Float64,
bin_info::Dict{Symbol, Tuple{Float64, Float64}})

guides, guide_freqs = construct_library(num_genes, coverage)

cell_count = num_genes*coverage*representation
guide_freqs_dist = Categorical(guide_freqs)

cells = transfect(guides, guide_freqs_dist, cell_count, moi)

bin_info = Dict(:bin1 => (0.0, 1/3), :bin2 => (2/3, 1.0))
bin_cells = facs_sort(cells, guides, bin_info, σ)

freqs = counts_to_freqs(bin_cells)
raw_data = sequencing(Dict(:bin1=>10^7,:bin2=>10^7), guides, freqs)

auroc = analyze(raw_data, gen_plots=false)
auroc = analyze(raw_data, gen_plots=true)

auroc
end

@time run_exp()
auroc = run_facs_crispri(N, coverage, representation, moi, σ, bin_info)

0 comments on commit b14990c

Please sign in to comment.