Tutorials on using latest dynamo package
aristoteleo / dynamo-tutorials Goto Github PK
View Code? Open in Web Editor NEWTutorials on using latest dynamo package
Tutorials on using latest dynamo package
The scNT_seq_readthedocs.ipynb notebook fails while executing dynamo_workflow(neuron_labeling)
(cell 10) with TypeError: Categorical is not ordered for operation max you can use .as_ordered() to change the Categorical to an ordered one
.
Steps to reproduce: Run #3 in Google colab.
When changing neuron_labeling.obs['time'] = neuron_labeling.obs.time.astype("categorical")
(cell 8) to neuron_labeling.obs['time'] = neuron_labeling.obs.time.astype(float)
to circumvent the problem in #4, I get a ValueError: Residuals are not finite in the initial point.
while dynamo/estimation/tsc/estimation_kinetic.py:auto_fit
runs least squares. Is this just an irrelevant error because one should fix #4 differently?
Full trace:
[<ipython-input-9-5d53bc49f5de>](https://ndagie4afs-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab-20230321-060141-RC01_518395136#) in dynamo_workflow(adata)
2 dyn.pp.recipe_monocle(adata)
3
----> 4 dyn.tl.dynamics(adata)
5
6 dyn.tl.reduceDimension(adata)
[~/.local/lib/python3.9/site-packages/dynamo/tools/dynamics.py](https://ndagie4afs-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab-20230321-060141-RC01_518395136#) in dynamics(adata, filter_gene_mode, use_smoothed, assumption_mRNA, assumption_protein, model, est_method, NTR_vel, group, protein_names, concat_data, log_unnormalized, one_shot_method, fraction_for_deg, re_smooth, sanity_check, del_2nd_moments, cores, tkey, **est_kwargs)
731 data_type = "smoothed" if use_smoothed else "sfs"
732
--> 733 (params, half_life, cost, logLL, param_ranges, cur_X_data, cur_X_fit_data,) = kinetic_model(
734 subset_adata,
735 tkey,
[~/.local/lib/python3.9/site-packages/dynamo/tools/dynamics.py](https://ndagie4afs-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab-20230321-060141-RC01_518395136#) in kinetic_model(subset_adata, tkey, model, est_method, experiment_type, has_splicing, splicing_labeling, has_switch, param_rngs, data_type, return_ntr, **est_kwargs)
1540 cur_X_raw = np.hstack((cur_X_raw[0, 0].A, cur_X_raw[1, 0].A))
1541
-> 1542 _, cost[i_gene] = estm.auto_fit(np.unique(time), cur_X_data)
1543 (
1544 model_1,
[~/.local/lib/python3.9/site-packages/dynamo/estimation/tsc/estimation_kinetic.py](https://ndagie4afs-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab-20230321-060141-RC01_518395136#) in auto_fit(self, time, x_data, alpha_min, beta_min, gamma_min, kin_weight, use_p0, **kwargs)
709
710 if use_p0:
--> 711 popt, cost = self.fit_lsq(time, x_data_norm, p0=p0, **kwargs)
712 else:
713 popt, cost = self.fit_lsq(time, x_data_norm, **kwargs)
[~/.local/lib/python3.9/site-packages/dynamo/estimation/tsc/estimation_kinetic.py](https://ndagie4afs-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab-20230321-060141-RC01_518395136#) in fit_lsq(self, t, x_data, p0, n_p0, bounds, sample_method, method, normalize)
209 X = []
210 for i in range(n_p0):
--> 211 ret = least_squares(
212 lambda p: self.f_lsq(p, t, x_data_norm, method, normalize),
213 p0[i],
[/usr/local/lib/python3.9/dist-packages/scipy/optimize/_lsq/least_squares.py](https://ndagie4afs-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab-20230321-060141-RC01_518395136#) in least_squares(fun, x0, jac, bounds, method, ftol, xtol, gtol, x_scale, loss, f_scale, diff_step, tr_solver, tr_options, jac_sparsity, max_nfev, verbose, args, kwargs)
835
836 if not np.all(np.isfinite(f0)):
--> 837 raise ValueError("Residuals are not finite in the initial point.")
838
839 n = x0.size
ValueError: Residuals are not finite in the initial point.
Hello, I have experimented with the zebrafish.ipynb file and it seems that the results generated are different from what is presented in the tutorial, for example, the vector field topology. The ones in the tutorial show clearly the stable fixed points but the ones I obtained appear less clear. I just used the exact same script with nothing changed. Could this be due to a package version issue? I am wondering why the results are so different.
Excuse me, when I try to join the public slack workspace, it told me the link is no longer valid. Could you please share a new link? Thank you. @Xiaojieqiu
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.