R/summaryFunctions.R
createSummarySpikesArray.Rd
createSummarySpikesMat
returns a 2D matrix without
cells/odours missing data. The matrix has ncells
rows x
(nodours
* numSamplePoints
) columns. Timepoints for the same
odour are in adjacent columuns.
createSummarySpikesArray
returns a 3D array without
cells/odours missing data. The array has ncells rows x nodours columns *
numSamplePoints slabs.
createSummarySpikesMat(summary_array, numSamplePoints = 7, NALimit = 3) createSummarySpikesArray(summary_array, numSamplePoints = 7, NALimit = 3)
summary_array | Raw 3D array of the form generated by
|
---|---|
numSamplePoints | The number of temporal sample points (defaults to 7) |
NALimit | The maximum number of missing responses that are acceptable |
Some analysis (eg PCA) cannot cope with missing data. These functions will drop cells or odours in order to give a dataset without missing data. The choice of NALimit will affect how many cells/odours are dropped. NALimit=3, the default for some time, is now too low since it will result in too many odours being dropped (while keeping more cells).
Other summary_array: create_raw_summary_array
summary_array=create_raw_summary_array() clean_summary_array=createSummarySpikesArray(summary_array, NALimit = 25) clean_summary_mat=createSummarySpikesMat(summary_array, NALimit = 25) str(clean_summary_array)#> num [1:440, 1:36, 1:7] 7.5 0 0 0.5 0 0 3 0 0.5 0 ... #> - attr(*, "dimnames")=List of 3 #> ..$ : chr [1:440] "nm20120216c0" "nm20120131c0" "nm20120321c0" "nm20120531c0" ... #> ..$ : chr [1:36] "OilBl" "E2Hex" "GerAc" "Prpyl" ... #> ..$ : chr [1:7] "baseline" "max1" "max2" "max3" ...str(clean_summary_mat)#> num [1:440, 1:252] 7.5 0 0 0.5 0 0 3 0 0.5 0 ... #> - attr(*, "dimnames")=List of 2 #> ..$ : chr [1:440] "nm20120216c0" "nm20120131c0" "nm20120321c0" "nm20120531c0" ... #> ..$ : NULL