Git Product home page Git Product logo

biotuner's Introduction

biotuner_logo

Biotuner

Python toolbox that incorporates tools from biological signal processing and musical theory to extract harmonic structures from biosignals.

PyPI Documentation License GitHub stars

๐Ÿงฌ๐ŸŽต Visit the documentation page

Installation

To install Biotuner, follow the steps below:

  1. Create a Python environment with v3.8 using conda:
conda create --name biotuner_env python=3.8
conda activate biotuner_env
  1. Clone the Biotuner repository:
git clone https://github.com/AntoineBellemare/biotuner.git
cd biotuner
  1. Install the package:
pip install -e .

Simple use case

biotuning = biotuner(sf = 1000) #initialize the object
biotuning.peaks_extraction(data, peaks_function='FOOOF') #extract spectral peaks
biotuning.compute_peaks_metrics() #get consonance metrics for spectral peaks

Biotuner_pipeline (6)-page-001

Peaks extraction methods

biotuner_peaks_extraction

biotuner's People

Contributors

antoinebellemare avatar hyruuk avatar sangfrois avatar

Stargazers

amerotz avatar Dominique Makowski avatar Alex avatar  avatar Jacob A Rose avatar D. Benesch avatar  avatar Quanteek avatar

Watchers

 avatar

Forkers

sangfrois

biotuner's Issues

`.gitignore`, requirements and linter

That's some wonderful work and I'm glad to be the first fork of that project! =D

Refactoring the repo

I'm doing a small technical issue to make sure we organize your code properly. I'm putting these tasks in the same issue as they all pertain to code and folder structure ; making sure everything is nice and neat, but mostly readable.

Note : we might want to keep issues as specific as we can. That way, we'll be able to make PR (pull requests) that address these issues iteratively. So here's a relatively thorough description of wanted changes and of the reasons why they should be addressed.

why include a .gitignore

We want to use easy git commands when pushing files, like this :

git status 
git add -a
git commit -m "this change"
git push

Say, you work on a notebook and want to add it with some changes to the README, and whatever other file, while also not wanting to push the .ipynb_checkpoints that comes with. Here's some docs. And a template for python usage.

why include a requirements.txt

We want to make the repo reproducible and get the tests workflow going, so we need all information pertaining to the package/version you use.

Ideally, we'd have a requirements files based directly on the conda/python environment that you are using.
Like this :
pip freeze > requirements.txt

This command essentially allows you to save all the current package/version you are using, but you can write them manually :

# specific version
scipy==14.0.1
# minimum specification
scipy>=13.9.0
# not recommended way that works
scipy

I'm writing bullshit here but you get the gist. You may want to enter you packages manually because the env you're using may contain packages not used in this current project. That or you go back from scratch, create an empty conda/python env and try to run your code after pip installing the packages you think you need, then pip freeze with specific package/versions.

Lintering

Let's forget the details here, but let's remember that conventions in python code are given by the PEP8 style guide. I suggest that we go back on written code and make sure it follows basic recommendation such as : line length (<80 characters), function docs format, proper empty lines and spaces. You'll get the hang of it if you use a proper dev env, as opposed to jupyter script editor or notepad, or any other text editor that's not optimized for the level of software dev you're asking for here.

There's an efficient way to check that : PyLint
I use Atom IDE and added a linter to check my code automatically (it sends error messages where your code does not respect conventions). It should be pre-installed in Windows Visual Code. I encourage you to look it up, or we'll chat it out at some point. Call me whenever, buddy!

I'll make a small PR to address the some changes.

Heavy data is contained in the repo

When installing the toolbox I was surprised that I had to download more than 100Mb of data.
The culprit is here : https://github.com/AntoineBellemare/biotuner/tree/main/examples/Brain_Art_chapter_examples

I suggest you remove the content of that folder from your repo, add the folder path to your .gitignore file, and upload these files somewhere else (e.g. personnal Google Drive ?). You can then provide a link in the README to download these data separately.

For now, everytime the package is installed as a requirement of something else it takes unnecessary time and space.

Error when importing biotuner

Hi, I have the following error when importing:

import biotuner.biotuner2d
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
[c:\Dropbox\Software\try_stuff.py](file:///C:/Dropbox/Software/MuseBSL/try_stuff.py) in line 1
----> [15](file:///c%3A/Dropbox/Software/try_stuff.py?line=14) import biotuner.biotuner2d

File [c:\Users\domma\AppData\Local\Programs\Python\Python311\Lib\site-packages\biotuner\biotuner2d.py:9](file:///C:/Users/domma/AppData/Local/Programs/Python/Python311/Lib/site-packages/biotuner/biotuner2d.py:9)
      [7](file:///c%3A/Users/domma/AppData/Local/Programs/Python/Python311/Lib/site-packages/biotuner/biotuner2d.py?line=6) import secrets
      [8](file:///c%3A/Users/domma/AppData/Local/Programs/Python/Python311/Lib/site-packages/biotuner/biotuner2d.py?line=7) import biotuner
----> [9](file:///c%3A/Users/domma/AppData/Local/Programs/Python/Python311/Lib/site-packages/biotuner/biotuner2d.py?line=8) from biotuner.biotuner_object import compute_peaks_ts
     [10](file:///c%3A/Users/domma/AppData/Local/Programs/Python/Python311/Lib/site-packages/biotuner/biotuner2d.py?line=9) from biotuner.metrics import *
     [11](file:///c%3A/Users/domma/AppData/Local/Programs/Python/Python311/Lib/site-packages/biotuner/biotuner2d.py?line=10) from biotuner.biotuner_utils import (
     [12](file:///c%3A/Users/domma/AppData/Local/Programs/Python/Python311/Lib/site-packages/biotuner/biotuner2d.py?line=11)      AAFT_surrogates, butter_bandpass_filter,
     [13](file:///c%3A/Users/domma/AppData/Local/Programs/Python/Python311/Lib/site-packages/biotuner/biotuner2d.py?line=12)      UnivariateSurrogatesTFT, phaseScrambleTS
     [14](file:///c%3A/Users/domma/AppData/Local/Programs/Python/Python311/Lib/site-packages/biotuner/biotuner2d.py?line=13) )

ImportError: cannot import name 'compute_peaks_ts' from 'biotuner.biotuner_object' (c:\Users\domma\AppData\Local\Programs\Python\Python311\Lib\site-packages\biotuner\biotuner_object.py)

I just downloaded it from pip

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.