|
1 | | - Installation instructions for CellProfiler + plugins using a conda environment on Macs using the new Apple M1/2 processor. |
| 1 | +Installation instructions for CellProfiler, CellProfiler plugins, CellPose and StarDist in a conda environment on Apple silicon. |
2 | 2 |
|
3 | 3 | 1. **Install brew** |
4 | 4 | ``` |
|
15 | 15 | brew install java |
16 | 16 | ``` |
17 | 17 |
|
18 | | -4. **For the system Java wrappers to find this JDK, symlink it with** |
| 18 | +4. **For the system Java wrappers to find this JDK and symlink it** |
19 | 19 | ``` |
20 | 20 | sudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk |
21 | 21 | ``` |
22 | 22 |
|
23 | | -5. **Set version in zshrc** |
| 23 | +5. **Set version in .zshrc** |
24 | 24 | ``` |
25 | 25 | echo export JAVA_HOME=$(/usr/libexec/java_home -v 1.8) >> ~/.zshrc |
26 | 26 | source ~/.zshrc |
27 | 27 | ``` |
28 | 28 |
|
29 | | -6. **Brew install the packages req** |
| 29 | +6. **Brew install package requirements** |
30 | 30 | ``` |
31 | 31 | brew install freetype mysql git |
32 | 32 | ``` |
|
41 | 41 | brew install hdf5@1.12 |
42 | 42 | ``` |
43 | 43 |
|
44 | | -9. Make sure to get the version directory correct for the version installed. Find with `ls /opt/homebrew/Cellar/hdf5/` |
| 44 | +9. **Make sure to get the version directory correct for the version installed. Find with `ls /opt/homebrew/Cellar/hdf5/`** |
45 | 45 | ``` |
46 | 46 | export HDF5_DIR=/opt/homebrew/Cellar/hdf5/1.12.1_1/ |
47 | 47 | ``` |
48 | | -10. **Create a folder and download cellprofiler, cellprofiler-core, and cellprofiler-plugins** |
| 48 | +10. **Create a folder and download cellprofiler-plugins** |
49 | 49 |
|
50 | 50 | ``` |
51 | 51 | mkdir cp_plugins |
52 | 52 | cd cp_plugins |
53 | | - git clone https://github.com/CellProfiler/core |
54 | | - git clone https://github.com/CellProfiler/CellProfiler |
55 | 53 | git clone https://github.com/CellProfiler/CellProfiler-plugins |
56 | 54 | ``` |
57 | 55 |
|
58 | | -11. **Modify the **setup.py** in the cloned CellProfiler repo.** |
59 | | - |
60 | | - Comment out cellprofiler-core and wxpython from the **install_requires** section, since we are installing our own versions: |
61 | | -
|
62 | | - ``` |
63 | | - ... |
64 | | - "boto3>=1.12.28", |
65 | | - # "cellprofiler-core==4.2.1", |
66 | | - "centrosome==1.2.0", |
67 | | - ... |
68 | | - "six", |
69 | | - # "wxPython==4.1.0", |
70 | | - ``` |
71 | | -
|
72 | | -12. **Download and install miniconda** |
| 56 | +11. **Download and install miniconda** |
73 | 57 |
|
74 | 58 | ``` |
75 | 59 | wget https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh -O ~/miniconda.sh |
76 | 60 | ``` |
77 | 61 |
|
78 | 62 |
|
79 | | -16. **Create a conda environment using the cellprofiler_plugins_macM1.yml file** |
| 63 | +12. **Create a conda `.yml` file** |
| 64 | + In a text editor, paste the following test and save it as `cellprofiler_plugins_macM1.yml`: |
| 65 | + ``` |
| 66 | + name: cpcellpose |
| 67 | +
|
| 68 | + channels: |
| 69 | + - conda-forge |
| 70 | + - anaconda |
| 71 | + - bioconda |
| 72 | + - defaults |
| 73 | + - apple |
| 74 | +
|
| 75 | + dependencies: |
| 76 | + - python=3.8 |
| 77 | + - pip |
| 78 | + - h5py |
| 79 | + - mysqlclient |
| 80 | + - imagecodecs |
| 81 | + - python.app |
| 82 | + - pandas |
| 83 | + - pip: |
| 84 | + - cellpose |
| 85 | + - attrdict |
| 86 | + - sip==5.5.0 |
| 87 | + - boto3>=1.12.28 |
| 88 | + - cellprofiler-core |
| 89 | + - centrosome==1.2.1 |
| 90 | + - docutils==0.15.2 |
| 91 | + - h5py~=3.6.0 |
| 92 | + - imageio>=2.5 |
| 93 | + - inflect>=2.1 |
| 94 | + - Jinja2>=2.11.2 |
| 95 | + - joblib>=0.13 |
| 96 | + - mahotas>=1.4 |
| 97 | + - matplotlib==3.1.3 |
| 98 | + - mysqlclient==1.4.6 |
| 99 | + - numpy>=1.20.1 |
| 100 | + - Pillow>=7.1.0 |
| 101 | + - prokaryote==2.4.4 |
| 102 | + - python-bioformats==4.0.6 |
| 103 | + - python-javabridge==4.0.3 |
| 104 | + - pyzmq~=22.3 |
| 105 | + - sentry-sdk==0.18.0 |
| 106 | + - requests>=2.22 |
| 107 | + - scikit-image>=0.17.2 |
| 108 | + - scikit-learn>=0.20 |
| 109 | + - scipy>=1.4.1 |
| 110 | + - six |
| 111 | + - tifffile<2022.4.22 |
| 112 | + - wxPython==4.2.0 |
| 113 | + ``` |
| 114 | +
|
| 115 | +
|
| 116 | +13. **Create a conda environment using the cellprofiler_plugins_macM1.yml file** |
80 | 117 |
|
81 | 118 | At this stage, your folder/file structure should look like this: |
82 | 119 |
|
83 | 120 | ``` |
84 | 121 | ├── cp_plugins |
85 | | - ├── CellProfiler/ |
86 | 122 | ├── CellProfiler-plugins |
87 | | - ├── core |
88 | 123 | └── cellprofiler_plugins_macM1.yml |
89 | | -
|
90 | 124 | ``` |
91 | 125 |
|
92 | 126 | In the terminal, make sure you are in the `cp_plugins` folder mentioned above. |
|
95 | 129 | conda env create -n cp_plugins --file cellprofiler_plugins_macM1.yml |
96 | 130 | ``` |
97 | 131 |
|
98 | | -17. **Activate the conda environment** |
| 132 | +14. **Activate the conda environment** |
99 | 133 |
|
100 | 134 | ``` |
101 | 135 | conda activate cp_plugins |
102 | 136 | ``` |
103 | 137 |
|
104 | | -18. **Install Cellprofiler core and cellprofiler** |
| 138 | +15. **Install Cellprofiler core and cellprofiler** |
105 | 139 |
|
106 | | - In the terminal with your environment activate, navigate to the folder where you download the softwares and enter: |
| 140 | + In the terminal with your environment activate, navigate to the folder where you download the software and enter: |
107 | 141 | |
108 | 142 | ``` |
109 | | - pip install ./core |
110 | | - pip install ./CellProfiler |
111 | | - ``` |
112 | | -
|
113 | | -19. **Resolving dependencies conflits** |
114 | | -
|
115 | | - In the terminal with your environment activate, enter: |
116 | | - ``` |
117 | | - pip uninstall -y centrosome python-javabridge |
118 | | - pip install --no-cache-dir --no-deps --no-build-isolation python-javabridge centrosome |
119 | | - pip uninstall matplotlib -y |
120 | | - pip install matplotlib==3.2 |
121 | | - pip uninstall mahotas -y |
122 | | - pip install mahotas |
| 143 | + pip install cellprofiler --no-deps |
123 | 144 | ``` |
124 | 145 |
|
125 | | -20. **Install other packages for other plugins (just for runStardist)** |
| 146 | +16. **Install other packages for other plugins (just for runStardist)** |
126 | 147 |
|
127 | 148 | In the terminal with your environment activate, enter: |
128 | 149 | ``` |
|
131 | 152 | pip install stardist csbdeep --no-deps |
132 | 153 | ``` |
133 | 154 |
|
134 | | -21. **Open CellProfiler** |
| 155 | +17. **Open CellProfiler** |
135 | 156 |
|
136 | 157 | Execute this command from within the downloaded CellProfiler repo (get there with `cd CellProfiler`) |
137 | 158 |
|
138 | 159 | ``` |
139 | 160 | pythonw -m cellprofiler |
140 | 161 | ``` |
141 | 162 |
|
142 | | -22. **Connect CellProfiler with the plugins folder** |
| 163 | +18. **Connect CellProfiler with the plugins folder** |
143 | 164 |
|
144 | 165 | With your environment active, type pythonw -m cellprofiler in terminal to open CellProfiler if it is not open already. |
145 | 166 |
|
|
150 | 171 | *Close CellProfiler and reopen it by typing pythonw -m cellprofiler on the command line |
151 | 172 |
|
152 | 173 |
|
| 174 | +### Resolving dependencies conflits |
| 175 | +
|
| 176 | + In the terminal with your environment activate, enter: |
| 177 | + ``` |
| 178 | + pip uninstall -y centrosome python-javabridge |
| 179 | + pip install --no-cache-dir --no-deps --no-build-isolation python-javabridge centrosome |
| 180 | + pip uninstall matplotlib -y |
| 181 | + pip install matplotlib==3.2 |
| 182 | + pip uninstall mahotas -y |
| 183 | + pip install mahotas |
| 184 | + ``` |
| 185 | +
|
153 | 186 | ### Test your installation |
154 | 187 |
|
155 | 188 | Add a module to your pipeline by hitting the **+** button in the pipeline panel (bottom left) |
|
0 commit comments