broadinstitute / infercnv

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

Question about analysis_mode #508

Open Sa753 opened 1 year ago

Sa753 commented 1 year ago

Hi @GeorgescuC

I am running infercnv to differentiate the cancer cells from fibroblasts in a tumour that has extensive EMT. The tumour cells are Trp53 deleted. My question is which is best to use analysis_mode='sub clusters' or 'sample'?. Then can I pull the cells with Trp53 deletion?.

Thanks

GeorgescuC commented 1 year ago

Hi @Sa753 ,

First, the analysis mode option is only important for the HMM results, so if you only care about the residual expression, it will only affect the hclust/dendrogram.

Generally running the analysis in "subclusters" mode is preferrable because it can separate the different subclones if there are any. However for best results you will need to inspect subclusters to see if the parameters (mainly the leiden resolution) fit your data. If you are using the latest code on github, there is a new method plot_subclusters() you can use on the preliminary object/step 15 object, to plot the residual expression with subclusters splits shown. I am actually working on a small tutorial that includes how to use it, but here is the short version:

# create the object
infercnv_obj = CreateInfercnvObject(...)

# run the analysis until the subclustering
preliminary_results = infercnv::run(infercnv_obj, analysis_mode = "subclusters", up_to_step = 15, ...)

# inspect subclusters
plot_subclusters(preliminary_results)

# adjust settings and rerun last 2 lines as needed to test

# once you have good settings, finish the run
final_results = infercnv::run(infercnv_obj, analysis_mode = "subclusters", ...) 

Regards, Christophe.