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
I am runing NCEM code from the scratch for coupling and cell enrichment analysis. Meanwhile, I wanted to save all the imaging output in png (or pdf) format. But except for the sc.pl.umap output , I am getting empty png file for the remaining analysis. I tried different ways to save the "image output" but still its not working.
import ncem as nc
import numpy as np
import matplotlib.pyplot as plt
import scanpy as sc
import squidpy as sq
sc.settings.set_figure_params(dpi=100)
import warnings
warnings.filterwarnings("ignore")
from ncem.interpretation import InterpreterInteraction
from ncem.data import get_data_custom, customLoader
results_folder = 'test'
run_name = f'{results_folder}/anndata/'
import scanpy as sc
empty figures
Hi
I am runing NCEM code from the scratch for coupling and cell enrichment analysis. Meanwhile, I wanted to save all the imaging output in png (or pdf) format. But except for the sc.pl.umap output , I am getting empty png file for the remaining analysis. I tried different ways to save the "image output" but still its not working.
import ncem as nc
import numpy as np
import matplotlib.pyplot as plt
import scanpy as sc
import squidpy as sq
sc.settings.set_figure_params(dpi=100)
import warnings
warnings.filterwarnings("ignore")
from ncem.interpretation import InterpreterInteraction
from ncem.data import get_data_custom, customLoader
results_folder = 'test'
run_name = f'{results_folder}/anndata/'
import scanpy as sc
import anndata as an
adata_file = f"{run_name}/sp.h5ad" # sp_cluster
ad = an.read_h5ad(adata_file)
ncem = InterpreterInteraction()
adata_vis = ad
ncem.data = customLoader(
adata=adata_vis, cluster='region_cluster', patient='sampleid', library_id='sample', radius=150
)
get_data_custom(interpreter=ncem)
var_decomp = ncem.data.compute_variance_decomposition()
ncem.data.variance_decomposition(var_decomp, figsize=(5,3))
plt.savefig('test.png')
ncem.data = customLoader(
adata=adata_vis, cluster='region_cluster', patient='sample', library_id='sample', radius=52
)
get_data_custom(interpreter=ncem)
adata_img, adata_vis, log_pval, fold_change = ncem.data.compute_cluster_enrichment(
image_key=['S1_A1_Complete'],
target_cell_type='2',
clip_pvalues=-5,
n_neighbors=50,
n_pcs=None,
)
sc.pl.umap(adata_vis, color='2 substates', palette='tab10')
plt.savefig("subclust_test.png")
plt.show()
I would appreciate your help
Thanks
The text was updated successfully, but these errors were encountered: