matsengrp / antigen

Simulating virus evolution and epidemiology
http://bedford.io/projects/antigen/
1 stars 0 forks source link

Added different cross immunity functions to SequencePhenotype #13

Closed thienktran closed 2 years ago

thienktran commented 2 years ago

Description

Updated riskOfInfection() in SequencePhenotype.java. There are 3 options for crossImmunityFunction

The function used to calculate the return value of riskOfInfection() can be changed by updating crossImmunityFunction in parameters.yml.

Closes #3

Tests

Added testRiskOfInfection() to TestSequencePhenotype.java, which passes for all the options of crossImmunityFunction.

Edge cases we tested:

We compared sequences that

  • resulted intestRiskOfInfection() returning 0
  • shared the same base in half the indices
    • hamming distance == 0.5 * this.sequence.length())
  • were completely different
    • hamming distance == this.sequence.length()

The main use was tested as well.

Checklist:

(Sorry about all the whitespace. I'm trying to work it out, but IntelliJ isn't cooperating right now)

huddlej commented 2 years ago

Regarding whitespace, you can hide these changes in the GitHub diffs now:

image