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
RunPCA error #1788
Comments
Hi Emily, Are you running this on the data from that tutorial? If not, could you provide an object that reproduces the issue? |
Hi Andrew,
I'm not running the data from the tutorial but using the large data that contains more than 130,000 cells from 23 samples. So maybe it's not convenience to provide the data.
And I was wondering if the number of the cells is too much.
…------------------ Original ------------------
From: "Andrew Butler"<notifications@github.com>;
Date: Fri, Jul 12, 2019 11:46 PM
To: "satijalab/seurat"<seurat@noreply.github.com>;
Cc: "zhangyan"<1050550990@qq.com>;"Author"<author@noreply.github.com>;
Subject: Re: [satijalab/seurat] RunPCA error (#1788)
Hi Emily,
Are you running this on the data from that tutorial? If not, could you provide an object that reproduces the issue?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Hmm, if you downsample the object to say 1k cells do you get the same error? |
Closing this now as we have not heard back, but please re-open if you are still having problems |
Hi Emily, have you solved this problem? |
Hi, in case someone comes across this post, I had the same error message. I saw another issue regarding this, and I made the same comment there too, sorry for posting twice.
|
Hi Seurat Team, I run the following code
and I able to run it. However when i run the following code: I get the following error and warning: Error in irlba(A = t(x = object), nv = npcs, ...) : So I tried running codes again using 9 samples and 49000 cells and I could run successfully. Can you help me to figure out why I am not able to run it when I use 27 samples with 98000 cells? Thanks very much, |
I'm getting the same error in the SCT workflow for data integration, even after down-sampling the whole data set from roughly 90k to 25k cells. seurat_integrated <- IntegrateData(
anchorset = seurat_anchors,
normalization.method = 'SCT'
)
seurat_integrated
# An object of class Seurat
# 37391 features across 24680 samples within 3 assays
# Active assay: integrated (3000 features)
# 2 other assays present: RNA, SCT
seurat_integrated <- RunPCA(seurat_integrated)
# Error in irlba(A = t(x = object), nv = npcs, ...) :
# max(nu, nv) must be positive
# In addition: Warning message:
# In PrepDR(object = object, features = features, verbose = verbose) :
# The following 3000 features requested have zero variance (running reduction without them): LYZ, HBA1, HBB, S100A8, HBA2, S100A9, HBD, HBM, CA1, GNLY, RP11-1143G9.4, AHSP, CCL5, CXCL8, HIST1H4C, HLA-DRA, S100A12, CST3, TYROBP, CD74, IGLL1, CA2, FCN1, IGKC, JCHAIN, KLRB1, NKG7, GYPA, IGLC3, LST1, LGALS1, IGLC2, G0S2, GZMB, STMN1, CCL3, FCER1G, AIF1, TUBA1B, CTSS, CCL4, HLA-DPB1, TCL1A, HLA-DPA1, CSTA, HLA-DRB1, FCGR3A, ALAS2, PRDX2, VCAN, MZB1, HMGB2, GZMK, HEMGN, CMC1, IGHM, SNCA, VPREB3, GZMA, HLA-DQA1, FCER1A, TRDC, SAT1, TUBB, SPINK2, GZMH, HLA-DQB1, CD79B, RETN, KIAA0101, S100A11, CD79A, MNDA, GYPB, IFIT1B, LGALS2, BLVRB, COTL1, IFITM3, AZU1, CD14, SERPINA1, CD24, MS4A1, SLC4A1, FGFBP2, TMCC2, TRBC1, CXCL2, SOX4, SLC25A37, IGHA1, IGHG3, IGHG1, CFD, CH17-373J23.1, CCL3L3, LTB, EREG, KLRF1, MS4A6A, FAM178B, IL32, CD8B, KLRD1, HLA-DRB5, IGHD, NEAT1, CST7, MS4A7, S100A4, S100A6, SRGN, FTL, HMGB1, CLIC3, PLAUR, PSAP, UBE2C, IRF8, CTSW, IFI30, RGS2, IFNG, PLD4, PRSS57, VIM, PRF1, HOPX, NA [... truncated] I also tried to run With all cells, I already got an error when trying to split the cells by group using EDIT: I'm using Seurat v3.1.1 on R 3.6.1. |
Hi Seurat Community, I encountered a similar issue when trying to combine a 700-cell object with a previously combined 4800-cell set. When I tried running "FindVariableFeatures" before running pca, I got the error: "Error in simpleLoess(y, x, w, span, degree = degree, parametric = parametric, : invalid 'x'" . Also, downsampling 4800-cell set to 2000-cell doesn't solve the issue:\ Sincerely hope someone could share their solution! Thanks! |
I encountered the same problem, then checked that the total variable genes are 'zero' (0) due to one unintentional mistake in the pipeline. So please check if total variable genes are present or not. I am not sure but if the cells are from one cell-types only and having few cells in number might cause this issue too. |
Hi Rahul, |
I encountered the same issue. So there are genes in my data having variance = 0. This creates
So I replaced the
Any better solution? |
Hi romanhaa, Did you ever figure out the solution to this issue? I'm experiencing the exact same thing on a dataset of 9k cells. Thanks, |
I encountered the same issue. Any news on this? Thanks |
I have the same problem with RunPCA pbmc <- RunPCA(pbmc, features = VariableFeatures(object = pbmc)) Someone have the solution????? |
One has to do the following steps before running a PCA:
|
I encountered the same error running FindTransferAnchors() on 2 objects: one of 16512 cells and the other of 8536 cells. I suspect they stem from the same bug so I'm reporting here. In my case, both objects had variable features calculated and 20 dimensions for each PCA, in the integrated assay for each. Even running with reference.assay = "integrated" and query.assay = "integrated" didn't solve the issue as I had hoped. However, running DefaultAssay(seurat_object) <- "integrated" for both objects before running FindTransferAnchors() resolved the issue. Maybe DefaultAssay() needs to be set to the assay with PCs calculated explicitly before calling RunPCA() on that object. Calling functions like NormalizeData(), ScaleData(), or FindVariableFeatures() resets the DefaultAssay of an object, so that will also work, but are unnecessary if you've already called them and are encountering this error. You can check the assay used to calculated PCs with the following line:
|
Hi Vikrant, |
I have encountered the same error when integrating 36 samples. I figured out decreasing k.weight in 'IntegrateData' help solve the problem. The previous code that went wrong was: I changed it into this and it works: I haven't tried it yet but I guess changing other parameters in 'FindIntegrationAnchors' and 'IntegrateData' related to number of anchors (k.*) may also help. Maybe it's worthwhile to automatically determine the number of anchors in Seurat program so that the function does not break down? Or determine the optimal number based on data itself? |
I had the same problem and I solved it by changing the npcs value. |
I had the same problem. For me it seems to always work for integration of dataset pairs, but fails when adding the 3th dataset on a merged pair, regardless of data order/which batches are used. I am working on a small test dataset so may not be very variable - I have tried some of the above suggestions, but that did not help (I made sure to add HVGs, changed dims and k.weight, and removing less variable datasets).
|
Hello, I am having the same issue of the RUNPCA command, I have tried all the solutions mentioned in this thread but still receiving this error. Thank you |
Hi, Seurat Team and all on this post, Honestly, I have no idea how I fixed this. After trying to figure out what was happening for a few hours, I decided to reapproach it fresh in the morning. I restarted R, cleared all of the history and etc, and reran the commands I saved from the previous night. Surprisingly, it did not encounter the same error as before. Maybe a hard reset of the program might be helpful for those still stuck. I hope that helps...! |
Hello all, Had a similar problem. When I was checking the data slot for the integrated data, turns out some of the datasets were all NaN. Followed the discussion from #4036 it seems to do with the naming of the assays across the different objects. Reset the naming and now it works fine! Hope it helps! |
I also found some problems after reading the whole data frame, which may be caused by some problems in the previous standardization. assay$RNA$var.feature is empty, which may affect the subsequent varfeature analysis. I believe that there are many people who may also have this question, please look for the answer in the previous standardization step. |
Hi Seurat Team,
I followed the tutorial of Integrating stimulated vs. control PBMC datasets to learn cell-type specific responses.
I did these above successfully.
The immune.combined is
An object of class Seurat
16494 features across 142032 samples within 2 assays
Active assay: integrated (2000 features)
1 other assay present: RNA
But when I did the RunPCA, there was something wrong with it.
immune.combined <- RunPCA(immune.combined, npcs = 30, verbose = FALSE)
the error is :
Error in irlba(A = t(x = object), nv = npcs, ...) :
max(nu, nv) must be positive
Could you please help me with that?
Many thanks,
Emily
The text was updated successfully, but these errors were encountered: