pd-parser

pd-parser: A tool for Matching Photodiode Deflection Events to Time-Stamped Events - Published in JOSS (2020)

https://github.com/alexrockhill/pd-parser

Science Score: 93.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org, zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Scientific Fields

Medicine Life Sciences - 84% confidence
Neuroscience Life Sciences - 84% confidence
Mathematics Computer Science - 84% confidence
Last synced: 4 months ago · JSON representation

Repository

A tool to parse photodiode events from a possibly corrupted channel, compatible with BIDS formatting

Basic Info
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 6
Created over 5 years ago · Last pushed about 3 years ago
Metadata Files
Readme Contributing License

README.rst

.. pd-parser's documentation

.. image:: https://zenodo.org/badge/287045175.svg
   :target: https://zenodo.org/badge/latestdoi/287045175

.. image:: https://joss.theoj.org/papers/10.21105/joss.02674/status.svg
   :target: https://doi.org/10.21105/joss.02674

|icon| pd-parser
================

The stable version of the documentation can be found `here `_.

.. |icon| image:: https://alexrockhill.github.io/pd-parser/_images/favicon.png
  :width: 25

A tool to parse photodiode events from a possibly corrupted channel, compatible with BIDS formatting.

Corrupted data may look like so:

.. image:: https://alexrockhill.github.io/pd-parser/_images/excluded_events.png
   :width: 800

Which may lead to some excluded events and differences between the events and the expected timing based on the behavior that look like so:

.. image:: https://alexrockhill.github.io/pd-parser/_images/event_diffs.png
   :width: 400

``pd-parser`` matches deflection events on a potentially corrupted photodiode channel with time-stamped events generated by the computer that changes the luminance sensed by the photodiode. This tool is for research that needs high-performance timing synchronization, especially in clinical settings where having a channel record a photodiode is the best or only method of task-integration available and where the photodiode is especially likely to be corrupted by unavoidable environmental noise. First, photodiode time series data is extracted from an electrophysiology data file. The photodiode data can be on a single channel or two channels that are then bipolar re-referenced. Candidate photodiode events from this photodiode time series are identified based on matching a square-wave template. Time-stamped events from the computer triggering changes to the luminance of the photodiode are read from a tab-separated value (tsv) file, and the best alignment of these events relative to photodiode deflection events is then found while accounting for any drift between computer clocks of separate recording devices. Events are excluded where when the difference between the photodiode event and the time-stamped event are greater then a specified threshold. This discrepancy in timing can occur when a monitor doesn't update the display for one or more frames most often because the computer paused execution of the program controlling luminance to do background tasks. Additional events can then be added using the time of each event relative to the corresponding photodiode-synchronized event. Adding relative events may be needed for any number of reasons. For instance, events may occur too rapidly in series relative to the monitor refresh rate to have a photodiode deflection for each event, or the photodiode deflection may effect neighboring channels on the amplifier with its large deflection and so be placed synchronous with an event, such the onset of fixation, where it will not effect other, more important events. Finally, the raw data and events data can be saved in brain imaging data structure (BIDS) format, which allows the behavioral events to be stored in a standardized format without modifying the underlying raw electrophysiology file.

Installation Instructions
-------------------------

1) Install the latest version python using of anaconda 
	- anaconda (https://www.anaconda.com/products/individual) *or* 
	- python (https://www.python.org/downloads/)

	and **make sure that you add the installed packages to the path**.

2) *Optional* Create virtual environment to keep the particular versions of software relevant to this project from getting changed. In a terminal, run
	- ``conda create --name myenv`` and then ``conda activate myenv`` *or* 
	- ``python -m venv /path/to/env/myenv`` and then ``source /path/to/env/myenv/bin/activate``

3) Run ``conda install pip`` in a terminal, and then ensure that when you run ``which pip`` in a terminal it points to the where the anaconda or python you just installed is.

4) Run ``pip install pd-parser`` in a terminal.


Getting Started
---------------

