Skip to content

concat when some values of X are None #678

Closed

Description

@ivirshup

Subpart of #467

What should we do when we concat multiple anndata objects where some of them have None for their X value?

While I think we should broadly do the same thing that we do for values in layers, I think this could have some weird behaviour.

Here is my current proposal for the behavior:

  • All AnnData's have X – current behavior
  • No AnnData's have X – same as if no AnnData had this key. It remains None.
  • Some AnnData's have X and it's an outer join. We use the fill_value and create .X arrays for the objects missing them
  • Some AnnData's have X and it's an inner join. Result has X = None.

The final case feels off to me, but it's the least weird behavior I could think of. I personally would expect this to result in an inner join on the variables with an outer join on the values for X. That is, we still take the intersection of the alternative axis, but we fill the Xs which were missing.

But this would inconsistent with the behavior for layers (#244), which I think is worse.

I think this leads to the broader issue of the join argument controlling both combining the dimensions and which elements are kept (#591).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions