Hello ....It's me again.
I tried to run the Differential abundance testing with GLM by applying the mouse gastrulation notebook on my data but I keep having the above error...it's the same error when I tried to use the Milopy function from the Pertpy package (posted the same issue there).
Please check my code and error in the image below:

the error itself:
/home/ahmed/yes/envs/milopy/lib/python3.8/site-packages/rpy2/robjects/numpy2ri.py:252: DeprecationWarning: The global conversion available with activate() is deprecated and will be removed in the next major release. Use a local converter.
warnings.warn('The global conversion available with activate() '
/home/ahmed/yes/envs/milopy/lib/python3.8/site-packages/rpy2/robjects/pandas2ri.py:368: DeprecationWarning: The global conversion available with activate() is deprecated and will be removed in the next major release. Use a local converter.
warnings.warn('The global conversion available with activate() '
RRuntimeError Traceback (most recent call last)
Cell In[51], line 1
----> 1 milo.DA_nhoods(adata_Epi, design="~condition_continuous")
File ~/yes/envs/milopy/lib/python3.8/site-packages/milopy/core.py:255, in DA_nhoods(adata, design, model_contrasts, subset_samples, add_intercept)
252 # Fit NB-GLM
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)
File ~/yes/envs/milopy/lib/python3.8/site-packages/rpy2/robjects/functions.py:208, in SignatureTranslatedFunction.call(self, *args, **kwargs)
206 v = kwargs.pop(k)
207 kwargs[r_k] = v
--> 208 return (super(SignatureTranslatedFunction, self)
209 .call(*args, **kwargs))
File ~/yes/envs/milopy/lib/python3.8/site-packages/rpy2/robjects/functions.py:131, in Function.call(self, *args, **kwargs)
129 else:
130 new_kwargs[k] = cv.py2rpy(v)
--> 131 res = super(Function, self).call(*new_args, **new_kwargs)
132 res = cv.rpy2py(res)
133 return res
File ~/yes/envs/milopy/lib/python3.8/site-packages/rpy2/rinterface_lib/conversion.py:45, in cdata_res_to_rinterface..(*args, **kwargs)
44 def _(*args, **kwargs):
---> 45 cdata = function(*args, **kwargs)
46 # TODO: test cdata is of the expected CType
47 return _cdata_to_rinterface(cdata)
File ~/yes/envs/milopy/lib/python3.8/site-packages/rpy2/rinterface.py:890, in SexpClosure.call(self, *args, **kwargs)
883 res = rmemory.protect(
884 openrlib.rlib.R_tryEval(
885 call_r,
886 call_context.sexp._cdata,
887 error_occured)
888 )
889 if error_occured[0]:
--> 890 raise embedded.RRuntimeError(_rinterface._geterrmessage())
891 return res
RRuntimeError: Error in colSums(x) : 'x' must be numeric
Hello ....It's me again.
I tried to run the Differential abundance testing with GLM by applying the mouse gastrulation notebook on my data but I keep having the above error...it's the same error when I tried to use the Milopy function from the Pertpy package (posted the same issue there).
Please check my code and error in the image below:
the error itself:
/home/ahmed/yes/envs/milopy/lib/python3.8/site-packages/rpy2/robjects/numpy2ri.py:252: DeprecationWarning: The global conversion available with activate() is deprecated and will be removed in the next major release. Use a local converter.
warnings.warn('The global conversion available with activate() '
/home/ahmed/yes/envs/milopy/lib/python3.8/site-packages/rpy2/robjects/pandas2ri.py:368: DeprecationWarning: The global conversion available with activate() is deprecated and will be removed in the next major release. Use a local converter.
warnings.warn('The global conversion available with activate() '
RRuntimeError Traceback (most recent call last)
Cell In[51], line 1
----> 1 milo.DA_nhoods(adata_Epi, design="~condition_continuous")
File ~/yes/envs/milopy/lib/python3.8/site-packages/milopy/core.py:255, in DA_nhoods(adata, design, model_contrasts, subset_samples, add_intercept)
252 # Fit NB-GLM
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)
File ~/yes/envs/milopy/lib/python3.8/site-packages/rpy2/robjects/functions.py:208, in SignatureTranslatedFunction.call(self, *args, **kwargs)
206 v = kwargs.pop(k)
207 kwargs[r_k] = v
--> 208 return (super(SignatureTranslatedFunction, self)
209 .call(*args, **kwargs))
File ~/yes/envs/milopy/lib/python3.8/site-packages/rpy2/robjects/functions.py:131, in Function.call(self, *args, **kwargs)
129 else:
130 new_kwargs[k] = cv.py2rpy(v)
--> 131 res = super(Function, self).call(*new_args, **new_kwargs)
132 res = cv.rpy2py(res)
133 return res
File ~/yes/envs/milopy/lib/python3.8/site-packages/rpy2/rinterface_lib/conversion.py:45, in cdata_res_to_rinterface..(*args, **kwargs)
44 def _(*args, **kwargs):
---> 45 cdata = function(*args, **kwargs)
46 # TODO: test cdata is of the expected CType
47 return _cdata_to_rinterface(cdata)
File ~/yes/envs/milopy/lib/python3.8/site-packages/rpy2/rinterface.py:890, in SexpClosure.call(self, *args, **kwargs)
883 res = rmemory.protect(
884 openrlib.rlib.R_tryEval(
885 call_r,
886 call_context.sexp._cdata,
887 error_occured)
888 )
889 if error_occured[0]:
--> 890 raise embedded.RRuntimeError(_rinterface._geterrmessage())
891 return res
RRuntimeError: Error in colSums(x) : 'x' must be numeric