Skip to content

Maximum recursion depth exceeded while calling a Python object when trying to run Milopy #51

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

Open
ahmed-agami opened this issue Nov 28, 2024 · 0 comments

Comments

@ahmed-agami
Copy link

Hello...everyone I keep receiving this error whenever I try to run the following code:

DA_nhoods(adata_Epi, design="~condition_continuous")


RecursionError Traceback (most recent call last)
/tmp/ipykernel_654903/4015237463.py in
----> 1 DA_nhoods(adata_Epi, design="~condition_continuous")

~/yes/envs/sc_analysis/lib/python3.8/site-packages/milopy/core.py in DA_nhoods(adata, design, model_contrasts, subset_samples, add_intercept)
253 dge = edgeR.DGEList(
254 counts=count_mat[keep_nhoods, :][:, keep_smp], lib_size=lib_size[keep_smp])
--> 255 dge = edgeR.calcNormFactors(dge, method="TMM")
256 dge = edgeR.estimateDisp(dge, model)
257 fit = edgeR.glmQLFit(dge, model, robust=True)

~/yes/envs/sc_analysis/lib/python3.8/site-packages/rpy2/robjects/functions.py in call(self, *args, **kwargs)
206 v = kwargs.pop(k)
207 kwargs[r_k] = v
--> 208 return (super(SignatureTranslatedFunction, self)
209 .call(*args, **kwargs))
210

~/yes/envs/sc_analysis/lib/python3.8/site-packages/rpy2/robjects/functions.py in call(self, *args, **kwargs)
121 def call(self, *args, **kwargs):
122 cv = conversion.get_conversion()
--> 123 new_args = [cv.py2rpy(a) for a in args]
124 new_kwargs = {}
125 for k, v in kwargs.items():

~/yes/envs/sc_analysis/lib/python3.8/site-packages/rpy2/robjects/functions.py in (.0)
121 def call(self, *args, **kwargs):
122 cv = conversion.get_conversion()
--> 123 new_args = [cv.py2rpy(a) for a in args]
124 new_kwargs = {}
125 for k, v in kwargs.items():

~/yes/envs/sc_analysis/lib/python3.8/functools.py in wrapper(*args, **kw)
873 '1 positional argument')
874
--> 875 return dispatch(args[0].class)(*args, **kw)
876
877 funcname = getattr(func, 'name', 'singledispatch function')

~/yes/envs/sc_analysis/lib/python3.8/site-packages/rpy2/robjects/numpy2ri.py in nonnumpy2rpy(obj)
141 else:
142 # The conversion module was "activated"
--> 143 return original_converter.py2rpy(obj)
144
145

... last 2 frames repeated, from the frame below ...

~/yes/envs/sc_analysis/lib/python3.8/functools.py in wrapper(*args, **kw)
873 '1 positional argument')
874
--> 875 return dispatch(args[0].class)(*args, **kw)
876
877 funcname = getattr(func, 'name', 'singledispatch function')

RecursionError: maximum recursion depth exceeded while calling a Python object

Do you have any suggestions? Has anyone else experienced the same error here? I tried to set the recursion limit even higher by using sys.setrecursionlimit() but also it didn't work and the notebook crashed

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

1 participant