Code Monkey home page Code Monkey logo

Comments (8)

dtm2451 avatar dtm2451 commented on June 15, 2024 1

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.

dtm2451 avatar dtm2451 commented on June 15, 2024

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.

beginner984 avatar beginner984 commented on June 15, 2024

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.

dtm2451 avatar dtm2451 commented on June 15, 2024

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.

dtm2451 avatar dtm2451 commented on June 15, 2024

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.

sagarutturkar avatar sagarutturkar commented on June 15, 2024

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.

dtm2451 avatar dtm2451 commented on June 15, 2024

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 like dittoHeatmap(sample, c("TLR7", "CD3E"), annot.by = c("orig.ident")).

from dittoseq.

sagarutturkar avatar sagarutturkar commented on June 15, 2024

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)

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.