Coder Social home page Coder Social logo

kcnischool2022-projectweek's Introduction

KCNI Sumer School 2022 - Whole-Brain + Cognitive Network Modelling Project Week

About the project

Disrupted sleep is heavily implicated in a wide variety of psychiatric and neurological illnesses. Insufficient sleep is well known to lead to neuronal hyperexcitabilty, and may lead mechanistically to brain pathologies via metabolic and inflammatory processes.

In this project we will use whole-brain modelling of fMRI data from the Stockholm Sleepy Brain Study to investigate physiological and network-level signatures and mechanisms of sleep deprivation.

We will be using a newly-developed approach for whole-brain modelling in Python using PyTorch, a widely-used machine learning library, as well as various standard Python neuroimaging tools (nilearn, nibabel, hcp_utils). All of the code needed is contained in this repo, and instructions for downloaded the requisite data are given below.

Setup Intructions

1. Clone repo

(Better: fork first, then clone your fork and add this repo as upstream)

git clone [email protected]:mygithubusername/kcnischool2022-projectweek
cd kcnischool2022-projectweek
git remote add upstream https://github.com/griffithslab/kcnischool2022-projectweek
git fetch upstream
git merge upstream/main

2. Setup Python env

On scinet:

Make sure you port forward when sshing:

ssh -X -L XXXX:localhost:XXXX [email protected]

First time only: create environment and install libraries

(note: this assumes that a) you have a fork of this repo, and b) you have added your scinet ssh keys generated with ssh-keygen to github)

module load anaconda3
conda create -n "kcnischool2022" pip git python=3.7
source activate kcnischool2022
git clone [email protected]:mygithubusername/kcnischool2022-projectweek
cd kcnischool-projectweek
pip install -r requirements.txt

After that, load environment for every usage

module load anaconda3
source activate kcnischool2022
cd kcnischool2022-projectweek
jupyter notebook --no-browser --port=XXX

3. Download data

cd data
python download_ds000201_data.py
cd ..

4. Look at the example notebooks

( in the notebooks folder )

5. Get cracking!

When you're ready, pull request (PRs) back to main:

First add your new stuff on a feature branch in your fork:

git checkout -b "mynewfeature"
git add mynewfile.ipynb
git commit mynewfile.ipynb -m"comment on mynewfile"
git push -u origin mynewfeature

...then submit a PR from your github fork, where this push will appear!

5. Further reading:

PyTorch whole-brain modelling methodology:

Original model by Deco et al.

Sleep fMRI data from:

https://openneuro.org/datasets/ds000201/versions/1.0.3

Instructions for launching notebooks in this repo in google colab

  1. Click on the 'open in colab' badge below

  2. Select the notebook that you want to run

  3. Open the notebook

  4. Add the following in a new cell at the top and run:

import os
os.system('rm -rf kcnischool2022-projectweek')
os.system('git clone https://github.com/griffithslab/kcnischool2022-projectweek')
os.chdir('kcnischool2022-projectweek/data')
os.system('python download_ds000201_data.py')
os.chdir('../')
os.system('pip install nilearn hcp_utils')

Open In Colab

Troubleshooting

If you are getting write permission errors when installing libraries in your conda env on scinet, you might need to do use the base Python environment, and do the following:

pip install -r requirements.txt --user

kcnischool2022-projectweek's People

Contributors

cathlyn-chen avatar davi1990 avatar johngriffiths avatar johnwangdataanalyst avatar minarose avatar palainar avatar suhayb-h avatar tsecara avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.