Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

None of the requested features were found in slot data of predicted_ADT Assay #4240

Closed
denvercal1234GitHub opened this issue Mar 16, 2021 · 5 comments

Comments

@denvercal1234GitHub
Copy link

@yuhanH in #4018 informed we can use GetResiduals to obtain residuals for genes that are not found in scale.data for SCransform().

Here, I was following the "multimodal reference mapping" vignette to "visualize the imputed levels of surface protein, which were inferred based on the CITE-seq reference" using my query data which was SCTransform()-ed.

DefaultAssay(objectquery) <- 'predicted_ADT'
FeaturePlot(objectquery, features = c("CD3-1", "CD45RA", "IgD"), reduction = "ref.umap", cols = c("lightgrey", "darkgreen"), ncol = 3)

But, I encountered the error below, yet the genes are computed as markers based onMapQuery() onto the ref, so these genes are present.

Would anyone mind helping me to solve this error?

Thank you for your help!

Found the following features in more than one assay, excluding the default. We will not include these in the final data frame: [a list of different gene names]
The following requested variables were not found: [a list of different gene names]
Error: None of the requested features were found: [a list of different gene names] in slot data

@andrewwbutler
Copy link
Collaborator

Hi,

Can you try specifying the assay for which you want to compute missing residuals? This error suggests that you are trying to compute residuals for a list of features that are present in multiple assays, so you need to be explicit about which one you intend.

@andrewwbutler andrewwbutler added the more-information-needed We need more information before this can be addressed label Mar 19, 2021
@denvercal1234GitHub
Copy link
Author

denvercal1234GitHub commented Mar 19, 2021

Thank you @andrewwbutler for your response.

I did the following

cellselect_merged <- GetResidual(cellselect_merged, features = rownames(cellselect_merged), assay = "SCT")

But it says:

Screen Shot 2021-03-19 at 8 34 31 PM

And, when I run:

DefaultAssay(cellselect_merged) <- 'predicted_ADT'

FeaturePlot(cellselect_merged, 
            features = head(rownames(cellselect_merged_treg.markers_fromSatijaPBMCref), 10), reduction = "ref.umap", cols = c("lightgrey", "darkgreen"), ncol = 2)

The same error persits in the slot data (not scale.data slot):

Screen Shot 2021-03-19 at 8 38 06 PM

@no-response no-response bot removed the more-information-needed We need more information before this can be addressed label Mar 19, 2021
@andrewwbutler
Copy link
Collaborator

Sorry for the slow response back. Just to clarify, you imputed protein levels using our published CITE-seq PBMC reference in your query object and now you want to visualize those results in FeaturePlot? Based on your first post, it seems that the features you want to plot weren't actually imputed. I would double check the code you're running to make sure those features are being imputed and being stored in the predicted_ADT assay. If it's still not clear from that, please post the code you ran.

You don't want to use GetResiduals here to fill in missing imputed protein values. This should generally only be used to impute the residuals (scale.data) for RNA assays.

@andrewwbutler andrewwbutler added the more-information-needed We need more information before this can be addressed label Apr 2, 2021
@denvercal1234GitHub
Copy link
Author

denvercal1234GitHub commented Apr 2, 2021

Hi @andrewwbutler,

Yes, that is correct. I followed this tutorial: https://satijalab.org/seurat/articles/multimodal_reference_mapping.html

Below are the codes I ran (modified the name for clarity). Would you mind helping me to troubleshoot it, when you have a chance?

Thank you so much for your help!

cxcr5posnegcd8 <- SCTransform(cxcr5posnegcd8, verbose = FALSE, do.scale=FALSE, do.center=FALSE)

cxcr5posnegcd8 <- CellCycleScoring(cxcr5posnegcd8, s.features = s.genes, g2m.features = g2m.genes, set.ident = FALSE)

DefaultAssay(cxcr5posnegcd8) <- "RNA"

cxcr5posnegcd8 <- SCTransform(cxcr5posnegcd8, 
vars.to.regress = c("percent.mt","CC.Difference"), verbose = FALSE, do.scale=TRUE, do.center=TRUE)

cxcr5posnegcd8 <- RunPCA(cxcr5posnegcd8, verbose = FALSE)

cxcr5posnegcd8 <- RunUMAP(cxcr5posnegcd8, reduction = "pca", dims = 1:25)

