Closed Hrovatin closed 3 years ago
I tried to run scran, but I get the below error. It goes away if I increase min.mean. Below is the image of my clusters (they are quite small).
--------------------------------------------------------------------------- RRuntimeError Traceback (most recent call last) <ipython-input-186-9952eef1e205> in <module> 24 ro.globalenv['data_mat'] = adata_sub.X.T 25 ro.globalenv['input_groups'] = adata_sub_pp.obs['groups'] ---> 26 size_factors = ro.r(f'calculateSumFactors(data_mat, clusters = input_groups, min.mean = 0.6, BPPARAM=MulticoreParam(workers = 16),positive=TRUE)') 27 adata.obs.loc[adata_sub.obs.index,'size_factors_sample'] = size_factors 28 ~/miniconda3/envs/rpy2_3/lib/python3.8/site-packages/rpy2/robjects/__init__.py in __call__(self, string) 414 def __call__(self, string): 415 p = rinterface.parse(string) --> 416 res = self.eval(p) 417 return conversion.rpy2py(res) 418 ~/miniconda3/envs/rpy2_3/lib/python3.8/site-packages/rpy2/robjects/functions.py in __call__(self, *args, **kwargs) 195 v = kwargs.pop(k) 196 kwargs[r_k] = v --> 197 return (super(SignatureTranslatedFunction, self) 198 .__call__(*args, **kwargs)) 199 ~/miniconda3/envs/rpy2_3/lib/python3.8/site-packages/rpy2/robjects/functions.py in __call__(self, *args, **kwargs) 123 else: 124 new_kwargs[k] = conversion.py2rpy(v) --> 125 res = super(Function, self).__call__(*new_args, **new_kwargs) 126 res = conversion.rpy2py(res) 127 return res ~/miniconda3/envs/rpy2_3/lib/python3.8/site-packages/rpy2/rinterface_lib/conversion.py in _(*args, **kwargs) 42 def _cdata_res_to_rinterface(function): 43 def _(*args, **kwargs): ---> 44 cdata = function(*args, **kwargs) 45 # TODO: test cdata is of the expected CType 46 return _cdata_to_rinterface(cdata) ~/miniconda3/envs/rpy2_3/lib/python3.8/site-packages/rpy2/rinterface.py in __call__(self, *args, **kwargs) 622 error_occured)) 623 if error_occured[0]: --> 624 raise embedded.RRuntimeError(_rinterface._geterrmessage()) 625 return res 626 RRuntimeError: Error in .rescale_clusters(clust.profile, ref.col = ref.clust, min.mean = min.mean) : inter-cluster rescaling factors are not strictly positive
Have a look at the discussion in LTLA/scuttle#7 for an explanation.
Thanks. After removing clusters with avg(n_genes) < threshold (in my case 1000 separated the populations) the error was resolved.
I tried to run scran, but I get the below error. It goes away if I increase min.mean. Below is the image of my clusters (they are quite small).