nbnode.specific_analyses.intraassay.sims package

Submodules

nbnode.specific_analyses.intraassay.sims.sim00 module

nbnode.specific_analyses.intraassay.sims.sim00.sim00_baseline(flowsim_tree: str | FlowSimulationTreeDirichlet, n_samples=100, n_cells=10000, use_only_diagonal_covmat=False, verbose=True, seed_sample_0=129873, save_dir='sim/sim00_pure_estimate', only_return_sampled_cell_numbers=False)[source]

Baseline simulation

Generates a TreeMeanRelative simulation with the same mean as the original simulation.

Parameters:
  • flowsim_tree (Union[str, FlowSimulationTreeDirichlet]) – See TreeMeanRelative.

  • n_samples (int, optional) – See TreeMeanRelative. Defaults to 100.

  • n_cells (int, optional) – See TreeMeanRelative. Defaults to 10000.

  • use_only_diagonal_covmat (bool, optional) – See TreeMeanRelative. Defaults to False.

  • verbose (bool, optional) – See TreeMeanRelative. Defaults to True.

  • seed_sample_0 (int, optional) – See TreeMeanRelative. Defaults to 129873.

  • save_dir (str, optional) – See TreeMeanRelative. Defaults to “sim/sim00_pure_estimate”.

  • only_return_sampled_cell_numbers (bool, optional) – See TreeMeanRelative. Defaults to False.

Returns:

From proportional_generator.sample()

Return type:

Tuple[pd.DataFrame, Dict[str, Any], List[pd.DataFrame]]

nbnode.specific_analyses.intraassay.sims.sim01 module

nbnode.specific_analyses.intraassay.sims.sim01.sim01_double_tcm(flowsim_tree: str | FlowSimulationTreeDirichlet, n_samples=100, n_cells=10000, use_only_diagonal_covmat=False, verbose=True, seed_sample_0=129873, save_dir='sim/sim01_double_tcm', only_return_sampled_cell_numbers=False)[source]

Double Tcm population

Generates a TreeMeanRelative simulation where /AllCells/CD4+/CD8-/Tcm proportion is doubled

Parameters:
  • flowsim_tree (Union[str, FlowSimulationTreeDirichlet]) – See TreeMeanRelative.

  • n_samples (int, optional) – See TreeMeanRelative. Defaults to 100.

  • n_cells (int, optional) – See TreeMeanRelative. Defaults to 10000.

  • use_only_diagonal_covmat (bool, optional) – See TreeMeanRelative. Defaults to False.

  • verbose (bool, optional) – See TreeMeanRelative. Defaults to True.

  • seed_sample_0 (int, optional) – See TreeMeanRelative. Defaults to 129873.

  • save_dir (str, optional) – See TreeMeanRelative. Defaults to “sim/sim01_double_tcm”.

  • only_return_sampled_cell_numbers (bool, optional) – See TreeMeanRelative. Defaults to False.

Returns:

From proportional_generator.sample()

Return type:

Tuple[pd.DataFrame, Dict[str, Any], List[pd.DataFrame]]

nbnode.specific_analyses.intraassay.sims.sim02 module

nbnode.specific_analyses.intraassay.sims.sim02.sim02_temra(flowsim_tree: str | FlowSimulationTreeDirichlet, n_samples=100, n_cells=10000, use_only_diagonal_covmat=False, verbose=True, seed_sample_0=129873, save_dir='sim/sim02_temra', only_return_sampled_cell_numbers=False)[source]

Change /AllCells/CD4-/CD8+/Temra proportion from 7.17% to 33.23%

Generates a TreeMeanRelative simulation where /AllCells/CD4-/CD8+/Temra proportion is increased from 7.17% (baseline) to 33.23% (target).

Parameters:
  • flowsim_tree (Union[str, FlowSimulationTreeDirichlet]) – See TreeMeanRelative.

  • n_samples (int, optional) – See TreeMeanRelative. Defaults to 100.

  • n_cells (int, optional) – See TreeMeanRelative. Defaults to 10000.

  • use_only_diagonal_covmat (bool, optional) – See TreeMeanRelative. Defaults to False.

  • verbose (bool, optional) – See TreeMeanRelative. Defaults to True.

  • seed_sample_0 (int, optional) – See TreeMeanRelative. Defaults to 129873.

  • save_dir (str, optional) – See TreeMeanRelative. Defaults to “sim/sim02_temra”.

  • only_return_sampled_cell_numbers (bool, optional) – See TreeMeanRelative. Defaults to False.

Returns:

From proportional_generator.sample()

Return type:

Tuple[pd.DataFrame, Dict[str, Any], List[pd.DataFrame]]

nbnode.specific_analyses.intraassay.sims.sim03 module

nbnode.specific_analyses.intraassay.sims.sim03.sim03_m_sd(flowsim_tree: str | FlowSimulationTreeDirichlet, meanshift: float, sd: float, population_name: str = '/AllCells/CD4+/CD8-/Tem', n_samples=100, n_cells=10000, use_only_diagonal_covmat=False, verbose=True, seed_sample_0=129873, save_dir='sim/sim03_m_sd', only_return_sampled_cell_numbers=False)[source]

Create a target normal distribution of a population

Generate a normal distribution with mean=original_mean+meanshift and standard deviation=sd. Then, sample from this distribution to create a new value for the population. The population’s concentration parameter is then set to the concentration parameter corresponding to the new value.

Parameters:
  • flowsim_tree (Union[str, FlowSimulationTreeDirichlet]) – See TreeMeanDistributionSampler.

  • meanshift (float) –

    Mean shift of the target normal distribution. The mean of the target normal distribution is original_mean + meanshift. E.g.:

    PseudoTorchDistributionNormal(
        loc=original_mean + meanshift, scale=sd
    )
    

  • sd (float) –

    Standard deviation of the target normal distribution. E.g.:

    PseudoTorchDistributionNormal(
        loc=original_mean + meanshift, scale=sd
    )
    

  • population_name (str, optional) – The get_name_full() of the population to change. Defaults to “/AllCells/CD4+/CD8-/Tem”.

  • n_samples (int, optional) – The number of samples to generate. Defaults to 100.

  • n_cells (int, optional) – The number of cells per sample. Defaults to 10000.

  • use_only_diagonal_covmat (bool, optional) – Whether to use only the diagonal of the covariance matrix. Defaults to False.

  • verbose (bool, optional) – Whether to print progress. Defaults to True.

  • seed_sample_0 (int, optional) – The seed for the first sample. All further sample seeds are incremented by 1 per sample. Defaults to 129873.

  • save_dir (str, optional) – The directory to save the samples to. Defaults to “sim/sim03_m_sd”.

  • only_return_sampled_cell_numbers (bool, optional) – Whether to only return the sampled cell numbers. Defaults to False.

Returns:

generator.sample()

Return type:

generator.sample()

Module contents