-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accessing Metadata from AnnData #50
Comments
Hi, the matrix with CNV scores is stored in > adata.obsm["X_cnv"]
<184x9111 sparse matrix of type '<class 'numpy.float64'>'
with 214913 stored elements in Compressed Sparse Row format> where each row is a cell and each column a genomic region. Additionally, there's information which columns in this matrix belong to which chromosome in > adata.uns["cnv"]["chr_pos"]
{'chr1': 0,
'chr2': 915,
'chr3': 1574,
'chr4': 2141,
'chr5': 2454,
'chr6': 2902,
'chr7': 3394,
'chr8': 3874,
'chr9': 4195,
'chr10': 4564,
'chr11': 4955,
'chr12': 5494,
'chr13': 6009,
'chr14': 6179,
'chr15': 6499,
'chr16': 6791,
'chr17': 7209,
'chr18': 7787,
'chr19': 7928,
'chr20': 8523,
'chr21': 8781,
'chr22': 8880} i.e. in this example adata.obsm["X_cnv"][:, 0:915] contains the scores for hope that helps, |
Hello, Yes this is helpful, thanks! However, it looks like this info is a superset of the table described here. Is there a way to acquire the 'map_metadata_from_infercnv.txt' described in that link directly from the Thank you for your help, |
Unfortunately, segmentation (e.g. using HMM) is currently not implemented in infercnvpy (See also #1). cnv_mat = adata.obsm["X_cnv"]
chr2_score = np.mean(cnv_mat[:, 915:1200], axis=1) to get a score for each cell. |
Hello~
chr1 0 So could you add the geneID in the ['X_cnv'].or maybe other ways to get the CNV region.Thanks so much.Waiting for your reply. |
Hi @zhangpebbels, yes, the metadata in @redst4r has been working on a feature to retrieve genes for each bin in #58. But there are still some tests failing and I'm not entirely sure what the status of that PR is. |
Thank you for sharing great wrapper for infercnvpy. I've been trying to annotate matching gene on heatmap plot (c.f., bottom for all/subset of matching gene symbols) but tuning on best, |
Hello,
I am attempting to export metadata after running inferCNV. I am able to export the CNV score and the Leiden clusters, however I would like to access everything that is also available in the R version such as the loss or gain of each chromosome for each cell. The R version seems to release a large table (~200) columns with data for each chromosome. Is it possible to access this somehow using the python version?
The text was updated successfully, but these errors were encountered: