Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-zero WT behavior subtly breaks guide quality model #65

Open
tlnagy opened this issue Jul 17, 2023 · 0 comments
Open

Non-zero WT behavior subtly breaks guide quality model #65

tlnagy opened this issue Jul 17, 2023 · 0 comments

Comments

@tlnagy
Copy link
Owner

tlnagy commented Jul 17, 2023

An email from a user, made me think of a potential edge case bug that could happen. Setting the "inactive/WT" phenotype to something other than 0 might lead to subtly incorrect behavior elsewhere. For example, the guide quality model assumes that 0 is the inactive phenotype:

julia> using Crispulator

julia> facs = FacsScreen();

julia> facs.num_genes = 1;

julia> max_phenotype_dists = Dict{Symbol, Tuple{Float64, Sampleable}}(:inactive => (1.0, Delta(-0.25)))
Dict{Symbol, Tuple{Float64, Sampleable}} with 1 entry:
  :inactive => (1.0, Delta(-0.25))

julia> lib = Library(max_phenotype_dists, CRISPRn());

julia> lib.knockdown_probs.p .= [0.5, 0.5] # high fraction of "low quality" guides
2-element Vector{Float64}:
 0.5
 0.5

julia> construct_library(facs, lib)[1]
25-element Vector{Crispulator.Barcode}:
 Crispulator.Barcode(1, 1.0, -0.25, NaN, :linear, :inactive, -Inf)
 Crispulator.Barcode(1, 1.0, -0.25, NaN, :linear, :inactive, -Inf)
 Crispulator.Barcode(1, 0.03168858098146547, -0.007922145245366368, NaN, :linear, :inactive, -Inf)
 Crispulator.Barcode(1, 1.0, -0.25, NaN, :linear, :inactive, -Inf)
 Crispulator.Barcode(1, 1.0, -0.25, NaN, :linear, :inactive, -Inf)

Guide 3 is a low quality guide, but theoretical phenotype is "better" because it is close to 0 instead of -0.25 like expected. The proper fix is to make "low quality" guide to behave like the inactive/WT class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant