-
Notifications
You must be signed in to change notification settings - Fork 4
Compatibility Issue with pandas in scFates 1.0.8 while i use tl.test_fork #35
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
Comments
Hi thanks for bringing up this issue. I have pushed changes that allow pandas version over 2.0 which should fix it. However I can't release it yet on pypi, the account is locked out at the moment. In the mean time I would suggest to install scfates from GitHub with the tag |
Dear Dr. Faure,
Thanks for your previous response, I updated the scfate and it worked. However I have another issue, i would appreciate you if you could help me.
I am running the following code:
scf.tl.linearity_deviation(adata,
start_milestone="106",
end_milestone="62",
percentiles=[20, 80],
n_jobs=1,n_map=1, plot=True,basis="X_umap")
I have confirmed that the milestones are included in the observations of
adata, and I filtered out doublet cells in my preprocessing step. However,
I am encountering this error:
ValueError: zero-size array to reduction operation maximum which has no
identity
I am using scFates version 1.0.9 and matplotlib version 3.8.4.
Thank you for your assistance!
Best regards,
Maryam
… Message ID: ***@***.***>
|
It is a bit hard to figure out the issue, could you show the full error message? How many cells do you have between milestone 106 and 62? You can check this by running |
Thanks for your prompt response. The number of the cells is in the following and then you can see the code and the full error.
Print the number of cells in the subset
ValueError Traceback (most recent call last) File ~/anaconda3/envs/secondenv/lib/python3.9/site-packages/scFates/tools/linearity_deviation.py:151, in linearity_deviation(adata, start_milestone, end_milestone, percentiles, n_jobs, n_map, plot, basis, copy) File ~/anaconda3/envs/secondenv/lib/python3.9/site-packages/scFates/tools/utils.py:47, in ProgressParallel.call(self, *args, **kwargs) File ~/anaconda3/envs/secondenv/lib/python3.9/site-packages/joblib/parallel.py:1918, in Parallel.call(self, iterable) File ~/anaconda3/envs/secondenv/lib/python3.9/site-packages/joblib/parallel.py:1847, in Parallel._get_sequential_output(self, iterable) File ~/anaconda3/envs/secondenv/lib/python3.9/site-packages/scFates/tools/linearity_deviation.py:135, in linearity_deviation..lindev_map(m) File ~/anaconda3/envs/secondenv/lib/python3.9/site-packages/scFates/tools/utils.py:47, in ProgressParallel.call(self, *args, **kwargs) File ~/anaconda3/envs/secondenv/lib/python3.9/site-packages/joblib/parallel.py:1918, in Parallel.call(self, iterable) File ~/anaconda3/envs/secondenv/lib/python3.9/site-packages/joblib/parallel.py:1847, in Parallel._get_sequential_output(self, iterable) File ~/anaconda3/envs/secondenv/lib/python3.9/site-packages/scFates/tools/linearity_deviation.py:129, in linearity_deviation..lindev_map..get_resid(x) File ~/anaconda3/envs/secondenv/lib/python3.9/site-packages/statsmodels/base/model.py:229, in Model.from_formula(cls, formula, data, subset, drop_cols, *args, **kwargs) File ~/anaconda3/envs/secondenv/lib/python3.9/site-packages/statsmodels/regression/linear_model.py:924, in OLS.init(self, endog, exog, missing, hasconst, **kwargs) File ~/anaconda3/envs/secondenv/lib/python3.9/site-packages/statsmodels/regression/linear_model.py:749, in WLS.init(self, endog, exog, weights, missing, hasconst, **kwargs) File ~/anaconda3/envs/secondenv/lib/python3.9/site-packages/statsmodels/regression/linear_model.py:203, in RegressionModel.init(self, endog, exog, **kwargs) File ~/anaconda3/envs/secondenv/lib/python3.9/site-packages/statsmodels/base/model.py:270, in LikelihoodModel.init(self, endog, exog, **kwargs) File ~/anaconda3/envs/secondenv/lib/python3.9/site-packages/statsmodels/base/model.py:95, in Model.init(self, endog, exog, **kwargs) File ~/anaconda3/envs/secondenv/lib/python3.9/site-packages/statsmodels/base/model.py:135, in Model._handle_data(self, endog, exog, missing, hasconst, **kwargs) File ~/anaconda3/envs/secondenv/lib/python3.9/site-packages/statsmodels/base/data.py:675, in handle_data(endog, exog, missing, hasconst, **kwargs) File ~/anaconda3/envs/secondenv/lib/python3.9/site-packages/statsmodels/base/data.py:88, in ModelData.init(self, endog, exog, missing, hasconst, **kwargs) File ~/anaconda3/envs/secondenv/lib/python3.9/site-packages/statsmodels/base/data.py:132, in ModelData._handle_constant(self, hasconst) File ~/anaconda3/envs/secondenv/lib/python3.9/site-packages/numpy/core/fromnumeric.py:2810, in max(a, axis, out, keepdims, initial, where) File ~/anaconda3/envs/secondenv/lib/python3.9/site-packages/numpy/core/fromnumeric.py:88, in _wrapreduction(obj, ufunc, method, axis, dtype, out, **kwargs) ValueError: zero-size array to reduction operation maximum which has no identity |
From this subsetted dataset, can you run: t_perc = [adata.obs.t.quantile(p / 100) for p in [20,80]]
print((adata.obs.t < t_perc[0]).sum())
print((adata.obs.t > t_perc[1]).sum())
print(((adata.obs.t > t_perc[0]) & ((adata.obs.t < t_perc[1]).sum())).sum()) It could be that there are no cells in one of the three groups, which would be unlikely, but the error suggests that |
Hi scFates team,
I am using scFates version 1.0.8 along with pandas 1.5.3, which is the latest version that satisfies the <2.0 constraint for this release. However, I'm encountering the following error when running the test_fork() function:
TypeError: drop_duplicates() takes 1 positional argument but 2 were given.
It appears that the drop_duplicates() function in pandas may no longer accept the False argument in the same way, causing incompatibility with the current scFates code. Here's the exact line in bifurcation_tools.py:
brcells = brcells.loc[brcells.index.drop_duplicates(False)]
I would suggest either removing the second argument or adapting the call to be compatible with the latest versions of pandas <2.0. Alternatively, could you suggest a workaround?
Thanks in advance for your help!
Best regards,
by the way this is the code I tried to run:
scf.tl.test_fork(bdata,root_milestone="30",milestones=["28","70"],n_jobs=60,rescale=True)
The text was updated successfully, but these errors were encountered: