Skip to content

Commit

Permalink
Installation guide and updated pip requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
bbarad committed Jan 6, 2023
1 parent 6c5bf3e commit 86ecf88
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 3 deletions.
66 changes: 66 additions & 0 deletions Install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Installation Tips
Installing the morphometrics pipeline is usually relatively easy, but there are a few edge cases that require special attention.

## M1 Macs
**Thanks to Genevieve Buckley for this solution: (https://github.com/GrotjahnLab/surface_morphometrics/issues/8)**
This is a temporary workaround and needs additional testing!

0. Build the conda environment like normal, but don't pip install pymeshlab - just remove it from the pip_requirements.txt file
1. Install pyqt into your conda environment:
For M1 Macs, the andfoy conda channel has a working pyqt build:
```bash
conda install pyqt -c andfoy
```

2. Build pymeshlab
https://github.com/cnr-isti-vclab/PyMeshLab/blob/main/src/README.md

```bash
brew install libomp cgal xerces-c
git clone --recursive https://github.com/cnr-isti-vclab/PyMeshLab.git
cd PyMeshLab

# Build pymeshlab
mkdir src/build
cd src/build
cmake ..
make
make install
```
<!--
This is not what worked - we need the original build instructions
modify build script (scripts/macOS/1_build.sh) line 77, with custom qt dir and remove -DBUILD_DUMMY_BIN_MAC_DEPLOY flag.`
sh scripts/macOS/1_build.sh
sh scripts/macOS/2_deploy.sh
-->

3. Export the `KMP_DUPLICATE_LIB_OK` environment variable
This prevents libomp errors.
You can use conda to permanently set an environment variable in the morphometrics conda environment:
```bash=
conda activate morphometrics
conda env config vars KMP_DUPLICATE_LIB_OK=TRUE
# Must reactivate conda environment
conda deactivate
conda activate morphometrics
conda env config vars list
# You should now see KMP_DUPLICATE_LIB_OK = TRUE in this list
```

4. Check the build worked:
```bash
python -m pip install pytest
python -m pytest --pyargs pymeshlab
```

4. Install pymeshlab to the conda environment:
```bash
pip install .
```

5. You're ready to go!
Try running the surface-morphometrics scripts on the example data. See the README for more details.

## Container Implementation
For older linux environments (such as CentOS7) Qt5 will not behave well. A container implementation is in progress (https://github.com/GrotjahnLab/surface_morphometrics/issues/10)
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ Individual steps are available as click commands in the terminal, and as functio
* Files with .log extension are log files, mostly from the output of the pycurv run.
* Quantifications (plots and statistical tests) are output in csv, svg, and png formats.


## Troubleshooting
0. If installation fails, you may want to reference `Install.md` for advanced installation tips (this is especially relevant for M1/M2 macs and Centos7 linux machines)
1. Warnings of the type `Gaussian or Mean curvature of X has a large computation error`... can be ignored, as they get cleaned up by pycurv
2. MRC files that are output by AMIRA don't have proper machine stamps by default. They need to be imported with `mrcfile.open(filename, permissive=True)`

Expand All @@ -100,6 +100,8 @@ Individual steps are available as click commands in the terminal, and as functio
8. Pycurv
1. Pyto
2. Graph-tool


## Citation
The development of this toolkit and examples of useful applications can be found in the following manuscript. Please cite it if you use this software in your research, or extend it to make improvements!

Expand Down
4 changes: 2 additions & 2 deletions pip_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
git+https://github.com/bbarad/Pyto.git
git+https://github.com/GrotjahnLab/pycurv.git
git+https://github.com/vladanl/Pyto.git
git+https://github.com/kalemaria/pycurv.git
pymeshlab
pyyaml
click
Expand Down

0 comments on commit 86ecf88

Please sign in to comment.