You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
finer control on the "outer, inner" join behavior of sc.concat #591
When we join two adata objects, usually we want to do inner join on the genes and outer join on the meta data (adata.obs). I understand that there is an option in sc.concat to control the behavior of joining, but it assigns the same behavior to the genes and adata.obs. Is it possible to add an option to control the behavior separately? Thanks!
I think this is a good idea, which has also come up here #416 (review).
I think the main question is API. I some thoughts on this, but am not completley happy with any. I would note that xr.concat (which I heavily borrowed concepts from for this function) doesn't have a clear analog here. Though perhaps this is more like passing a list to data_vars or coords?
I'll give a few of my thoughts, but would like to hear others and get feedback
Specify kind of join per attribute/ element via dict
But what's the behaviour for unspecified elements? E.g. What does this result in for other elements of obsm? It would be great if it was a simple consistent rule.
This is a bit like passing a dict for fill_value to xr.concat (which we could also do, and would be a nice symmetry for the arguments).
A simple option which would be quick to implement would be a join_elements argument, which defaults the value of join, but if passed allows you to override how elements in obs, obsm (/ var, varm) are joined. So:
Activity
ivirshup commentedon Jul 15, 2021
I think this is a good idea, which has also come up here #416 (review).
I think the main question is API. I some thoughts on this, but am not completley happy with any. I would note that
xr.concat(which I heavily borrowed concepts from for this function) doesn't have a clear analog here. Though perhaps this is more like passing a list todata_varsorcoords?I'll give a few of my thoughts, but would like to hear others and get feedback
Specify kind of join per attribute/ element via dict
But what's the behaviour for unspecified elements? E.g. What does this result in for other elements of
obsm? It would be great if it was a simple consistent rule.This is a bit like passing a dict for
fill_valuetoxr.concat(which we could also do, and would be a nice symmetry for the arguments).Example of xr.concat with fill_value
Maybe we could also explicitly provide a list of elements to keep?
Simple option
A simple option which would be quick to implement would be a
join_elementsargument, which defaults the value ofjoin, but if passed allows you to override how elements inobs, obsm(/var, varm) are joined. So: