atarashansky / SAMap

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

transfer_annotations - removed #104

Closed kullrich closed 1 year ago

kullrich commented 1 year ago

Hi,

in the original vignette, there was the function transfer_annotations.

This function is not there anymore in the analysis.py file.

Could you please explain, why you removed the function, is it still valid to use it as it was in the older versions or what are the problems with it?

Thank you in anticipation

Best regards

Kristian

kullrich commented 1 year ago

Should be this commit:

https://github.com/atarashansky/SAMap/commit/a2b28391285c8688ccf986efff5358b8060b7cc7

# TODO: Deprecate for now and fix this later
def transfer_annotations(sm,reference_id=None, keys=[],num_iters=5, inplace = True):
atarashansky commented 1 year ago

Hi Kristian - I deprecated and removed this function because the quality of the label propagation was never thoroughly evaluated (this particular functionality was not used in the publication). There may not necessarily be a problem with it as the methodology is inspired by the approach taken by Conos. If you'd still like to use this function, feel free to do so externally.

kullrich commented 1 year ago

OK, I really like this functionality, since I am working with some pre-annotated data sets and transfering the cell types directly with SAMap is a very good feature in my opinion.

Another question would be if you ever tested integrating two data sets from the same species with SAMap?

I tested and so far it looks quite promising to me.

Thank you in anticipation

Best regards

Kristian

atarashansky commented 1 year ago

Hi Kullrich - I have tested integrating two datasets from the same species with SAMap and as you observed it does work pretty well. It's particularly useful when you have two datasets mapped to different references.

dnjst commented 1 year ago

I will second that transfer_annotations was very useful.

@atarashansky and @kullrich, could you explain briefly how you integrate from the same species with SAMap? Do you give each different species keys, and build a BLAST graph of the same FASTA to itself?

atarashansky commented 1 year ago

Hi @dnjst - sorry for the late reply. You can use the (unfortunately undocumented) _mapper function in the samap module (from samap import _mapper). This function is the core mapping engine that aligns the manifolds together.

The required input is sams: a dictionary of dataset ID as keys (e.g. dataset1 and dataset2) and corresponding SAM objects as values.

That's all you need. _mapper will align them and spit out a combined SAM object. So, for example, you would run: combined_sam = _mapper(sams, umap=True)

atarashansky commented 1 year ago

Another useful use case for SAMAP is to align datasets from the same species that have been mapped to different transcriptomes. In that case, you would treat them as separate species and run the analysis in the exact way you would run it for mapping two different species.

atarashansky commented 1 year ago

(Closing this issue for now, if you have any more questions please reopen!!)