simplicity.phenotype package

Submodules

simplicity.phenotype.consensus module

simplicity.phenotype.consensus.build_weighted_consensus_matrix(data)[source]
Parameters:

data (TYPE) – DESCRIPTION.

Returns:

  • matrix (TYPE) – DESCRIPTION.

  • bases (TYPE) – DESCRIPTION.

  • unique_positions (TYPE) – DESCRIPTION.

simplicity.phenotype.consensus.get_consensus(data, t)[source]
simplicity.phenotype.consensus.get_seq_weights(data, t_sim)[source]

preprocess lineage data to calculate weighted consensus. calculate weight for sequence at time t_sim

Parameters:
  • data (list) – list of list containing lineages data. data contains lineage_name, sequence, n_infected_t, t

  • t_sim (float) – time of the simulation at which we evalute the weights.

Returns:

seq_for_consensus – [sequence, #_infected_t, w_t(t_sim)].

Return type:

list

simplicity.phenotype.consensus.weighted_consensus(matrix, positions)[source]

calculate the weighted consensus sequence between individuals in the population

simplicity.phenotype.distance module

Here there are the functions we use to calculate the hamming distance for the phenotype model. Please consider that they are adapted to the data sctructure we use to store genomic data (we only store the positions and mutations that are

different from the reference genome.)

simplicity.phenotype.distance.hamming(lineage)[source]
simplicity.phenotype.distance.hamming_iw(lineage, lineage2)[source]

simplicity.phenotype.update module

simplicity.phenotype.update.immune_waning_fitness_score(population, lineage_genome, consensus)[source]
simplicity.phenotype.update.update_fitness_factory(type)[source]

Factory of fitness update function. Returns update_fitness, depending on selected phenotype model. Update_fitness computes and assigns the fitness score of every intra host lineage for all individuals to be updated.

simplicity.phenotype.weight module

simplicity.phenotype.weight.w_t_params(t_half=30, t_max=21)[source]

Compute values for k_e and k_a from known pharmacokinetics relationships

Parameters:
  • t_half (int, optional) – half life of antibodies in plasma. The default is 30.

  • t_max (int, optional) – time of max antibody concentration after exposure. The default is t_max.

Returns:

  • float – k_e antibody elimination rate constant.

  • float – k_a - antibody generation rate constant.

simplicity.phenotype.weight.weights(t, t_eval, k_e, k_a, t_max)[source]

Module contents