I used hashsolo to demultiplex my data and I am a bit confused as to how to continue the analysis. Following hashsolo my samples look like below:

AnnData object with n_obs × n_vars = 8684 × 18197
    obs: 'most_likely_hypothesis', 'Classification', 'n_genes'
    var: 'gene_ids', 'feature_types', 'genome', 'n_counts', 'n_cells'
    layers: 'counts'

AnnData object with n_obs × n_vars = 9901 × 20862
    obs: 'most_likely_hypothesis', 'Classification'
    var: 'gene_ids', 'feature_types', 'genome', 'n_counts'
    layers: 'counts'

I have a few questions regarding the analysis. My initial plan was to merge the 2 samples. However, when I do that and I print the Classification the merged object seems to add the classification counts because the same hashtag names were used.

For example hashtag 1 has 949 in sample A1 and 1286 in sample A2. When I do print(adata.obs['Classification'].value_counts()) hashtag1 has 2235 counts. Will that be a problem with the analysis? I merged the object like this:

# add some metadata

# merge into one object.
adata = A1.concatenate(A2)

AnnData object with n_obs × n_vars = 18585 × 18064
    obs: 'most_likely_hypothesis', 'Classification', 'n_genes', 'type', 'batch'
    var: 'gene_ids', 'feature_types', 'genome', 'n_counts-0', 'n_cells-0', 'n_counts-1'
    layers: 'counts'

Hashtag_2_Antibody    5134
Hashtag_3_Antibody    3150
Hashtag_4_Antibody    2000
Hashtag_1_Antibody    2235
Doublet                                         1598
Negative                                           9
Name: Classification, dtype: int64

My hashtags also show up wen I do sc.pl.highest_expr_genes(adata, n_top=20, ). Is that a problem?

enter image description here I would also like to plot a UMAP following leiden for each hashtagged sample but I am a bit confused on how to do that. Normally, I would add information such as sample or type on metadata and color by sample for example. But if I try to color by classification it will merge the hashtags from both samples.

Thank you


1 Answer 1


You could add something like A1.obs["Classification_obj"] = [c+"_A1" for c in adata.obs["Classification"]] but the classification should also be clear in the merged adata object from the "Classification" and "batch" labels together

More importantly, after running hashsolo, you must delete your hashtag feature_types from adata.var, something like A1 = A1[:, [g for g in A1.var.index if g not in list_of_Ab_hashtags]] . Once you have the cell type classifications and are happy with them (can be worth doing further QC first), you can throw away that Ab count data for the downstream standard GEX analysis

  • $\begingroup$ Thank you so much! That really helped. Should I also delete the cells that were classified as doublets and negative? $\endgroup$ Apr 26, 2023 at 17:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.