GithubHelp home page GithubHelp logo

sankeyplot fails in V.1.5.3 about celltypist HOT 4 CLOSED

rgranit avatar rgranit commented on September 22, 2024
sankeyplot fails in V.1.5.3

from celltypist.

Comments (4)

ChuanXu1 avatar ChuanXu1 commented on September 22, 2024 1

This is due to the new behavior of naming .value_counts() output to count or proportion. I will fix this soon. Before this, you can downgrade pandas to < 2.0.0 as a temporary solution.

https://pandas.pydata.org/docs/whatsnew/v2.0.0.html#value-counts-sets-the-resulting-name-to-count

from celltypist.

ChuanXu1 avatar ChuanXu1 commented on September 22, 2024 1

Due to some considerations, we have isolated the harmonization and integration modules into a separate tool CellHint, and now CellTypist will be retained as a cell-type-classification-focused tool. If you still have any questions, please refer to CellHint repo, open an issue or let us know.

from celltypist.

ChuanXu1 avatar ChuanXu1 commented on September 22, 2024

@rgranit, do you mind showing all tracebacks?

from celltypist.

rgranit avatar rgranit commented on September 22, 2024

@ChuanXu1 sure, here it is:

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
Cell In[26], line 1
----> 1 celltypist.sankeyplot(alignment)

File [~/miniconda3/envs/celltypist_1.5/lib/python3.8/site-packages/celltypist/contro/plot.py:357](https://vscode-remote+ssh-002dremote-002bsuerat-005froy-005fpass.vscode-resource.vscode-cdn.net/homefolder/royg/misc/~/miniconda3/envs/celltypist_1.5/lib/python3.8/site-packages/celltypist/contro/plot.py:357), in sankeyplot(alignment, node_color, novel_node_color, remain_node_color, link_color, title, show, save, width, height, layout_dict, trace_dict, expand_label)
    354 else:
    355     raise TypeError(
    356             f"🛑 Please provide correct input - either a DistanceAlignment or a data frame")
--> 357 trace = _relation_to_data(relation, return_sankey = True)[1]
    358 #relation2new_relation is run twice actually, but time cost is negligible; this new relation is row ordered
    359 new_relation = _identify_relation_groups(relation, group_prefix = 'Group', order_row = True, order_column = False)[1]

File [~/miniconda3/envs/celltypist_1.5/lib/python3.8/site-packages/celltypist/contro/plot.py:170](https://vscode-remote+ssh-002dremote-002bsuerat-005froy-005fpass.vscode-resource.vscode-cdn.net/homefolder/royg/misc/~/miniconda3/envs/celltypist_1.5/lib/python3.8/site-packages/celltypist/contro/plot.py:170), in _relation_to_data(relation, return_sankey)
    168     vc[['source', 'target']] = vc['index'].str.split(SEP2, expand=True).values
    169     vc.rename(columns = {0: 'value'}, inplace = True)
--> 170     link = pd.concat([link, vc[['source', 'target', 'value']]])
    171 source = refer.loc[link.source.values, 'index'].values
    172 target = refer.loc[link.target.values, 'index'].values

File [~/miniconda3/envs/celltypist_1.5/lib/python3.8/site-packages/pandas/core/frame.py:3767](https://vscode-remote+ssh-002dremote-002bsuerat-005froy-005fpass.vscode-resource.vscode-cdn.net/homefolder/royg/misc/~/miniconda3/envs/celltypist_1.5/lib/python3.8/site-packages/pandas/core/frame.py:3767), in DataFrame.__getitem__(self, key)
   3765     if is_iterator(key):
   3766         key = list(key)
-> 3767     indexer = self.columns._get_indexer_strict(key, "columns")[1]
   3769 # take() does not accept boolean indexers
...
   5938     raise KeyError(f"None of [{key}] are in the [{axis_name}]")
   5940 not_found = list(ensure_index(key)[missing_mask.nonzero()[0]].unique())
-> 5941 raise KeyError(f"{not_found} not in index")

KeyError: "['value'] not in index"
Output is truncated. View as a [scrollable element](command:cellOutput.enableScrolling?2bc49026-6fac-44f7-bf3a-a334c431fd91) or open in a [text editor](command:workbench.action.openLargeOutput?2bc49026-6fac-44f7-bf3a-a334c431fd91). Adjust cell output [settings](command:workbench.action.openSettings?%5B%22%40tag%3AnotebookOutputLayout%22%5D)...

from celltypist.

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.