You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for developing this extraordinarily useful software. In some Visium HD data I'm working with, I've also observed the technical effect where certain array rows or columns have smaller/larger total raw counts than others. However, I've found that b2c.destripe() actually exaggerates the problem. The data is private, so while I can't provide a reproducible example, I'll provide the chunk of relevant code, then show screenshots of the resulting plots, where the only difference between the two is whether b2c.destripe(adata_filtered) was run. I read in the raw data from Spaceranger, apply the recommended filtering steps seen in the tutorial, apply b2c.destripe in one case, then add up total UMI counts for each bin. For display, I cap totals at 5 UMI, which helps the color range in the plots.
adata_filtered = b2c.read_visium(
sr_dir,
count_file = 'filtered_feature_bc_matrix.h5',
source_image_path = raw_image_path,
spaceranger_image_path = sr_spatial_dir
)
b2c.scaled_he_image(
adata_filtered,
mpp = mpp,
save_path = 'temp.tiff'
)
# Apply recommended filtering steps following tutorial
sc.pp.filter_cells(adata_filtered, min_counts=1)
sc.pp.filter_genes(adata_filtered, min_cells=3)
# In one of the two cases, this is run
b2c.destripe(adata_filtered)
# Add up counts for all genes in each bin. Set a hard maximum threshold to
# eliminate outliers that throw off the color scale in plots
adata_filtered.obs['sum_umi'] = adata_filtered.X.sum(axis = 1)
adata_filtered.obs['capped_umi'] = np.clip(adata_filtered.obs['sum_umi'], 0, 5)
# Take a small subset in the top-right corner of the data
scale_factor = 0.3
mask = (
(adata_filtered.obs['array_row'] >= (1 - scale_factor) * adata_filtered.obs['array_row'].max()) &
(adata_filtered.obs['array_col'] >= (1 - scale_factor) * adata_filtered.obs['array_col'].max())
)
adata_small = adata_filtered[mask, :]
sc.pl.spatial(
adata_small, color="capped_umi", img_key=f"{mpp}_mpp_150_buffer",
basis="spatial_cropped_150_buffer"
)
This particular sample is quite low in total UMI in general (with a median around 2 counts per 2um bin after destriping). Is the high sparsity maybe throwing off the destripe algorithm?
Without destripe:
With destripe:
Best,
-Nick
The text was updated successfully, but these errors were encountered:
Hello,
Thanks for developing this extraordinarily useful software. In some Visium HD data I'm working with, I've also observed the technical effect where certain array rows or columns have smaller/larger total raw counts than others. However, I've found that
b2c.destripe()
actually exaggerates the problem. The data is private, so while I can't provide a reproducible example, I'll provide the chunk of relevant code, then show screenshots of the resulting plots, where the only difference between the two is whetherb2c.destripe(adata_filtered)
was run. I read in the raw data from Spaceranger, apply the recommended filtering steps seen in the tutorial, applyb2c.destripe
in one case, then add up total UMI counts for each bin. For display, I cap totals at 5 UMI, which helps the color range in the plots.This particular sample is quite low in total UMI in general (with a median around 2 counts per 2um bin after destriping). Is the high sparsity maybe throwing off the
destripe
algorithm?Without
![Image](https://private-user-images.githubusercontent.com/45461721/410646875-e3bf3a80-f697-4168-9a84-5a77df907b74.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2NTMxNTAsIm5iZiI6MTczOTY1Mjg1MCwicGF0aCI6Ii80NTQ2MTcyMS80MTA2NDY4NzUtZTNiZjNhODAtZjY5Ny00MTY4LTlhODQtNWE3N2RmOTA3Yjc0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDIwNTQxMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNhZTQ2YjYwZDIwN2U3ODFkNmYzMTlmZmZkZDk0ZDMzMmU3Yzc5YTVjMWRkNDkwZWMwM2JmMDE2Y2E1ZThlMDUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.PdnUtQX64M1AWXpOdFWxezP90pcE66T5RMJvSenGXb4)
destripe
:With
![Image](https://private-user-images.githubusercontent.com/45461721/410646917-b49b20b3-99a4-4a17-8ced-ca43df48576c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2NTMxNTAsIm5iZiI6MTczOTY1Mjg1MCwicGF0aCI6Ii80NTQ2MTcyMS80MTA2NDY5MTctYjQ5YjIwYjMtOTlhNC00YTE3LThjZWQtY2E0M2RmNDg1NzZjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDIwNTQxMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTMzYzhmNjkxM2VjNjE2MGViNWZhZmZhYzdkZGI3ZjA4OWI2ODE4NTUwOTE2NWM4ODU2MThkOWY1ZDdjZGNmMWEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.gLZeAg-p-i84Qv022Gp_uzTVrPwRretV6Q4H2aEdhI8)
destripe
:Best,
-Nick
The text was updated successfully, but these errors were encountered: