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

SAMap consistently generating a bifurcated UMAP #142

Closed
dariotommasini opened this issue Feb 6, 2024 · 7 comments
Closed

SAMap consistently generating a bifurcated UMAP #142

dariotommasini opened this issue Feb 6, 2024 · 7 comments

Comments

@dariotommasini
Copy link

Hi @atarashansky ,

Do you know why SAMap would consistently generate UMAPs that look like this? Essentially, every cluster is being split in two. The different species are well integrated within those clusters. Any ideas what might be causing this and what hyperparameter i could tune to prevent this?

Screenshot 2024-02-06 at 2 48 49 PM Screenshot 2024-02-06 at 2 52 13 PM
@atarashansky
Copy link
Owner

Usually you see this as an artifact of some batch effect or confounding biological process like cell cycle. Can you try differential expression between the bifurcated clusters to see what pops up? Also, if you look at each species' embedding separately (e.g. sm.sams['species1_id'].run_umap() followed by sm.sams['species1_id'].scatter() do you also see the bifurcation?

@dariotommasini
Copy link
Author

Thanks, I'll try that!

@dariotommasini
Copy link
Author

Hi @atarashansky ,

I have a question about how SAMap reads the data. It seems like if there exists a file called 'XXX_pr.h5ad', then SAMap will use that file. Is there a way to turn off this behavior? I want it to always process the original XXX.h5ad file rather than use the preprocessed one.

@dariotommasini
Copy link
Author

Actually, I was mistaken. The issue is that the filenames dictionary is a mutable so after a SAMap run, it will be a dictionary holding SAM objects rather than file paths. I had to deep copy it to stop this behavior.

@dariotommasini
Copy link
Author

Hi @atarashansky ,

Is there a way to make a SAM object directly from an h5ad file, or would I have to save the h5ad file and then load it as a sam object?

@atarashansky
Copy link
Owner

You can do sam=SAM(counts=adata) where adata is an AnnData object loaded in memory.

@dariotommasini
Copy link
Author

Awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants