Skip to content

eds_scikit.biology.viz.plot

plot_concepts_set

plot_concepts_set(concepts_set_name: str, source_path: str = 'Biology_summary') -> Union[alt.ConcatChart, pd.DataFrame]

Plot and save a summary table and 2 interactive dashboards. For more details, have a look on the [visualization section][visualization]

PARAMETER DESCRIPTION
concepts_set_name

Name of the concepts-set to plot

TYPE: str

source_path

Name of the folder with aggregated data where the plots will be saved

TYPE: str, optional DEFAULT: 'Biology_summary'

RETURNS DESCRIPTION
List[alt.ConcatChart, pd.DataFrame]

Altair plots describing the volumetric and the distribution properties of your biological data along with a pandas DataFrame with a statistical summary

Source code in eds_scikit/biology/viz/plot.py
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
def plot_concepts_set(
    concepts_set_name: str,
    source_path: str = "Biology_summary",
) -> Union[alt.ConcatChart, pd.DataFrame]:
    """Plot and save a summary table and 2 interactive dashboards. For more details, have a look on the [visualization section][visualization]

    Parameters
    ----------
    concepts_set_name : str
        Name of the concepts-set to plot
    source_path : str, optional
        Name of the folder with aggregated data where the plots will be saved

    Returns
    -------
    List[alt.ConcatChart, pd.DataFrame]
        Altair plots describing the volumetric and the distribution properties of your biological data along with a pandas DataFrame with a statistical summary
    """
    if os.path.isdir("{}/{}".format(source_path, concepts_set_name)):
        if os.path.isfile(
            "{}/{}/measurement_stats.pkl".format(source_path, concepts_set_name)
        ):
            measurement_stats = pd.read_pickle(
                "{}/{}/measurement_stats.pkl".format(source_path, concepts_set_name)
            )
            _save_and_display_table(measurement_stats, source_path, concepts_set_name)
        if os.path.isfile(
            "{}/{}/measurement_volumetry.pkl".format(source_path, concepts_set_name)
        ):
            measurement_volumetry = pd.read_pickle(
                "{}/{}/measurement_volumetry.pkl".format(source_path, concepts_set_name)
            )
            interactive_volumetry = plot_interactive_volumetry(
                measurement_volumetry,
            )
            _save_and_display_chart(
                interactive_volumetry,
                source_path,
                concepts_set_name,
                "interactive_volumetry",
            )
        if os.path.isfile(
            "{}/{}/measurement_distribution.pkl".format(source_path, concepts_set_name)
        ):
            measurement_distribution = pd.read_pickle(
                "{}/{}/measurement_distribution.pkl".format(
                    source_path, concepts_set_name
                )
            )
            interactive_distribution = plot_interactive_distribution(
                measurement_distribution,
            )
            _save_and_display_chart(
                interactive_distribution,
                source_path,
                concepts_set_name,
                "interactive_distribution",
            )

    else:
        logger.error(
            "The folder {} has not been found",
            source_path,
        )
        raise FileNotFoundError
Back to top