cxcr5posnegcd8 <- FindNeighbors(cxcr5posnegcd8, dims = 1:25)

cxcr5posnegcd8 <- FindClusters(cxcr5posnegcd8, resolution = 1)

DefaultAssay(cxcr5posnegcd8) <- "RNA"

cxcr5posnegcd8 <- NormalizeData(cxcr5posnegcd8, assay = "RNA")

cxcr5posnegcd8 <- ScaleData(cxcr5posnegcd8, features = rownames(cxcr5posnegcd8), assay = "RNA")

cxcr5posnegcd8 <- FindAllMarkers(cxcr5posnegcd8, only.pos = TRUE)

Should I switch to SCT Assay here before doing FindTransferAnchors()? Currently the object cxcr5posnegcd8 still has active assay as RNA because I was doing DEG analysis

# Begin of mapping
SatijaPBMC_cxcr5posnegcd8.anchors <- FindTransferAnchors(
  reference = SatijaPBMC_reference,
  query = cxcr5posnegcd8,
  normalization.method = "SCT",
  reference.reduction = "spca",
  dims = 1:50
)

Screen Shot 2021-04-02 at 10 17 21 PM


cxcr5posnegcd8 <- MapQuery(
  anchorset = SatijaPBMC_cxcr5posnegcd8.anchors,
  query = cxcr5posnegcd8,
  reference = SatijaPBMC_reference,
  refdata = list(
    celltype.l1 = "celltype.l1",
    celltype.l2 = "celltype.l2",
    predicted_ADT = "ADT"
  ),
  reference.reduction = "spca", 
  reduction.model = "wnn.umap"
)

Screen Shot 2021-04-02 at 10 19 47 PM

DefaultAssay(cxcr5posnegcd8) <- 'RNA'

Idents(cxcr5posnegcd8) <- 'predicted.celltype.l2'

cxcr5posnegcd8_treg.markers_fromSatijaPBMCref <- FindMarkers(cxcr5posnegcd8, ident.1 = "Treg", 
only.pos = TRUE, logfc.threshold = 0.1)


# Visualize imputed protein levels 

DefaultAssay(cxcr5posnegcd8) <- 'predicted_ADT'

FeaturePlot(cxcr5posnegcd8, 
            features = head(rownames(cxcr5posnegcd8_treg.markers_fromSatijaPBMCref), 10), 
            reduction = "ref.umap", cols = c("lightgrey", "darkgreen"), ncol = 2)

Screen Shot 2021-04-02 at 10 32 35 PM

Screen Shot 2021-04-02 at 10 33 05 PM

@no-response no-response bot removed the more-information-needed We need more information before this can be addressed label Apr 2, 2021
@yuhanH
Copy link
Collaborator

yuhanH commented Apr 9, 2021

HI, @denvercal1234GitHub
You found markers for Treg using RNA assay, but when you plotted those genes, you changed the default assay to predicted_ADT. That's why the FeaturePlot doesn't work.

DefaultAssay(cxcr5posnegcd8) <- 'RNA'
cxcr5posnegcd8_treg.markers_fromSatijaPBMCref <- FindMarkers(cxcr5posnegcd8, ident.1 = "Treg", 
only.pos = TRUE, logfc.threshold = 0.1)
DefaultAssay(cxcr5posnegcd8) <- 'predicted_ADT'

FeaturePlot(cxcr5posnegcd8, 
            features = head(rownames(cxcr5posnegcd8_treg.markers_fromSatijaPBMCref), 10), 
            reduction = "ref.umap", cols = c("lightgrey", "darkgreen"), ncol = 2)

You can find markers in the predicted_ADT assay and plot them.

DefaultAssay(cxcr5posnegcd8) <- 'predicted_ADT'
cxcr5posnegcd8_treg.markers_fromSatijaPBMCref <- FindMarkers(cxcr5posnegcd8, ident.1 = "Treg", 
only.pos = TRUE, logfc.threshold = 0.1)

FeaturePlot(cxcr5posnegcd8, 
            features = head(rownames(cxcr5posnegcd8_treg.markers_fromSatijaPBMCref), 10), 
            reduction = "ref.umap", cols = c("lightgrey", "darkgreen"), ncol = 2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants