Open RoryCostell opened 2 months ago
@RoryCostell hey mate, we will have a look! This most often comes up if there are some ROIs that don't have all the region types present. Was an oversight on our part when writing the code (we had larger ROIs where there was always representation across them). But if it was working before the update then perhaps something went wrong when we moved to v1.2.
@RoryCostell hey mate, we will have a look! This most often comes up if there are some ROIs that don't have all the region types present. Was an oversight on our part when writing the code (we had larger ROIs where there was always representation across them). But if it was working before the update then perhaps something went wrong when we moved to v1.2.
Thanks Tom!
That must be it, as the ROIs are based on a TMA of separate regions. The workaround I've used for now is to redefine area.table to area.totals, with the previous checks above.
` ### Some checks
as.matrix(unique(cell.dat[[roi.col]]))
as.matrix(unique(cell.dat[[group.col]]))
as.matrix(unique(cell.dat[[region.col]]))
as.matrix(unique(cell.dat[[batch.col]]))
area.table
as.matrix(unique(cell.dat[[pop.col]]))
## Temporary until region fix
**area.totals
cell.dat$Region <- 'Total'
region.col <- 'Region'**
### Run area analysis on the DATA.TABLE
reg.dat <- run.spatial.analysis(dat = cell.dat,
sample.col = roi.col,
pop.col = pop.col,
annot.cols = batch.col, group.col,
region.col = region.col,
**area.table = area.totals**) ## Also calculate on total by default
reg.dat[,c(1:10)]
`
Hi, I have updated my Spectre to 1.2.0, and also updated R and R studio to the latest build.
When I run the new advanced spatial workflow, everything works great and the addition of the regions and cell types is great.
However, when I run the third script - advanced quantitative analysis, and I run the area analysis, it seems unable to run the area analysis by region for all the ROIs, giving the error:
It this because some of the cell types are not present in the region: Tumour?
The area analysis is working fine with the old code, setting the region to total and ignoring the individual regions for the area analysis.
Please let me know if you need more information and I will reproduce the error.
Thank you very much!