From e2fbccb0db3f87c1e47634387e5eb9e3227e1baf Mon Sep 17 00:00:00 2001
From: David Mendez <dmendez@ebi.ac.uk>
Date: Wed, 31 Aug 2022 15:30:28 +0100
Subject: [PATCH] Cell health and viability data: add average and standard
 deviation to the table

---
 .../ImagesInTime/ImagesDialog.vue             |  2 +-
 .../PropertiesDetailsDialog.vue               | 48 +++++++++++++++----
 2 files changed, 40 insertions(+), 10 deletions(-)

diff --git a/components/report_cards/chemical_probe/CellViabilityAndHealthComponents/CellPropsRows/ImagesInTime/ImagesDialog.vue b/components/report_cards/chemical_probe/CellViabilityAndHealthComponents/CellPropsRows/ImagesInTime/ImagesDialog.vue
index 063c446..9b4c9b1 100644
--- a/components/report_cards/chemical_probe/CellViabilityAndHealthComponents/CellPropsRows/ImagesInTime/ImagesDialog.vue
+++ b/components/report_cards/chemical_probe/CellViabilityAndHealthComponents/CellPropsRows/ImagesInTime/ImagesDialog.vue
@@ -74,7 +74,7 @@
 
                         <v-col cols="12" sm="6">
                           <b>Img URL:</b><br />
-                          <a href="replicateData.img_url">
+                          <a :href="replicateData.img_url">
                             {{ replicateData.img_url }}</a
                           >
                           <br /><br />
diff --git a/components/report_cards/chemical_probe/CellViabilityAndHealthComponents/CellPropsRows/PropertiesDetails/PropertiesDetailsDialog.vue b/components/report_cards/chemical_probe/CellViabilityAndHealthComponents/CellPropsRows/PropertiesDetails/PropertiesDetailsDialog.vue
index 2838ce5..9be4bd0 100644
--- a/components/report_cards/chemical_probe/CellViabilityAndHealthComponents/CellPropsRows/PropertiesDetails/PropertiesDetailsDialog.vue
+++ b/components/report_cards/chemical_probe/CellViabilityAndHealthComponents/CellPropsRows/PropertiesDetails/PropertiesDetailsDialog.vue
@@ -27,16 +27,30 @@
                 v-for="rowData in getActivityRows(actData.byTimePoints)"
                 :key="rowData.timePoint"
               >
-                <td>{{ rowData.timePoint }}</td>
-                <td>
-                  <a :href="getLinkToAssay(chemblID)">{{
-                    rowData.assayChemblID
-                  }}</a>
-                </td>
+                <template v-if="rowData.replicateNumber > 0">
+                  <td>{{ rowData.timePoint }}</td>
+                  <td>
+                    <a :href="getLinkToAssay(chemblID)">{{
+                      rowData.assayChemblID
+                    }}</a>
+                  </td>
 
-                <td>{{ rowData.replicateNumber }}</td>
-                <td>{{ rowData.standardValue }}</td>
-                <td>{{ rowData.standardUnits }}</td>
+                  <td>{{ rowData.replicateNumber }}</td>
+                  <td>{{ rowData.standardValue }}</td>
+                  <td>{{ rowData.standardUnits }}</td>
+                </template>
+
+                <template v-else>
+                  <td></td>
+                  <td></td>
+                  <td>
+                    <b>{{ rowData.assayChemblID }}</b>
+                  </td>
+                  <td>
+                    <b>{{ rowData.standardValue }}</b>
+                  </td>
+                  <td></td>
+                </template>
               </tr>
             </tbody>
           </v-simple-table>
@@ -91,6 +105,22 @@ export default {
             standardUnits: replicateData.standard_units,
           })
         }
+
+        // average
+        rows.push({
+          timePoint,
+          assayChemblID: 'AVG',
+          replicateNumber: -1,
+          standardValue: timePointData.summary.avg,
+        })
+
+        // std dev
+        rows.push({
+          timePoint,
+          assayChemblID: 'STD',
+          replicateNumber: -2,
+          standardValue: timePointData.summary.std,
+        })
       }
 
       return rows
-- 
GitLab