diff --git a/WorkSpace/AlexP/SpotCountingByCellAndByZ/merge_dfs.py b/WorkSpace/AlexP/SpotCountingByCellAndByZ/merge_dfs.py new file mode 100644 index 0000000..63033ac --- /dev/null +++ b/WorkSpace/AlexP/SpotCountingByCellAndByZ/merge_dfs.py @@ -0,0 +1,26 @@ +import pandas as pd + +# Load the CSV files +file1_path = 'dataframe_A549_DUSP1_100nM_10min_062723_spot_counts.csv' +file2_path = 'dataframe_A549_DUSP1_100nM_10min_062723_spot_counts_z_5_9.csv' +file3_path = 'dataframe_A549_DUSP1_100nM_10min_062723_spot_counts_z_7.csv' + +df1 = pd.read_csv(file1_path) +df2 = pd.read_csv(file2_path) +df3 = pd.read_csv(file3_path) + +# Rename the "Spot_Count" column in the second dataframe to "Z_5_9" +df2.rename(columns={'Spot_Count': 'Z_5_9'}, inplace=True) + +# Rename the "Spot_Count" column in the third dataframe to "Z_7" +df3.rename(columns={'Spot_Count': 'Z_7'}, inplace=True) + +# Merge the three dataframes on the "Image_Cell_ID" column +df4 = pd.merge(df1, df2, on='Image_Cell_ID', how='inner') +merged_df = pd.merge(df4, df3, on='Image_Cell_ID', how='inner') + +# Save the merged dataframe to a new CSV file +merged_file_path = 'merged_dataframe_A549_DUSP1_100nM_10min_062723.csv' +merged_df.to_csv(merged_file_path, index=False) + +merged_file_path diff --git a/WorkSpace/AlexP/SpotCountingByCellAndByZ/merged_dataframe_A549_DUSP1_100nM_10min_062723.csv b/WorkSpace/AlexP/SpotCountingByCellAndByZ/merged_dataframe_A549_DUSP1_100nM_10min_062723.csv new file mode 100644 index 0000000..e520a3f --- /dev/null +++ b/WorkSpace/AlexP/SpotCountingByCellAndByZ/merged_dataframe_A549_DUSP1_100nM_10min_062723.csv @@ -0,0 +1,125 @@ +Image_Cell_ID,Spot_Count,Z_5_9,Z_7 +"(0, 0)",122,79,25 +"(0, 1)",287,193,62 +"(0, 2)",215,111,36 +"(0, 3)",306,161,52 +"(0, 4)",134,101,29 +"(0, 5)",124,97,28 +"(1, 6)",273,154,18 +"(1, 7)",167,94,11 +"(1, 8)",45,20,1 +"(2, 9)",82,37,8 +"(2, 10)",90,66,24 +"(2, 11)",204,129,55 +"(2, 12)",171,111,34 +"(2, 13)",41,28,5 +"(2, 14)",111,56,11 +"(3, 15)",381,281,85 +"(3, 16)",261,210,47 +"(3, 17)",195,126,31 +"(3, 18)",100,68,18 +"(4, 19)",322,189,67 +"(4, 20)",327,256,64 +"(4, 21)",44,35,6 +"(4, 22)",90,59,14 +"(5, 23)",47,36,9 +"(5, 24)",237,174,37 +"(5, 25)",147,107,29 +"(5, 26)",93,64,16 +"(5, 27)",55,45,9 +"(5, 28)",151,133,26 +"(5, 29)",75,59,11 +"(6, 30)",237,175,51 +"(6, 31)",276,222,60 +"(6, 32)",220,143,18 +"(6, 33)",71,38,6 +"(7, 34)",195,150,29 +"(7, 35)",240,141,40 +"(7, 36)",164,103,25 +"(7, 37)",168,114,22 +"(7, 38)",72,46,10 +"(7, 39)",52,45,15 +"(7, 40)",47,41,12 +"(8, 41)",123,84,18 +"(8, 42)",64,43,11 +"(8, 43)",104,83,30 +"(8, 44)",62,50,11 +"(8, 45)",53,38,11 +"(9, 46)",265,213,75 +"(9, 47)",164,100,31 +"(9, 48)",162,126,32 +"(9, 49)",227,160,55 +"(9, 50)",65,38,10 +"(9, 51)",106,77,25 +"(9, 52)",66,47,15 +"(9, 53)",32,19,4 +"(9, 54)",26,20,6 +"(10, 55)",104,75,13 +"(10, 56)",127,86,15 +"(10, 57)",40,30,10 +"(11, 58)",59,45,5 +"(11, 59)",149,97,21 +"(11, 60)",183,114,19 +"(11, 61)",142,95,18 +"(11, 62)",70,53,10 +"(11, 63)",77,64,11 +"(11, 64)",9,6,2 +"(12, 65)",272,178,24 +"(12, 66)",350,274,58 +"(12, 67)",171,108,14 +"(12, 68)",274,102,14 +"(12, 69)",43,23,4 +"(12, 70)",71,56,7 +"(13, 71)",81,51,14 +"(13, 72)",191,146,21 +"(13, 73)",88,72,13 +"(14, 74)",141,104,17 +"(14, 75)",444,393,80 +"(14, 76)",93,66,20 +"(15, 77)",60,30,3 +"(15, 78)",50,24,1 +"(15, 79)",62,36,1 +"(15, 81)",62,35,1 +"(16, 83)",155,62,1 +"(18, 87)",135,124,31 +"(18, 88)",45,43,5 +"(18, 89)",59,51,12 +"(18, 90)",39,29,6 +"(19, 91)",93,63,22 +"(19, 92)",149,123,46 +"(19, 93)",62,42,15 +"(19, 94)",51,30,13 +"(19, 95)",11,8,3 +"(20, 97)",249,183,57 +"(20, 98)",134,115,48 +"(20, 99)",65,50,21 +"(20, 100)",36,26,3 +"(22, 102)",91,42,2 +"(22, 103)",115,62,11 +"(22, 104)",185,109,21 +"(22, 105)",34,19,3 +"(24, 108)",77,50,11 +"(24, 109)",60,39,5 +"(25, 110)",77,38,7 +"(25, 111)",102,72,7 +"(25, 112)",62,42,15 +"(25, 113)",23,15,5 +"(25, 114)",15,11,2 +"(25, 115)",12,8,2 +"(26, 116)",97,54,9 +"(26, 117)",73,43,1 +"(26, 118)",73,37,9 +"(26, 119)",25,18,1 +"(27, 121)",81,48,13 +"(27, 122)",10,4,2 +"(27, 123)",66,49,10 +"(27, 124)",24,13,3 +"(27, 125)",14,13,3 +"(28, 126)",17,11,2 +"(28, 127)",21,9,2 +"(28, 128)",27,17,6 +"(29, 130)",38,28,5 +"(29, 131)",55,29,5 +"(29, 132)",47,30,5 +"(29, 134)",54,29,5 +"(29, 135)",52,32,6 diff --git a/WorkSpace/AlexP/SpotCountingByCellAndByZ/spot_counting_Zs5thru9.py b/WorkSpace/AlexP/SpotCountingByCellAndByZ/spot_counting_Zs5thru9.py new file mode 100644 index 0000000..5b2068a --- /dev/null +++ b/WorkSpace/AlexP/SpotCountingByCellAndByZ/spot_counting_Zs5thru9.py @@ -0,0 +1,51 @@ +import pandas as pd + +# List of file names +files = [ + 'dataframe_A549_DUSP1_100nM_10min_062723.csv', + 'dataframe_A549_DUSP1_100nM_20min_062723.csv', + 'dataframe_A549_DUSP1_100nM_30min_062723.csv', + 'dataframe_A549_DUSP1_100nM_40min_062723.csv' +] + +# Initialize a dictionary to store the total "spot_count" for each file +spot_count_per_file = {} + +# Loop through each file +for file in files: + # Load the CSV file + df = pd.read_csv(file) + + # Filter the dataframe to include only rows with "z" values between 5 and 9 + filtered_df = df[(df['z'] >= 5) & (df['z'] <= 9)] + + # Initialize a dictionary to store the spot count for each "cell_id" in the file + file_spot_counts = {} + + # Loop through each "image_id" + for image_id in filtered_df['image_id'].unique(): + image_df = filtered_df[filtered_df['image_id'] == image_id] + + # Loop through each "cell_id" in the current "image_id" + for cell_id in image_df['cell_id'].unique(): + cell_df = image_df[image_df['cell_id'] == cell_id] + + # Count the number of unique "spot_id" values per "z" value for this cell_id + spot_count = cell_df.groupby('z')['spot_id'].nunique().sum() + + # Save the total "spot_count" for this "cell_id" + file_spot_counts[(image_id, cell_id)] = spot_count + + # Store the result for the current file + spot_count_per_file[file] = file_spot_counts + +# Save the spot counts for each file into separate CSVs +for file, spot_counts in spot_count_per_file.items(): + # Convert the dictionary to a DataFrame + spot_counts_df = pd.DataFrame(list(spot_counts.items()), columns=['Image_Cell_ID', 'Spot_Count']) + + # Save the DataFrame to a new CSV file + output_filename = file.replace('.csv', '_spot_counts_z_5_9.csv') + spot_counts_df.to_csv(output_filename, index=False) + +print("Spot count files for z=5-9 saved successfully.") diff --git a/WorkSpace/AlexP/SpotCountingByCellAndByZ/spot_counting_singleZ.py b/WorkSpace/AlexP/SpotCountingByCellAndByZ/spot_counting_singleZ.py new file mode 100644 index 0000000..61c4319 --- /dev/null +++ b/WorkSpace/AlexP/SpotCountingByCellAndByZ/spot_counting_singleZ.py @@ -0,0 +1,51 @@ +import pandas as pd + +# List of file names +files = [ + 'dataframe_A549_DUSP1_100nM_10min_062723.csv', + 'dataframe_A549_DUSP1_100nM_20min_062723.csv', + 'dataframe_A549_DUSP1_100nM_30min_062723.csv', + 'dataframe_A549_DUSP1_100nM_40min_062723.csv' +] + +# Initialize a dictionary to store the total "spot_count" for each file +spot_count_per_file = {} + +# Loop through each file +for file in files: + # Load the CSV file + df = pd.read_csv(file) + + # Filter the dataframe to include only rows with "z" values = 7 + filtered_df = df[(df['z'] == 7)] + + # Initialize a dictionary to store the spot count for each "cell_id" in the file + file_spot_counts = {} + + # Loop through each "image_id" + for image_id in filtered_df['image_id'].unique(): + image_df = filtered_df[filtered_df['image_id'] == image_id] + + # Loop through each "cell_id" in the current "image_id" + for cell_id in image_df['cell_id'].unique(): + cell_df = image_df[image_df['cell_id'] == cell_id] + + # Count the number of unique "spot_id" values per "z" value for this cell_id + spot_count = cell_df.groupby('z')['spot_id'].nunique().sum() + + # Save the total "spot_count" for this "cell_id" + file_spot_counts[(image_id, cell_id)] = spot_count + + # Store the result for the current file + spot_count_per_file[file] = file_spot_counts + +# Save the spot counts for each file into separate CSVs +for file, spot_counts in spot_count_per_file.items(): + # Convert the dictionary to a DataFrame + spot_counts_df = pd.DataFrame(list(spot_counts.items()), columns=['Image_Cell_ID', 'Spot_Count']) + + # Save the DataFrame to a new CSV file + output_filename = file.replace('.csv', '_spot_counts_z_7.csv') + spot_counts_df.to_csv(output_filename, index=False) + +print("Spot count files for z=7 saved successfully.") diff --git a/WorkSpace/AlexP/SpotCountingByCellAndByZ/spot_counting_thru_time_100nM.py b/WorkSpace/AlexP/SpotCountingByCellAndByZ/spot_counting_thru_time_100nM.py new file mode 100644 index 0000000..be301d7 --- /dev/null +++ b/WorkSpace/AlexP/SpotCountingByCellAndByZ/spot_counting_thru_time_100nM.py @@ -0,0 +1,122 @@ +# Import necessary libraries +import pandas as pd +import matplotlib.pyplot as plt + +# File paths +file_paths = [ + 'dataframe_A549_DUSP1_100nM_10min_062723.csv', + 'dataframe_A549_DUSP1_100nM_20min_062723.csv', + 'dataframe_A549_DUSP1_100nM_30min_062723.csv', + 'dataframe_A549_DUSP1_100nM_40min_062723.csv', +] + +# Corresponding time points +time_points = ['10min', '20min', '30min', '40min'] + +# Initialize dictionaries to store spot counts +total_spot_counts_by_time = {} +spot_counts_z_0_3_by_time = {} +spot_counts_z_4_7_by_time = {} +spot_counts_z_8_11_by_time = {} +spot_counts_z_12_15_by_time = {} +spot_counts_z_16_19_by_time = {} +spot_counts_z_20_23_by_time = {} +spot_counts_z_24_27_by_time = {} + +# Loop through each file and calculate the spot counts +for file, time_point in zip(file_paths, time_points): + df = pd.read_csv(file) + + # Count unique spot_id values per image_id and cell_id for all z-values + total_spot_count = df.groupby(['image_id', 'cell_id'])['spot_id'].nunique().sum() + + # Filter for z-slices + filtered_df_z_0_3 = df[(df['z'] >= 0) & (df['z'] <= 3)] + filtered_df_z_4_7 = df[(df['z'] >= 4) & (df['z'] <= 7)] + filtered_df_z_8_11 = df[(df['z'] >= 8) & (df['z'] <= 11)] + filtered_df_z_12_15 = df[(df['z'] >= 12) & (df['z'] <= 15)] + filtered_df_z_16_19 = df[(df['z'] >= 16) & (df['z'] <= 19)] + filtered_df_z_20_23 = df[(df['z'] >= 20) & (df['z'] <= 23)] + filtered_df_z_24_27 = df[(df['z'] >= 24) & (df['z'] <= 27)] + + # Count unique spot_id values per image_id and cell_id for z=0-3 + spot_count_z_0_3 = filtered_df_z_0_3.groupby(['image_id', 'cell_id'])['spot_id'].nunique().sum() + + # Count unique spot_id values per image_id and cell_id for z=4-7 + spot_count_z_4_7 = filtered_df_z_4_7.groupby(['image_id', 'cell_id'])['spot_id'].nunique().sum() + + # Count unique spot_id values per image_id and cell_id for z=8-11 + spot_count_z_8_11 = filtered_df_z_8_11.groupby(['image_id', 'cell_id'])['spot_id'].nunique().sum() + + # Count unique spot_id values per image_id and cell_id for z=12-15 + spot_count_z_12_15 = filtered_df_z_12_15.groupby(['image_id', 'cell_id'])['spot_id'].nunique().sum() + + # Count unique spot_id values per image_id and cell_id for z=16-19 + spot_count_z_16_19 = filtered_df_z_16_19.groupby(['image_id', 'cell_id'])['spot_id'].nunique().sum() + + # Count unique spot_id values per image_id and cell_id for z=20-23 + spot_count_z_20_23 = filtered_df_z_20_23.groupby(['image_id', 'cell_id'])['spot_id'].nunique().sum() + + # Count unique spot_id values per image_id and cell_id for z=24-27 + spot_count_z_24_27 = filtered_df_z_24_27.groupby(['image_id', 'cell_id'])['spot_id'].nunique().sum() + + # Save the total spot counts for this time point + total_spot_counts_by_time[time_point] = total_spot_count + spot_counts_z_0_3_by_time[time_point] = spot_count_z_0_3 + spot_counts_z_4_7_by_time[time_point] = spot_count_z_4_7 + spot_counts_z_8_11_by_time[time_point] = spot_count_z_8_11 + spot_counts_z_12_15_by_time[time_point] = spot_count_z_12_15 + spot_counts_z_16_19_by_time[time_point] = spot_count_z_16_19 + spot_counts_z_20_23_by_time[time_point] = spot_count_z_20_23 + spot_counts_z_24_27_by_time[time_point] = spot_count_z_24_27 + +# Prepare data for plotting +times = list(total_spot_counts_by_time.keys()) +total_spot_counts = list(total_spot_counts_by_time.values()) +spot_counts_z_0_3 = list(spot_counts_z_0_3_by_time.values()) +spot_counts_z_4_7 = list(spot_counts_z_4_7_by_time.values()) +spot_counts_z_8_11 = list(spot_counts_z_8_11_by_time.values()) +spot_counts_z_12_15 = list(spot_counts_z_12_15_by_time.values()) +spot_counts_z_16_19 = list(spot_counts_z_16_19_by_time.values()) +spot_counts_z_20_23 = list(spot_counts_z_20_23_by_time.values()) +spot_counts_z_24_27 = list(spot_counts_z_24_27_by_time.values()) + +# Create the plot +plt.figure(figsize=(10,6)) + +# Plot total spot counts across all z-values +plt.plot(times, total_spot_counts, marker='o', linestyle='-', color='b', markersize=8, label='Total Spot Counts') + +# Plot z=24-27 spot counts +plt.plot(times, spot_counts_z_24_27, marker='o', linestyle='-', color='c', markersize=8, label='Spot Counts (z=24-27)') + +# Plot z=20-23 spot counts +plt.plot(times, spot_counts_z_20_23, marker='o', linestyle='-', color='c', markersize=8, label='Spot Counts (z=20-23)') + +# Plot z=16-19 spot counts +plt.plot(times, spot_counts_z_16_19, marker='o', linestyle='-', color='c', markersize=8, label='Spot Counts (z=16-19)') + +# Plot z=12-15 spot counts +plt.plot(times, spot_counts_z_12_15, marker='o', linestyle='-', color='c', markersize=8, label='Spot Counts (z=12-15)') + +# Plot z=8-11 spot counts +plt.plot(times, spot_counts_z_8_11, marker='o', linestyle='-', color='c', markersize=8, label='Spot Counts (z=8-11)') + +# Plot z=4-7 spot counts +plt.plot(times, spot_counts_z_4_7, marker='o', linestyle='-', color='r', markersize=8, label='Spot Counts (z=4-7)') + +# Plot z=0-3 spot counts +plt.plot(times, spot_counts_z_0_3, marker='o', linestyle='-', color='r', markersize=8, label='Spot Counts (z=0-3)') + + +# Add labels and title +plt.title('Spot Counts Through Time (All z-stacks and z-slice subsets) 100nM Dex') +plt.xlabel('Time (min)') +plt.ylabel('Spot Count') +plt.grid(True) + +# Adjust the legend placement to move it slightly up from the lower right corner +plt.legend(loc='upper left', bbox_to_anchor=(0, 1)) + +# Display the plot +plt.show() \ No newline at end of file diff --git a/WorkSpace/AlexP/SpotCountingByCellAndByZ/spots_per_cell.py b/WorkSpace/AlexP/SpotCountingByCellAndByZ/spots_per_cell.py new file mode 100644 index 0000000..e2e345f --- /dev/null +++ b/WorkSpace/AlexP/SpotCountingByCellAndByZ/spots_per_cell.py @@ -0,0 +1,48 @@ +import pandas as pd + +# List of file names +files = [ + 'dataframe_A549_DUSP1_100nM_10min_062723.csv', + 'dataframe_A549_DUSP1_100nM_20min_062723.csv', + 'dataframe_A549_DUSP1_100nM_30min_062723.csv', + 'dataframe_A549_DUSP1_100nM_40min_062723.csv' +] + +# Initialize a dictionary to store the total "spot_count" for each file +spot_count_per_file = {} + +# Loop through each file +for file in files: + # Load the CSV file + df = pd.read_csv(file) + + # Initialize a dictionary to store the spot count for each "cell_id" in the file + file_spot_counts = {} + + # Loop through each "image_id" + for image_id in df['image_id'].unique(): + image_df = df[df['image_id'] == image_id] + + # Loop through each "cell_id" in the current "image_id" + for cell_id in image_df['cell_id'].unique(): + cell_df = image_df[image_df['cell_id'] == cell_id] + + # Count the number of unique "spot_id" values per "z" value for this cell_id + spot_count = cell_df.groupby('z')['spot_id'].nunique().sum() + + # Save the total "spot_count" for this "cell_id" + file_spot_counts[(image_id, cell_id)] = spot_count + + # Store the result for the current file + spot_count_per_file[file] = file_spot_counts + +# Save the spot counts for each file into separate CSVs +for file, spot_counts in spot_count_per_file.items(): + # Convert the dictionary to a DataFrame + spot_counts_df = pd.DataFrame(list(spot_counts.items()), columns=['Image_Cell_ID', 'Spot_Count']) + + # Save the DataFrame to a new CSV file + output_filename = file.replace('.csv', '_spot_counts.csv') + spot_counts_df.to_csv(output_filename, index=False) + +print("Spot count files saved successfully.") \ No newline at end of file diff --git a/WorkSpace/AlexP/SpotCountingByCellAndByZ/spots_per_z.R b/WorkSpace/AlexP/SpotCountingByCellAndByZ/spots_per_z.R new file mode 100644 index 0000000..0d29203 --- /dev/null +++ b/WorkSpace/AlexP/SpotCountingByCellAndByZ/spots_per_z.R @@ -0,0 +1,32 @@ +# Load necessary libraries +library(ggplot2) +library(dplyr) + +# Load the dataset (adjust the path as needed) +df <- read.csv("dataframe_A549_DUSP1_100nM_10min_062723.csv") + +# Create a line plot for each image_id and cell_id +unique_image_ids <- unique(df$image_id) + +for (image_id in unique_image_ids) { + # Filter the data for the current image_id + filtered_data_image <- df %>% + filter(image_id == !!image_id) + + # Group by 'cell_id' and 'z', and count the unique 'spot_id' values for each combination + unique_spots_per_z_cell <- filtered_data_image %>% + group_by(cell_id, z) %>% + summarize(unique_spot_count = n_distinct(spot_id)) + + # Create the plot + p <- ggplot(unique_spots_per_z_cell, aes(x = z, y = unique_spot_count, group = cell_id)) + + geom_line(alpha = 0.5) + + geom_point(alpha = 0.5) + + labs(title = paste("Number of Unique spot_id Values for Each z by cell_id in image_id =", image_id), + x = "z Values", + y = "Unique Spot Count") + + theme_minimal() + + # Display the plot + print(p) +} diff --git a/WorkSpace/AlexP/workspaceOct22_2024.mat b/WorkSpace/AlexP/workspaceOct22_2024.mat new file mode 100644 index 0000000..915aee5 Binary files /dev/null and b/WorkSpace/AlexP/workspaceOct22_2024.mat differ diff --git a/WorkSpace/EricModel/a1_Apply_PDO_to_DUSP1_data_and_model.m b/WorkSpace/EricModel/a1_Apply_PDO_to_DUSP1_data_and_model.m index 907416e..c4a8da1 100644 --- a/WorkSpace/EricModel/a1_Apply_PDO_to_DUSP1_data_and_model.m +++ b/WorkSpace/EricModel/a1_Apply_PDO_to_DUSP1_data_and_model.m @@ -7,7 +7,7 @@ addpath(genpath('../../src')); loadPrevious = true; -savedWorkspace = 'workspaceOct22_2024'; +savedWorkspace = '../AlexP/workspaceOct22_2024'; addpath('tmpPropensityFunctions'); if loadPrevious @@ -76,6 +76,14 @@ ModelPDOSpots = ModelGRDusp100nM.calibratePDO('../../ExampleData/pdoCalibrationData.csv',... {'rna'},{'nTotal'},{'nSpots0'},'AffinePoiss',true); +%% STEP PDO.B.1.a -- Calibrate PDO from single (and 5-9) z-stacks +ModelPDO_single_Z = ModelGRDusp100nM; +ModelPDO_5thru9_Zs = ModelGRDusp100nM; +ModelPDO_single_Z = ModelPDO_single_Z.calibratePDO('../AlexP/SpotCountingByCellAndByZ/merged_dataframe_A549_DUSP1_100nM_10min_062723.csv',... + {'rna'},{'Spot_Count'},{'Z_7'},'AffinePoiss',true); +ModelPDO_5thru9_Zs = ModelPDO_5thru9_Zs.calibratePDO('../AlexP/SpotCountingByCellAndByZ/merged_dataframe_A549_DUSP1_100nM_10min_062723.csv',... + {'rna'},{'Spot_Count'},{'Z_5_9'},'AffinePoiss',true,[1,230,0.5]); + %% STEP PDO.B.2. -- Calibrate PDO from Eric's DUSP1 Intensity Data. ModelPDOIntensEric = ModelGRDusp100nM; ModelPDOIntensEric = ModelPDOIntensEric.calibratePDO('EricData/pdoCalibrationData_EricIntensity_DexSweeps.csv',... @@ -107,6 +115,58 @@ CH(5).LineWidth = 3; end end + +%% STEP PDO.C.1.a. -- Analyze FIM with PDO for single Z and Zs 5-9 +%fimsPDO_single_Z = ModelPDO_single_Z.computeFIM([],'log'); +%fimPDO_single_Z = ModelPDO_single_Z.evaluateExperiment(fimsPDO_single_Z,nCellsOpt,diag(GRDusp1_log10PriorStd.^2)); + +%nCellsOptPDO_single_Zs = ModelPDO_single_Z.optimizeCellCounts(fimsPDO_single_Z,nTotal,'tr[1:4]'); + + +%fig_single_Z = figure; +%ModelGRDusp100nM.plotMHResults(MHResultsDusp1,[fimPDO_single_Z,fimTotal,fimOpt],'log',[],fig_single_Z); +%for i = 1:3 +% for j = i:3 +% subplot(3,3,(i-1)*3+j) +% CH = get(gca,'Children'); +% CH(1).Color=[0,0,0]; % MH - black +% CH(1).LineWidth = 3; +% CH(2).Color=[0,0,0]; % MLE - black +% CH(2).LineWidth = 3; +% CH(3).Color=[0,0,1]; % fimPDOSpots - cyan +% CH(3).LineWidth = 3; +% CH(4).Color=[0,1,1]; % fimTotal - blue +% CH(4).LineWidth = 3; +% CH(5).Color=[1,0,1]; % fimOpt - magenta +% CH(5).LineWidth = 3; +% end +%end + +fimsPDO_5thru9_Zs = ModelPDO_5thru9_Zs.computeFIM([],'log'); +fimPDO_5thru9_Zs = ModelPDO_5thru9_Zs.evaluateExperiment(fimsPDO_5thru9_Zs,nCellsOpt,diag(GRDusp1_log10PriorStd.^2)); + +nCellsOptPDO_5thru9_Zs = ModelPDO_5thru9_Zs.optimizeCellCounts(fimsPDO_5thru9_Zs,nTotal,'tr[1:4]'); + + +fig_Zs_5thru9 = figure; +ModelGRDusp100nM.plotMHResults(MHResultsDusp1,[fimPDO_5thru9_Zs,fimTotal,fimOpt],'log',[],fig_Zs_5thru9); +for i = 1:3 + for j = i:3 + subplot(3,3,(i-1)*3+j) + CH = get(gca,'Children'); + CH(1).Color=[0,0,0]; % MH - black + CH(1).LineWidth = 3; + CH(2).Color=[0,0,0]; % MLE - black + CH(2).LineWidth = 3; + CH(3).Color=[0,0,1]; % fimPDOSpots - cyan + CH(3).LineWidth = 3; + CH(4).Color=[0,1,1]; % fimTotal - blue + CH(4).LineWidth = 3; + CH(5).Color=[1,0,1]; % fimOpt - magenta + CH(5).LineWidth = 3; + end +end + %% STEP PDO.C.2. -- Analyze FIM with PDO for Intensity only fimsPDOIntens = ModelPDOIntensEric.computeFIM([],'log'); fimPDOIntens = ModelPDOIntensEric.evaluateExperiment(fimsPDOIntens,nCellsOpt,diag(GRDusp1_log10PriorStd.^2));