:py:mod:`BioSANS2020.BioSANS` ============================= .. py:module:: BioSANS2020.BioSANS .. autoapi-nested-parse:: This module is the BioSANS module The purpose of this module is to provide a graphical user interface and to facilitate the transfer of information from BioSANS topology file to other modules. The following are the list of functions in this module 1. load_data 2. show_file_dir 3. create_file 4. extract_ode 5. sbml_to_topo2 6. save_file 7. runpy_file 8. run_ssl 9. load_data2 10. tload_data2 11. delete_this 12. canvas_update_widgets 13. load_image 14. eval2 15. dict_trans 16. convert 17. range_trans 18. range_prep 19. mrun_propagation 20. tprocess 21. analysis_case 22. plot_traj_d2 23. param_set Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: BioSANS2020.BioSANS.load_data BioSANS2020.BioSANS.show_file_dir BioSANS2020.BioSANS.create_file BioSANS2020.BioSANS.extract_ode BioSANS2020.BioSANS.sbml_to_topo2 BioSANS2020.BioSANS.save_file BioSANS2020.BioSANS.runpy_file BioSANS2020.BioSANS.run_ssl BioSANS2020.BioSANS.load_data2 BioSANS2020.BioSANS.tload_data2 BioSANS2020.BioSANS.delete_this BioSANS2020.BioSANS.canvas_update_widgets BioSANS2020.BioSANS.load_image BioSANS2020.BioSANS.eval2 BioSANS2020.BioSANS.dict_trans BioSANS2020.BioSANS.convert BioSANS2020.BioSANS.range_trans BioSANS2020.BioSANS.range_prep BioSANS2020.BioSANS.mrun_propagation BioSANS2020.BioSANS.tprocess BioSANS2020.BioSANS.analysis_case BioSANS2020.BioSANS.plot_traj_d BioSANS2020.BioSANS.get_checked BioSANS2020.BioSANS.plot_traj_d2 BioSANS2020.BioSANS.param_set Attributes ~~~~~~~~~~ .. autoapisummary:: BioSANS2020.BioSANS.TEMPORARY_FOLDER BioSANS2020.BioSANS.TOP BioSANS2020.BioSANS.HEADER BioSANS2020.BioSANS.FRAME BioSANS2020.BioSANS.FOOTER BioSANS2020.BioSANS.FILE_NAME BioSANS2020.BioSANS.CURRENT_DATA BioSANS2020.BioSANS.SUPER_THREAD_RUN BioSANS2020.BioSANS.MENUBUT1 .. py:data:: TEMPORARY_FOLDER .. py:data:: TOP .. py:data:: HEADER .. py:data:: FRAME .. py:data:: FOOTER .. py:data:: FILE_NAME .. py:function:: load_data(itups) This fuction reads topology file and display the contents in a text area. Args: itups (tuple): (canvas, scroll_x, scroll_y) .. py:function:: show_file_dir(path) This function opens the current working directory Args: path (str): directory path .. py:function:: create_file(itups, ftype) This function creates a temporary file in a temporary directory where new topology / files can be placed. Args: itups (tuple): (canvas, scroll_x, scroll_y) ftype (int): 1 for BioSANS topology file, 2 for ODE file .. py:function:: extract_ode(itups) This function extracts topology from ODE file format Args: itups (tuple): (canvas, scroll_x, scroll_y) .. py:function:: sbml_to_topo2(tocon, itups) This function helps in the conversion of SBML files to BioSANS topology files. Args: tocon (str): sbml file name to convert itups (tuple): (canvas, scroll_x, scroll_y) .. py:function:: save_file() This function saves the content of the last opened text area into a file. .. py:function:: runpy_file() This module write the contents of the text area into a python file and run the file as a python script. .. py:function:: run_ssl() This function initiates BioSSL or the BioSABS structured simulation language. .. py:function:: load_data2(plot=False) This function loads data for numerical processing or for plotting Args: plot (bool, optional): if True, loaded trajectory is plotted. Defaults to False. .. py:function:: tload_data2(plot=False) This function starts a thread that handles loading data. Args: plot (bool, optional): if True, loaded trajectory is plotted. Defaults to False. .. py:function:: delete_this(frame, canvas) This function delete an object in the canvas Args: frame (tkinter.Frame): frame or other objects canvas (tkinter.Canvas): canvas object .. py:function:: canvas_update_widgets(_, canvas) This function rearranged the elements in the canvas. Args: _ (None): Not needed canvas (tkinter.Canvas): canvas object] Returns: str: "break" .. py:function:: load_image(wdata=False) This function load image into a canvas and display in BioSANS. Args: wdata (bool, optional): if True, data will also be loaded in the memory. Defaults to False. .. py:function:: eval2(xvar) This function evaluates expression Args: xvar (str): expression Returns: str: evaluated expression .. py:data:: CURRENT_DATA .. py:function:: dict_trans(x_1) This function creates a dictionary from a list assignment Args: x_1 (str): string of symbols and assinged values. Returns: dict: a dictionary from a list assignment .. py:function:: convert(xvar, con) This function converts a variable into con data type. Args: xvar (str): string con (con): new data type con Returns: con: xvar equivalent in con .. py:function:: range_trans(x_1) This function converts the x_1 comma concatenated string into a list and put the first element as the last element. Args: x_1 (str): comma concatenated string Returns: list: the first element goes last now .. py:function:: range_prep(x_1) This function process some string input and converts them to a list which is used as a range on other fuctions. Args: x_1 (str): comma concatenated string Returns: list: list of float or list of list and floats .. py:function:: mrun_propagation(par, entry_list, defs2) Ths function grabs the values from defs2 whcih serves as the set of input for the tprocess function. Args: par (tkinter.Toplevel): top level container entry_list (list): list of tkinter.Entry or tkinter.OptionMenu defs2 (list): values .. py:data:: SUPER_THREAD_RUN .. py:function:: tprocess(defs) This function creates a thread and sed defs to the BioSANS2020.prepcodes.process function. Args: defs (list): inputs for process fucntion .. py:function:: analysis_case(ana_case, itups) This function redirects input to the corresponding numerical or plotting processes. Args: ana_case (str): type of analysis itups (tuple): (canvas, scroll_x, scroll_y) Returns: np.ndarray : numerical values or None .. py:function:: plot_traj_d(current_data, itups) This function plot the trajectory data stored as current data. The plot can be the phase portrait. Args: current_data (np.ndarray or list): loaded data itups (tuple): (canvas, scroll_x, scroll_y) .. py:function:: get_checked(el_1, slabels) This function returns the components name with a check from el_1 check boxes list. Args: el_1 (list): list of values slabels (list):components or species labels Returns: [type]: [description] .. py:function:: plot_traj_d2(current_data, itups) This function is another plotting function. Args: current_data (np.ndarray or list): loaded data itups (tuple): (canvas, scroll_x, scroll_y) .. py:function:: param_set(method) This function opens the parameter setting dialof box and grab the user custom settings. Args: method (str): Defaults to "CLE". Any of the option in the list of available method keywords is listed below; Stochastic (refer to section 10.2.4) 1. "CLE" - Molecules(micro), tau-adaptive 2. "CLE2" - Molecules(micro), cle-fixIntvl 3. "Gillespie_" - Molecules(micro), Direct method 4. "Tau-leaping" - Molecules(micro), Not swapping with Gillespie 5. "Tau-leaping2" - Molecules(micro), Swapping with Gillespie 6. "Sim-TauLeap" - Molecules(micro), Simplified, Swapping with Gillespie Deterministic (refer to section 10.2.1) 7. "Euler-1" - Molecules(micro), tau-adaptive-1 8. "Euler-2" - Molar (macro), tau-adaptive-1 9. "Euler-3" - Mole (macro), tau-adaptive-1 10. "Euler2-1" - Molecules(micro), tau-adaptive-2 11. "Euler2-2" - Molar (macro), tau-adaptive-2 12. "Euler2-3" - Mole (macro), tau-adaptive-2 13. "ODE-1" - Molecules(micro), using ode_int from scipy 14. "ODE-2" - Molar(macro), using ode_int from scipy 15. "ODE-3" - Mole(macro), using ode_int from scipy 16. "rk4-1" - Molecules(micro), fix-interval 17. "rk4-2" - Molar(macro), fix-interval 18. "rk4-3" - Mole(macro), fix-interval 19. "rk4-1a" - Molecules(micro), tau-adaptive 20. "rk4-2a" - Molar(macro), tau-adaptive 21. "rk4-3a" - Mole(macro), tau-adaptive Linear Noise Approximation (refer to 10.1.2 & 10.2.2) 22. "LNA" - Numeric, values 23. "LNA-vs" - Symbolic, values, Macroscopic 24. "LNA-ks" - Symbolic, f(ks), Macroscopic 25. "LNA-xo" - Symbolic, f(xo), Macroscopic 26. "LNA2" - Symbolic, f(xo,ks), Microscopic 27. "LNA3" - Symbolic, f(xo,ks), Macroscopic 28. "LNA(t)" - COV-time-dependent, Macroscopic 29. "LNA2(t)" - FF-time-dependent, Macroscopic Network Localization (refer to 10.1.3) 30. "NetLoc1" - Symbolic, Macroscopic 31. "NetLoc2" - Numeric, Macroscopic Parameter estimation (refer to 10.2.3) 32. "k_est1" - MCEM, Macroscopic 33. "k_est2" - MCEM, Microscopic 34. "k_est3" - NM-Diff. Evol., Macroscopic 35. "k_est4" - NM-Diff. Evol., Microscopic 36. "k_est5" - Parameter slider/scanner 37. "k_est6" - Nelder-Mead (NM), Macroscopic 38. "k_est7" - Nelder-Mead (NM), Microscopic 39. "k_est8" - Powell, Macroscopic 40. "k_est9" - Powell, Microscopic 41. "k_est10" - L-BFGS-B, Macroscopic 42. "k_est11" - L-BFGS-B, Microscopic Symbolic/Analytical expression of species (refer to 10.1.1) 43. "Analyt" - Pure Symbolic :f(t,xo,k) 44. "Analyt-ftx" - Semi-Symbolic :f(t,xo) 45. "SAnalyt" - Semi-Symbolic :f(t) 46. "SAnalyt-ftk" - Semi-Symbolic :f(t,k) 47. "Analyt2" - Creates commands for wxmaxima .. py:data:: MENUBUT1