Comments (7)
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.
Hi!
This works perfectly! Thank you so much!
from liger.
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.
@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.
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.
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.
Thanks for your great help, Yichen. It works now.
from liger.
Related Issues (20)
- "shared factor neighborhood" not used anymore as described in the paper? HOT 3
- log transform data first? HOT 1
- Another request for help regarding SCTransform HOT 1
- Generate gene and promoter bed files
- Problems with scaleNotCenter() HOT 2
- Prepare for upcoming Seurat v5 release HOT 1
- Bug in Seurat's wrapper function HOT 1
- cran package archived HOT 6
- NaNs during `SelectGenes()` HOT 1
- Error on makeFeatureMatrix HOT 1
- How to improving similarity between snRNA-seq and snATAC-seq nuclei, by tuning parameters like 'k', 'lambda'? HOT 4
- Dataset specificity plot
- Issue with loading old liger object via convertOldLiger function HOT 3
- Error in `signal_stage()` HOT 4
- invalid type "list" in R_matrix_as_sparse error HOT 3
- no slot name "defaultCluster" for this object of class "liger" HOT 1
- Query on building shared factor neighborhood graph HOT 2
- Error when performing the Wilcoxon test on the peak counts HOT 1
- Error in ImputeKNN
- How can I determine the similarity scores between clusters using Liger's UINMF? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from liger.