Skip to main content

sekupy

example workflow codecov Documentation Status Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. CodeFactor

sekupy is a python-package created for deterging your (dirty) (and) (multivariate) neuroimaging analyses. The package has been thought for decoding analyses but it includes also basic univariate analyses.

It has some utilities to vary sets of parameters of the analyses without struggling with for and if statements.

It deterges your results, by saving them in a safe manner, by also keeping in mind BIDS.

sekupy is the deterged version of pyitab.

Documentation

The documention can be found here.

Install

The package isn't yet on pip. You can install it by using:

python setup.py install

Example

The main idea is to use a dictionary to configure all parameters of your analysis, feed the configuration into an AnalysisPipeline object, call fit to obtain results, then save to store in a BIDS-ish way.

For example if we want to perform a RoiDecoding analysis using some preprocessing steps we will have a script like this (this is not a complete example):

from sekupy.analysis.configurator import AnalysisConfigurator
from sekupy.analysis.pipeline import AnalysisPipeline
from sekupy.analysis.decoding.roi_decoding import RoiDecoding

_default_config = {
                    # Here we specifiy that we have to transform the dataset labels
                    # then select samples and then balance data
                    'prepro': ['target_transformer', 'sample_slicer', 'balancer'],
                    
                    # Here we set which attribute to choose (dataset is a pymvpa dataset)
                    'target_transformer__attr': "image_type",
                    # Here we select samples with a image_type equal to I or O and evidence equal to 1
                    'sample_slicer__attr': {'image_type':["I", "O"], 'evidence':[1]},
                    # Then we say that we want to balance image_type at subject-level
                    "balancer__attr": 'subject',

                    # We setup the estimator in a sklearn way
                    'estimator': [
                        ('fsel', SelectKBest(k=50)),
                        ('clf', SVC(C=1, kernel='linear'))],
                    'estimator__clf__C': 1,
                    'estimator__clf__kernel': 'linear',
                    
                    # Then the cross-validation object (also sklearn)
                    'cv': LeaveOneGroupOut,
                    
                    'scores': ['accuracy'],
                    
                    # Then the analysis
                    'analysis': RoiDecoding,
                    'analysis__n_jobs': -1,
                    
                    'analysis__permutation': 0,
                    
                    'analysis__verbose': 0,
                    
                    # Here we say that we want use the region with value 1 in image+type mask
                    'kwargs__roi_values': [('image+type', [1]), ('image+type', [2]), ('image+type', [3]),
                                            ('image+type', [4]), ('image+type', [5])],
                    
                    # We want to use subject for our cross-validation
                    'kwargs__cv_attr': 'subject'
                    }

configuration = AnalysisConfigurator(**_default_config), 
                                     kind='configuration') 
kwargs = configuration._get_kwargs() 
a = AnalysisPipeline(conf, name="roi_decoding_across_full").fit(ds, **kwargs) 
a.save() 

Surf the code, starting from classes used here!!

Metadata

Release files for sekupy 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sekupy 0.0.1
File Size Uploaded
sekupy-0.0.1.tar.gz 197.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sekupy 0.0.1
File Interpreter ABI Platform
sekupy-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 433.7 kB

Release files / sekupy-0.0.1.tar.gz

Download URL sekupy-0.0.1.tar.gz
Size 197.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c22727006392b25e6edfd8891aa28c85a4f78c44ec46986090cdcf359eaa9e56
BLAKE2b-256 checksum
How to use checksums
e9719c0b3dbeb812df714cff55ee9811f2ff50eeea04f73fba9a5292eaa18b85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release files / sekupy-0.0.1-py3-none-any.whl

Download URL sekupy-0.0.1-py3-none-any.whl
Size 236.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
54b4c9e7d5d0929602e3e13adaabfd176843220eb6e259586e1503f05fd7622e
BLAKE2b-256 checksum
How to use checksums
072b0d9cdde258aea7e8a0dc27ec235aae89425180b8a054a7bb2ad06ff99361
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page