diff options
author | Frederick Muriuki Muriithi | 2022-03-08 08:18:32 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2022-03-08 08:18:32 +0300 |
commit | a7696cc668e00215e1d5af2425765451811bca9d (patch) | |
tree | cc4bb5865605f0ce2f2f0fc3fdba9f8155eb51f5 /gn3/computations | |
parent | e30f9a9b746f7dcdc8707e66cc65e580e6f83f47 (diff) | |
download | genenetwork3-a7696cc668e00215e1d5af2425765451811bca9d.tar.gz |
Remove unused function and its tests
Diffstat (limited to 'gn3/computations')
-rw-r--r-- | gn3/computations/partial_correlations.py | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/gn3/computations/partial_correlations.py b/gn3/computations/partial_correlations.py index e826a8b..1a37838 100644 --- a/gn3/computations/partial_correlations.py +++ b/gn3/computations/partial_correlations.py @@ -69,35 +69,6 @@ def control_samples(controls: Sequence[dict], sampleslist: Sequence[str]): [__process_control__(trait_data) for trait_data in controls], (tuple(), tuple(), tuple(), tuple())) -def dictify_by_samples(samples_vals_vars: Sequence[Sequence]) -> Sequence[dict]: - """ - Build a sequence of dictionaries from a sequence of separate sequences of - samples, values and variances. - - This is a partial migration of - `web.webqtl.correlation.correlationFunction.fixStrains` function in GN1. - This implementation extracts code that will find common use, and that will - find use in more than one place. - """ - def __build_key_value_pairs__( - sample: str, value: Union[float, None], - variance: Union[float, None]) -> dict[ - str, dict[str, Union[str, float, None]]]: - smp = sample.strip() - if smp == "": - warnings.warn( - "Empty strings for sample names is not allowed. Returning None", - category=RuntimeWarning) - return None - return (smp, {"sample_name": smp, "value": value, "variance": variance}) - - return tuple( - dict(item for item in - (__build_key_value_pairs__(sample, val, var) - for sample, val, var in zip(*trait_line)) - if item is not None) - for trait_line in zip(*(samples_vals_vars[0:3]))) - def fix_samples(primary_trait: dict, control_traits: Sequence[dict]) -> Sequence[Sequence[Any]]: """ Corrects sample_names, values and variance such that they all contain only |