ventolab / CellphoneDB

CellPhoneDB can be used to search for a particular ligand/receptor, or interrogate your own HUMAN single-cell transcriptomics data.
https://www.cellphonedb.org/
MIT License
320 stars 51 forks source link

.mtx file as input? #116

Closed stefanerb89 closed 10 months ago

stefanerb89 commented 1 year ago

I saved the input files like in 0_prepare_your_data_from_Seurat.ipynb

# Save normalised counts - NOT scaled!
writeMM(so@assays$RNA@data, file = 'endometrium_example_counts_mtx/matrix.mtx')
# save gene and cell names
write(x = rownames(so@assays$RNA@data), file = "endometrium_example_counts_mtx/features.tsv")
write(x = colnames(so@assays$RNA@data), file = "endometrium_example_counts_mtx/barcodes.tsv")

But I see no possibility to to use this files as input in the cellphonedb functions. There is only a recommendation for a txt or h5ad file. How I should handle the .mtx file?

ktroule commented 1 year ago

Hi,

Currently we only support anndata h5ad and text files. You can either read your raw data with scanpy and save it to h5ad or use sceasy to convert your seurat object to h5ad.

Regards

ktroule commented 1 year ago

Reviewing this comment, a colleague noticed a mistake on my side. CellPhoneDB supports Mex format matrices.

You just need to pass to the counts_file_path argument of the CellPhoneDB method you are using the path where you have your counts (matrix/barcode/features).

Apologies for the confusion. Regards