From cd0161b9f115109c78be89fe60e0b8005d57ef94 Mon Sep 17 00:00:00 2001 From: Aleksandra Nenadic Date: Wed, 10 Apr 2024 10:37:54 +0100 Subject: [PATCH 01/12] Added full analysis code --- inflammation-analysis.py | 11 ++++++++++- inflammation/compute_data.py | 31 +++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 inflammation/compute_data.py diff --git a/inflammation-analysis.py b/inflammation-analysis.py index 1ca0132f7..b619ec7f6 100644 --- a/inflammation-analysis.py +++ b/inflammation-analysis.py @@ -2,8 +2,10 @@ """Software for managing and analysing patients' inflammation data in our imaginary hospital.""" import argparse +import os from inflammation import models, views +from inflammation.compute_data import analyse_data def main(args): @@ -17,8 +19,13 @@ def main(args): if not isinstance(InFiles, list): InFiles = [args.infiles] + print("infiles: " + str(InFiles)) - for filename in InFiles: + if args.full_data_analysis: + analyse_data(os.path.dirname(InFiles[1])) + return + + for filename in InFiles[1:]: inflammation_data = models.load_csv(filename) view_data = {'average': models.daily_mean(inflammation_data), 'max': models.daily_max(inflammation_data), 'min': models.daily_min(inflammation_data)} @@ -34,6 +41,8 @@ def main(args): nargs='+', help='Input CSV(s) containing inflammation series for each patient') + parser.add_argument('--full-data-analysis', action='store_true', dest='full_data_analysis') + args = parser.parse_args() main(args) diff --git a/inflammation/compute_data.py b/inflammation/compute_data.py new file mode 100644 index 000000000..47730326f --- /dev/null +++ b/inflammation/compute_data.py @@ -0,0 +1,31 @@ +"""Module containing mechanism for calculating standard deviation between datasets. +""" + +import glob +import os +import numpy as np + +from inflammation import models, views + + +def analyse_data(data_dir): + """Calculate the standard deviation by day between datasets + + Gets all the inflammation csvs within a directory, works out the mean + inflammation value for each day across all datasets, then graphs the + standard deviation of these means.""" + data_file_paths = glob.glob(os.path.join(data_dir, 'inflammation*.csv')) + if len(data_file_paths) == 0: + raise ValueError(f"No inflammation csv's found in path {data_dir}") + data = map(models.load_csv, data_file_paths) + + + means_by_day = map(models.daily_mean, data) + means_by_day_matrix = np.stack(list(means_by_day)) + + daily_standard_deviation = np.std(means_by_day_matrix, axis=0) + + graph_data = { + 'standard deviation by day': daily_standard_deviation, + } + views.visualize(graph_data) \ No newline at end of file From 407e1bb15a0024a80dd7cff0d3eae312e38938ef Mon Sep 17 00:00:00 2001 From: Aleksandra Nenadic Date: Fri, 12 Apr 2024 11:37:46 +0100 Subject: [PATCH 02/12] Improved formatting and documentation --- inflammation-analysis.py | 12 +++++------- inflammation/compute_data.py | 10 +++++----- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/inflammation-analysis.py b/inflammation-analysis.py index b619ec7f6..2a62ba60a 100644 --- a/inflammation-analysis.py +++ b/inflammation-analysis.py @@ -19,13 +19,8 @@ def main(args): if not isinstance(InFiles, list): InFiles = [args.infiles] - print("infiles: " + str(InFiles)) - if args.full_data_analysis: - analyse_data(os.path.dirname(InFiles[1])) - return - - for filename in InFiles[1:]: + for filename in InFiles: inflammation_data = models.load_csv(filename) view_data = {'average': models.daily_mean(inflammation_data), 'max': models.daily_max(inflammation_data), 'min': models.daily_min(inflammation_data)} @@ -41,7 +36,10 @@ def main(args): nargs='+', help='Input CSV(s) containing inflammation series for each patient') - parser.add_argument('--full-data-analysis', action='store_true', dest='full_data_analysis') + parser.add_argument( + '--full-data-analysis', + action='store_true', + dest='full_data_analysis') args = parser.parse_args() diff --git a/inflammation/compute_data.py b/inflammation/compute_data.py index 47730326f..db3840d14 100644 --- a/inflammation/compute_data.py +++ b/inflammation/compute_data.py @@ -9,14 +9,14 @@ def analyse_data(data_dir): - """Calculate the standard deviation by day between datasets + """Calculates the standard deviation by day between datasets. - Gets all the inflammation csvs within a directory, works out the mean - inflammation value for each day across all datasets, then graphs the - standard deviation of these means.""" + Gets all the inflammation data from CSV files within a directory, + works out the mean inflammation value for each day across all datasets, + then plots the graphs of standard deviation of these means.""" data_file_paths = glob.glob(os.path.join(data_dir, 'inflammation*.csv')) if len(data_file_paths) == 0: - raise ValueError(f"No inflammation csv's found in path {data_dir}") + raise ValueError(f"No inflammation data CSV files found in path {data_dir}") data = map(models.load_csv, data_file_paths) From 8a281d8fe1897105e903ed22632964add555f925 Mon Sep 17 00:00:00 2001 From: Steve Crouch Date: Thu, 25 Apr 2024 13:32:17 +0100 Subject: [PATCH 03/12] Update with revised version from thomaskileyukaea --- inflammation-analysis.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/inflammation-analysis.py b/inflammation-analysis.py index 2a62ba60a..df03d4cd5 100644 --- a/inflammation-analysis.py +++ b/inflammation-analysis.py @@ -15,18 +15,27 @@ def main(args): - selecting the necessary models and views for the current task - passing data between models and views """ - InFiles = args.infiles - if not isinstance(InFiles, list): - InFiles = [args.infiles] + infiles = args.infiles + if not isinstance(infiles, list): + infiles = [args.infiles] - for filename in InFiles: + if args.full_data_analysis: + analyse_data(os.path.dirname(infiles[0])) + return + + for filename in infiles: inflammation_data = models.load_csv(filename) - view_data = {'average': models.daily_mean(inflammation_data), 'max': models.daily_max(inflammation_data), 'min': models.daily_min(inflammation_data)} + view_data = { + 'average': models.daily_mean(inflammation_data), + 'max': models.daily_max(inflammation_data), + 'min': models.daily_min(inflammation_data) + } views.visualize(view_data) + if __name__ == "__main__": parser = argparse.ArgumentParser( description='A basic patient inflammation data management system') From 3030e15cee4141922f49eef6bf9e4d1f490bc4c7 Mon Sep 17 00:00:00 2001 From: Steven C Chan <80276802+SCChan21@users.noreply.github.com> Date: Fri, 17 Jan 2025 10:23:09 +0000 Subject: [PATCH 04/12] Breaking analyse_data up --- inflammation/compute_data.py | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/inflammation/compute_data.py b/inflammation/compute_data.py index db3840d14..f1615dcba 100644 --- a/inflammation/compute_data.py +++ b/inflammation/compute_data.py @@ -8,24 +8,42 @@ from inflammation import models, views +def compute_sdev(data, axis=0): + """ + Compute standard deviation + """ + return np.std(data, axis=axis) + + +def compute_stacked_means_by_day(data): + """ + Apply models.daily_mean to data and np.stack them. + """ + means_by_day = map(models.daily_mean, data) + return np.stack(list(means_by_day)) + + +def compute_daily_sdev(data): + means_by_day_matrix = compute_stacked_means_by_day(data) + return compute_sdev(compute_daily_sdev) + + def analyse_data(data_dir): """Calculates the standard deviation by day between datasets. Gets all the inflammation data from CSV files within a directory, works out the mean inflammation value for each day across all datasets, then plots the graphs of standard deviation of these means.""" + data_file_paths = glob.glob(os.path.join(data_dir, 'inflammation*.csv')) if len(data_file_paths) == 0: raise ValueError(f"No inflammation data CSV files found in path {data_dir}") - data = map(models.load_csv, data_file_paths) - - means_by_day = map(models.daily_mean, data) - means_by_day_matrix = np.stack(list(means_by_day)) - - daily_standard_deviation = np.std(means_by_day_matrix, axis=0) + data = map(models.load_csv, data_file_paths) + daily_standard_deviation = compute_daily_sdev(data) graph_data = { 'standard deviation by day': daily_standard_deviation, } + views.visualize(graph_data) \ No newline at end of file From 687fb103440c82f182ff8236748ad202a2ca0db3 Mon Sep 17 00:00:00 2001 From: Steven C Chan <80276802+SCChan21@users.noreply.github.com> Date: Fri, 17 Jan 2025 10:23:43 +0000 Subject: [PATCH 05/12] Breaking analyse_data up --- inflammation/compute_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inflammation/compute_data.py b/inflammation/compute_data.py index f1615dcba..4948f9e3e 100644 --- a/inflammation/compute_data.py +++ b/inflammation/compute_data.py @@ -25,7 +25,7 @@ def compute_stacked_means_by_day(data): def compute_daily_sdev(data): means_by_day_matrix = compute_stacked_means_by_day(data) - return compute_sdev(compute_daily_sdev) + return compute_sdev(means_by_day_matrix) def analyse_data(data_dir): From 75d85f2de2d39063f35ebc1b84c78293543ddb6e Mon Sep 17 00:00:00 2001 From: Steven C Chan <80276802+SCChan21@users.noreply.github.com> Date: Fri, 17 Jan 2025 10:48:25 +0000 Subject: [PATCH 06/12] Abstracted compute_data csv loading --- inflammation/compute_data.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/inflammation/compute_data.py b/inflammation/compute_data.py index 4948f9e3e..d9e52692d 100644 --- a/inflammation/compute_data.py +++ b/inflammation/compute_data.py @@ -28,6 +28,14 @@ def compute_daily_sdev(data): return compute_sdev(means_by_day_matrix) +class CSVStuff: + def __init__(self, csv_file_list): + self.csv_filenames = csv_file_list + + def load_data(self): + return map(models.load_csv, self.csv_filenames) + + def analyse_data(data_dir): """Calculates the standard deviation by day between datasets. @@ -39,7 +47,7 @@ def analyse_data(data_dir): if len(data_file_paths) == 0: raise ValueError(f"No inflammation data CSV files found in path {data_dir}") - data = map(models.load_csv, data_file_paths) + data = CSVStuff(data_file_paths).load_data() daily_standard_deviation = compute_daily_sdev(data) graph_data = { From 43be41941f23d72b6a018b78cd5ed55c6d4ce13c Mon Sep 17 00:00:00 2001 From: Steven C Chan <80276802+SCChan21@users.noreply.github.com> Date: Fri, 17 Jan 2025 10:58:29 +0000 Subject: [PATCH 07/12] Abstracted compute_data csv loading --- inflammation/compute_data.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/inflammation/compute_data.py b/inflammation/compute_data.py index d9e52692d..81658fd60 100644 --- a/inflammation/compute_data.py +++ b/inflammation/compute_data.py @@ -28,9 +28,15 @@ def compute_daily_sdev(data): return compute_sdev(means_by_day_matrix) -class CSVStuff: - def __init__(self, csv_file_list): +class CSVDataSrc: + def __init__(self, data_dir): + csv_file_list = glob.glob(os.path.join(data_dir, 'inflammation*.csv')) + csv_file_list.sort() + self.data_dir = data_dir + if len(csv_file_list) == 0: + raise ValueError(f"No inflammation data CSV files found in path {data_dir}") self.csv_filenames = csv_file_list + print(self.csv_filenames[0], self.csv_filenames[-1]) def load_data(self): return map(models.load_csv, self.csv_filenames) @@ -43,11 +49,7 @@ def analyse_data(data_dir): works out the mean inflammation value for each day across all datasets, then plots the graphs of standard deviation of these means.""" - data_file_paths = glob.glob(os.path.join(data_dir, 'inflammation*.csv')) - if len(data_file_paths) == 0: - raise ValueError(f"No inflammation data CSV files found in path {data_dir}") - - data = CSVStuff(data_file_paths).load_data() + data = CSVDataSrc(data_dir).load_data() daily_standard_deviation = compute_daily_sdev(data) graph_data = { From cdc05bd6689c74fc95be264be1f000b8292f767d Mon Sep 17 00:00:00 2001 From: Steven C Chan <80276802+SCChan21@users.noreply.github.com> Date: Fri, 17 Jan 2025 12:25:33 +0000 Subject: [PATCH 08/12] Not-really-json file tests --- data/inflammation-01.json | 60 ++++++++++++++++++++++++++++++++++++ data/inflammation-02.json | 60 ++++++++++++++++++++++++++++++++++++ data/inflammation-03.json | 60 ++++++++++++++++++++++++++++++++++++ data/inflammation-04.json | 60 ++++++++++++++++++++++++++++++++++++ data/inflammation-05.json | 60 ++++++++++++++++++++++++++++++++++++ inflammation-analysis.py | 12 ++++++-- inflammation/compute_data.py | 28 ++++++++++++----- inflammation/models.py | 12 +++++++- 8 files changed, 341 insertions(+), 11 deletions(-) create mode 100644 data/inflammation-01.json create mode 100644 data/inflammation-02.json create mode 100644 data/inflammation-03.json create mode 100644 data/inflammation-04.json create mode 100644 data/inflammation-05.json diff --git a/data/inflammation-01.json b/data/inflammation-01.json new file mode 100644 index 000000000..07a2e6040 --- /dev/null +++ b/data/inflammation-01.json @@ -0,0 +1,60 @@ +0,0,1,3,1,2,4,7,8,3,3,3,10,5,7,4,7,7,12,18,6,13,11,11,7,7,4,6,8,8,4,4,5,7,3,4,2,3,0,0 +0,1,2,1,2,1,3,2,2,6,10,11,5,9,4,4,7,16,8,6,18,4,12,5,12,7,11,5,11,3,3,5,4,4,5,5,1,1,0,1 +0,1,1,3,3,2,6,2,5,9,5,7,4,5,4,15,5,11,9,10,19,14,12,17,7,12,11,7,4,2,10,5,4,2,2,3,2,2,1,1 +0,0,2,0,4,2,2,1,6,7,10,7,9,13,8,8,15,10,10,7,17,4,4,7,6,15,6,4,9,11,3,5,6,3,3,4,2,3,2,1 +0,1,1,3,3,1,3,5,2,4,4,7,6,5,3,10,8,10,6,17,9,14,9,7,13,9,12,6,7,7,9,6,3,2,2,4,2,0,1,1 +0,0,1,2,2,4,2,1,6,4,7,6,6,9,9,15,4,16,18,12,12,5,18,9,5,3,10,3,12,7,8,4,7,3,5,4,4,3,2,1 +0,0,2,2,4,2,2,5,5,8,6,5,11,9,4,13,5,12,10,6,9,17,15,8,9,3,13,7,8,2,8,8,4,2,3,5,4,1,1,1 +0,0,1,2,3,1,2,3,5,3,7,8,8,5,10,9,15,11,18,19,20,8,5,13,15,10,6,10,6,7,4,9,3,5,2,5,3,2,2,1 +0,0,0,3,1,5,6,5,5,8,2,4,11,12,10,11,9,10,17,11,6,16,12,6,8,14,6,13,10,11,4,6,4,7,6,3,2,1,0,0 +0,1,1,2,1,3,5,3,5,8,6,8,12,5,13,6,13,8,16,8,18,15,16,14,12,7,3,8,9,11,2,5,4,5,1,4,1,2,0,0 +0,1,0,0,4,3,3,5,5,4,5,8,7,10,13,3,7,13,15,18,8,15,15,16,11,14,12,4,10,10,4,3,4,5,5,3,3,2,2,1 +0,1,0,0,3,4,2,7,8,5,2,8,11,5,5,8,14,11,6,11,9,16,18,6,12,5,4,3,5,7,8,3,5,4,5,5,4,0,1,1 +0,0,2,1,4,3,6,4,6,7,9,9,3,11,6,12,4,17,13,15,13,12,8,7,4,7,12,9,5,6,5,4,7,3,5,4,2,3,0,1 +0,0,0,0,1,3,1,6,6,5,5,6,3,6,13,3,10,13,9,16,15,9,11,4,6,4,11,11,12,3,5,8,7,4,6,4,1,3,0,0 +0,1,2,1,1,1,4,1,5,2,3,3,10,7,13,5,7,17,6,9,12,13,10,4,12,4,6,7,6,10,8,2,5,1,3,4,2,0,2,0 +0,1,1,0,1,2,4,3,6,4,7,5,5,7,5,10,7,8,18,17,9,8,12,11,11,11,14,6,11,2,10,9,5,6,5,3,4,2,2,0 +0,0,0,0,2,3,6,5,7,4,3,2,10,7,9,11,12,5,12,9,13,19,14,17,5,13,8,11,5,10,9,8,7,5,3,1,4,0,2,1 +0,0,0,1,2,1,4,3,6,7,4,2,12,6,12,4,14,7,8,14,13,19,6,9,12,6,4,13,6,7,2,3,6,5,4,2,3,0,1,0 +0,0,2,1,2,5,4,2,7,8,4,7,11,9,8,11,15,17,11,12,7,12,7,6,7,4,13,5,7,6,6,9,2,1,1,2,2,0,1,0 +0,1,2,0,1,4,3,2,2,7,3,3,12,13,11,13,6,5,9,16,9,19,16,11,8,9,14,12,11,9,6,6,6,1,1,2,4,3,1,1 +0,1,1,3,1,4,4,1,8,2,2,3,12,12,10,15,13,6,5,5,18,19,9,6,11,12,7,6,3,6,3,2,4,3,1,5,4,2,2,0 +0,0,2,3,2,3,2,6,3,8,7,4,6,6,9,5,12,12,8,5,12,10,16,7,14,12,5,4,6,9,8,5,6,6,1,4,3,0,2,0 +0,0,0,3,4,5,1,7,7,8,2,5,12,4,10,14,5,5,17,13,16,15,13,6,12,9,10,3,3,7,4,4,8,2,6,5,1,0,1,0 +0,1,1,1,1,3,3,2,6,3,9,7,8,8,4,13,7,14,11,15,14,13,5,13,7,14,9,10,5,11,5,3,5,1,1,4,4,1,2,0 +0,1,1,1,2,3,5,3,6,3,7,10,3,8,12,4,12,9,15,5,17,16,5,10,10,15,7,5,3,11,5,5,6,1,1,1,1,0,2,1 +0,0,2,1,3,3,2,7,4,4,3,8,12,9,12,9,5,16,8,17,7,11,14,7,13,11,7,12,12,7,8,5,7,2,2,4,1,1,1,0 +0,0,1,2,4,2,2,3,5,7,10,5,5,12,3,13,4,13,7,15,9,12,18,14,16,12,3,11,3,2,7,4,8,2,2,1,3,0,1,1 +0,0,1,1,1,5,1,5,2,2,4,10,4,8,14,6,15,6,12,15,15,13,7,17,4,5,11,4,8,7,9,4,5,3,2,5,4,3,2,1 +0,0,2,2,3,4,6,3,7,6,4,5,8,4,7,7,6,11,12,19,20,18,9,5,4,7,14,8,4,3,7,7,8,3,5,4,1,3,1,0 +0,0,0,1,4,4,6,3,8,6,4,10,12,3,3,6,8,7,17,16,14,15,17,4,14,13,4,4,12,11,6,9,5,5,2,5,2,1,0,1 +0,1,1,0,3,2,4,6,8,6,2,3,11,3,14,14,12,8,8,16,13,7,6,9,15,7,6,4,10,8,10,4,2,6,5,5,2,3,2,1 +0,0,2,3,3,4,5,3,6,7,10,5,10,13,14,3,8,10,9,9,19,15,15,6,8,8,11,5,5,7,3,6,6,4,5,2,2,3,0,0 +0,1,2,2,2,3,6,6,6,7,6,3,11,12,13,15,15,10,14,11,11,8,6,12,10,5,12,7,7,11,5,8,5,2,5,5,2,0,2,1 +0,0,2,1,3,5,6,7,5,8,9,3,12,10,12,4,12,9,13,10,10,6,10,11,4,15,13,7,3,4,2,9,7,2,4,2,1,2,1,1 +0,0,1,2,4,1,5,5,2,3,4,8,8,12,5,15,9,17,7,19,14,18,12,17,14,4,13,13,8,11,5,6,6,2,3,5,2,1,1,1 +0,0,0,3,1,3,6,4,3,4,8,3,4,8,3,11,5,7,10,5,15,9,16,17,16,3,8,9,8,3,3,9,5,1,6,5,4,2,2,0 +0,1,2,2,2,5,5,1,4,6,3,6,5,9,6,7,4,7,16,7,16,13,9,16,12,6,7,9,10,3,6,4,5,4,6,3,4,3,2,1 +0,1,1,2,3,1,5,1,2,2,5,7,6,6,5,10,6,7,17,13,15,16,17,14,4,4,10,10,10,11,9,9,5,4,4,2,1,0,1,0 +0,1,0,3,2,4,1,1,5,9,10,7,12,10,9,15,12,13,13,6,19,9,10,6,13,5,13,6,7,2,5,5,2,1,1,1,1,3,0,1 +0,1,1,3,1,1,5,5,3,7,2,2,3,12,4,6,8,15,16,16,15,4,14,5,13,10,7,10,6,3,2,3,6,3,3,5,4,3,2,1 +0,0,0,2,2,1,3,4,5,5,6,5,5,12,13,5,7,5,11,15,18,7,9,10,14,12,11,9,10,3,2,9,6,2,2,5,3,0,0,1 +0,0,1,3,3,1,2,1,8,9,2,8,10,3,8,6,10,13,11,17,19,6,4,11,6,12,7,5,5,4,4,8,2,6,6,4,2,2,0,0 +0,1,1,3,4,5,2,1,3,7,9,6,10,5,8,15,11,12,15,6,12,16,6,4,14,3,12,9,6,11,5,8,5,5,6,1,2,1,2,0 +0,0,1,3,1,4,3,6,7,8,5,7,11,3,6,11,6,10,6,19,18,14,6,10,7,9,8,5,8,3,10,2,5,1,5,4,2,1,0,1 +0,1,1,3,3,4,4,6,3,4,9,9,7,6,8,15,12,15,6,11,6,18,5,14,15,12,9,8,3,6,10,6,8,7,2,5,4,3,1,1 +0,1,2,2,4,3,1,4,8,9,5,10,10,3,4,6,7,11,16,6,14,9,11,10,10,7,10,8,8,4,5,8,4,4,5,2,4,1,1,0 +0,0,2,3,4,5,4,6,2,9,7,4,9,10,8,11,16,12,15,17,19,10,18,13,15,11,8,4,7,11,6,7,6,5,1,3,1,0,0,0 +0,1,1,3,1,4,6,2,8,2,10,3,11,9,13,15,5,15,6,10,10,5,14,15,12,7,4,5,11,4,6,9,5,6,1,1,2,1,2,1 +0,0,1,3,2,5,1,2,7,6,6,3,12,9,4,14,4,6,12,9,12,7,11,7,16,8,13,6,7,6,10,7,6,3,1,5,4,3,0,0 +0,0,1,2,3,4,5,7,5,4,10,5,12,12,5,4,7,9,18,16,16,10,15,15,10,4,3,7,5,9,4,6,2,4,1,4,2,2,2,1 +0,1,2,1,1,3,5,3,6,3,10,10,11,10,13,10,13,6,6,14,5,4,5,5,9,4,12,7,7,4,7,9,3,3,6,3,4,1,2,0 +0,1,2,2,3,5,2,4,5,6,8,3,5,4,3,15,15,12,16,7,20,15,12,8,9,6,12,5,8,3,8,5,4,1,3,2,1,3,1,0 +0,0,0,2,4,4,5,3,3,3,10,4,4,4,14,11,15,13,10,14,11,17,9,11,11,7,10,12,10,10,10,8,7,5,2,2,4,1,2,1 +0,0,2,1,1,4,4,7,2,9,4,10,12,7,6,6,11,12,9,15,15,6,6,13,5,12,9,6,4,7,7,6,5,4,1,4,2,2,2,1 +0,1,2,1,1,4,5,4,4,5,9,7,10,3,13,13,8,9,17,16,16,15,12,13,5,12,10,9,11,9,4,5,5,2,2,5,1,0,0,1 +0,0,1,3,2,3,6,4,5,7,2,4,11,11,3,8,8,16,5,13,16,5,8,8,6,9,10,10,9,3,3,5,3,5,4,5,3,3,0,1 +0,1,1,2,2,5,1,7,4,2,5,5,4,6,6,4,16,11,14,16,14,14,8,17,4,14,13,7,6,3,7,7,5,6,3,4,2,2,1,1 +0,1,1,1,4,1,6,4,6,3,6,5,6,4,14,13,13,9,12,19,9,10,15,10,9,10,10,7,5,6,8,6,6,4,3,5,2,1,1,1 +0,0,0,1,4,5,6,3,8,7,9,10,8,6,5,12,15,5,10,5,8,13,18,17,14,9,13,4,10,11,10,8,8,6,5,5,2,0,2,0 +0,0,1,0,3,2,5,4,8,2,9,3,3,10,12,9,14,11,13,8,6,18,11,9,13,11,8,5,5,2,8,5,3,5,4,1,3,1,1,0 diff --git a/data/inflammation-02.json b/data/inflammation-02.json new file mode 100644 index 000000000..e30a9b275 --- /dev/null +++ b/data/inflammation-02.json @@ -0,0 +1,60 @@ +0,0,0,1,3,4,6,5,2,7,7,8,6,11,5,6,10,4,5,9,15,15,14,13,14,12,10,9,8,8,6,6,6,6,5,4,2,1,1,0 +0,0,2,2,4,2,1,7,5,7,3,6,10,5,5,14,14,9,11,10,5,5,5,15,6,6,10,13,6,8,3,5,7,7,3,2,2,0,2,1 +0,1,2,3,2,1,4,1,8,7,4,5,10,3,11,5,11,8,18,4,17,9,5,6,15,14,11,5,6,4,7,2,5,6,4,5,4,0,2,1 +0,0,0,0,1,2,4,7,3,5,8,7,5,13,10,7,11,8,18,6,13,4,10,13,5,5,4,3,8,9,2,3,2,3,5,3,1,3,1,1 +0,1,0,2,1,2,3,6,5,2,9,3,5,12,9,5,8,11,9,4,19,19,15,9,6,12,9,3,6,2,9,9,8,5,3,5,3,0,2,1 +0,0,1,3,4,4,2,2,6,3,2,9,4,11,12,8,6,8,8,7,18,11,13,13,10,5,7,11,3,6,9,6,4,5,1,4,1,0,0,0 +0,1,0,3,2,3,2,2,4,6,4,11,11,8,3,9,11,7,12,16,10,5,17,8,11,15,6,8,11,10,6,9,4,3,3,3,1,3,1,1 +0,1,2,1,4,1,2,7,2,2,8,9,5,6,12,12,6,14,6,5,12,11,11,5,10,7,6,6,10,2,4,5,8,3,5,3,3,0,0,1 +0,0,1,2,2,1,4,2,7,4,10,6,4,3,6,5,8,13,8,8,12,4,13,4,13,4,14,5,12,10,6,3,2,1,5,3,4,3,2,0 +0,1,1,1,4,2,1,3,5,3,2,3,11,3,4,5,14,4,5,8,18,18,13,5,11,4,13,12,11,4,10,9,3,3,6,3,2,0,2,0 +0,1,0,0,2,3,5,2,5,8,4,7,7,8,5,5,8,15,14,4,10,12,8,14,11,14,5,13,4,6,8,3,6,5,5,2,4,2,2,1 +0,1,2,3,2,5,6,4,2,4,6,9,6,9,6,6,14,11,6,18,6,13,18,7,15,13,3,12,8,8,5,2,5,7,4,2,2,3,2,0 +0,0,0,1,4,1,4,1,7,7,8,7,7,4,9,3,8,17,17,9,13,19,5,10,8,7,5,3,7,4,6,5,4,1,5,2,1,0,0,0 +0,0,2,1,1,4,5,7,8,5,5,3,6,9,7,8,10,10,13,19,18,15,4,11,6,4,8,11,7,5,4,3,7,3,5,4,4,0,1,0 +0,1,0,3,4,3,3,7,6,8,4,11,6,10,10,7,12,9,11,17,10,16,17,4,5,8,4,8,10,8,5,5,4,7,4,2,3,1,0,1 +0,0,0,3,1,3,5,1,6,5,3,4,8,11,11,3,4,12,14,17,7,9,4,8,8,15,3,12,9,10,6,6,3,3,2,5,4,3,1,0 +0,1,0,0,4,5,5,6,8,9,2,11,4,13,5,15,13,5,13,7,7,5,12,4,12,10,7,4,4,10,10,7,8,2,4,3,4,0,1,1 +0,0,2,0,2,3,2,4,4,3,10,5,8,9,8,12,15,10,9,4,17,5,13,12,15,5,8,10,9,5,3,9,4,2,6,4,2,0,1,1 +0,0,2,1,3,4,3,2,7,3,5,7,9,8,6,3,7,12,13,15,20,7,5,17,13,5,5,13,8,6,8,4,5,1,1,5,3,2,1,1 +0,0,0,3,4,2,2,5,2,8,6,10,7,13,7,11,10,6,12,14,8,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,3,2,9,4,2,12,11,6,4,9,11,4,18,19,5,4,6,7,7,10,13,9,2,8,4,3,5,4,2,3,0,0,1 +0,1,1,3,2,5,2,5,2,2,9,5,10,11,14,14,15,8,4,13,6,13,11,13,9,5,10,12,8,8,2,2,2,2,6,5,3,1,1,0 +0,1,1,2,2,3,2,7,7,8,7,9,4,5,3,9,8,8,11,19,5,16,13,7,16,12,8,7,11,8,3,4,6,1,1,1,4,3,1,0 +0,1,1,2,4,4,4,4,4,5,5,11,3,5,6,13,8,14,5,14,9,6,9,15,9,6,4,7,4,6,7,2,4,4,4,3,1,2,0,1 +0,0,2,1,1,1,4,7,3,2,9,7,11,4,5,4,16,16,9,4,16,5,16,17,4,9,6,4,10,11,9,9,6,4,6,1,1,0,2,1 +0,0,1,1,3,1,4,4,4,7,9,2,3,11,5,10,12,8,6,6,16,13,10,6,7,10,9,7,4,6,5,7,4,3,6,3,1,2,1,1 +0,0,1,0,3,3,1,7,4,8,8,2,12,5,12,15,4,12,12,13,20,8,14,5,14,15,6,5,4,4,6,9,5,1,2,1,4,2,0,0 +0,1,0,1,4,2,2,5,4,7,3,11,3,12,11,6,4,15,15,16,8,4,16,15,8,7,12,10,5,5,9,5,8,1,3,4,4,2,0,0 +0,0,1,2,3,5,4,6,7,7,2,8,9,6,4,9,7,14,6,11,17,16,13,12,16,12,6,5,8,3,8,5,3,1,4,3,1,2,0,1 +0,1,2,3,1,3,5,2,2,4,5,9,12,4,7,13,15,4,15,12,15,18,5,16,4,15,8,9,4,9,2,2,6,1,2,3,3,2,1,0 +0,1,1,1,2,2,6,3,5,2,10,4,7,13,3,5,14,10,9,16,18,11,15,5,9,14,8,4,3,3,2,8,4,1,4,1,1,1,2,1 +0,1,1,2,1,1,5,3,5,4,9,8,11,3,5,15,6,6,8,19,8,15,18,10,12,10,10,6,9,3,10,9,7,6,3,3,1,2,0,0 +0,1,2,0,2,1,4,1,5,7,3,2,5,6,6,9,4,17,11,10,16,12,17,13,10,7,13,6,8,9,8,3,8,2,6,1,1,3,2,0 +0,0,1,2,3,2,3,5,3,9,8,4,3,9,8,14,6,15,13,4,17,8,9,17,9,5,6,8,10,6,3,7,4,4,3,1,1,0,2,0 +0,1,1,0,1,1,2,7,8,6,4,4,9,3,10,14,14,11,6,8,18,5,13,10,4,5,3,12,9,7,8,8,2,4,3,4,3,2,1,1 +0,0,0,1,1,1,4,2,5,4,10,9,7,9,3,15,12,6,14,17,16,18,5,8,10,12,10,11,11,8,10,9,8,5,1,3,4,3,0,1 +0,0,0,2,4,4,1,2,7,4,7,7,10,7,14,9,6,17,8,8,8,9,6,15,15,12,10,9,11,6,4,7,7,2,4,1,4,1,1,1 +0,1,1,1,1,1,1,3,3,4,10,2,6,7,12,8,6,5,11,19,8,10,6,9,15,7,13,7,10,3,3,8,2,2,1,3,2,0,2,1 +0,1,1,2,2,4,5,3,4,6,2,3,10,3,7,15,10,8,12,7,13,12,9,7,8,4,9,8,12,10,6,2,4,3,4,3,3,1,0,0 +0,0,0,1,3,2,6,5,6,6,7,8,3,13,5,12,4,12,10,18,13,7,7,4,15,13,5,8,10,3,7,6,3,4,5,5,2,1,1,0 +0,0,1,0,2,2,3,3,4,8,5,2,8,7,9,7,9,4,7,4,6,11,10,10,8,14,4,5,3,10,6,5,8,3,6,2,3,3,2,0 +0,0,2,2,2,1,6,4,4,2,2,3,7,4,8,15,8,12,17,10,17,8,13,13,8,7,3,9,6,2,3,4,8,2,1,1,2,1,2,0 +0,0,0,1,4,2,1,4,8,7,7,10,12,5,4,4,12,7,18,9,16,19,11,7,14,8,11,11,10,9,9,8,4,7,6,5,2,2,1,1 +0,0,2,2,4,2,3,6,4,5,4,2,5,4,11,13,4,10,16,16,6,16,7,14,5,7,11,10,12,10,8,6,4,1,2,2,4,1,2,0 +0,1,0,2,2,1,6,2,2,2,9,5,9,12,5,12,10,13,9,4,17,14,5,10,12,3,13,4,9,8,8,6,7,4,4,5,4,0,2,0 +0,0,2,0,4,3,5,5,6,9,4,5,4,3,10,3,7,11,12,10,19,16,17,14,16,9,12,5,10,11,6,7,7,3,3,1,1,0,2,0 +0,0,0,3,3,1,5,7,7,7,6,8,7,6,10,14,6,12,5,15,20,18,14,17,14,11,13,10,9,5,5,5,5,7,1,5,3,2,2,0 +0,1,2,0,4,5,6,6,2,5,10,10,3,7,13,9,5,16,6,18,15,10,13,11,12,15,10,12,3,8,8,7,5,6,2,5,2,3,2,0 diff --git a/data/inflammation-03.json b/data/inflammation-03.json new file mode 100644 index 000000000..c301c9b66 --- /dev/null +++ b/data/inflammation-03.json @@ -0,0 +1,60 @@ +0,0,0,2,0,4,1,7,2,6,4,7,2,4,10,7,3,13,9,3,0,1,0,15,0,5,12,3,8,6,8,6,4,3,3,2,0,0,0,0 +0,0,0,3,0,4,3,5,3,11,4,13,6,2,8,1,3,0,17,12,4,3,4,4,9,8,8,2,5,3,11,2,3,1,5,0,1,1,0,0 +0,0,1,2,0,1,0,1,6,9,4,3,7,5,4,14,8,5,0,10,5,4,9,12,4,5,5,8,6,2,0,0,1,7,6,1,1,0,0,0 +0,0,0,0,0,3,7,3,2,1,5,2,8,0,10,3,3,1,13,11,12,0,5,0,5,6,10,8,4,3,2,11,3,5,1,1,0,0,0,0 +0,0,1,0,0,2,1,2,3,9,6,14,4,6,13,8,7,13,0,15,3,1,3,1,6,4,4,0,4,2,5,11,3,5,6,0,0,1,0,0 +0,0,0,1,1,2,2,7,4,5,4,6,5,3,11,6,2,14,1,15,8,3,3,1,2,0,8,3,14,5,4,1,2,4,6,3,1,1,0,0 +0,0,1,2,1,0,0,1,1,5,2,14,9,1,12,12,1,13,10,14,2,13,4,16,8,0,12,2,3,4,7,6,3,2,1,0,0,0,0,0 +0,0,0,2,0,5,2,5,1,5,6,11,2,4,2,5,0,0,4,1,7,1,7,17,12,5,5,4,3,6,1,0,5,5,0,2,3,0,0,0 +0,0,0,2,0,2,6,3,1,6,3,9,8,4,11,5,0,10,9,3,9,5,5,16,10,2,2,8,10,1,1,0,0,2,2,1,3,0,0,0 +0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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/inflammation-04.json b/data/inflammation-04.json new file mode 100644 index 000000000..219ae8149 --- /dev/null +++ b/data/inflammation-04.json @@ -0,0 +1,60 @@ +0,1,2,2,4,4,2,5,2,4,8,4,10,7,3,13,10,11,7,7,9,17,7,6,12,13,12,6,5,4,8,6,7,3,5,1,1,0,1,0 +0,1,1,1,2,1,4,1,4,9,3,10,10,4,7,10,5,15,17,9,6,12,10,11,9,15,7,11,11,9,3,4,8,3,6,2,3,0,1,0 +0,0,1,2,4,1,2,3,6,8,5,6,4,3,8,12,7,4,14,11,15,17,13,4,11,13,10,9,5,6,4,9,4,3,4,2,4,2,1,0 +0,0,2,1,1,2,4,1,5,8,3,2,6,10,6,5,11,9,15,9,5,9,17,13,9,12,5,4,6,3,5,8,8,7,4,2,2,3,2,0 +0,1,2,3,4,2,2,5,5,5,2,9,11,11,5,15,15,16,15,17,18,18,8,12,5,10,12,11,8,2,7,7,4,2,1,5,1,2,0,0 +0,1,0,0,2,2,1,5,6,8,9,7,11,6,4,14,15,11,13,11,18,9,5,16,6,11,10,10,10,2,5,8,7,2,6,4,2,2,2,0 +0,0,0,2,4,5,1,1,5,2,10,6,12,5,12,6,13,15,11,12,19,14,15,17,13,9,14,4,12,8,6,4,7,6,6,4,1,2,0,0 +0,0,1,2,2,2,2,4,2,5,6,6,10,12,8,15,11,14,15,15,20,9,7,9,10,7,9,12,11,2,8,6,2,2,3,5,1,1,2,1 +0,0,1,3,2,5,5,5,7,4,4,3,5,7,9,13,4,13,16,11,13,10,16,13,12,9,6,10,12,6,7,8,8,1,2,3,2,0,0,1 +0,1,0,3,3,4,1,7,7,8,8,10,5,6,11,5,16,5,16,19,9,7,12,15,5,3,7,8,9,8,6,2,2,7,6,3,1,1,1,0 +0,0,0,1,4,1,6,6,2,8,7,10,4,8,11,9,5,4,11,18,7,19,4,5,8,9,5,12,4,11,8,5,3,2,2,5,4,0,1,0 +0,1,2,2,1,2,4,5,5,8,2,10,8,7,12,4,14,14,9,15,20,5,14,12,11,6,12,12,6,9,9,6,5,4,6,4,2,3,1,1 +0,1,0,1,1,3,1,5,5,6,5,11,5,12,14,12,8,16,5,7,15,12,12,10,5,9,14,13,10,6,2,5,4,3,1,5,2,1,0,0 +0,1,0,2,3,5,4,4,5,9,4,8,9,11,12,5,8,4,16,5,14,15,14,12,11,9,3,8,8,6,9,3,7,2,6,1,2,2,2,0 +0,1,2,3,2,4,6,3,7,3,10,2,5,13,10,11,10,17,7,9,7,17,17,13,15,7,9,6,10,10,5,9,8,5,1,4,2,2,0,0 +0,0,0,3,4,2,4,6,4,5,4,3,12,9,3,8,9,8,12,17,20,11,4,9,12,9,3,12,7,8,7,2,2,5,2,5,3,3,0,0 +0,0,0,3,2,5,4,7,3,9,2,2,6,3,3,15,5,7,14,19,11,13,6,16,5,6,8,13,6,2,8,4,3,5,4,5,2,3,0,1 +0,1,0,2,3,3,4,7,7,9,2,3,9,3,6,14,6,4,11,7,17,7,16,11,6,13,7,7,11,2,10,2,8,5,2,4,2,1,1,1 +0,1,1,3,2,1,1,1,8,2,8,10,3,10,9,7,16,17,8,19,18,6,5,7,8,14,14,10,12,5,7,7,2,2,6,3,4,2,2,0 +0,1,1,1,2,2,2,7,5,4,8,3,4,6,4,12,9,11,12,14,6,6,18,12,9,9,11,8,4,3,3,8,3,1,1,2,1,1,1,1 +0,1,1,3,2,2,6,2,7,2,4,5,11,10,13,5,8,6,13,14,19,8,13,4,15,8,12,10,12,8,5,9,2,6,2,4,1,2,1,0 +0,0,1,2,2,5,2,5,8,7,5,2,11,5,14,10,6,14,11,6,18,6,14,9,14,5,6,3,6,11,7,7,4,1,4,1,2,1,2,0 +0,1,1,2,2,3,6,4,6,7,10,10,12,12,6,15,5,15,10,19,7,15,16,10,7,14,12,6,7,2,3,9,8,5,6,4,1,2,1,0 +0,1,0,3,2,3,5,2,2,7,3,6,7,9,12,12,15,15,15,13,14,8,17,12,15,4,9,13,12,4,6,3,5,7,2,5,1,1,0,0 +0,0,0,1,2,4,1,4,2,2,6,4,10,8,5,14,6,11,10,10,17,10,14,16,8,13,3,4,7,3,5,7,2,3,5,5,1,0,2,1 +0,0,0,1,3,4,4,5,6,6,8,7,11,7,9,6,15,7,12,10,16,16,15,11,4,5,14,8,5,9,8,2,6,5,5,1,3,2,0,1 +0,1,0,3,4,2,5,3,2,7,10,2,5,8,4,8,14,15,15,8,15,6,17,14,12,5,12,8,9,9,2,5,4,5,2,5,4,2,1,1 +0,1,0,1,4,3,1,6,4,6,2,6,10,12,6,15,9,7,10,8,15,5,8,16,8,4,7,12,11,4,4,7,6,7,3,4,3,2,2,0 +0,1,2,1,1,2,1,7,2,3,4,6,8,12,3,11,9,11,15,16,17,4,17,5,8,6,3,5,10,11,4,6,4,2,1,4,1,3,0,1 +0,0,1,3,4,5,3,5,5,8,7,6,8,5,14,15,14,9,8,16,20,19,5,6,8,9,5,12,9,2,9,6,6,3,5,5,4,0,0,0 +0,0,0,2,3,2,4,2,6,8,5,10,3,6,12,9,10,4,7,6,15,19,5,7,10,15,6,12,12,10,2,8,6,3,5,4,2,0,1,0 +0,1,0,2,2,4,4,2,8,4,6,7,11,5,4,7,13,11,12,5,9,18,15,4,11,6,11,6,9,4,4,5,6,6,6,5,3,1,2,1 +0,0,0,2,3,2,5,2,5,9,3,4,9,10,10,9,5,12,10,16,12,6,15,9,6,3,8,13,7,8,2,5,4,3,5,4,1,2,2,1 +0,0,0,3,3,2,6,1,8,3,3,5,12,6,8,13,4,14,9,6,14,10,15,13,15,11,12,8,4,4,10,3,4,7,1,2,4,2,2,0 +0,0,1,1,3,4,1,6,5,5,10,9,6,5,11,14,7,14,6,10,11,15,11,10,16,7,4,3,11,7,5,3,3,2,2,3,3,2,0,0 +0,0,1,0,2,3,5,3,5,6,5,3,5,6,6,9,11,10,11,19,19,19,14,5,7,13,5,8,5,6,8,2,8,1,6,3,1,1,1,1 +0,0,1,2,3,2,4,6,8,4,3,7,10,4,5,7,8,6,14,15,6,4,9,17,6,6,8,5,7,8,6,9,3,7,4,1,3,0,0,1 +0,1,1,1,4,4,4,5,2,2,4,7,4,12,11,11,15,13,7,11,10,6,8,4,5,11,13,4,7,11,7,3,8,5,2,1,1,3,0,1 +0,1,1,1,1,2,5,6,5,7,6,3,8,11,13,8,14,14,8,12,8,5,15,13,13,15,10,9,3,4,6,4,7,1,4,4,3,3,2,1 +0,1,0,1,1,4,2,4,3,3,3,8,7,4,10,13,10,6,17,16,20,7,12,16,6,6,11,12,7,4,2,7,7,1,4,4,1,1,1,0 +0,1,2,0,1,2,6,5,8,6,7,6,11,6,7,12,9,7,16,7,10,12,14,9,15,11,5,3,6,9,9,3,5,2,3,5,3,3,1,0 +0,0,1,0,4,4,1,7,4,5,6,9,11,6,3,7,10,15,11,17,19,15,8,14,16,14,14,8,3,2,9,6,5,1,3,5,2,0,1,1 +0,1,0,3,4,5,5,2,8,2,2,4,6,5,6,13,7,9,7,6,8,10,13,4,4,6,14,8,10,3,9,6,7,6,2,1,2,3,1,0 +0,1,1,0,3,3,2,4,2,6,4,3,11,11,6,3,10,10,18,13,14,8,12,8,8,13,6,7,6,5,9,7,8,3,6,5,4,3,2,0 +0,0,1,2,4,3,4,4,4,8,6,8,5,11,13,4,16,11,11,7,6,18,13,9,10,10,5,9,10,4,2,5,8,5,3,5,4,1,1,1 +0,0,0,2,1,2,3,2,6,2,10,2,12,7,8,15,16,8,16,13,11,14,14,16,15,14,7,5,3,4,2,2,2,1,2,2,1,0,2,1 +0,0,1,0,3,4,5,6,5,8,3,4,10,5,3,10,9,15,4,13,5,17,9,4,15,6,6,3,3,3,10,7,7,7,1,1,4,0,0,1 +0,0,0,3,4,5,1,5,4,5,5,5,4,12,14,6,10,14,11,19,12,11,8,16,14,6,13,8,8,9,3,9,3,1,2,5,3,1,2,1 +0,0,2,2,3,2,2,1,7,3,3,8,12,3,12,5,12,11,5,12,10,8,17,16,16,12,5,7,3,2,3,6,8,3,1,5,2,1,1,0 +0,1,2,1,4,5,1,6,2,3,10,7,11,6,11,5,6,4,17,5,5,5,16,6,10,12,11,5,10,11,9,2,2,5,1,2,4,3,0,1 +0,1,2,2,4,2,3,2,4,3,2,3,3,8,8,11,4,6,9,11,14,9,14,14,15,15,10,6,7,2,9,9,6,1,2,2,3,1,0,0 +0,0,2,2,2,1,5,4,7,7,2,9,12,6,7,15,10,4,12,4,20,7,18,16,9,15,4,11,4,10,4,8,5,2,3,1,4,0,0,1 +0,1,0,3,2,4,1,5,8,5,5,10,9,12,10,4,4,14,16,4,20,14,10,15,6,6,6,8,7,5,7,5,5,1,6,5,4,3,1,1 +0,0,0,2,2,3,4,1,8,5,6,5,8,12,14,6,4,10,18,10,10,11,7,15,6,14,11,10,9,2,2,9,3,6,6,2,4,2,2,0 +0,0,2,3,2,4,2,3,2,6,2,10,10,7,4,13,14,11,17,16,6,8,4,16,12,15,6,11,12,5,10,3,6,4,6,3,2,2,1,0 +0,0,0,3,2,1,5,3,4,3,6,5,5,9,13,11,6,6,7,11,8,17,11,16,14,8,13,7,9,9,7,3,2,2,1,2,2,1,0,0 +0,0,1,3,3,3,3,3,5,4,4,9,9,13,4,11,14,5,13,10,11,18,11,8,11,6,8,5,5,2,4,2,6,1,1,5,2,2,1,0 +0,0,1,2,3,5,4,7,3,3,7,7,3,3,8,4,16,9,9,9,5,4,12,6,4,15,3,11,4,4,3,5,4,6,5,2,4,0,1,0 +0,0,2,3,2,1,4,7,8,4,4,11,12,6,9,13,10,11,13,4,17,16,12,5,4,11,11,5,12,2,10,2,4,3,4,2,4,2,0,1 +0,0,2,2,1,1,4,4,5,2,8,10,4,9,13,5,11,5,10,5,9,15,18,14,11,11,7,6,11,10,4,8,2,7,2,2,2,1,0,1 diff --git a/data/inflammation-05.json b/data/inflammation-05.json new file mode 100644 index 000000000..25ef868c6 --- /dev/null +++ b/data/inflammation-05.json @@ -0,0 +1,60 @@ +0,1,0,2,4,4,5,1,2,5,5,8,10,12,10,9,15,9,7,9,10,7,5,8,9,6,7,5,11,9,3,8,6,7,5,1,3,0,2,1 +0,0,2,1,1,4,4,6,2,4,4,4,7,12,11,15,10,9,12,15,7,17,14,12,6,12,5,11,3,9,7,8,8,3,3,3,1,1,0,1 +0,1,0,0,1,2,2,3,4,8,5,2,7,13,14,13,15,16,15,13,18,4,10,11,6,3,14,4,4,6,10,8,6,2,6,2,3,0,0,1 +0,1,0,2,1,3,6,1,3,4,10,2,8,11,11,12,14,12,15,15,20,11,12,7,4,15,9,11,9,5,10,7,5,2,3,1,4,2,0,0 +0,0,2,2,3,3,5,1,4,2,9,7,5,7,11,10,14,6,9,7,18,15,15,5,6,14,5,5,11,9,8,9,8,1,6,4,2,1,2,1 +0,0,0,2,3,4,4,5,3,2,9,8,8,12,11,6,15,8,17,14,20,7,8,10,4,11,9,6,7,7,2,3,5,6,3,4,3,3,0,0 +0,1,1,1,3,1,6,4,5,5,2,6,9,13,13,11,10,6,15,16,14,16,14,10,5,9,8,4,9,4,5,9,7,5,6,1,2,1,2,1 +0,0,2,3,1,4,6,6,4,5,3,5,10,8,6,8,4,14,7,17,7,5,17,8,10,10,10,3,11,3,9,6,6,7,2,1,3,1,2,1 +0,0,2,1,4,4,4,7,5,5,10,8,6,12,14,12,6,6,16,5,6,15,10,5,15,13,13,7,3,11,9,3,7,4,5,4,1,2,1,1 +0,1,2,1,2,3,6,1,2,6,10,7,12,6,3,4,4,16,16,18,9,7,10,10,16,12,11,6,3,10,6,8,5,3,4,1,4,2,1,1 +0,0,1,3,2,1,1,4,4,5,10,9,6,5,12,13,4,16,11,19,11,15,13,13,9,7,12,5,3,7,8,8,6,2,5,5,3,3,2,1 +0,0,1,0,1,3,1,3,4,7,7,8,8,6,7,5,10,12,6,15,15,8,12,8,14,5,5,7,9,4,9,2,3,4,5,3,4,2,2,1 +0,1,0,0,2,1,5,1,8,3,7,2,5,13,9,9,10,12,9,5,12,7,5,8,16,5,6,5,4,4,2,2,4,1,3,5,2,1,0,0 +0,1,1,2,1,4,2,3,3,9,2,7,6,7,6,3,13,11,13,15,14,15,8,15,14,13,8,9,10,8,5,9,7,4,6,2,4,3,1,0 +0,1,1,3,2,4,2,7,3,8,5,9,10,7,9,4,4,5,4,10,13,4,9,9,12,8,7,5,3,4,5,9,6,1,4,1,2,0,0,1 +0,0,2,2,4,5,6,2,5,3,5,5,11,6,8,8,6,6,10,17,19,9,11,8,7,11,4,5,12,6,3,8,7,5,2,5,1,3,0,0 +0,1,0,2,4,3,6,7,7,9,2,7,9,5,12,7,8,5,15,12,13,16,18,5,13,15,4,8,3,4,7,8,6,1,5,4,2,1,2,0 +0,1,1,3,4,5,4,3,4,9,10,5,11,10,7,6,10,7,15,18,14,17,15,16,13,14,6,4,6,8,9,6,5,2,4,5,4,1,2,0 +0,0,2,1,3,4,3,6,8,5,6,2,10,11,11,10,5,15,9,18,10,15,11,15,8,15,7,13,7,5,4,3,8,6,5,1,1,0,0,1 +0,1,1,0,2,1,4,4,4,5,10,11,12,10,7,10,7,16,16,8,14,18,8,16,7,13,14,12,9,2,10,9,7,7,2,2,3,2,0,0 +0,1,0,1,1,2,4,1,4,5,5,7,3,12,10,9,5,5,17,4,8,12,5,11,11,4,13,7,6,4,6,8,7,3,6,5,2,1,1,1 +0,0,2,2,2,4,1,4,7,5,8,11,12,5,3,4,6,6,17,17,16,7,4,17,16,4,11,3,11,4,4,2,2,5,3,3,2,1,0,0 +0,1,0,1,4,2,6,3,7,6,9,8,4,9,10,7,7,6,6,5,5,13,17,4,11,15,13,3,10,5,10,4,4,2,4,4,2,2,0,0 +0,0,2,3,2,4,6,4,3,5,6,5,10,10,8,9,15,16,17,14,5,18,17,6,7,6,7,11,7,10,3,2,5,2,2,3,4,3,1,1 +0,0,1,0,1,1,3,1,4,7,8,10,11,11,8,13,9,7,12,14,16,10,10,15,9,4,9,10,3,10,10,9,8,5,2,2,3,3,1,0 +0,0,1,1,4,5,3,4,8,2,10,6,6,5,9,3,16,16,18,10,16,19,11,8,15,3,11,3,6,3,3,5,5,2,1,4,3,1,2,0 +0,0,2,2,3,5,4,5,5,7,4,2,4,12,11,6,7,17,18,4,10,5,8,15,16,10,7,12,6,4,4,8,2,3,4,3,4,1,2,1 +0,0,0,3,2,1,2,7,4,7,10,11,12,3,13,5,6,14,10,16,13,10,11,8,11,13,11,8,12,8,6,3,2,6,5,1,2,1,2,0 +0,1,1,2,4,1,5,7,6,5,4,3,11,10,4,10,9,6,16,12,5,4,4,10,9,5,14,5,6,4,2,4,7,6,3,4,4,2,2,1 +0,0,2,0,3,3,3,7,2,4,3,8,6,13,5,9,7,12,13,18,8,13,6,6,15,3,10,7,10,7,5,5,3,6,4,5,3,1,0,1 +0,0,1,2,4,1,5,7,6,5,4,3,12,12,13,5,15,8,12,5,12,4,7,6,5,9,3,3,7,3,7,7,2,4,4,2,3,3,0,0 +0,0,0,0,1,2,6,3,4,2,2,10,3,9,6,10,6,11,11,19,12,15,14,10,15,9,11,7,3,3,8,7,7,7,5,1,3,0,1,1 +0,0,2,2,1,1,5,6,6,7,5,7,12,5,7,5,15,11,7,13,15,19,14,13,15,4,11,5,6,7,2,4,7,5,5,5,3,1,1,0 +0,0,0,2,1,4,5,3,3,2,7,7,5,4,9,6,16,8,13,12,16,17,5,15,13,6,8,13,12,6,3,7,7,2,2,2,2,1,2,0 +0,1,2,1,4,5,5,1,7,6,5,10,9,4,4,5,16,4,5,4,6,9,11,4,4,5,4,8,10,7,6,7,8,1,6,2,4,1,2,1 +0,1,2,3,4,2,2,1,3,2,9,2,8,9,8,13,5,11,13,8,20,7,6,15,4,7,14,4,8,9,7,6,3,3,5,5,4,2,0,1 +0,0,2,0,4,4,6,3,4,8,4,8,10,13,6,10,10,15,6,13,10,6,16,6,5,3,10,6,9,3,6,7,4,6,1,4,3,2,2,1 +0,0,0,2,3,3,3,3,6,7,5,6,10,8,13,5,14,9,11,6,10,17,7,10,15,3,4,10,12,11,7,7,4,5,6,4,1,1,0,0 +0,1,2,0,3,1,4,7,8,2,5,4,7,11,11,14,12,17,10,11,5,18,14,14,9,7,5,8,9,7,9,8,2,7,3,1,2,1,2,1 +0,0,0,2,1,4,2,1,7,5,9,8,8,6,9,3,11,9,17,6,10,11,17,16,16,10,13,13,6,10,6,9,2,2,2,1,2,0,0,0 +0,0,1,2,4,4,3,5,3,3,2,6,9,13,6,13,6,4,15,6,15,11,6,14,6,7,13,4,3,11,4,4,8,4,1,3,2,1,0,0 +0,0,2,2,4,5,5,1,5,2,9,6,6,7,14,15,11,17,13,19,18,18,16,4,7,15,6,5,6,8,2,4,6,7,5,5,2,2,2,0 +0,0,2,1,2,3,6,5,8,5,3,8,11,4,6,5,15,17,9,7,16,9,18,6,9,13,12,10,6,10,2,7,6,5,3,4,2,0,1,1 +0,0,0,2,1,5,4,2,5,6,7,6,6,9,3,15,9,11,14,14,14,10,5,10,11,11,12,10,6,4,8,7,4,5,2,2,3,3,1,1 +0,0,0,1,1,1,6,3,3,4,7,7,9,7,14,3,7,8,12,7,6,7,7,6,8,14,4,6,8,10,4,3,3,5,6,5,2,3,1,0 +0,0,2,2,4,3,4,2,8,6,2,8,12,9,5,10,11,16,16,14,9,15,7,17,13,11,10,10,3,4,3,6,5,7,3,3,2,2,0,0 +0,0,2,0,3,1,4,4,4,4,9,11,4,9,12,15,4,13,9,13,11,17,5,15,8,6,8,3,12,8,7,3,2,7,3,3,4,0,0,1 +0,0,0,1,1,3,1,5,4,8,8,5,9,3,14,15,7,11,10,17,20,8,13,10,9,7,6,8,3,2,4,4,3,3,1,1,4,0,0,1 +0,1,0,1,4,5,3,7,2,3,9,7,3,11,3,12,6,16,16,13,12,8,14,17,9,13,8,8,9,4,2,8,5,6,1,5,3,2,0,1 +0,0,0,1,4,1,5,6,4,9,3,5,7,9,11,15,10,9,8,18,18,19,12,4,6,4,11,11,5,11,10,3,8,5,4,1,4,2,0,1 +0,1,1,0,3,4,1,7,7,4,2,8,7,12,14,8,6,8,12,15,18,8,12,17,14,4,12,7,10,8,5,2,8,4,2,4,2,0,1,0 +0,1,1,2,2,4,5,2,7,9,7,6,10,9,9,4,16,4,11,12,6,10,16,12,7,11,14,8,12,7,6,7,8,1,4,4,1,0,2,0 +0,0,1,3,3,1,3,3,3,2,6,9,6,3,13,15,7,16,17,15,10,16,4,17,8,13,4,10,12,3,5,7,6,6,4,3,4,0,1,0 +0,0,0,3,2,3,2,5,8,8,7,4,8,6,8,4,8,4,4,4,9,19,8,9,7,8,10,12,4,11,8,9,6,6,6,3,3,1,1,0 +0,0,1,2,3,5,6,4,8,4,10,7,3,6,12,6,6,15,9,19,7,15,16,11,9,9,9,6,8,2,7,7,4,5,6,4,4,0,1,1 +0,0,1,0,1,3,5,5,5,3,4,9,10,5,6,5,13,9,4,6,5,16,5,11,5,12,10,5,7,10,6,9,6,3,4,5,3,2,0,0 +0,1,1,1,2,2,4,1,2,8,9,8,5,11,3,12,4,7,6,7,5,5,11,12,7,12,5,8,6,10,6,7,4,2,1,4,2,1,0,1 +0,0,2,1,3,5,6,2,3,8,6,6,3,3,11,5,4,14,10,11,5,15,10,15,13,12,13,10,3,2,2,5,7,6,1,5,4,0,1,1 +0,1,2,3,4,5,1,2,2,6,7,2,4,8,8,14,14,9,13,13,9,8,10,17,14,15,13,13,9,4,2,6,6,3,2,5,4,1,2,1 +0,0,1,0,3,4,4,3,3,9,3,2,8,11,8,7,9,15,7,19,16,15,6,16,5,13,9,11,5,3,6,9,5,3,3,2,4,1,0,1 diff --git a/inflammation-analysis.py b/inflammation-analysis.py index df03d4cd5..7a51089b1 100644 --- a/inflammation-analysis.py +++ b/inflammation-analysis.py @@ -6,7 +6,7 @@ from inflammation import models, views from inflammation.compute_data import analyse_data - +from inflammation.compute_data import CSVDataSrc, JSONDataSrc def main(args): """The MVC Controller of the patient inflammation data system. @@ -21,7 +21,15 @@ def main(args): if args.full_data_analysis: - analyse_data(os.path.dirname(infiles[0])) + data_src = os.path.dirname(infiles[0]) + _, data_ext = os.path.splitext(infiles[0]) + if data_ext == ".csv": + src_type = CSVDataSrc + elif data_ext == ".json": + src_type = JSONDataSrc + else: + raise ValueError('Unknown extension: {data_ext}') + analyse_data(data_src, src_type=src_type) return for filename in infiles: diff --git a/inflammation/compute_data.py b/inflammation/compute_data.py index 81658fd60..d980e6fa8 100644 --- a/inflammation/compute_data.py +++ b/inflammation/compute_data.py @@ -30,26 +30,38 @@ def compute_daily_sdev(data): class CSVDataSrc: def __init__(self, data_dir): - csv_file_list = glob.glob(os.path.join(data_dir, 'inflammation*.csv')) - csv_file_list.sort() self.data_dir = data_dir + + def load_data(self): + csv_file_list = glob.glob(os.path.join(self.data_dir, 'inflammation*.csv')) + csv_file_list.sort() if len(csv_file_list) == 0: - raise ValueError(f"No inflammation data CSV files found in path {data_dir}") - self.csv_filenames = csv_file_list - print(self.csv_filenames[0], self.csv_filenames[-1]) + raise ValueError(f"No inflammation data CSV files found in path {self.data_dir}") + print('Loading : ', csv_file_list[0], csv_file_list[-1]) + return map(models.load_csv, csv_file_list) + + +class JSONDataSrc: + def __init__(self, data_dir): + self.data_dir = data_dir def load_data(self): - return map(models.load_csv, self.csv_filenames) + json_file_list = glob.glob(os.path.join(self.data_dir, 'inflammation*.json')) + json_file_list.sort() + if len(json_file_list) == 0: + raise ValueError(f"No inflammation data CSV files found in path {self.data_dir}") + print('Loading : ', json_file_list[0], json_file_list[-1]) + return map(models.load_csv, json_file_list) -def analyse_data(data_dir): +def analyse_data(data_dir, src_type=CSVDataSrc): """Calculates the standard deviation by day between datasets. Gets all the inflammation data from CSV files within a directory, works out the mean inflammation value for each day across all datasets, then plots the graphs of standard deviation of these means.""" - data = CSVDataSrc(data_dir).load_data() + data = src_type(data_dir).load_data() daily_standard_deviation = compute_daily_sdev(data) graph_data = { diff --git a/inflammation/models.py b/inflammation/models.py index 5169ac42d..717116cfb 100644 --- a/inflammation/models.py +++ b/inflammation/models.py @@ -8,7 +8,7 @@ """ import numpy as np - +import json def load_csv(filename): """Load a Numpy array from a CSV @@ -18,6 +18,16 @@ def load_csv(filename): return np.loadtxt(fname=filename, delimiter=',') +def load_json(filename, + json_key="observations"): + """Load a Numpy array from a JSON + + :param filename: Filename of JSON to load + """ + json_dict = json.loads(filename) + return [np.array(dats) for dats in json_dict[json_key]] + + def daily_mean(data): """Calculate the daily mean of a 2d inflammation data array.""" return np.mean(data, axis=0) From f6a64a5bb2fbdefef0ec7ddfda10d85f118ebc6f Mon Sep 17 00:00:00 2001 From: Steven C Chan <80276802+SCChan21@users.noreply.github.com> Date: Fri, 17 Jan 2025 15:00:00 +0000 Subject: [PATCH 09/12] Resolve conflicts? --- inflammation-analysis.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/inflammation-analysis.py b/inflammation-analysis.py index 7a51089b1..41c7e8457 100644 --- a/inflammation-analysis.py +++ b/inflammation-analysis.py @@ -15,14 +15,14 @@ def main(args): - selecting the necessary models and views for the current task - passing data between models and views """ - infiles = args.infiles - if not isinstance(infiles, list): - infiles = [args.infiles] + in_files = args.infiles + if not isinstance(in_files, list): + in_files = [args.infiles] if args.full_data_analysis: - data_src = os.path.dirname(infiles[0]) - _, data_ext = os.path.splitext(infiles[0]) + data_src = os.path.dirname(in_files[0]) + _, data_ext = os.path.splitext(in_files[0]) if data_ext == ".csv": src_type = CSVDataSrc elif data_ext == ".json": From c6ac18ca0c416360e80ac1617143bb1da14889de Mon Sep 17 00:00:00 2001 From: Steven C Chan <80276802+SCChan21@users.noreply.github.com> Date: Fri, 17 Jan 2025 15:01:35 +0000 Subject: [PATCH 10/12] Resolve conflicts? --- inflammation-analysis.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inflammation-analysis.py b/inflammation-analysis.py index 41c7e8457..b9062fc7f 100644 --- a/inflammation-analysis.py +++ b/inflammation-analysis.py @@ -32,7 +32,7 @@ def main(args): analyse_data(data_src, src_type=src_type) return - for filename in infiles: + for filename in in_files: inflammation_data = models.load_csv(filename) view_data = { From 34819549eb56f397d466f42563486750397f263b Mon Sep 17 00:00:00 2001 From: Steven C Chan <80276802+SCChan21@users.noreply.github.com> Date: Fri, 17 Jan 2025 15:06:14 +0000 Subject: [PATCH 11/12] Resolve conflicts? --- inflammation-analysis.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inflammation-analysis.py b/inflammation-analysis.py index b9062fc7f..de59d3778 100644 --- a/inflammation-analysis.py +++ b/inflammation-analysis.py @@ -38,7 +38,7 @@ def main(args): view_data = { 'average': models.daily_mean(inflammation_data), 'max': models.daily_max(inflammation_data), - 'min': models.daily_min(inflammation_data) + 'min': models.daily_min(inflammation_data), } views.visualize(view_data) From 8548894b6784ea901c4f1d673be3f5755c12ff31 Mon Sep 17 00:00:00 2001 From: Steven C Chan <80276802+SCChan21@users.noreply.github.com> Date: Fri, 17 Jan 2025 15:09:12 +0000 Subject: [PATCH 12/12] Resolve conflicts? --- inflammation-analysis.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inflammation-analysis.py b/inflammation-analysis.py index de59d3778..9ceb4b409 100644 --- a/inflammation-analysis.py +++ b/inflammation-analysis.py @@ -36,9 +36,9 @@ def main(args): inflammation_data = models.load_csv(filename) view_data = { - 'average': models.daily_mean(inflammation_data), - 'max': models.daily_max(inflammation_data), - 'min': models.daily_min(inflammation_data), + "average": models.daily_mean(inflammation_data), + "max": models.daily_max(inflammation_data), + "min": models.daily_min(inflammation_data), } views.visualize(view_data)