Setup the environment for lumicks-pylake and C_Trap-Multimer-photontrack.ipynb

gene_x 0 like s 16 view s

Tags: packages, python, pipeline

https://lumicks-pylake.readthedocs.io/en/v0.8.2/install.html#updating

https://github.com/JamesLiWan/MultimerizationCode/blob/main/C_Trap-Multimer-photontrack.ipynb

  1. Fix which pylake we should use for the legacy-code.

    Yep – you’re absolutely right, the channel parameter was added in pylake v0.9.0. If you look at the changelog:
    
    v0.9.0 (Jul 29 2021) introduces unit support and other updates, which also aligns with introducing the channel argument in track_greedy()
    
    Versions before v0.9.0, like v0.8.2 (Apr 30 2021), use the old signature:
    
    track_greedy(kymograph, line_width, pixel_threshold, …)
    with no channel argument.
    
    Since your code uses track_greedy(data, …) without specifying channel, you should install: pylake v0.8.2
    
  2. Create mamba environment for pylake v0.8.2

    mamba env remove -n pylake_082_clean
    mamba env create -f pylake_082_env.yml
    
        name: pylake_082_clean
        channels:
        - conda-forge
        - defaults
        dependencies:
        - python=3.8
        - pip
        - jupyterlab
        - ipywidgets
        - numpy
        - matplotlib
        - h5py
        - pandas
        - scipy
    
    mamba activate pylake_082_clean
    
    #IMPORTANT:
    mamba install -c conda-forge lumicks.pylake=0.8.2
    mamba install -c conda-forge  numpy matplotlib ipywidgets scipy scikit-image pandas
    
    python -c "import lumicks.pylake; print(lumicks.pylake.__version__)"
    
    mamba install notebook=6
    
    #+ ipython_genutils    0.2.0  pyhd8ed1ab_1  conda-forge     Cached
    #+ nbclassic           1.1.0  pyhd8ed1ab_0  conda-forge     Cached
    #+ notebook            6.5.7  pyha770c72_0  conda-forge     Cached
    
    #Downgrade:
    #─────────────────────────────────────────────────────────────────────
    
    #- jupyter_client      8.6.3  pyhd8ed1ab_0  conda-forge     Cached
    #+ jupyter_client      7.4.9  pyhd8ed1ab_0  conda-forge     Cached
    
    jupyter notebook --version
    #pip show notebook
    
    (pylake_082_clean) jhuang@WS-2290C:/mnt/md1/DATA/Data_Vero_Kymographs$ mamba list jupyter
    # packages in environment at /home/jhuang/mambaforge/envs/pylake_082_clean:
    #
    # Name                    Version                   Build  Channel
    jupyter-lsp               2.2.5              pyhd8ed1ab_0    conda-forge
    jupyter_client            7.4.9              pyhd8ed1ab_0    conda-forge
    jupyter_core              5.8.1              pyh31011fe_0    conda-forge
    jupyter_events            0.10.0             pyhd8ed1ab_0    conda-forge
    jupyter_server            2.14.2             pyhd8ed1ab_0    conda-forge
    jupyter_server_terminals  0.5.3              pyhd8ed1ab_0    conda-forge
    jupyterlab                4.3.0              pyhd8ed1ab_0    conda-forge
    jupyterlab_pygments       0.3.0              pyhd8ed1ab_1    conda-forge
    jupyterlab_server         2.27.3             pyhd8ed1ab_0    conda-forge
    jupyterlab_widgets        3.0.13             pyhd8ed1ab_0    conda-forge
    (pylake_082_clean) jhuang@WS-2290C:/mnt/md1/DATA/Data_Vero_Kymographs$ mamba list notebook
    # packages in environment at /home/jhuang/mambaforge/envs/pylake_082_clean:
    #
    # Name                    Version                   Build  Channel
    notebook                  6.5.7              pyha770c72_0    conda-forge
    notebook-shim             0.2.4              pyhd8ed1ab_0    conda-forge
    
    #Note that Notebook v6.x and Notebook v7 is different, we have to notebook v6 More Detailed Breakdown:
    #Version    Backend Used    Notes
    #Notebook v6.x and below    notebook (classic Tornado-based server) No jupyter_server dependency
    #Notebook v7+   Uses jupyter_server under the hood  Required dependency
    
  3. Install extension for the recognization of %%javascript, %matplotlib inline, and %matplotlib notebook

    mamba install widgetsnbextension -c conda-forge
    jupyter nbextension enable --py widgetsnbextension --sys-prefix
    #ModuleNotFoundError: No module named 'ipympl', but we don't need it!    jupyter nbextension enable --py ipympl --sys-prefix
    jupyter nbextension list
    
  4. BUG_1: ModuleNotFoundError: No module named 'matplotlib_venn'

    mamba install -c conda-forge matplotlib-venn
    
  5. BUG_2: TypeError: init() got an unexpected keyword argument 'drawtype'

    #indicates that your version of Matplotlib is too new, and it no longer supports the drawtype argument in matplotlib.widgets.RectangleSelector. Only <= 3.4.3 supprts drawtype!
    
    mamba list matplotlib
    # packages in environment at /home/jhuang/mambaforge/envs/pylake_082_clean:
    #
    # Name                    Version                   Build  Channel
    #matplotlib                3.7.3            py38h578d9bd_0    conda-forge
    #matplotlib-base           3.7.3            py38h58ed7fa_0    conda-forge
    #matplotlib-inline         0.1.7              pyhd8ed1ab_0    conda-forge
    #matplotlib-venn           1.1.1              pyhd8ed1ab_0    conda-forge
    
    #DEBUG:         # MODIFIED: Delete "drawtype='box'," in kymowidget.py
    self.area_selector = RectangleSelector(self._axes, self.track_kymo,
                                            useblit=True,
                                        button=[3],
                                        minspanx=5, minspany=5,
                                        spancoords='pixels',
                                        interactive=False)
    
  6. OPTIONAL_BUG (NOT_DONE): [W 13:13:49.115 NotebookApp] Error loading server extension jupyterlab

    #Traceback (most recent call last):
    #  File "/home/jhuang/mambaforge/envs/pylake_082/lib/python3.8/site-packages/notebook/notebookapp.py", line 2050, in init_server_extensions
    #    func(self)
    #  File "/home/jhuang/mambaforge/envs/pylake_082/lib/python3.8/site-packages/jupyterlab/serverextension.py", line 71, in load_jupyter_server_extension
    #    extension.initialize()
    #  File "/home/jhuang/mambaforge/envs/pylake_082/lib/python3.8/site-packages/jupyterlab/labapp.py", line 921, in initialize
    #    super().initialize()
    #  File "/home/jhuang/mambaforge/envs/pylake_082/lib/python3.8/site-packages/jupyter_server/extension/application.py", line 437, in initialize
    #    self._prepare_handlers()
    #  File "/home/jhuang/mambaforge/envs/pylake_082/lib/python3.8/site-packages/jupyter_server/extension/application.py", line 327, in _prepare_handlers
    #    self.initialize_handlers()
    #  File "/home/jhuang/mambaforge/envs/pylake_082/lib/python3.8/site-packages/jupyterlab/labapp.py", line 735, in initialize_handlers
    #    page_config["token"] = self.serverapp.identity_provider.token
    #AttributeError: 'NotebookApp' object has no attribute 'identity_provider'
    
    jupyter serverextension disable jupyterlab
    mamba remove jupyterlab (or pip uninstall jupyterlab)
    
  7. Run notebook on (pylake_082_clean) jhuang@WS-2290C:/mnt/md1/DATA/Data_Vero_Kymographs/MultimerizationCode-main_v082

    (pylake_082_clean) jhuang@WS-2290C:/mnt/md1/DATA/Data_Vero_Kymographs/MultimerizationCode-main_v082$ jupyter notebook
    
    #jupyter notebook --no-browser --port=8888
    

like unlike

点赞本文的读者

还没有人对此文章表态


本文有评论

没有评论

看文章,发评论,不要沉默


© 2023 XGenes.com Impressum