Open StefTesta opened 1 year ago
Hi @StefTesta ,
The infercnv_obj that is returned at the end of run() only contains the residual expressions. If you wish to use residual expressions, then infercnv_obj@expr.data
is the matrix to use, and you can load it back with infercnv_obj = readRDS("run.final.infercnv_obj")
.
If you want to use the HMM predictions instead, you can either use the helper method described later in this answer, or calculate scores yourself, in which case you will need to load the results from the objects save as backups after each step:
infercnv_hmm_obj = readRDS("17_HMM_predHMMi6.hmm_mode-samples.infercnv_obj")
will load the HMM predictions without any filtering.infercnv_hmm_obj = readRDS("19_HMM_pred.Bayes_NetHMMi6.hmm_mode-samples.Pnorm_0.5.infercnv_obj")
will load the HMM predictions with the Bayesian Pnormal filtering applied.
In both cases, you can then access the HMM predictions in the infercnv_hmm_obj@expr.data
matrix. Please note however that for the HMM, the values are the 6 different states as defined in the documentationOther useful fields for selecting rows/columns are:
infercnv_obj@gene_order
: position of each gene kept in the analysis (chromosome, start position, end position)
infercnv_obj@reference_grouped_cell_indices
: the indices for the cells defined as references as a list for each annotation
infercnv_obj@observation_grouped_cell_indices
: the indices for the cells defined as observations as a list for each annotation
infercnv_obj@tumor_subclusters
:
$hc
contains a list of hclust objects for each annotation group (or "all_observations"/"all_references" if cluster_by_groups is False).$subclusters
contains a list for each annotation (or "all_observations"/"all_references" if cluster_by_groups is False) of a list of each subcluster and the cell indices present in them.Helper HMM method:
For plotting HMM results on your Seurat t-SNE/UMAP, you can find examples in the documentation, and use that as a starting point if you want to plot the same type of visualizations with scores you calculated yourself. You should only need to add your scores as features in seurat_obj@meta.data
to be able to use FeaturePlot
and DimPlot
.
Regards, Christophe.
Hi,
Thank you for this great tool! I'm relatively new to the field of bioinformatics and have a question that is probably quite easy to answer but could not find any solution to my problem on the issues already reported here.
I have several tumor samples and I'm running inferCNV separately on each sample to differentiate tumor vs normal using the CNA level of each cells. I'm using endothelial cells, macrophages and CAF as references. I defined these groups based on default clustering and annotation methods in seurat.
Now I am trying to obtain something similar to what has been done in this paper:
Methods:
Basically, I would like to calculate the overall CNA level for each cell across all the genomic windows, run an analysis similar to what done in the paper above, and then I would like to add this information to my original seurat object to obtain a t-SNE/UMAP plot like the one posted here.
I'm finding hard to find and extract the needed data from the inferCNV output. Also I'm running the analysis with HMM=T. So should I use "infercnv_obj@expr.data" or "17_HMM_predHMMi6.hmm_mode-samples.infercnv_obj" as the source of the CNA values for each cell?
Thank you, Stefano