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

Error in STEP 15: computing tumor subclusters via leiden,,heatmap.cnv(obs_data, Rowv = obs_dendrogram, Colv = FALSE, cluster.by.row = TRUE, : 'RowIndividualColors' must be a character vector of length nrow(x) #680

Open
qiuhuijiajia opened this issue Dec 28, 2024 · 2 comments

Comments

@qiuhuijiajia
Copy link

qiuhuijiajia commented Dec 28, 2024

Hello InferCNV Team,

I've encountered this issue in Step 15, when I was running the following code:

infercnv_obj = infercnv::run(infercnv_obj,
cutoff=0.1, # cutoff=1 works well for Smart-seq2, and cutoff=0.1 works well for 10x Genomics
out_dir="gse155446_1225",
no_prelim_plot = T,
cluster_by_groups=TRUE,
denoise=TRUE,
HMM=F,
min_cells_per_gene = 10,
num_threads=10,
leiden_resolution = 0.05,
plot_steps=F,
write_expr_matrix = T)
Error : heatmap.cnv(obs_data, Rowv = obs_dendrogram, Colv = FALSE, cluster.by.row = TRUE, :
'RowIndividualColors' must be a character vector of length nrow(x)
Warning:
1: In asMethod(object) :
sparse->dense coercion: allocating vector of size 2.4 GiB
2: In asMethod(object) :
sparse->dense coercion: allocating vector of size 2.4 GiB
3: In asMethod(object) :
sparse->dense coercion: allocating vector of size 2.4 GiB
4: In cbind(row_groupings, get_group_color_palette()(length(table(hcl_obs_annotations_groups)))[hcl_obs_annotations_groups]) :
number of rows of result is not a multiple of vector length (arg 2)
5: In cbind(split_groups, row_groupings[, 1], hcl_obs_annotations_groups, :
number of rows of result is not a multiple of vector length (arg 3)

I am trying to determine if this issue stems from my sample data or if it's something that can be addressed technically. Here are the specifics of my analysis setup for your reference:

packageVersion("infercnv")
[1] ‘1.22.0’

My sessionInfo as follow:
R version 4.4.2 (2024-10-31)
Platform: x86_64-pc-linux-gnu

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so; LAPACK version 3.10.0

locale:
[1] LC_CTYPE=zh_CN.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_CA.UTF-8 LC_COLLATE=zh_CN.UTF-8
[5] LC_MONETARY=en_CA.UTF-8 LC_MESSAGES=zh_CN.UTF-8
[7] LC_PAPER=en_CA.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_CA.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] future_1.34.0 SeuratObject_4.1.4 Seurat_4.4.0 infercnv_1.22.0
[5] qs_0.27.2

loaded via a namespace (and not attached):
[1] RcppAnnoy_0.0.22 splines_4.4.2
[3] later_1.4.1 bitops_1.0-9
[5] tibble_3.2.1 polyclip_1.10-7
[7] lifecycle_1.0.4 fastcluster_1.2.6
[9] edgeR_4.4.0 doParallel_1.0.17
[11] globals_0.16.3 lattice_0.22-5
[13] MASS_7.3-61 magrittr_2.0.3
[15] limma_3.62.1 plotly_4.10.4
[17] httpuv_1.6.15 sctransform_0.4.1
[19] spam_2.11-0 sp_2.1-4
[21] spatstat.sparse_3.1-0 reticulate_1.40.0
[23] cowplot_1.1.3 pbapply_1.7-2
[25] DBI_1.2.3 RColorBrewer_1.1-3
[27] multcomp_1.4-26 abind_1.4-8
[29] zlibbioc_1.52.0 Rtsne_0.17
[31] GenomicRanges_1.58.0 purrr_1.0.2
[33] BiocGenerics_0.52.0 TH.data_1.1-2
[35] sandwich_3.1-1 GenomeInfoDbData_1.2.13
[37] IRanges_2.40.0 S4Vectors_0.44.0
[39] ggrepel_0.9.6 irlba_2.3.5.1
[41] listenv_0.9.1 spatstat.utils_3.1-1
[43] goftest_1.2-3 spatstat.random_3.3-2
[45] fitdistrplus_1.2-1 parallelly_1.39.0
[47] leiden_0.4.3.1 codetools_0.2-19
[49] coin_1.4-3 DelayedArray_0.32.0
[51] RApiSerialize_0.1.4 tidyselect_1.2.1
[53] futile.logger_1.4.3 UCSC.utils_1.2.0
[55] farver_2.1.2 rjags_4-16
[57] matrixStats_1.4.1 stats4_4.4.2
[59] spatstat.explore_3.3-3 jsonlite_1.8.9
[61] progressr_0.15.1 ggridges_0.5.6
[63] survival_3.7-0 iterators_1.0.14
[65] foreach_1.5.2 tools_4.4.2
[67] ica_1.0-3 Rcpp_1.0.13-1
[69] glue_1.8.0 gridExtra_2.3
[71] SparseArray_1.6.0 MatrixGenerics_1.18.0
[73] GenomeInfoDb_1.42.0 dplyr_1.1.4
[75] withr_3.0.2 formatR_1.14
[77] BiocManager_1.30.25 fastmap_1.2.0
[79] fansi_1.0.6 caTools_1.18.3
[81] digest_0.6.37 parallelDist_0.2.6
[83] R6_2.5.1 mime_0.12
[85] colorspace_2.1-1 scattermore_1.2
[87] gtools_3.9.5 tensor_1.5
[89] spatstat.data_3.1-4 utf8_1.2.4
[91] tidyr_1.3.1 generics_0.1.3
[93] data.table_1.16.2 httr_1.4.7
[95] htmlwidgets_1.6.4 S4Arrays_1.6.0
[97] uwot_0.2.2 pkgconfig_2.0.3
[99] gtable_0.3.6 modeltools_0.2-23
[101] lmtest_0.9-40 SingleCellExperiment_1.28.1
[103] XVector_0.46.0 htmltools_0.5.8.1
[105] dotCall64_1.2 scales_1.3.0
[107] Biobase_2.66.0 png_0.1-8
[109] phyclust_0.1-34 spatstat.univar_3.1-1
[111] lambda.r_1.2.4 rstudioapi_0.17.1
[113] reshape2_1.4.4 coda_0.19-4.1
[115] nlme_3.1-166 zoo_1.8-12
[117] stringr_1.5.1 KernSmooth_2.23-24
[119] parallel_4.4.2 miniUI_0.1.1.1
[121] libcoin_1.0-10 pillar_1.9.0
[123] grid_4.4.2 vctrs_0.6.5
[125] gplots_3.2.0 RANN_2.6.2
[127] promises_1.3.2 stringfish_0.16.0
[129] xtable_1.8-4 cluster_2.1.8
[131] locfit_1.5-9.10 mvtnorm_1.3-2
[133] cli_3.6.3 compiler_4.4.2
[135] futile.options_1.0.1 rlang_1.1.4
[137] crayon_1.5.3 future.apply_1.11.3
[139] argparse_2.2.4 plyr_1.8.9
[141] stringi_1.8.4 viridisLite_0.4.2
[143] deldir_2.0-4 munsell_0.5.1
[145] lazyeval_0.2.2 spatstat.geom_3.3-4
[147] Matrix_1.7-1 patchwork_1.3.0
[149] ggplot2_3.5.1 statmod_1.5.0
[151] shiny_1.9.1 SummarizedExperiment_1.36.0
[153] ROCR_1.0-11 igraph_2.1.1
[155] RcppParallel_5.1.9 ape_5.8

output12252.txt

@qiuhuijiajia
Copy link
Author

7: (function ()
traceback(2))()
6: stop("'RowIndividualColors' must be a character vector of length nrow(x)")
5: heatmap.cnv(obs_data, Rowv = obs_dendrogram, Colv = FALSE, cluster.by.row = TRUE,
cluster.by.col = FALSE, main = cnv_title, ylab = cnv_obs_title,
margin.for.labCol = 2, xlab = "Genomic Region", key = TRUE,
labCol = contig_labels, cexCol = contig_lab_size, cexAt = c(1,
contig_seps), notecol = "black", density.info = "histogram",
denscol = "blue", trace = "none", dendrogram = "row", cexRow = 0.8,
breaks = breaksList, gene_position_breaks = gene_position_breaks,
scale = "none", x.center = x.center, color.FUN = col_pal,
if.plot = !testing, sepList = contigSepList, sep.color = c("black",
"black"), sep.lty = 1, sep.lwd = 1, RowIndividualColors = row_groupings,
annotations_legend = annotations_legend, grouping_key_coln = grouping_key_coln,
ColIndividualColors = contig_colors, key.title = "Distribution of Expression",
key.xlab = "Modified Expression", key.ylab = "Count", force_lmat = layout_lmat,
force_lwid = layout_lwid, force_lhei = layout_lhei, useRaster = useRaster)
4: .plot_cnv_observations(infercnv_obj = infercnv_obj, obs_data = obs_data,
file_base_name = out_dir, do_plot = !is.na(output_format),
write_expr_matrix = write_expr_matrix, write_phylo = write_phylo,
output_filename_prefix = output_filename, cluster_contig = ref_contig,
contigs = contigs, contig_colors = ct.colors[contigs], contig_labels = contig_labels,
contig_names = contig_names, col_pal = custom_pal, contig_seps = col_sep,
num_obs_groups = k_obs_groups, obs_annotations_groups = obs_annotations_groups,
obs_annotations_names = obs_annotations_names, grouping_key_coln = grouping_key_coln[1],
cluster_by_groups = cluster_by_groups, cnv_title = title,
cnv_obs_title = obs_title, contig_lab_size = contig_cex,
breaksList = breaksList_t, gene_position_breaks = gene_position_breaks,
x.center = x.center, hclust_method = hclust_method, layout_lmat = force_layout[["lmat"]],
layout_lhei = force_layout[["lhei"]], layout_lwid = force_layout[["lwid"]],
useRaster = useRaster)
3: plot_cnv(subcluster_obj, cluster_by_groups = TRUE, output_filename = output_filename,
out_dir = out_dir, write_expr_matrix = FALSE)
2: plot_subclusters(infercnv_obj, out_dir = out_dir, output_filename = "infercnv_subclusters")
1: infercnv::run(infercnv_obj, cutoff = 0.1, out_dir = "gse155446_1225",
no_prelim_plot = T, cluster_by_groups = TRUE, denoise = TRUE,
HMM = F, min_cells_per_gene = 10, num_threads = 10, leiden_resolution = 0.05,
plot_steps = F, write_expr_matrix = T)

@qiuhuijiajia
Copy link
Author

here is my output log
output12252.txt

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

1 participant