-
Notifications
You must be signed in to change notification settings - Fork 3
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
Tutorial error: KeyError
when calling: assign_migration!
#11
Comments
From _fill_migration_array!(
initial_migration,
migration_data,
gene_to_index_migration_matrix,
stage_to_index_migration_matrix,
network.locations_key_map,
) is the last executed line in the function. I go to this function which relies on const life_stage_key_map =
Dict("Egg" => Egg, "Larva" => Larva, "Pupa" => Pupa, "Male" => Male, "Female" => Female)
const genetics_key_map = Dict(
"WW" => WW,
"ww" => ww,
# end Wolbachia
"HH" => HH,
"Hh" => Hh,
"HR" => HR,
"hh" => hh,
"hR" => hR,
"RR" => RR,
# end single-locus homing gene drive (HGD/MCR)
"WR" => WR,
# end RIDL (total = WW, WR, RR)
"AA" => AA,
"Aa" => Aa,
"aa" => aa,
# end Mendelian
) these are in Specifically, function _fill_migration_array!(
initial_migration,
migration_data,
gene_to_index_migration_matrix,
stage_to_index_migration_matrix,
locations_key_map,
)
for (life_gene_key, migration_matrix) in migration_data
stage, gene = life_gene_key
stage_index = stage_to_index_migration_matrix[life_stage_key_map[stage]]
gene_index = gene_to_index_migration_matrix[genetics_key_map[gene]]
for ix in stage_index
mat = initial_migration[ix, gene_index]
for (from_to_nodes, move_rate) in migration_matrix
from_node, to_node = from_to_nodes
from_index = locations_key_map[from_node]
to_index = locations_key_map[to_node]
mat[from_index, to_index] = move_rate
end
for i in 1:size(mat)[1]
mat[i, i] = -sum(mat[i, :])
end
end
end
end These two lines are indexed by stage and gene. The error occurs from stage_index = stage_to_index_migration_matrix[life_stage_key_map[stage]]
gene_index = gene_to_index_migration_matrix[genetics_key_map[gene]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
These commands run fine.
Then:
Gives this error
I am running on
And I have
GeneDrive.jl
version:GeneDrive v0.1.0
The text was updated successfully, but these errors were encountered: