I'm working with matched single cell data, where we have treated and untreated samples for the same patient. I ran CNV analysis using the infercnv
package.
I've followed the tutorial:
# data matrix
counts_matrix <- scData@assays$RNA@counts
meta = data.frame(labels = Idents(scData), row.names = names(Idents(scData)))
unique(meta$labels) # check the cell labels
# Create the infercnv object
infercnv_obj <- CreateInfercnvObject(raw_counts_matrix = counts_matrix,
annotations_file = meta,
delim = "\t",
gene_order_file = "hg38_gencode_v27.txt",
ref_group_names = NULL)
# perform infercnv operations to reveal cnv signal
infercnv_obj = infercnv::run(infercnv_obj,
cutoff=1, # use 1 for smart-seq, 0.1 for 10x-genomics
out_dir="output_dir", # dir is auto-created for storing outputs
cluster_by_groups=T, # cluster
denoise=T,
HMM=T
)
Now, I'm not sure how to plot the results. Any help would be appreciated.
When running the below recommendation I get this:
INFO [2023-05-19 12:49:22] ::plot_cnv:Start
INFO [2023-05-19 12:49:22] ::plot_cnv:Current data dimensions (r,c)=34108,17624 Total=82463956 Min=0 Max=55099.
INFO [2023-05-19 12:49:22] ::plot_cnv:Depending on the size of the matrix this may take a moment.
<sparse>[ <logic> ]: .M.sub.i.logical() maybe inefficient
Warning: sparse->dense coercion: allocating vector of size 4.5 GiBINFO [2023-05-19 12:50:12] plot_cnv(): auto thresholding at: (-2.725632 , 3.000000)
INFO [2023-05-19 12:50:35] plot_cnv_observation:Start
INFO [2023-05-19 12:50:35] Observation data size: Cells= 17624 Genes= 34108
INFO [2023-05-19 12:50:35] clustering observations via method: ward.D
INFO [2023-05-19 12:50:35] Number of cells in group(1) is 331
INFO [2023-05-19 12:50:36] group size being clustered: 331,34108
Error in parallelDist(data_to_cluster, threads = infercnv.env$GLOBAL_NUM_THREADS) :
x must be a matrix or a list of matrices.