Implement scverse datastucture - #356
Merged
Merged
Conversation
grst
force-pushed
the
scverse_datastructure
branch
from
March 25, 2023 11:03
d60ad64 to
17e7a17
Compare
grst
marked this pull request as ready for review
March 29, 2023 09:35
for more information, see https://pre-commit.ci
This reverts commit 6e19241.
Will fail, because anndata 0.9rc1 is not on conda.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implementing the changes suggested in #327.
Close #327
Close #184
Close #383
Requires
installed from theval_shapebranchTODO
_check_upgrade_schema()wrappers to detect the 0.7 < x <= 0.11 data structure.-> NO. Get rid of them everywhere.
Should chain_qc be called implicitly here?No good reason to change that. Also it adds toobsand that should not happen implicitly.chain_qcfunction.adata.obsm["airr"]. These special cases must be caught beforehand (it loading/saving doesn't interfere, it should definitely be possible to rely on the data being cleaned during IO)merge_adatafunctions? (-> We got rid ofmerge_with_ir, and replacemerge_airr_chainswithmerge_airr. There is probably some functionality to expand (e.g. add airr chains on IR object with different dimensions), but we'll see how that works out in practice (see 'documentation' section of this checklist).Spatial & bulk ready
adata.unsFor spatial data (visium) we may have spots instead of cells. That means our usual receptor model doesn't fit.
While I am not going to implement all required changes for that in this PR, it would be good if the data structure
could already be used without backwards-incompatible changes for that.
.obsm["chain_indices"]to an awkward array with[ {"VJ": [0], "VDJ": [1], "multichain": False}, # single pair {"VJ": [0, 2], "VDJ": [1,3], "multichain": False}, # dual IR {"VJ": [1,2,3,6,7,8,12,14], "VDJ": None, "multichain": True}, # other indexing strategy for bulk/visium ]obsm['chain_indices']is NaN) versus cells that have a receptor, but no CDR3 sequences. Currently (also in the old implementation) they are treated differently (the former receives 'nan' as a clonotype, the latter a separate clonotypeairr_key/chain_idx_keyin all functions?index_chainsby default during IO, but instead perform it on-the-fly when missing, as done elsewhere..obsm[airr_key]is missing instead of complaining that the schema is outdated, as this is only one possibility why the key is missing. Or change the check to havingIR_VJ...columns in adata.obs. But those could also have been added manually 🤷airrorchain_indicesis missing from obsmget_airr,get.airr,"chain_indices",_has_ir.adataas attributegex:xxx,airr:xxx.scirpy.datasetsinplaceoperations write toGet module
[ ] Do we want amost_frequentfunction or others?Documentation
merge_airr_chains-> this function now returns an AnnData object and doesn't modify inplace anymore. Also it removes all non-airr information.
Final checks:
IR_/IR_VJ/IR_VDJjust in case something is not covered by testshas_ir,multichainFollow-up