Skip to content
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

Assistance Needed: Error with imt_gsea - Unexpected Keyword Argument 'perm_index #28

Open
xiaobeiLiu opened this issue Jul 1, 2024 · 3 comments

Comments

@xiaobeiLiu
Copy link

xiaobeiLiu commented Jul 1, 2024

Hello, when running 'imt_gsea', I encountered an error: 'TypeError: gsea() got an unexpected keyword argument 'perm_index'.' I've tried various methods but still can't resolve it. Can you help me? The code is as follows:

(transcriptomics) C:\Users\96516>imt_gsea --input D:\project\output\Imt_5-HT2A_mean_bmax_pls\pls_analysis.pkl --geneset lake Traceback (most recent call last): File "_ctypes/callbacks.c", line 232, in 'calling callback function' File "D:\Aanaconda\envs\transcriptomics\lib\site-packages\llvmlite\binding\executionengine.py", line 171, in _raw_object_cache_notify def _raw_object_cache_notify(self, data): KeyboardInterrupt Traceback (most recent call last): File "D:\Aanaconda\envs\transcriptomics\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "D:\Aanaconda\envs\transcriptomics\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "D:\Aanaconda\envs\transcriptomics\Scripts\imt_gsea.exe\__main__.py", line 7, in <module> File "D:\Aanaconda\envs\transcriptomics\lib\site-packages\imaging_transcriptomics\script\imt_gsea.py", line 63, in main gene_limit=parsed.max_genes) File "D:\Aanaconda\envs\transcriptomics\lib\site-packages\imaging_transcriptomics\transcriptomics.py", line 300, in gsea gene_limit=gene_limit) TypeError: gsea() got an unexpected keyword argument 'perm_index'

@alegiac95
Copy link
Owner

Hi,
did you run the correlation analysis with one version of the toolbox and then upgraded before running the imt_gsea? it seems to me that the issues you're encountering are due to this, probably.

You can try and re-run the entire pipeline with the same toolbox version and the errors should disappear

@WangYunHong98
Copy link

WangYunHong98 commented Nov 9, 2024

Hi @alegiac95

I got the same issue.

I used your package (version 1.1.15) on Jupyter Notebook to test. And the script below:

import numpy as np
import imaging_transcriptomics as imt
my_data = np.random.random(50).flatten() 

analysis = imt.ImagingTranscriptomics(my_data, method="pls", 
                                      n_components=1, 
                                      atlas='Schaefer_100', 
                                      n_permutations=1000,
                                      regions="all")
analysis.run(gsea=True)

I got PLS results:
dc6e713f35ecf1fe77ab09704ac0154

but when running gsea, an issue comes up:

{
	"name": "TypeError",
	"message": "gsea() got an unexpected keyword argument 'perm_index'",
	"stack": "---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
~\\AppData\\Local\\Temp\\ipykernel_64052\\2119373549.py in <module>
      9                                       n_permutations=1000,
     10                                       regions=\"all\")
---> 11 analysis.run(gsea=True)

c:\\ProgramData\\anaconda3\\envs\\transcriptomics\\lib\\site-packages\\imaging_transcriptomics\\transcriptomics.py in run(self, outdir, scan_name, gsea, gene_set, save_res, n_cpu, gene_limit)
    405                 self.gsea(gene_set=gene_set,
    406                           outdir=outdir,
--> 407                           gene_limit=gene_limit)

c:\\ProgramData\\anaconda3\\envs\\transcriptomics\\lib\\site-packages\\imaging_transcriptomics\\transcriptomics.py in gsea(self, outdir, gene_set, gene_limit)
    298                                            perm_index=self._permutation_ind,
    299                                            outdir=outdir,
--> 300                                            gene_limit=gene_limit)
    301 
    302     def run(self, outdir=None, scan_name=\"\", gsea=False,

TypeError: gsea() got an unexpected keyword argument 'perm_index'"
}

Could you help me how to resolve this issue? I appreciate your reply.

@tillandlauer
Copy link

Hello, I have a similar issue, no matter whether I run
imagingtranscriptomics --input my_file.nii --regions all --geneset Reactome_Pathways_2024 pls --ncomp 1
or
imt_gsea --input my_file.pkl --geneset Reactome_Pathways_2024

Traceback (most recent call last):
  File ".pyenv/versions/imaging-transcriptomics-env/bin/imagingtranscriptomics", line 8, in <module>
    sys.exit(main())
  File ".pyenv/versions/3.7.10/envs/imaging-transcriptomics-env/lib/python3.7/site-packages/imaging_transcriptomics/script/imagingtranscriptomics.py", line 107, in main
    gene_limit=parsed.max_genes)
  File ".pyenv/versions/3.7.10/envs/imaging-transcriptomics-env/lib/python3.7/site-packages/imaging_transcriptomics/transcriptomics.py", line 351, in run
    self.gsea(gene_set=gene_set, outdir=outdir)
  File ".pyenv/versions/3.7.10/envs/imaging-transcriptomics-env/lib/python3.7/site-packages/imaging_transcriptomics/transcriptomics.py", line 300, in gsea
    gene_limit=gene_limit)
TypeError: gsea() got an unexpected keyword argument 'perm_index'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants