kharchenkolab / Baysor

Bayesian Segmentation of Spatial Transcriptomics Data
https://kharchenkolab.github.io/Baysor/
MIT License
152 stars 31 forks source link

Missing Transcript Plots with Preview #113

Closed matthewcormier95 closed 1 month ago

matthewcormier95 commented 6 months ago

Hello! My first time posting so my apoligies if I am missing some information.

I am using baysor preview with V0.6.2. The code works but then I get an error at the end. When I open the html output, I get all the available plot outputs except for the transcript plots. Does anyone know what could be the matter?

(baysor) $ baysor preview -x x_location -y y_location -z z_location -g feature_name -m 10 path/to/transcript.csv
[14:51:39] Info: # CLI params: `-x x_location -y y_location -z z_location -g feature_name -m 10 path/to/transcript.csv`
[14:51:39] Info: (2024-03-14) Run Baysor v0.6.2
[14:51:39] Info: Loading data...
[14:51:54] Info: Loaded 4594120 transcripts
[14:51:56] Info: Estimating noise level
[14:53:21] Info: Done
[14:53:21] Info: Estimating local colors
[15:08:59] Info: Building transcript plots
[15:09:02] Info: Building gene structure plot
[15:10:01] Info: Plotting
[15:11:27] Info: All done!

(process:35155): GLib-CRITICAL **: 15:11:27.593: g_datalist_id_set_data_full: assertion 'key_id > 0' failed

(process:35155): GLib-CRITICAL **: 15:11:27.593: g_datalist_id_set_data_full: assertion 'key_id > 0' failed
matthewcormier95 commented 6 months ago

Update: it seems to have worked if I downgraded Baysor to v0.5.0.

VPetukhov commented 2 months ago

That looks like some dependency error. If it's still relevant, could you try running it on a subset of the data?

alipirani88 commented 1 week ago

I get the same error with V0.6.2. Still missing transcript plots from the preview report. Screenshot 2024-09-24 at 9 41 33 AM

VPetukhov commented 2 days ago

That is something, which is supposed to be fixed in v0.7.0. Transcript plots were just too big on Xenium, so they weren't rendered. (Yeah, I remember that v0.7.0 doesn't work for you because of the bug).

I'd suggest building a transcript plot manually. I have this WIP package baysorpy, which is mostly for internal use. But you can use it from Python, and have from baysorpy.plot_utils import plot_molecules and then run plot_molecules(df, color="ncv_color") on the Baysor output. It only requires columns to be named x, y and gene.