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 version recommended #101

Closed
yasodha30 opened this issue Jun 2, 2021 · 7 comments
Closed

Seurat version recommended #101

yasodha30 opened this issue Jun 2, 2021 · 7 comments

Comments

@yasodha30
Copy link

Hi
I was trying to run the conos package for 4 single-cell samples which were already processed with Seurat v4, but I ran into errors while trying to visualize geneExpression or metadata.
So wanted to know what is the current recommended Seurat version to use so that I can run conos

Thanks

@VPetukhov
Copy link
Contributor

Hi,
I don't think we tested it with v4: only v3 and v2. Could you please post the code that doesn't work together with the output?

@yasodha30
Copy link
Author

@VPetukhov : Thanks for the quick reply. Attached is the script.

Version of Conos: 1.4.1

`
list of already normalized and scaled Seurat v4 objects
merged_samples.panel <- list("A_M" = A_M,
"B_M" = B_M,
"C_F" = C_F,
"D_F" = D_F)

any(duplicated(unlist(lapply(merged_samples.panel,colnames))))

for (i in 1:length(merged_samples.panel)) {
merged_samples.panel[[i]] <- RunPCA(merged_samples.panel[[i]], verbose = FALSE) %>% RunTSNE()
}
con <- Conos$new(merged_samples.panel, n.cores=4)
con$buildGraph(k=30, k.self=5, space='PCA', ncomps=30, n.odgenes=2000, matching.method='mNN', metric='angular', score.component.variance=TRUE, verbose=TRUE)

plotComponentVariance(con, space='PCA')

con$findCommunities(method=leiden.community, resolution=1)
con$embedGraph()
con$plotGraph(alpha=0.1)
con$plotPanel(font.size=4)
plotClusterBarplots(con, legend.height = 0.1)

error here same as issue 96

con$plotPanel(gene = "FOXA1")

metadata of cell type to propagate to other samples
A_M_metadata$cells <- paste0("A_M_", rownames(A_M_metadata))
cellannot <- A_M_metadata[, c("cells", "CellType")]
cellannot <- setNames(cellannot[,2], cellannot[,1])

visualization here is just like when data is NA - all greyed out

con$plotPanel(groups = cellannot)
new.label.info <- con$propagateLabels(labels = cellannot, verbose=TRUE)`

@evanbiederstedt
Copy link
Collaborator

Hi @yasodha30

Thanks for the issue

It would be helpful if there was some data we could use to reproduce your example exactly. As you mention, this was done in #96

Could you provide a full example with example data to reproduce the error with Seurat v4? That would be exceptionally helpful for us going forward. Please provide example data + code we could use to reproduce your error, so we could do any modifications on our end to fix things.

As Viktor mentioned, we have support for Seurat v2 and v3, but we haven't incorporated Seurat v4 into conos yet.

Best, Evan

@yasodha30
Copy link
Author

Seuratv4-conos_example.Rmd.txt

Hi @evanbiederstedt

Since, the data I am working is yet to be published, tried out the same with example data from "SeuratData" - ifnb dataset. Attached is the Rmd file for the same. But here, when I try to do buildGraph, getting an error that "Error in FUN(X[[i]], ...) : unknown reduction provided" even though the inputs are same as Conos tutorial. Is this also due to the version difference?

@evanbiederstedt
Copy link
Collaborator

evanbiederstedt commented Jun 14, 2021

Hi @yasodha30

Thanks, I just had time to look into this.

The code you're using is from here: https://github.com/satijalab/seurat-wrappers/blob/master/docs/conos.md

Yes, it looks like we'll have to modify Conos for Seurat v4; I'll coordinate with @VPetukhov

FWIW, here is the code related to versions v2 and v3 of Seurat:
https://github.com/kharchenkolab/conos/blob/master/R/integrations.R#L35-L90

But here, when I try to do buildGraph, getting an error that "Error in FUN(X[[i]], ...) : unknown reduction provided" even though the inputs are same as Conos tutorial.

Also FWIW, the error is here: https://github.com/kharchenkolab/conos/blob/master/R/conclass.R#L238-L251

If you take your conos object and look at con$pairs[['PCA']], you'll get a sense for what's going wrong.

We'll update you with a fix, hopefully soon-ish.

Best, Evan

@evanbiederstedt
Copy link
Collaborator

Hi @yasodha30

I think there's a fix here: #103

I've pushed to the dev branch. Feel free to try it there, or at the branch in the PR.

If it works, we'll push to main and update the version soon enough.

Thanks, Evan

@evanbiederstedt
Copy link
Collaborator

Hi @yasodha30

I pushed these changes to the main branch with the version 1.4.2. I'll upload to CRAN; it should be available soon.

Thanks, Evan

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