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

Install "scottgigante/seurat", ref="patch/add-PHATE-again" get error #104

Closed
Roger-GOAT opened this issue Mar 18, 2021 · 3 comments
Closed
Labels

Comments

@Roger-GOAT
Copy link

Dear Dr.Gigante, I get great result from phate.R. However, I can't write the embedding back to Seurat object.
Q1: devtools::install_github("scottgigante/seurat", ref="patch/add-PHATE-again"), error as below:
Error in parse(con, keep.source = FALSE, srcfile = NULL) :
284:1: unexpected input
283: export(RunPCA)
284: <<
^
Calls: ... withCallingHandlers -> loadNamespace -> parseNamespaceFile -> parse
Execution halted
ERROR: lazy loading failed for package ‘Seurat’
─ removing ‘/tmp/RtmpjZATAL/Rinst217acf75462a82/Seurat’
-----------------------------------
ERROR: package installation failed
Error: Failed to install 'Seurat' from GitHub:
System command 'R' failed, exit status: 1, stdout + stderr (last 10 lines):
E> 284:1: unexpected input
E> 283: export(RunPCA)
E> 284: <<
E> ^
E> Calls: ... withCallingHandlers -> loadNamespace -> parseNamespaceFile -> parse
E> Execution halted
E> ERROR: lazy loading failed for package ‘Seurat’
E> * removing ‘/tmp/RtmpjZATAL/Rinst217acf75462a82/Seurat’
E> -----------------------------------
E> ERROR: package installation failed
Q2:If I give up to install this version of Seurat, how to write the Phate result into Seurat object? Or write a .csv file from py.phate result? I notice the there is more than one embedding in phate result.
Thank you for your time. Best!

@scottgigante
Copy link
Collaborator

Hi @Roger-GOAT ,

Looks like installation from satijalab/seurat is broken right now per satijalab/seurat#4226.

You can fix this with

devtools::install_version("spatstat", version = "1.64-1")

and then try again to install my fork, which I've updated to Seurat 4.0.0.

devtools::install_github("scottgigante/seurat", ref="patch/add-PHATE-again")

If you can't install the fork, you can run PHATE on a Seurat object by doing the following:

assay = 'RNA'
data <- t(GetAssayData(object = seurat_data, slot = 'data', assay = assay))
phate_output <- phateR::phate(data)

# save PHATE result to csv
readr::write_csv(as.data.frame(phate_output))

# save PHATE result to Seurat
phate_output <- as.matrix(phate_output)
colnames(phate_output) <- paste0("PHATE_", 1:ncol(phate_output))
rownames(phate_output) <- rownames(seurat_data)
phate.reduction <- CreateDimReducObject(
    embeddings = phate_output,
    key = "PHATE_",
    assay = assay
)
seurat_data[["phate"]] <- phate.reduction

Feel free to reopen if you're still having issues.

@Roger-GOAT
Copy link
Author

Thank you Scott. I don't know why I succeed to do this: devtools::install_github("scottgigante/seurat", ref="patch/add-PHATE-again") (I done this "spatstat", version = "1.64-1" before I submited this issue). But I get all the reduction image (tSNE,umap,PHATE) like this:
image
I never met this before. Maybe some conflicts between packages.

@scottgigante
Copy link
Collaborator

Does this happen if you go back to the reference installation for Seurat?

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

No branches or pull requests

2 participants