icbi-lab / infercnvpy

Infer copy number variation (CNV) from scRNA-seq data. Plays nicely with Scanpy.

Home Page:https://infercnvpy.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ith score

rahhhm opened this issue · comments

commented

In the case of ITH cna, IQR is distribution of the coefeffiient values of Pearson correlation between malignant cells for each sample taken from the gene expression matrix derived from the cnv heatmap
In the case of ITHgex, can I say that iqr is obtained from the scaling gene expression matrix?

I did the same with the matrix from infercnv(R), and I expected that the two values would be different, but the correlation was completely different, so I asked because I thought there might be some misunderstanding.

Hi @rahhhm,

thanks for the question!

The implementation is pretty straightforward, you can take a look here:

pcorr = np.corrcoef(X, rowvar=True)
assert pcorr.shape == (
tmp_adata.shape[0],
tmp_adata.shape[0],
), "pcorr is a cell x cell matrix"
q75, q25 = np.percentile(pcorr, [75, 25])
ithcna[group] = q75 - q25

(ithgex is basically the same and can be found in the same file)

In the case of ITHgex, can I say that iqr is obtained from the scaling gene expression matrix?

By default, adata.raw.X is used. If no .raw is available, adata.X is used.

I did the same with the matrix from infercnv(R), and I expected that the two values would be different, but the correlation was completely different, so I asked because I thought there might be some misunderstanding.

That is weird, I would expect the values to be at least roughly comparable. How do the CNV plots of the R version compare to the infercnv version? Are they comparable?

commented

gex score was roughly comparable, but cna score was completely different.

I used infercnv.reference.txt and infercnv.observation.txt created by infercnv :: run

did I use right files?

or If the CNV plots are incomparable, is the difference natural?

or If the CNV plots are incomparable, is the difference natural?

yes, then I'd also expect the ITH score to be different. But in that case it would be interesting to know why the plots are not comparable in the first place.

infercnvpy is not an exact re-implementation of the infercnv algorithm, but in my examples the final results were quite similar.

commented

thank you for comment

I solved it, I used "infercnv_obj@expr.data"

It has same order of ITH cna score with "infercnvpy.tl.ithcna"