GithubHelp home page GithubHelp logo

diamsar's Introduction

DiamSar

code accompanying "No relationship between frontal alpha asymmetry and depressive disorders in a multiverse analysis of five studies" paper (https://elifesciences.org/articles/60595).

Required packages

You need a standard sientific python istallation (Anaconda is recommended) with numpy, scipy, pandas, matplotlib etc. Additional non-standard libraries are:

To plot the figure 1 supplement 1 or summarize channel-pair analyses in a table with effect sizes and their bootstrap confidence intervals you will also need the following packages:

Installation

Currently, the code is used without standard installation process - you just need to download the DiamSar repository, place the folder somewhere on your computer and add that location to the python path. You can either add this location to the PYTHONPATH envirionment variable or add the path through python every time you use DiamSar:

import sys
sys.path.append(r'C:\src\DiamSar')

import DiamSar as ds

Folder structure

DiamSar expects a specific directory stucture that we used throught the analysis. The data should be available on Dryad soon - they contain one zip package for each study. To use DiamSar code you need at least the DiamSar study unzipped somewhere on your computer. However to reproduce the analyses from the paper it is best to download and unzip all three studies. In the end you should have a folder with three subfolders: DiamSar, Wronski and Nowowiejska (these are studies III, II and I, respectively).

Usage example

(more examples will come soon in the form of notebooks)
Once you have the folder structure set up, assuming you have the studies located in C:\data\threetimesno directory, to import and activate DiamSar you need to execute:

import DiamSar as ds
paths = ds.pth.set_paths(base_dir=r'C:\data\threetimesno')

Now the paths variable contains a borsar.project.Paths object that allows to easily get paths and data for any of the three studies. For example you can read BDI scores for the participants for given study in the following way:

bdi = paths.get_data('bdi', study='B')

or read power spectra for given study-space combination:

psd, freq, ch_names, subj_id = paths.get_data('psd', study='C', space='avg')

Now the easiest analysis you can perform is with the deault settings (to learn more see the documentation of DiamSar.analysis.run_analysis):

# run the default analysis
clst = ds.analysis.run_analysis()

# plot the topography of the statistics (t test in this case)
topo = clst.plot(vmin=-2, vmax=2)
# add colorbar
plt.colorbar(topo.img)

diamsar's People

Contributors

mmagnuski avatar n-ruban avatar nruban avatar

Watchers

 avatar  avatar  avatar

diamsar's Issues

Make DiamSar work with BIDS studies

Might be useful to change DiamSar so that studies in BIDS format would work well. The outputs of DiamSar could be put in derivatives. This would make the multiverse functions available in DiamSar much more useful.

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.