Comments (8)
Ahhh, great!
Also FYI:
isGene()
is a helper function in dittoSeq that could have helped with that as well! (There's a bunch of helpers in dittoSeq that unify and simplify certain interactions with Seurat
/SingleCellExperiment
/SummarizedExperiment
objects, which are used in dittoSeq's internals, but I also felt were worth exposing for users.)
You could use this in the future to automate trimming to just the genes inside your object: TCF7_in <- isGene(TCF7, sample, return.values = TRUE)
Cheers,
Dan
from dittoseq.
The error message tells you that 'argument "var" is missing'. You need to give this function something to color the points by.
You can run getMetas(pbmc2)
or getGenes(pbmc2)
to see what metadata or gene (probably thousands) options there are in the object.
But mainly, what you need to do is give something to the var
input:
dittoDimPlot(pbmc2, var = "<a_gene_or_metadata>")
from dittoseq.
Thank you so much
I passed that now I get this
> getMetas(pbmc1)
[1] "orig.ident" "nCount_RNA" "nFeature_RNA" "percent.mt"
[5] "RNA_snn_res.1" "seurat_clusters" "RNA_snn_res.0.2" "RNA_snn_res.0.5"
> dittoHeatmap(pbmc1, features2,
+ annot.by = "RNA_snn_res.0.2")
Error in intI(i, n = d[1], dn[[1]], give.dn = FALSE) :
invalid character indexing
> dittoHeatmap(pbmc1, features2,
+ annot.by = c("RNA_snn_res.0.2"))
Error in intI(i, n = d[1], dn[[1]], give.dn = FALSE) :
invalid character indexing
> features2
[1] "CD38" "B220" "IL2RA" "TCRB" "IFNG" "MHC-II" "TNF" "CD274"
[9] "CD4" "TBX21" "CD19" "CD80" "PDCD1" "CD8A" "ITGAE" "CD86"
[17] "EMR1" "PTPRC" "FOXP3" "Ly6c1" "ITGAM" "FCGR1A" "CD44" "RORC"
[25] "ARG1" "KLRB1" "ITGAX" "Ly6g" "SIGLEC8" "FOXP3" "NOS2" "SELL"
[33] "MRC1"
> dittoHeatmap(pbmc1, features2,
+ order.by = "RNA_snn_res.0.2")
Error in intI(i, n = d[1], dn[[1]], give.dn = FALSE) :
invalid character indexing
>
> dittoDotPlot(pbmc1, vars = features2, group.by = "RNA_snn_res.0.2")
Error in .multi_var_gather_raw(object, vars, assay, slot, adjustment, :
All 'vars' must be a metadata or gene
Any help please?
from dittoseq.
Potentially you have a weird Seurat object that has odd cell column names or metadata rownames? I'm curious where this Seurat object that doesn't have a counts slot would be from... that wouldn't happen for any normal Seurat workflow. This leads me to believe the object was likely constructed in an ill-advised way.
dittoSeq commonly indexes data via the cells' names. What do you see if you look at colnames(pbmc2)
, rownames([email protected])
, and names(pbmc2$RNA_snn_res.0.2)
? Those should all be identical.
from dittoseq.
Coming back to this, it also looks like you have a mix of fully uppercase + some partially lowercase genes in your features2
that you are trying to plot. That could also be your issue... human genes are fully uppercase whereas other species may have lowercase letters. If any of your features don't actually exist in the object, such errors would be expected.
I don't think this is a bug to do with dittoSeq itself, so I'm going to close the issue, but feel free to respond / reopen if needed.
from dittoseq.
Thank you for providing this nice package. I am facing the similar issue but only with the function dittoHeatmap
. I am able to generate other plots without any issue and I am using the same gene for dittoHeatmap
dittoDimPlot(sample, "orig.ident")
dittoPlot(sample, "Irf7", group.by = "orig.ident")
dittoBarPlot(sample, "orig.ident", group.by = "seurat_clusters")
dittoBoxPlot(sample, "Irf7", group.by = "orig.ident")
dittoHeatmap(sample, TLR7, annot.by = c("orig.ident"))
Error:
Error in intI(i, n = d[1], dn[[1]], give.dn = FALSE) :
invalid character indexing
My Seurat object is created after subsetting a group of cells from the original Seurat object. It's a relatively small file. I can share the link for this file if you provide a good email address. Your help will be much appreciated.
Thanks
from dittoseq.
Couple issues perhaps with the syntax here:
- You don't have TLR7 in quotes, so unless you actually have a vector of gene names stored in an object named TCF7, that could be to root of this issue?
- Secondly, (again assuming TLR7 doesn't hold a character vector?) the dittoHeatmap function assumes that you are providing more than one total of genes (to the
genes
input) and/or metadatas (to the 'metas' input). There's scaling of the extracted data matrix that's performed by default before the plot is generated, and that scaling requires more than one row of data. Heatmaps are normally made with many genes. I recommend selecting some more genes to put in your heatmap so giving something likedittoHeatmap(sample, c("TLR7", "CD3E"), annot.by = c("orig.ident"))
.
from dittoseq.
Thank you, for the quick response and suggestions. This is resolved now.
The issue here was again the gene names.TLR7
was indeed a character vector but a few genes were missing from the Seurat object itself. I used the DoHeatmap
function from Seurat which automatically removed the missing genes and generated a heatmap. Then, I used those exact set of genes to dittoHeatmap
function and it worked well.
Thank you again for this awesome package.
from dittoseq.
Related Issues (20)
- `scales = "free"` not properly respected in `split.adjust` when multiple vars provided to dittoPlot (and co) HOT 3
- Adding 'padding' to DotPlot rows to highlight differences across celltypes? HOT 6
- About HOT 3
- working with dataframe HOT 2
- have x-values sort numerically? HOT 3
- X values in dittoBarPlot not ordering according to x.reorder HOT 6
- Throw error if dimReds are NA HOT 3
- working with altExps HOT 14
- dittoHeatmap on "scale.data" and rowSums == 0 HOT 4
- Prepare for upcoming Seurat v5 release
- Changing titles on multi-plots / pseudo facet titles HOT 2
- How to remove median in boxplot? HOT 7
- Add parameter to control boxplot outlier size HOT 2
- Change colors of genes in dittoHeatmap HOT 4
- Error generating dittoheatmap HOT 2
- Dotplot on single gene split by two conditions HOT 5
- dittoHeatmap HOT 5
- dittoHeatmap with pale heat map colors HOT 2
- Support for Seurat V5? HOT 3
- Marker disappeared in the heatmap HOT 3
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 dittoseq.