-
Notifications
You must be signed in to change notification settings - Fork 166
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
Error Encountered during Step 15 "Error in paste(sig, collapse = "#") : (converted from warning) NAs introduced by coercion to integer range" #426
Comments
Hi, Change the method for the subclusters to: tumor_subcluster_partition_method='random_trees' That should fix it Good luck |
Unfortunately from looking into it, this seems to be an issue coming from the Leiden package and/or some of its dependencies (such as igraph). I get the same warnings when running the following minimal Leiden example:
The warnings existed for some time, but it seems like in R 4.2 they get converted to errors. The workaround for now is to simply add a Regards, |
@iS4i4S @GeorgescuC Error in file(con, "w") : all connections are in use
I will be trying @GeorgescuC's suggestion next and see if that works out. Will keep you guys posted. Thank you. |
@GeorgescuC Error in py_module_import(module, convert = convert) : This is what traceback() returns: Here is the sessioninfo for the run.
Matrix products: default locale: attached base packages: other attached packages: loaded via a namespace (and not attached): |
Hi @bhabakd , It seems there is an error loading the Leiden dependencies. Can you try running this minimal example to see if Leiden is setup properly?
Regards, |
Hi @GeorgescuC
regards Bhaba |
Hi @bhabakd, Sorry for the delay in getting back to you. I have been working on replacing the old implementation of the Leiden clustering that required Python to the one from igraph that doesn't, so the current master branch should allow you to run infercnv without this issue. You might however need to install a couple extra R dependencies that have been added. Regards, |
Hi Christophe,
Thank you for getting back to me. I also have been caught up with a few
other things, and was planning to get back to infercnv early next week. So
the timing of your email is just about perfect. I really appreciate the
effort you took to find a remedy to this issue. Excited to try It out. Will
keep you posted on how it goes.
Thanks again
Regards
Bhaba KD
…On Wed, 17 Aug 2022 at 5:49 PM, GeorgescuC ***@***.***> wrote:
Hi @bhabakd <https://github.com/bhabakd>,
Sorry for the delay in getting back to you. I have been working on
replacing the old implementation of the Leiden clustering that required
Python to the one from igraph that doesn't, so the current master branch
should allow you to run infercnv without this issue. You might however need
to install a couple extra R dependencies that have been added.
Regards,
Christophe.
—
Reply to this email directly, view it on GitHub
<#426 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXAIUBERBEWOAMAWPOIM5PTVZWCB5ANCNFSM5YSZWBSA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@GeorgescuC I just had the same issue on using Rv4.2.1 despite building the conda env from the recommended commands from the leiden package using r-reticulate. I uninstalled |
Hi @tbrunetti , The version currently on master does not use python and r-reticulate anymore at all, so the initial issue in step 15 should not happen anymore. Please let me know if you encounter any issues with this new version, I am planning on releasing it on the devel branch of Bioconductor after a few people have had the time to try it out to make sure things run well in different setups. Regards, |
Yes, this fix resolved my issues. Thanks! |
Hi @GeorgescuC, I have yet another query though. I want to arrange the samples in a specific order. Is there a way to do so? Regards BhabaKD |
I get a different error when runing the latest infercnv. Warning in irlba(A = t(x = object), nv = npcs, ...) : This error occurred when running Step15. More strangely, Most samples can get the right result but only some samples get this error. I have tried docker image and install infercnv from github directly, both methods will get this error. |
Hi @bhabakd , In the current version, samples/annotations are sorted with sort() in R, so if you append a prefix to them you should be able to order them as you wish. One thing to remember though is that the plot is done bottom to top, so the order will be reversed there. To avoid rerunning the whole analysis, you can create a new infercnv object with the updated annotation names and transfer the @observation_grouped_cell_indices field from the new object to the object with results, as long as you do not change anything else (the matrix most importantly). Regards, |
Hi @shanshenbing , I suspect chromosome 21 has too few genes for the PCA to be meaningful in some of those samples. I have added a fallback to the simpler Leiden clustering for those cases in the latest commit, so if you can update your installation of infercnv from the master branch, it will hopefully solve the issue. Regards, |
Thank you for your reply. I finally updated my R to 4.2.1 and installed the latest version of inferCNV on my self local windows10 computer using the same samples with no errors. |
Hi
I am new to infercnv.
While attempting to run the analysis with analysis_mode = "subcluster", I am encountering the following during Step 15:
STEP 15: computing tumor subclusters via leiden
INFO [2022-06-12 20:26:56] define_signif_tumor_subclusters(p_val=0.05
INFO [2022-06-12 20:26:56] define_signif_tumor_subclusters(), tumor: M
Error in paste(sig, collapse = "#") :
(converted from warning) NAs introduced by coercion to integer range
15: (function ()
traceback(2))()
14: doWithOneRestart(return(expr), restart)
13: withOneRestart(expr, restarts[[1L]])
12: withRestarts({
.Internal(.signalCondition(simpleWarning(msg, call), msg,
call))
.Internal(.dfltWarn(msg, call))
}, muffleWarning = function() NULL)
11: .signalSimpleWarning("NAs introduced by coercion to integer range",
base::quote(paste(sig, collapse = "#")))
10: paste(sig, collapse = "#")
9: .sigLabel(signature)
8: .findMethodInTable(c(from, to), methods)
7: .quickCoerceSelect(thisClass, Class, coerceFun, coerceMethods,
where)
6: as(object, "dgCMatrix")
5: leiden.Matrix(sparse_adjacency_matrix, resolution_parameter = leiden_resolution)
4: leiden(sparse_adjacency_matrix, resolution_parameter = leiden_resolution)
3: .single_tumor_leiden_subclustering(tumor_group = tumor_group,
tumor_group_idx = tumor_group_idx, tumor_expr_data = tumor_expr_data,
k_nn = k_nn, leiden_resolution = leiden_resolution, hclust_method = hclust_method)
2: define_signif_tumor_subclusters(infercnv_obj, p_val = tumor_subcluster_pval,
k_nn = k_nn, leiden_resolution = leiden_resolution, hclust_method = hclust_method,
cluster_by_groups = cluster_by_groups, partition_method = tumor_subcluster_partition_method)
1: infercnv::run(T99_infercnv_obj, analysis_mode = "subclusters",
cutoff = 0.1, out_dir = tempfile(), cluster_by_groups = TRUE,
plot_steps = FALSE, denoise = TRUE, HMM = TRUE, num_threads = 10,
tumor_subcluster_pval = 0.05, no_plot = TRUE)
This is the command I use after creating the infercnv object
S99_infercnv_obj <- infercnv::run(S99_infercnv_obj, analysis_mode = 'subclusters',
cutoff=0.1, # cutoff=1 works well for Smart-seq2, and cutoff=0.1 works well for 10x Genomics
out_dir=tempfile(),
cluster_by_groups=TRUE,
plot_steps = FALSE,
denoise=TRUE,
HMM=TRUE,
num_threads = 10,
tumor_subcluster_pval = 0.05,
no_plot = TRUE)
The analysis is been performed on a count_matrix generated from a Seurat object using GetAssayData(obj, slot ="count").
Cells have been annotated as either malignant (M) or non-malignant(NM), with 492 cells of the former and 4190 of the latter.
Interestingly, the command works fine without 'subcluster'.
The text was updated successfully, but these errors were encountered: