-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible bug in clean_obs_names function #1029
Comments
Dear scvelo team, thank you for your great work! The obs_names of my scanpy merged anndata object don't have the same length. e.g. xx1_AAACCCATCGCCGTGA-1 and xxxxxxxx3_TTTGTTGAGTAGTCTC-1. after running scv.utils.clean_obs_names(adata, id_length=16), the former barcode was corrected cleaned to AAACCCATCGCCGTGA whereas the latter one turned into xxxx3_TTTGTTGAGT. At the same time, obs_names of my concatenated velocyto loom files don't have the same length. (I readin loom files by scv.read loom and then concatenate the anndatas after .var_names_make_unique). Before concatenate the obs_names was like: sample_alignments_xxxxx:AAGATAGGTCGCTTGGx, after concatenation, the obs_names turned into: AAGATAGGTCGC. Could you let me know if you have any suggestions for these? |
Thank you for the solution, had the issue that after running scv.utils.clean_obs_names(adata, id_length=16) in some of my samples the barcode was splitted, your "correction" solved the issue! |
Dear scvelo team, thank you for your great work!
I ran into a problem where the
clean_obs_names()
function fromscvelo/core/_anndata.py
did not clean up all obs_names correctly (see below for an example).I believe the for loop of that function might not actually work on the looped
obs_name
items but only on the first itemadata.obs_names[0]
, possibly by mistake:I was able to fix this by replacing lines 63-66 with the following code:
Can you confirm the issue or am I misinterpreting the usage?
Example: I had a merged anndata object where the obs_names did not have the same length, e.g.
221229_Test_Run_230123_1_Spl:AAAGCAAAGGCATTGGx
and221229_Test_Run_230123_5_Blood:TTTGTCATCTGGCGTGx
. After runningscv.utils.clean_obs_names(adata, id_length=16)
, the former barcode was correctly cleaned toAAAGCAAAGGCATTGG
whereas the latter one turned intod:TTTGTCATCTGGCG
.The text was updated successfully, but these errors were encountered: