Code Monkey home page Code Monkey logo

phzlab's Introduction

PHZLAB: A MATLAB toolbox for analyzing physiological data.

PHZLAB Logo

PHZLAB is a MATLAB Toolbox for analyzing physiological data, both peripheral (e.g., EDA, EMG) and neural (i.e., ABR). Really, it is good for any multiple-trial time-series data. It has been designed with the following goals in mind:

  • make it easy and fast to try different analyses
  • easy presentation-ready figures and stats-ready data frames
  • be simple enough to act as an introduction to MATLAB
  • be hackable enough so as not to be a hindrance, while still adding value

See the wiki for a proper introduction, quickstart guide, documentation, and example scripts.

Installation in Three Steps

1. System Requirements

PHZLAB requires MATLAB to run. Since PHZLAB uses the table and categorical variable types, it will only run on MATLAB versions R2014a and later. Also for this reason, it won't run in Octave.

Some PHZLAB functions depend on MATLAB Toolboxes. Details about the dependencies can be found in the help section of the functions themselves.

  • phzBiopac_readJournalMarkers requires the Statistics and Machine Learning Toolbox.

  • phz_filter requires the Signal Processing Toolbox.

2. Download

Manual download. Use the download link in the upper-right corner of this webpage (https://github.com/gabenespoli/phzlab). Unzip the file and put it somewhere where you can easily add it to your MATLAB path (like ~/Documents/MATLAB).

Install using git. From a terminal, move to the directory where you want to put PHZLAB (like ~/Documents/MATLAB) and clone the git repository there. You may need to install git first (e.g., on a Mac you'll need the XCode Command Line Tools, which you can obtain by running xcode-select install in a terminal).

cd ~/Documents/MATLAB
git clone https://github.com/gabenespoli/phzlab

This makes it easy to update PHZLAB:

cd ~/Documents/MATLAB/phzlab
git pull

3. Add to the MATLAB path

Use the MATLAB menu to add the phzlab folder to your path, or type the following in the command window or your scripts:

addpath('~/Documents/MATLAB/phzlab')

Acknowledgements

I would like to thank the SMART Lab (especially Frank Russo, Ella Dubinsky, and Fran Copelli), Alex Andrews, and Carson Pun for their invaluable thoughts, suggestions, inspiration, and feedback.

PHZLAB contains an adapted version of sigstar.

License

This software is covered by the GNU General Public Licence v3.

Contributing

If you are interested in contributing to this project please get in touch! You can email me at [email protected]

phzlab's People

Contributors

gabenespoli avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

phzlab's Issues

don't do preprocessing at the same time as parsing varargin

By doing the preprocessing at the same time as parsing varargin, it is impossible to adjust the values of a preset on the fly. Instead, varargin should simply log the values of the preprocessing, as well as their order, and then apply them later. This means that we can overwrite a value from a preset.

However, one big issue with this is that you may want to use the preset value AS WELL as a new value, like using subset twice for example.

make 'preset' a parameter-value pair

If length(varargin) is odd then assume the first arg is preset. This is so that you could specify processing before the preset, and after the preset. Currently, with the requirement that the first arg is the preset, no processing can be dynamically inserted before the preset.

change phzABR to phzFFR in all relevant code

Since phzABR has been changed to phzFFR, this needs to be reflected in all code. noted in phz_combine, line 141: TMP = phzABR_equalizeTrials(TMP, equalGrpVar, verbose);

change to phzFFR_equalizeTrials -- I haven't checked to see whether there are any other similar issues.

phz_writetable

Hi Gabe,

When using phz_writetable, I am running into an issue when I define the parameter value pair 'region','target' and 'feature','snr'. It says that the region is invalid (which I don't think is true because if I type PHZ.region, target appears in the list), as well as the feature is an unknown feature. I tried debugging right before the error appears, and it doesn't seem that PHZ.region is being cleared out, so I'm not entirely sure what is happening.

Screenshot of the error attached. If you'd like to play with a data file you can find one under Emily's folder called combined.phz. PS this error happens with single and combined files.

Let me know what you think
screen shot 2018-05-07 at 11 34 41 am

phz_plot.m: remove dependency of calling summary through phz_feature

The reason for this in the comments says:

% (run phz_summary through phz_feature because fft feature needs to average
% over the summaryType by participant before doing the fft)

This needs to be removed to allow the user to insert processing in between feature and summary, or to do them in a different order.

Summary function not working properly when looking at combined files.

Note: 'summary' works with 'all', but not individual parameters e.g., 'participant'


FFTStry = phz_writetable(PHZ, 'feature', 'fft100', 'region', 'target', 'FFRsummary', 'efr', 'summary', {'participant', 'session'})
Calculating features...

Feature 1/1: fft100
Restricted to 'target [0.06 0.17]' region.
Summarized data by 'participant session'.
Extracted feature 'fft100'.
Index exceeds matrix dimensions.

Error in phz_discard (line 80)
PHZ.lib.tags.(field) = PHZ.lib.tags.(field)(keep);

Error in phz_summary (line 135)
TMP = phz_discard(TMP, false); % verbose = false

Error in phz_feature (line 352)
[PHZ, preSummaryData] = phz_summary(PHZ,keepVars,verbose);

Error in phz_writetable (line 173)
[s,featureTitle] =
phz_feature(PHZ,feature{i},'summary',keepVars,'region',region,'verbose',verbose);

phz_writetable presets

Use PHZ.lib.tables.(tablename) to store presets for tables, just like PHZ.lib.plots. Could also try and conflate this with PHZ.lib.plots.

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.