Git Product home page Git Product logo

Comments (11)

Seandelao avatar Seandelao commented on September 26, 2024

Could it be because the niche cells are not present in the "BLC_Alone" sample? Here is the UMAP of the sample runs.

image

from nichenetr.

Seandelao avatar Seandelao commented on September 26, 2024

Hello,

I am wondering if it might be because of the structure of my data.

When loading the example data from the Seurat tutorial the meta data is as follows:

[email protected] %>% head()
nGene nUMI orig.ident aggregate res.0.6 celltype nCount_RNA nFeature_RNA
W380370 880 1611 LN_SS SS 1 CD8 T 1607 876
W380372 541 891 LN_SS SS 0 CD4 T 885 536
W380374 742 1229 LN_SS SS 0 CD4 T 1223 737
W380378 847 1546 LN_SS SS 1 CD8 T 1537 838
W380379 839 1606 LN_SS SS 0 CD4 T 1603 836
W380381 517 844 LN_SS SS 0 CD4 T 840 513

with mine, I get the following:

[email protected] %>% head()
orig.ident nCount_RNA nFeature_RNA percent.mt integrated_snn_res.0.5 seurat_clusters celltype
AAACCTGAGACTTTCG_1 BLC_Alone 7795 3042 4.541373 1 1 1
AAACCTGAGCCGTCGT_1 BLC_Alone 35138 6058 9.863965 8 8 8
AAACCTGAGCGATCCC_1 BLC_Alone 25600 5525 5.929688 0 0 0
AAACCTGAGTCGTACT_1 BLC_Alone 14136 4444 16.447368 0 0 0
AAACCTGCAGACAGGT_1 BLC_Alone 8785 2882 3.779169 1 1 1
AAACCTGCAGTCGATT_1 BLC_Alone 17425 4683 10.599713 0 0 0

I created my object with Seurat v3.1, using their standard Integrate Anchors workflow.

Is NicheNetR only compatible with older versions of Seurat Objects?

from nichenetr.

browaeysrobin avatar browaeysrobin commented on September 26, 2024

Hi @Seandelao,

Sorry for the late response, I was on holidays.

A possible problem could be that your cell cluster identities don't accord with the cell cluster you give as receiver and/or sender cells.
Can you check what your cell cluster identities are? e.g. via

seuratObj %>% Idents() %>% unique()

In your example, they should contain "11", "2", "7", "5","0", "4", "3".

from nichenetr.

Seandelao avatar Seandelao commented on September 26, 2024

Hi @browaeysrobin,

No worries, hope you had a great holiday!

My cluster identities are:

BLC_Niche_Merge %>% Idents() %>% unique():
[1] 1 8 0 6 10 4 7 3 9 12 5 2 11
Levels: 0 1 2 3 4 5 6 7 8 9 10 11 12

So the clusters are there I believe.

One thing I will say is that these clusters aren't present in each condition; meaning my BLC_Alone condition does not contain all of the same clusters/cell types that my BLC_Niche has. The BLC_Alone was one cell type sequenced, while the BLC_Niche was two cell types. Would this affect the analysis?

from nichenetr.

browaeysrobin avatar browaeysrobin commented on September 26, 2024

Hi @Seandelao,

Because you integrated the data in one Seurat object, it should work fine. I tested an example with some cell clusters of only one condition, and it worked. There would only be a problem if all your receiver cells would be of one condition (because you try to explain DE between two conditions in receiver cells), but then the error message will occur when trying to define DE genes and not determine expressed genes as in your case. It seems that there is another problem here.

Could you try to run the different steps of the analysis as described in https://github.com/saeyslab/nichenetr/blob/master/vignettes/seurat_steps.md? And tell where exactly the error occurs there (with input example)?

from nichenetr.

Seandelao avatar Seandelao commented on September 26, 2024

Hi @browaeysrobin,

It basically happens at the beginning:

receiver

receiver = c("0", "4", "3")
expressed_genes_receiver = get_expressed_genes(receiver, BLC_Niche_Merge, pct = 0.10)

with the error:
Error in get_expressed_genes(receiver, BLC_Niche_Merge, pct = 0.1) :
Not all cells of interest are in your expression matrix. Please check that the expression matrix contains cells in columns and genes in rows.

from nichenetr.

browaeysrobin avatar browaeysrobin commented on September 26, 2024

Hi @Seandelao

I think this problem occurs because the scaled expression matrix in Seurat objects after applying the Seurat integration workflow is by default in the 'integrated' slot and not in the 'RNA' slot. I adapted the code now such that the wrapper function works as well for Seurat objects after integration. If you reinstall nichenetr and try again, your issue should be solved.

But please be aware of the pitfalls of using the default Seurat integration workflow in combination with this wrapper: these Seurat objects end up with an integrated, scaled expression matrix for only 2000 genes. Because for NicheNet, all expressed genes and differentially expressed genes between conditions need to be determined, the scaled expression matrix should be genome-wide. Therefore, the Seurat integration function should be run with all genes and not with the default 2000. See the documentation of the FindIntegrationAnchors and IntegrateData functions of the Seurat package on how to do this.

from nichenetr.

Seandelao avatar Seandelao commented on September 26, 2024

Hi @browaeysrobin,

Thank you so much, this worked like a charm! Do you think running NicheNet on the RNA vs. integrated data slot would be more applicable in the future? I think Seurat recommends doing DEG analysis on the RNA counts.

Another quick question; I want to also perform NicheNet on a single data set, meaning non-integrated, to see if ligands expressed from my mesenchymal cells can potentially explain epithelial differentiation. Since this data set is just a single timepoint during development, I don't have a receiver reference vs affected condition. What part of the code would I modify for this?

Thanks again!

from nichenetr.

browaeysrobin avatar browaeysrobin commented on September 26, 2024

If you want to predict mesenchymal ligands that might induce epithelial differentiation, this epithelial differentiation process needs to be present in your data before running a NicheNet analysis. Your dataset does not seem to have this, unless you would have a differentiation trajectory in your data. In that case, you could perform trajectory inference and define which genes change in expression during the differentiation (https://dynverse.org/), and use this set of genes as input for a NicheNet analysis (change step2 in https://github.com/saeyslab/nichenetr/blob/master/vignettes/seurat_steps.md).
If no trajectory would be present, the best you can do is a classic ligand-receptor analysis and define all mesenchymal expressed ligands for which a receptor is expressed.

from nichenetr.

Seandelao avatar Seandelao commented on September 26, 2024

Hi @browaeysrobin,

Sorry to re-open this, just wanted to get some clarity on your response above.

I am wanting to use NicheNetR on a data set in which we have a differentiation trajectory of epithelial cells that we think is influenced by surrounding niche cells (that are also included in the data set). When you say gene expression changes during the differentiation, do you mean genes expressed in one cluster later in the differentiation vs. earlier iteratively? Or genes along the total trajectory, such as genes expressed across pseudotime?

from nichenetr.

browaeysrobin avatar browaeysrobin commented on September 26, 2024

Hi @Seandelao
Both options are fine.

from nichenetr.

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.