aboutsummaryrefslogtreecommitdiff
path: root/gn3/correlation/correlation_computations.py
blob: 6a3f2bb475c59bfdf1863413c31af07b7e6b75ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""module contains code for any computation in correlation"""

import json
from .show_corr_results import CorrelationResults

def compute_correlation(correlation_input_data,
                        correlation_results=CorrelationResults):
    """function that does correlation .creates Correlation results instance

    correlation_input_data structure is a dict with

     {
     "trait_id":"valid trait id",
     "dataset":"",
      "sample_vals":{},
      "primary_samples":"",
      "corr_type":"",
      corr_dataset:"",
      "corr_return_results":"",

       
     }

    """

    corr_object = correlation_results(
        start_vars=correlation_input_data)

    corr_results = corr_object.do_correlation(start_vars=correlation_input_data)
    # possibility of file being so large cause of the not sure whether to return a file

    return corr_results