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:

  1. 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:

https://mybinder.org/badge_logo.svg
  1. 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-env conda environment:

conda activate sarcgraph-env
  1. Install the Jupyter package:

    pip install jupyter
    

    If you’re new to Jupyter Notebooks, you may find these introductory videos helpful:

  2. 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 .ipynb extension.

      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/directory
      
    • Cloning the entire GitHub repository using the following command:

      git clone https://github.com/Sarc-Graph/sarcgraph
      

      Once you have cloned the repository, move to the tutorials directory:

      cd sarcgraph/tutorials
      

d. 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