Git Product home page Git Product logo

Comments (7)

vkozareva avatar vkozareva commented on July 2, 2024

Hello! This error is likely due to a bug we accidentally introduced in our latest update, which should be fixed now.
As for the cluster label format, they should just be factors with names that match the cell names of your liger object. In your case, the following might work:

# Assuming your cell names in liger are numbers like your dataframe
# Comma allows you to index by row instead of column
p2_labels <- factor(p2_cluster[rownames(liger@H[[1]]), ])
names(p2_labels) <- rownames(liger@H[[1]])

You can also find tenx_seqwell_clusters.RDS with example cluster labels in our data files: pbmc_alignment.zip.

from liger.

shiwei-wang avatar shiwei-wang commented on July 2, 2024

Hi!

This works perfectly! Thank you so much!

from liger.

Lei-Guo avatar Lei-Guo commented on July 2, 2024

I have exact same problem. Below is my code. The names of clusters match the raw.data columns in the liger object.

ligerex_endo <- seuratToLiger(list(sub_endo, sub_E), names = c('sub_endo', 'sub_E'), num.hvg.info = 2000)

makeRiverplot(ligerex_endo, cluster1 = Idents(sub_endo), cluster2 = Idents(sub_E)) # Error in edge_list[[nodes1[i]]] <- temp :
  attempt to select less than one element in OneIndex

identical(colnames([email protected]$sub_endo), names(Idents(sub_endo))) #TRUE

identical(colnames([email protected]$sub_E), names(Idents(sub_E))) #TRUE

from liger.

mvfki avatar mvfki commented on July 2, 2024

@Lei-Guo Would you mind sharing what shows when you run head(Idents(sub_endo)) and head(Idents(sub_E))? That error message could be caused by using "double brackets" to subscribe "0" index from a list-like object. So if your Seurat Idents are zero-based numbers, converting them to a character factor object could be worth a try. But I could be wrong with the prediction of your issue.

Also, for other users who might also get a problem with makeRiverplot() in the future, please note that we are planning to deprecate this function because it seems this function is actually rarely used. We are currently actively updating rliger package, so hopefully, it'll get a big new release soon.

from liger.

Lei-Guo avatar Lei-Guo commented on July 2, 2024

Thanks for the quick response, Yichen. Please see below. You guys are deprecating the makeRiverplot() function? That's a shame. That's the function that leads me to the liger package. I think it's a great function that allows comparing clusters between 2 datasets. Do you have any recommendations for good alternatives for comparing clusters between 2 datasets?

> head(Idents(sub_endo))
AAACCCAAGGATTCAA-1_1 AAACCCAGTCTGTGTA-1_1 AAACGAAAGAACTGAT-1_1
                 EC3                  EC1                  EC1
AAACGAATCAGCAGAG-1_1 AAACGCTTCGTGTTCC-1_1 AAACGCTTCTATTGTC-1_1
                 EC2                  EC3                  EC3
Levels: EC3 EC1 EC2 EC4 EC5 LEC
> head(Idents(sub_E))
AAACCTGAGCCATCGC-1 AAACCTGTCCAGTATG-1 AAAGATGCAAGCCCAC-1 AAAGATGTCCCTAACC-1
                E1                 E2                 E1                 E1
AAAGCAACATTTGCCC-1 AAAGCAATCACAATGC-1
                E1                 E1
Levels: E1 E2 E3

from liger.

mvfki avatar mvfki commented on July 2, 2024

Ok, I tried to make some toy examples where I created a liger object from two Seurat objects. Could you check with ligerex_endo@clusters? If it is not named, then that should be the problem that our SeuratToLiger converter introduced this bug. A workaround could be:

names(ligerex_endo@clusters) <- c(colnames([email protected]$sub_endo), colnames([email protected]$sub_E))

By the way, makeRiverplot compares given cluster assignments for individual datasets against the joint clustering result for the whole liger object. From your example code, it looks like the "joint clustering" variable being used would be just a concatenation of the cluster assignment from the two original Seurat datasets. This doesn't seem to be an ideal case of using makeRiverplot.

Thanks for your feedback on the need for this function. Our team will have some discussion on this for sure.

from liger.

Lei-Guo avatar Lei-Guo commented on July 2, 2024

Thanks for your great help, Yichen. It works now.

from liger.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.