Closed thienktran closed 1 year ago
@thienktran: looks good!
One question: above you said "Synonymous mutations don't require updates to the nucleotide sequence". This isn't correct as synonymous mutations do require updating the nucleotide sequence. Though, they do not require updating the virus's location in antigenic space. Just wanted to make sure that synonymous mutations are still changing the virus's sequence in context of the updates you made. Thanks!
That's a really good catch, @Haddox!! I will move the code that updates the nucleotide sequence up, so that both returns are accurate. Thank you for catching that!
Edit: It's been fixed now!
Thanks Thien!
@Haddox Yes, I was able to fix it! When predefinedVectors: false
, I forgot to update the location from the current position. Changing this gave me the same results as what we saw earlier.
Great! Sounds good.
Description
I created an inner class called
MutationVector
inBiology.java
, becauseMutationVector
instead of adouble[]
.double[]
requires us to remember how attributes are arbitrarily indexed.mutA
andmutB
, so having fields namedtheta
andr
keeps things more organized.MutationVector
containscalculateMutation()
, a function that computes how a mutation affects the location of a virus in antigenic space. This function is used to create predefined vectors inBiology.java
or each timemutate()
is called.predefinedVectors
is a new parameter that determines if the simulation should use random or predefined mutation vectors. It is used by a conditional statement inmutate()
to determine if a vector can be retrieved or has to be freshly computed.Lastly, I rearranged the order of some logic in
mutate()
. Synonymous mutations don't require updates to the nucleotide sequence, so that means we can return early and save ourselves some unnecessary computations. The virus doesn't move in antigenic space, so there is no need to calculate or determine the mutation vector.Tests
In addition to running the tests from #17 when
predefinedVectors: true
andpredefinedVectors: false
, I created a PrintStream variable to create a CSV file of vectors randomly calculated to represent antigenic effect of mutations in epitope sites for a single simulation. Using 'testGammaDistribution.py', we get:Here is what happens if vectors in non-epitope sites are included in the CSV:
(The orange line is the distribution used in the original Antigen and is used for reference).
The parameters used when
predefinedVectors: false
can be found in this commit's parameters.yml. I can only simulate up to 1000 days before running out of memory, so the trees produced aren't very informative.Checklist:
#278
) has been searched for in the code to find relevant notes