1) Plot the examples in a Jupyter notebook
    - In the `Examples page `_, click on 'Download all examples in Jupyter notebooks'
    - Unzip the downloaded file
    - Run ``pip install jupyter``
    - Point the terminal to the folder where the files you downloaded are by running ``cd /path/to/downloads/``
    - Run ``jupyter notebook`` in the terminal, this will pop up a webpage in your default browser.
    - Change ``%matplotlib inline`` to just ``%matplotlib`` to pop the plots out interactively instead of below the cell in the notebook.
    - Run each cell, change the parameters and explore the example.
2) Try pd-parser on your photodiode data. You will need:
    - **Time series data** in ``.fif``, ``.edf``, ``.bdf``, ``.vhdr``, or ``.set`` format like the data from the first cell of `this example `_. If you do not know the name of the photodiode channel, the data will be plotted and you will be asked to find it so it is not necessary to pass the name.
    - **A behavior file** in tab-separated value (tsv) format like the one created in the second cell of `this example `_. The file needs to have:
        - One column corresponding to the expected event in seconds, called by default ``fix_onset_time``
        - *Optionally* Other columns with relative event times in seconds.
    - How to run:
        - See the `example notebooks `_ for information on how to extract parameters for ``pd_parser``, use the parameters to detect events, and saving the events and data in a BIDS-compatible format.

Bug reports
-----------

Use the `GitHub issue tracker `_
to report bugs.

Contributing
------------

Please see our `contributing guide `_.
`

Alex Rockhill
Eugene, OR 2020

Owner

  • Name: Alex Rockhill
  • Login: alexrockhill
  • Kind: user
  • Location: Eugene, OR
  • Company: University of Oregon

Graduate Student in the Swann Lab

JOSS Publication

pd-parser: A tool for Matching Photodiode Deflection Events to Time-Stamped Events
Published
October 25, 2020
Volume 5, Issue 54, Page 2674
Authors
Alexander P. Rockhill, ORCID
University of Oregon, Department of Human Physiology, Eugene, Oregon.
Ahmed M. Raslan ORCID
Department of Neurological Surgery, Oregon Health & Science University, Portland, Oregon.
Nicole C. Swann ORCID
University of Oregon, Department of Human Physiology, Eugene, Oregon.
Editor
Olivia Guest ORCID
Tags
neuroscience electrophysiology psychology behavior

GitHub Events

Total
Last Year

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 153
  • Total Committers: 2
  • Avg Commits per committer: 76.5
  • Development Distribution Score (DDS): 0.294
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Alex a****l@m****g 108
Alex a****6@g****m 45
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 8
  • Total pull requests: 1
  • Average time to close issues: 3 days
  • Average time to close pull requests: about 2 hours
  • Total issue authors: 3
  • Total pull request authors: 1
  • Average comments per issue: 4.75
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • rly (4)
  • libertyh (3)
  • rougier (1)
Pull Request Authors
  • alexrockhill (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 12 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 11
  • Total maintainers: 1
pypi.org: pd-parser

pd-parser: Take a potentially corrupted photodiode channel and find the event time samples at which it turned on.

  • Versions: 11
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 12 Last month
Rankings
Dependent packages count: 10.1%
Dependent repos count: 21.6%
Average: 25.4%
Downloads: 26.6%
Forks count: 29.8%
Stargazers count: 38.8%
Maintainers (1)
Last synced: 4 months ago

Dependencies

docsrc/requirements.txt pypi
  • matplotlib *
  • numpydoc *
  • sphinx_bootstrap_theme *
  • sphinx_gallery *
.github/workflows/main.yml actions
  • actions/checkout v2 composite
  • actions/setup-node v1 composite
  • actions/setup-python v1 composite
  • codecov/codecov-action v1 composite
.github/workflows/python-publish.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
requirements.txt pypi
  • argparse *
  • check-manifest *
  • flake8 *
  • matplotlib *
  • mne >=0.19.1
  • mock *
  • numpy >=1.19.0
  • pybv *
  • pydocstyle *
  • pytest <5.4
  • pytest-cov *
  • pytest-sugar *
  • scipy *
  • tqdm *
setup.py pypi
  • argparse *
  • matplotlib *
  • mne >=0.19.1
  • mne-bids *
  • numpy >=1.19.0
  • pybv *
  • scipy *
  • tqdm *