atarashansky / SAMap

SAMap: Mapping single-cell RNA sequencing datasets from evolutionarily distant organisms.
MIT License
66 stars 19 forks source link

Harmony integration (was closed issue #83) #131

Closed dsb66 closed 1 year ago

dsb66 commented 1 year ago

I am running the current version of SAMap (v1.0.15). I am trying to use the batch option with the command sm.run(batch_key="batch") but I get the error: TypeError: run() got an unexpected keyword argument 'batch_key'.

Has the batch_key option been removed from the current version?

atarashansky commented 1 year ago

SAMap never had a batch_key. Perhaps you're thinking of SAM?

dsb66 commented 1 year ago

I see - I am sorry this the first time I work with SAMap/SAM. So the procedure would be: 1- normalize and log-transform individual datasets 2- concatenate datasets, separately for each species 3- integrate concatenated objects in SAM 4- run SAMap Is this correct? Thanks!

atarashansky commented 1 year ago

Do you have AnnData objects with raw counts? What's your input data look like? What's your objective?

SAM is a method to analyze individual datasets. SAMap is a method that integrates SAM objects together across species.

dsb66 commented 1 year ago

I have 4 human and 4 mouse datasets (raw counts). I want to integrate the datasets from each species, before running SAMap to integrate the human and mouse integrated objects. What would be the correct sequence of steps?

atarashansky commented 1 year ago

Concatenate all human data into one AnnData, load it into SAM, then run SAM with batch_key set to your batch key. Do the same for mouse. Then you need to pass them into SAMap. At this stage, please refer to the SAMAP tutorial notebook in this repo.

dsb66 commented 1 year ago

Great - thank you very much!

lengfei5 commented 1 week ago

Dear @atarashansky ,

Thank you so much for developing such a great tool to integration data from multiple species. I am also wondering if it is possible to integrate datasets of different batches for individual species using scVI-tools, instead of SAM, before passing them to SAMap for species integration ?

Best, Jingkui

atarashansky commented 3 days ago

Yes, that should be fairly easy to do. You can pass the output AnnData from SCVI into SAM like so sam=SAM(counts=adata) and this sam object should be able to be used by SAMap.

lengfei5 commented 3 days ago

Dear @atarashansky ,

Many thanks for your quick answer. This is amazing !

Does it mean that SAMap will be using the batch-corrected gene expression matrix (NOT the count table) in the AnnData from SCVI ? right ?

Thanks again.