-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
key error #255
Comments
can you print first 5 row of your ranking ? make sure the first column is gene_symbol, the second column is ranking values |
This is how I calculate the rank: and ranking.head(5) yields: |
can you print out the full error message ? I don't know where the errors come from |
here is the entire error message:KeyError Traceback (most recent call last) File ~/miniconda3/lib/python3.9/site-packages/gseapy/init.py:396, in prerank(rnk, gene_sets, outdir, pheno_pos, pheno_neg, min_size, max_size, permutation_num, weight, ascending, threads, figsize, format, graph_num, no_plot, seed, verbose, *arg, **kwargs) File ~/miniconda3/lib/python3.9/site-packages/gseapy/gsea.py:444, in Prerank.run(self) File ~/miniconda3/lib/python3.9/site-packages/gseapy/gsea.py:418, in Prerank.load_ranking(self) File ~/miniconda3/lib/python3.9/site-packages/gseapy/gsea.py:385, in Prerank._load_ranking(self, rank_metric) File ~/miniconda3/lib/python3.9/site-packages/gseapy/base.py:246, in GSEAbase.make_unique(self, rank_metric, col_idx) File ~/miniconda3/lib/python3.9/site-packages/pandas/core/series.py:2238, in Series.groupby(self, by, axis, level, as_index, sort, group_keys, observed, dropna) File ~/miniconda3/lib/python3.9/site-packages/pandas/core/groupby/groupby.py:1329, in GroupBy.init(self, obj, keys, axis, level, grouper, exclusions, selection, as_index, sort, group_keys, observed, dropna) File ~/miniconda3/lib/python3.9/site-packages/pandas/core/groupby/grouper.py:1043, in get_grouper(obj, key, axis, level, sort, observed, validate, dropna) KeyError: 'gene_name' |
I think the issue is same to #251, can you install v1.1.2 and try again ? the error should be gone in the fixed version( v1.1.2) |
Setup
I am reporting a problem with GSEApy version, Python version, and operating
system as follows:
(Please copy and run the above in your Python, and copy-and-paste the output)
Expected behaviour
prerank
Actual behaviour
key error: "gene_name"
Steps to reproduce
pre_res = gp.prerank(rnk = ranking, gene_sets = 'GO_Biological_Process_2021', seed = 6, permutation_num = 100, min_size = 5 )
ranking is df with 2 columns.
The text was updated successfully, but these errors were encountered: