broadinstitute / infercnv

Inferring CNV from Single-Cell RNA-Seq
Other
557 stars 164 forks source link

plot_cnv() failed to cluster samples into 'k_obs_groups' #518

Open Ray-Xia778 opened 1 year ago

Ray-Xia778 commented 1 year ago

hi, thanku for your attention to this issue. it seems the parameter 'k_obs_group' of plot_cnv() doesn't work and there seems not any clustering on the Row. how to fix it? infercnv

here is my code infercnv_obj = infercnv::run(infercnv_obj, cutoff=0.1, out_dir="infercnv1", cluster_by_groups=F, denoise=T,window_length= 200,k_obs_groups = 10, HMM=F,analysis_mode = 'subclusters')

and after i got the strange heatmap, i repeat plot_cnv() using different 'k_obs_groups' but nothing changed. plot_cnv(infercnv_obj, out_dir = ".",cluster_by_groups = F,k_obs_groups = 5, hclust_method = "ward.D2",write_expr_matrix = T, useRaster = F)

Looking forward to your reply!!! thanks!

GeorgescuC commented 1 year ago

Hi @Ray-Xia778 ,

The plot looks like the issue is too high a Leiden resolution leading to too many subclusters. Because individual subclusters are very small, the 9 first splits obtained using k_obs_groups are all stacked at the very bottom of the figure, which you can notice because the left color column has a few lines of a different color there. Subclusters are also not organized hierarchically against each other which explains why nothing really looks like it clusters together in your plot.

I would try running infercnv again using the leiden_resolution option set to something lower than the default 0.05, at least down to 0.01 although you might need to go lower in your case.

Regards, Christophe.

Ray-Xia778 commented 1 year ago

I got a satisfying heatmap after setting leiden_resolution=0.00001 Thank you so much! @GeorgescuC