zijianni / SpotClean

R package for decontaminating the spot swapping effect and recovering true expression in spatial transcriptomics data
21 stars 8 forks source link

RCTD "SpatialRNA: counts does not contain integers" #33

Open ahwanpandey opened 3 hours ago

ahwanpandey commented 3 hours ago

Hello,

Thanks for sharing this tool!

I just cleaned my Spatial data using SpotClean. Now I am trying to feed in this cleaned data into RCTD but am getting this error:

> query <- SpatialRNA(coords, counts, nUMI)
Error in check_counts(counts, "SpatialRNA", require_int = require_int) : 
  SpatialRNA: counts does not contain integers

The developer of RCTD states that the data does not need to be corrected as RCTD should handle it. https://github.com/dmcable/spacexr/issues/147 https://github.com/dmcable/spacexr/issues/161

I am thinking of rounding the SpotClean values to integers.

Or maybe as the RCTD developer suggest,s I don't need to run SpotClean before using RCTD.

Do you have any suggestions or experience with this?

Thanks! Ahwan

ahwanpandey commented 2 hours ago

I just did a quick check for one sample by converting the post Spotclean values to integers [round(spot_clean_vals, 0)] and then running RCTD. The results were very similar so it seems I don't need to actually run SpotClean for this purpose? But then again, this was on a sample where the contamination rate was quite low.

But in any case, would be great to hear your thoughts!