Repository navigation
Support the Baysor Cpp implementation - #430
Conversation
quentinblampey
left a comment
There was a problem hiding this comment.
Two naive questions (because I didn't try the new version):
- The original issue mentions
Baysor segmentation fails: missing config.toml, but in the command line you only change the output location, so how did it fix the config.toml issue? Or maybe the issue the user had was not related to the new baysor version? - One other question about backward compatibility (see my review comment)
Switching the Baysor command to TSV output might be the better long-term option.
If Baysor always output a TSV (in both >=0.8 and <0.8 versions) then, yes definitely, it would avoid this read_loom complexity
| prior_suffix = f" :{prior_shapes_key}" if prior_shapes_key else "" # use a prior segmentation | ||
|
|
||
| return f"{baysor_executable_path} run {polygon_format} -c config.toml transcripts.csv" + prior_suffix | ||
| return f"{baysor_executable_path} run {polygon_format} -c config.toml transcripts.csv -o ." + prior_suffix |
There was a problem hiding this comment.
Does it also work with the previous baysor versions? In baysor<0.8, -o is the path to one single file, so I'm not sure what happens if the output file is .?
There was a problem hiding this comment.
Yes, I tested it on v0.7.1 and cpp_v0.8.2, and it works. The -o option specifies the output path. In cpp_v0.8.2, however, it defaults to segmentation.csv, which is a bit confusing. 😕
|
I'm not sure why the user mentioned a missing config.toml. I think the error message I was able to reproduce the same message simply by switching to the Baysor C++ version: The fix resolves the issue. But let's switch to |
This PR adds support for Baysor C++ v0.8.2 (issue #427).
What changed
-o .to the Baysor command so the outputs are written directly into the patch directory instead of asegmentation.csv/subfolder.Reverted changes
segmentation_counts.loomwith loompy usingvalidate=Falseand rebuild theAnnDatawith the correct orientation. The Baysor C++ implementation writes the matrix transposed (cells × genes) relative to the Loom spec (genes × cells), which makesread_loomreject the file.Loom is not well maintained and supports only a subset of anndata features. The
anndata.io.read_loomreader is also deprecated since anndata 0.13 (see https://anndata.readthedocs.io/en/latest/generated/anndata.io.read_loom.html). Switching the Baysor command to TSV output might be the better long-term option.@quentinblampey
Closes #427