Skip to content

Handling of CellID in scv.utils.merge #524

Answered by WeilerP
ifanirene asked this question in Q&A
Discussion options

You must be logged in to vote

@ifanirene, I suppose your ldataX objects are the AnnData objects you get from the loom files?

scv.utils.merge only "cleans" the observation names if there are no overlap between adata.obs_names and ldata.obs_names:

common_obs = pd.unique(adata.obs_names.intersection(ldata.obs_names))

scvelo/scvelo/read_load.py

Lines 168 to 171 in 1659cc8

if len(common_obs) == 0:
clean_obs_names(adata)
clean_obs_names(ldata)
common_obs = adata.obs_names.intersection(ldata.obs_names)

scv.utils.clean_obs_names removes unwanted parts from the observation names and saves the removed part in adata.obs['sample_batch']

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ifanirene
Comment options

Answer selected by WeilerP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #523 on July 09, 2021 17:08.