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

Seurat Integrated dataset import SAMAP #61

Closed
billadelonge opened this issue Dec 17, 2021 · 2 comments
Closed

Seurat Integrated dataset import SAMAP #61

billadelonge opened this issue Dec 17, 2021 · 2 comments

Comments

@billadelonge
Copy link
Collaborator

Hi Alec,
I've recently tried to use some integrated datasets (Seurat Integration) into samap but I get the following error
"ValueError: Input contains NaN, infinity or a value too large for dtype('float64')."
It could be this is due to my conversion to h5ad, I currently use SeuratDisk and go to h5Seurat to h5ad. Any help would be much appreciated!
Thanks as always,
Laura

@atarashansky
Copy link
Owner

Hi, sorry about the delay.

I'm not sure if this is still an issue for you, but often times Seurat integration will yield standardized counts that could be possible negative. If you're passing in the file names to SAMAP, then i will try to log-transform the data because it assumes raw counts.

I would make sure you pass in pre-loaded SAM objects

from samalg import SAM
sam1=SAM()
sam1.load_data(filename1)
#sam1.preprocess_data() # <<< OMIT THIS STEP SINCE DATA IS ALREADY PROCESSED BY SEURAT
sam1.run()

Then,

sams={'id1':sam1,'id2':sam2}
sm = SAMAP(sams)
sm.run()

Please reopen this issue if you're still having trouble.

@rodrisenovilla
Copy link

Hi! Thank you for the great tool!

I am having a similar problem trying to transfer my multiple replicates integrated Seurat annotated objects to SAMAP. In my case, the RNA assay is converted finely, but when SCT is converting... An error appears:

Error in slot(object = object, name = x) :
there is not a slot named "median_umi" for this object of class "SCTModel"

However, conversion via loom worked without any errors. However, SeuratDisk::"as.loom" only incorporates (or at least that I think), the default assay of the object, so it doesn't completely convert my object...

In R,
DefaultAssay(me9)<-"RNA"
SeuratDisk::as.loom(me9, "/home/phylobrain/bioinfo/samap_pb/sam1.loom")

In Python,
adata=sc.read_loom("raw_data/sam1.loom")
sam1 = sce.tl.sam(adata, inplace=True)
sam1.preprocess_data()

In this way, I lost all the integration variables of my Seurat object, but I can, at least, make it work. Will it be better to upload the SCT via loom and avoid preprocessing in SAM? I am reluctant to upload integrated assays as there are dimensional reduced (less genes matrix)...

I have tried to eliminate all assays except for "RNA", so I can create an .h5Seurat. It works properly, but I don't know if it has some advantages...

Really looking forward to your opinion. Thank you beforehand and great tool for evo-devo!
Best,
Rodrigo

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

3 participants