Installation Guide
To install SarcGraph follow the following steps:
Prerequisites
SarcGraph needs the following packages to run:
Package Name |
Version |
|---|---|
ffmpeg |
4.2.2 |
matplotlib |
3.5.2 |
networkx |
2.8.4 |
numpy |
1.23.5 |
pandas |
1.5.2 |
scikit-image |
0.19.3 |
scikit-learn |
1.2.1 |
scipy |
1.10.0 |
sk-video |
1.1.10 |
trackpy |
0.6.1 |
Stable Version Installation
From Conda
We recommend using Anaconda to install sarcgraph.
1. Install Anaconda
Follow Anaconda’s installation instructions. Alternatively you can install Miniconda (a minimal installer for conda).
2. Create a new Conda environment and install sarcgraph
Run the following command in Anaconda terminal to create a new conda environment containing the sarcgraph package and all its dependencies:
conda create --name sarcgraph-env -c conda-forge -c saeedmhz sarcgraph
Type y and press Enter when prompted.
3. Activate the environment
conda activate sarcgraph-env
From PyPI
Since ffmpeg is not availble on PyPI, you need to install it seperately. We recommend using Anaconda to install the correct version of ffmpeg.
1. Install ffmpeg
Install anaconda and run the following commands in Anaconda terminal to create and activate a new environment:
conda create --name sarcgraph-env python=3.10
conda activate sarcgraph-env
Run the following command to install ffmpeg:
conda install -c conda-forge ffmpeg=4.2.2
2. Install SarcGraph
SarcGraph and its dependencies can be installed using the following command:
pip install --upgrade sarcgraph
Verify Installation
Run the following command and check if it runs with no errors:
python -c "from sarcgraph.sg import SarcGraph"
Run Tutorial Notebooks
You have two options for running the tutorial demos in the tutorials directory:
Use Binder:
You can run the tutorials directly in your browser using Binder. This option does not require you to set up the environment locally, but it may take some time for Binder to finish the initial setup. Click the badge below to launch the tutorials on Binder:
Run Locally:
If you prefer to run the tutorials on your local machine, follow these steps:
a. Set up your local environment by activating the
sarcgraph-envconda environment:conda activate sarcgraph-env
Install the
Jupyterpackage:pip install jupyterIf you’re new to Jupyter Notebooks, you may find these introductory videos helpful:
Download the tutorial files by either:
Downloading the individual notebook files from the tutorials folder in the GitHub repository. You can do this by clicking on each file, then clicking the “Raw” button, and finally right-clicking and selecting “Save As” to save the file to your local machine. Make sure to save the file with the
.ipynbextension.Once you have downloaded the tutorial files, move them to a local directory. You can use the following command to move to that directory:
cd path/to/local/directoryCloning the entire GitHub repository using the following command:
git clone https://github.com/Sarc-Graph/sarcgraphOnce you have cloned the repository, move to the tutorials directory:
cd sarcgraph/tutorialsd. You can open and run any of the demos by executing the following command while in the directory where the tutorial files are located:
jupyter notebook demo_file_name.ipynb