Comments (2)
Hi @ankitbioinfo,
yes you can run the analysis on your own data by just switching the tutorial code to
ncem.data = customLoader(
adata=ad, cluster='clusters', patient=None, library_id=None, radius=52
)
and by selecting a radius that is suited for the interactions you want to analyze in your data. The ideal radius can also be obtained by running an ablation study over multiple resolutions and finding the best performing radius for your dataset.
I hope this answers your question.
from ncem.
Hi @AnnaChristina,
Thank you for the answer. I ran with following command as you suggested.
adata_file='spatial_all_CSR.h5ad'
ad = an.read_h5ad(adata_file)
print(ad)
ncem = InterpreterInteraction()
print('step 1 done')
adata_vis = ad
print('step 2 done')
ncem.data = customLoader(adata=adata_vis, cluster='clusters', patient='None', library_id='None', radius=25)
print('step 3 done')
And got the following output.
AnnData object with n_obs × n_vars = 393286 × 346
obs: 'umi_sct', 'log_umi_sct', 'gene_sct', 'log_gene_sct', 'umi_per_gene_sct', 'log_umi_per_gene_sct', 'clusters'
var: 'Intercept_sct', 'log_umi_sct', 'theta_sct', 'Intercept_step1_sct', 'log_umi_step1_sct', 'dispersion_step1_sct', 'genes_step1_sct', 'log10_gmean_sct'
uns: 'spatial'
obsm: 'spatial'
step 1 done
step 2 done
Loading data from raw files
registering celldata
Traceback (most recent call last):
File "/Users/agrawal/miniconda3/envs/ncem_new/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 3361, in get_loc
return self._engine.get_loc(casted_key)
File "pandas/_libs/index.pyx", line 76, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 108, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 5198, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 5206, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'None'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "ncem_run.py", line 35, in <module>
ncem.data = customLoader(adata=adata_vis, cluster='clusters', patient='None', library_id='None', radius=25)
File "/Users/agrawal/miniconda3/envs/ncem_new/lib/python3.7/site-packages/ncem/data.py", line 1831, in __init__
self.register_celldata(n_top_genes=n_top_genes)
File "/Users/agrawal/miniconda3/envs/ncem_new/lib/python3.7/site-packages/ncem/data.py", line 1750, in register_celldata
self._register_celldata(n_top_genes=n_top_genes)
File "/Users/agrawal/miniconda3/envs/ncem_new/lib/python3.7/site-packages/ncem/data.py", line 1875, in _register_celldata
for p in np.unique(celldata.obs[self.patient]):
File "/Users/agrawal/miniconda3/envs/ncem_new/lib/python3.7/site-packages/pandas/core/frame.py", line 3458, in __getitem__
indexer = self.columns.get_loc(key)
File "/Users/agrawal/miniconda3/envs/ncem_new/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 3363, in get_loc
raise KeyError(key) from err
KeyError: 'None'
I am still not sure what causing the above error.
Thank you.
from ncem.
Related Issues (20)
- Error saving the output figures in png or pdf format HOT 1
- Problems using GPU HOT 2
- Error while loading custom data in NCEM HOT 2
- Where can I find the cell_metadata.csv file for MERFISH brain data in merfish_brain.ipynb? HOT 1
- ncem - python 3.9 HOT 1
- Use Tangram mapped visium for ncem HOT 10
- compatibility with 10x visium HOT 4
- Issue installing ncem on macOS
- How to run NCEM for CODEX csv/or FCS output data? HOT 2
- Supporting jinja2>=3.0.3 HOT 1
- Input to the "interaction linear model" HOT 2
- QuestionInternalError: Graph execution error: HOT 1
- Naive Question
- LinAlgError: SVD did not converge HOT 2
- Work with 10X Visium Estimator
- cannot get the grid search results HOT 1
- Question HOT 1
- Differential interaction HOT 2
- getting only zeros at enrichment step HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ncem.