Git Product home page Git Product logo

Comments (2)

AnnaChristina avatar AnnaChristina commented on May 24, 2024

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.

ankitbioinfo avatar ankitbioinfo commented on May 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.