Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dsb background #314

Merged
merged 3 commits into from
Nov 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions panpipes/python_scripts/run_preprocess_prot.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,17 @@
else:
L.error("You must specify a background MuData to run dsb, containing both rna and prot")
sys.exit("You must specify a background MuData to run dsb, containing both rna and prot")

# RNA and PROT layer must be present in the object to run dsb
if 'rna' not in list(all_mdata_bg.mod.keys()):
L.error("The MuData you specified does not contain rna modality. Cannot run dsb")
sys.exit("The MuData you specified does not contain rna modality. Cannot run dsb")

# the RNA and PROT must intersect - they won't if experimental design included some cells without PROT data
L.info("Checking that only cells with PROT signal present are in the background object")
if all_mdata_bg['rna'].shape[0] != all_mdata_bg['prot'].shape[0]:
mu.pp.intersect_obs(mdata_bg)
all_mdata_bg.update()

# checking that the same proteins are in foreground and background (since foreground might have been filtered)
L.info("Checking that the same proteins are in foreground and background")
Expand Down
Loading