Commits (16)
src/cicada/gui/__pycache__/
src/cicada/preprocessing/__pycache__/
src/cicada/analysis/__pycache__/
src/cicada/__pycache__/
src/cicada/utils/__pycache__/
src/cicada/utils/display/__pycache__/
__pycache__/
CICADA.egg-info/
PyCICADA.egg-info/
dist/
docs/.DS_Store
src/cicada/preprocessing/.DS_Store
src/cicada/utils/.DS_Store
src/cicada/.DS_Store
.DS_Store
......@@ -7,6 +7,6 @@ species: SWISS wild type
subject_id: p6_18_02_07
# in grams
weight: 4.35
# format should be : '%m/%d/%'
# format should be : '%m/%d/%Y'
date_of_birth: 02/01/2018
......@@ -44,7 +44,7 @@ setup(
# For a discussion on single-sourcing the version across setup.py and the
# project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version="1.0.4", # Required
version="1.0.5", # Required
# cmdclass=versioneer.get_cmdclass(),
# This is a one-line description or tagline of what your project does. This
# corresponds to the "Summary" metadata field:
......@@ -145,7 +145,7 @@ setup(
#
# For an analysis of "install_requires" vs pip's requirements files see:
# https://packaging.python.org/en/latest/requirements.html
# install_requires=['peppercorn'], # Optional
# install_requires=[''], # Optional
# List additional groups of dependencies here (e.g. development
# dependencies). Users will be able to install these using the "extras"
......
......@@ -43,4 +43,4 @@ y = (screenGeometry.height() - cicada_main_window.height()) / 2
cicada_main_window.move(x, y)
cicada_main_window.show()
sys.exit(app.exec_())
\ No newline at end of file
sys.exit(app.exec_())
from cicada.analysis.cicada_analysis import CicadaAnalysis
from time import time
class CicadaActivityIntervalsRatioAnalysis(CicadaAnalysis):
def __init__(self):
"""
"""
CicadaAnalysis.__init__(self, name="Activity ratio", family_id="Intervals",
short_description="Activity ratio over intervals")
def check_data(self):
"""
Check the data given one initiating the class and return True if the data given allows the analysis
implemented, False otherwise.
:return: a boolean
"""
super().check_data()
self.invalid_data_help = "Not implemented yet"
return False
if self._data_format != "nwb":
self.invalid_data_help = "Non NWB format compatibility not yet implemented"
return False
# check is raw traces available
return True
def set_arguments_for_gui(self):
"""
Returns:
"""
CicadaAnalysis.set_arguments_for_gui(self)
def update_original_data(self):
"""
To be called if the data to analyse should be updated after the analysis has been run.
:return: boolean: return True if the data has been modified
"""
pass
def run_analysis(self, **kwargs):
"""
testa
:param kwargs:
segmentation
:return:
"""
CicadaAnalysis.run_analysis(self, **kwargs)
start_time = time()
print("Ratio activity over intervals: coming soon...")
n_sessions = len(self._data_to_analyse)
self.update_progressbar(start_time, 100 / n_sessions)
......@@ -8,6 +8,8 @@ from qtpy.QtCore import QThread
from datetime import datetime
import sys
import os
from time import time
import numpy as np
class CicadaAnalysis(ABC):
"""
......@@ -48,6 +50,8 @@ class CicadaAnalysis(ABC):
# attribute that will be used to display the reason why the analysis is not possible with the given
# data passed to it
self.invalid_data_help = None
# Initialized in run_analysis, can be used to save in the log file the run time.
self.analysis_start_time = 0
self.analysis_arguments_handler = AnalysisArgumentsHandler(cicada_analysis=self)
# path of the dir where the results will be saved
......@@ -134,8 +138,8 @@ class CicadaAnalysis(ABC):
data_to_analyse = [data_to_analyse]
self._data_to_analyse = data_to_analyse
self._data_format = data_format
if self.gui:
self.set_arguments_for_gui()
# set_arguments_for_gui cllaed in analysis_tree_gui when double_clicked is called
# self.set_arguments_for_gui()
@abstractmethod
def check_data(self):
......@@ -169,6 +173,9 @@ class CicadaAnalysis(ABC):
create the attribution for results_path
:return: None
"""
if not self.gui:
return
# creating a new AnalysisArgumentsHandler instance
self.analysis_arguments_handler = AnalysisArgumentsHandler(cicada_analysis=self)
# we order_index at 1000 for it to be displayed at the end
......@@ -206,6 +213,8 @@ class CicadaAnalysis(ABC):
:param kwargs:
:return:
"""
self.analysis_start_time = time()
if "results_path" in kwargs:
results_path = kwargs["results_path"]
if self._results_path is None:
......@@ -228,10 +237,78 @@ class CicadaAnalysis(ABC):
new_set_value (float): Value that should be set as the current value of the progress bar
"""
time_elapsed = time() - time_started
if self.gui:
worker = QThread.currentThread()
worker.setProgress(name=worker.name, time_started=time_started, increment_value=increment_value,
worker.setProgress(name=worker.name, time_elapsed=time_elapsed, increment_value=increment_value,
new_set_value=new_set_value)
else:
pass
def add_ci_movie_arg_for_gui(self, long_description=None):
"""
Will add an argument for gui, named ci_movie that will list all calcium imaging available for each session
Returns:
"""
ci_movies_dict_for_arg = dict()
for data in self._data_to_analyse:
ci_movies_dict = data.get_ci_movies(only_2_photons=False)
for movie_id in ci_movies_dict.keys():
# we put the identifier of each movie as values
ci_movies_dict_for_arg[data.identifier] = movie_id
ci_movie_arg = {"arg_name": "ci_movie", "choices": ci_movies_dict_for_arg,
"short_description": "Calcium imaging movie to use", "mandatory": False,
"multiple_choices": False}
if long_description is not None:
ci_movie_arg.update({"long_description": long_description})
self.add_argument_for_gui(**ci_movie_arg)
def add_segmentation_arg_for_gui(self):
"""
Will add an argument for gui, named segmentation that will list all segmentations available for each session
Returns:
"""
segmentation_dict_for_arg = dict()
for data in self._data_to_analyse:
segmentation_dict_for_arg[data.identifier] = data.get_segmentations()
# not mandatory, because one of the element will be selected by the GUI
segmentation_arg = {"arg_name": "segmentation", "choices": segmentation_dict_for_arg,
"short_description": "Segmentation to use", "mandatory": False,
"multiple_choices": False}
self.add_argument_for_gui(**segmentation_arg)
def add_roi_response_series_arg_for_gui(self, short_description, long_description=None):
rrs_dict_for_arg = dict()
for data in self._data_to_analyse:
rrs_dict_for_arg[data.identifier] = data.get_roi_response_series()
rrs_arg = {"arg_name": "roi_response_series", "choices": rrs_dict_for_arg,
"short_description": short_description, "mandatory": False,
"multiple_choices": False}
if long_description is not None:
rrs_arg.update({"long_description": long_description})
self.add_argument_for_gui(**rrs_arg)
def add_intervals_arg_for_gui(self, short_description, arg_name="intervals", long_description=None):
intervals_dict_for_arg = dict()
for data in self._data_to_analyse:
intervals_dict_for_arg[data.identifier] = data.get_intervals_names()
intervals_arg = {"arg_name": arg_name, "choices": intervals_dict_for_arg,
"short_description": short_description, "mandatory": False,
"multiple_choices": False}
if long_description is not None:
intervals_arg.update({"long_description": long_description})
self.add_argument_for_gui(**intervals_arg)
......@@ -2,6 +2,7 @@ from qtpy.QtWidgets import *
from qtpy.QtCore import Qt
# to import the Widgets for the GUI
from cicada.gui.cicada_analysis_parameters_gui import *
from cicada.utils.constants import CICADA_VERSION
import yaml
......@@ -58,7 +59,8 @@ class AnalysisArgument:
self._widget = FileDialogWidget(analysis_arg=self, directory_only=True)
return self._widget
elif getattr(self, "value_type", None) == "file":
self._widget = FileDialogWidget(analysis_arg=self, directory_only=False)
extensions = getattr(self, "extensions", None)
self._widget = FileDialogWidget(analysis_arg=self, directory_only=False, extensions=extensions)
return self._widget
elif getattr(self, "value_type", None) == "color":
self._widget = ColorDialogWidget(analysis_arg=self, show_alpha_channel=False)
......@@ -87,6 +89,14 @@ class AnalysisArgument:
"""
self._final_value = self.get_argument_value()
def get_family_widget(self):
"""
Return a string reprenting the family widget to which this argument belongs, or None if it doesn't belong to any
:return:
"""
return getattr(self, "family_widget", None)
def get_all_attributes(self):
"""
Return a dict containing all attributes of this argument except for the widget one
......@@ -332,30 +342,8 @@ class AnalysisArgumentsHandler:
session_identifiers = [session.identifier for session in self.cicada_analysis.get_data_to_analyse()]
analysis_args_for_yaml["session_identifiers"] = session_identifiers
for arg_name, analysis_arg in self.args_dict.items():
analysis_args_for_yaml[arg_name] = analysis_arg.get_all_attributes()
if (not yaml_file_name.endswith(".yaml")) and (not yaml_file_name.endswith(".yml")):
yaml_file_name = yaml_file_name + ".yaml"
with open(os.path.join(path_dir, yaml_file_name), 'w') as outfile:
yaml.dump(analysis_args_for_yaml, outfile, default_flow_style=False)
def save_user_param_to_yaml_file(self, yaml_file_name, dir_name):
"""
Save parameters under the name given by the user in the corresponding analysis directory. Parent directory is
set up in the config YAML
Args:
yaml_file_name (str): Name given to the parameter file
dir_name (str): Path where the file will be saved
"""
analysis_args_for_yaml = dict()
# first we add the subjects id
session_identifiers = [session.identifier for session in self.cicada_analysis.get_data_to_analyse()]
analysis_args_for_yaml["session_identifiers"] = session_identifiers
# then we add the version of CICADA used
analysis_args_for_yaml["CICADA_VERSION"] = CICADA_VERSION
for arg_name, analysis_arg in self.args_dict.items():
analysis_args_for_yaml[arg_name] = analysis_arg.get_all_attributes()
......@@ -363,10 +351,10 @@ class AnalysisArgumentsHandler:
if (not yaml_file_name.endswith(".yaml")) and (not yaml_file_name.endswith(".yml")):
yaml_file_name = yaml_file_name + ".yaml"
if not os.path.isdir(dir_name):
os.mkdir(dir_name)
if not os.path.isdir(path_dir):
os.mkdir(path_dir)
with open(os.path.join(dir_name, yaml_file_name), 'w') as outfile:
with open(os.path.join(path_dir, yaml_file_name), 'w') as outfile:
yaml.dump(analysis_args_for_yaml, outfile, default_flow_style=False)
def load_analysis_argument_from_yaml_file(self, file_name):
......@@ -381,7 +369,7 @@ class AnalysisArgumentsHandler:
"""
with open(file_name, 'r') as stream:
analysis_args_from_yaml = yaml.load(stream)
analysis_args_from_yaml = yaml.load(stream, Loader=yaml.FullLoader)
# sys.stderr.write(f"{analysis_args_from_yaml}")
for arg_name, args_content in analysis_args_from_yaml.items():
......@@ -439,18 +427,54 @@ class AnalysisArgumentsHandler:
"""
pass
def get_gui_widgets(self):
def get_gui_widgets(self, group_by_family=False):
"""
Get the list of widgets necessary to fill the arguments for the cicada analysis associated
Args:
group_by_family: if True, group the widgets in one widget to be grouped together if they belong to the same
family. AnalysisArgument will have an attribute named family_widget whose value is a string.
Returns:
"""
gui_widgets = []
analysis_arguments = self.get_analysis_arguments(sorted=True)
if not group_by_family:
for analysis_argument in analysis_arguments:
widget = analysis_argument.get_gui_widget()
if widget:
gui_widgets.append(widget)
return gui_widgets
# first we get all the families present
family_widgets_dict = dict()
# we're keeping just the first arg of each family and other args not in family, just to keep the order of the
# args
analysis_arguments_filtered = []
for analysis_argument in analysis_arguments:
widget = analysis_argument.get_gui_widget()
if widget:
gui_widgets.append(widget)
family_widget = analysis_argument.get_family_widget()
if family_widget is not None:
if family_widget in family_widgets_dict:
family_widgets_dict[family_widget].append(analysis_argument)
else:
family_widgets_dict[family_widget] = [analysis_argument]
analysis_arguments_filtered.append(analysis_argument)
else:
analysis_arguments_filtered.append(analysis_argument)
for analysis_argument in analysis_arguments_filtered:
family_widget = analysis_argument.get_family_widget()
if family_widget is not None:
family_gui_widgets = []
for a_a_in_family in family_widgets_dict[family_widget]:
widget = a_a_in_family.get_gui_widget()
if widget:
family_gui_widgets.append(widget)
# building the widget that will contain those of the same family
gui_widgets.append(SameFamilyWidgetsContainer(widgets=family_gui_widgets))
else:
widget = analysis_argument.get_gui_widget()
if widget:
gui_widgets.append(widget)
return gui_widgets
def check_arguments_validity(self):
......@@ -460,7 +484,7 @@ class AnalysisArgumentsHandler:
"""
for arg_name, analysis_argument in self.args_dict.items():
value = analysis_argument.get_argument_value()
if analysis_argument.is_mandatory and (value is None):
if analysis_argument.is_mandatory() and (value is None):
return False
return True
......
......@@ -33,10 +33,69 @@ class CicadaAnalysisFormatWrapper(ABC):
"""
pass
# it's only need to providing an implementation only for the getter in the class works and allows for instantiation
# it's only needed to provide an implementation only for the getter in the class works and allows for instantiation
@property
@abstractmethod
def identifier(self):
"""
Identifier of the session
:return:
"""
pass
# it's only needed to provide an implementation only for the getter in the class works and allows for instantiation
@property
@abstractmethod
def age(self):
"""
Age of the subject
:return: None if age unknown
"""
pass
@property
@abstractmethod
def genotype(self):
"""
Genotype of the subject
:return: None if age unknown
"""
pass
@property
@abstractmethod
def species(self):
"""
Species of the subject
:return: None if age unknown
"""
pass
@property
@abstractmethod
def subject_id(self):
"""
Id of the subject
:return: None if age unknown
"""
pass
@property
@abstractmethod
def weight(self):
"""
Id of the subject
:return: None if age unknown
"""
pass
@property
@abstractmethod
def sex(self):
"""
Sex (gender) of the subject
:return: None if sex unknown
"""
pass
# @identifier.setter
......@@ -44,6 +103,8 @@ class CicadaAnalysisFormatWrapper(ABC):
# def identifier(self):
# pass
@abstractmethod
def get_segmentations(self):
"""
......@@ -55,6 +116,19 @@ class CicadaAnalysisFormatWrapper(ABC):
"""
pass
@abstractmethod
def get_roi_response_series(self):
"""
Returns: a list or dict of objects representing all roi response series (rrs) names
rrs could represents raw traces, or binary raster, and its link to a given segmentation.
The results returned should allow to identify the segmentation associated.
Object could be strings, or a list of strings, that identify a rrs and give information
how to get there.
"""
pass
@abstractmethod
def get_pixel_mask(self, segmentation_info):
"""
......@@ -105,3 +179,12 @@ class CicadaAnalysisFormatWrapper(ABC):
"""
pass
@abstractmethod
def get_intervals_names(self):
"""
Return a list representing the intervals contains in this data
Returns:
"""
pass
from cicada.analysis.cicada_analysis_format_wrapper import CicadaAnalysisFormatWrapper
from pynwb.ophys import ImageSegmentation, TwoPhotonSeries
from pynwb.ophys import ImageSegmentation, TwoPhotonSeries, Fluorescence
from pynwb.image import ImageSeries
import os
from pynwb import NWBHDF5IO
......@@ -26,6 +26,42 @@ class CicadaAnalysisNwbWrapper(CicadaAnalysisFormatWrapper):
def identifier(self):
return self._nwb_data.identifier
@property
def age(self):
return self._nwb_data.subject.age
@property
def genotype(self):
return self._nwb_data.subject.genotype
@property
def species(self):
return self._nwb_data.subject.species
@property
def subject_id(self):
"""
Id of the subject
:return: None if subject_id unknown
"""
return self._nwb_data.subject.subject_id
@property
def weight(self):
"""
Id of the subject
:return: None if weight unknown
"""
return self._nwb_data.subject.weight
@property
def sex(self):
"""
Sex (gender) of the subject
:return: None if sex unknown
"""
return self._nwb_data.subject.sex
def get_segmentations(self):
"""
......@@ -36,7 +72,6 @@ class CicadaAnalysisNwbWrapper(CicadaAnalysisFormatWrapper):
"""
segmentation_dict = dict()
for name_mod, mod in self._nwb_data.modules.items():
# mod = self._nwb_data.modules['ophys']
segmentation_dict[name_mod] = dict()
for key, value in mod.data_interfaces.items():
# we want to check that the object in Module is an Instance of ImageSegmentation
......@@ -50,6 +85,27 @@ class CicadaAnalysisNwbWrapper(CicadaAnalysisFormatWrapper):
# it could be empty, but if it would matter, it should have been check by method check_data in CicadaAnalysis
return segmentation_dict
def get_roi_response_series(self):
"""
Returns: a list or dict of objects representing all roi response series (rrs) names
rrs could represents raw traces, or binary raster, and its link to a given segmentation.
The results returned should allow to identify the segmentation associated.
Object could be strings, or a list of strings, that identify a rrs and give information
how to get there.
"""
rrs_dict = dict()
for name_mod, mod in self._nwb_data.modules.items():
rrs_dict[name_mod] = dict()
for key, fluorescence in mod.data_interfaces.items():
# we want to check that the object in Module is an Instance of pynwb.ophys.Fluorescence
if isinstance(fluorescence, Fluorescence):
rrs_dict[name_mod][key] = []
for name_rrs, rrs in fluorescence.roi_response_series.items():
rrs_dict[name_mod][key].append(name_rrs)
return rrs_dict
def get_pixel_mask(self, segmentation_info):
"""
Return pixel_mask which is a list of list of pair of integers representing the pixels coordinate (x, y) for each
......@@ -139,3 +195,24 @@ class CicadaAnalysisNwbWrapper(CicadaAnalysisFormatWrapper):
"""
return session_data.identifier
def get_intervals_names(self):
"""
Return a list representing the intervals contains in this data
Returns:
"""
if self._nwb_data.intervals is None:
return []
intervals = []
for name_interval in self._nwb_data.intervals.keys():
intervals.append(name_interval)
return intervals
def __str__(self):
"""
Return a string representing the session. Here session.identifier
:return:
"""
return self._nwb_data.identifier
from cicada.analysis.cicada_analysis import CicadaAnalysis
from time import time
class CicadaAssembliesCoreAnalysis(CicadaAnalysis):
def __init__(self):
"""
"""
CicadaAnalysis.__init__(self, name="CORE", family_id="Assemblies detection",
short_description="Miller et al. 2014 Proc Natl Acad Sci USA") # Proc Natl Acad Sci USA
def check_data(self):
"""
Check the data given one initiating the class and return True if the data given allows the analysis
implemented, False otherwise.
:return: a boolean
"""
super().check_data()
self.invalid_data_help = "Not implemented yet"
return False
if self._data_format != "nwb":
self.invalid_data_help = "Non NWB format compatibility not yet implemented"
return False
return True
def set_arguments_for_gui(self):
"""
Returns:
"""
CicadaAnalysis.set_arguments_for_gui(self)
def update_original_data(self):
"""
To be called if the data to analyse should be updated after the analysis has been run.
:return: boolean: return True if the data has been modified
"""
pass
def run_analysis(self, **kwargs):
"""
test
:param kwargs:
segmentation
:return:
"""
CicadaAnalysis.run_analysis(self, **kwargs)
start_time = time()
print("CORE assemblies detection: coming soon...")
n_sessions = len(self._data_to_analyse)
self.update_progressbar(start_time, 100 / n_sessions)
from cicada.analysis.cicada_analysis import CicadaAnalysis
from time import time
class CicadaAssembliesGonzalezAnalysis(CicadaAnalysis):
def __init__(self):
"""
"""
CicadaAnalysis.__init__(self, name="Similarity Graph Clustering", family_id="Assemblies detection",
short_description="Gonzalez et al. 2019 Science")
def check_data(self):
"""
Check the data given one initiating the class and return True if the data given allows the analysis
implemented, False otherwise.
:return: a boolean
"""
super().check_data()
self.invalid_data_help = "Not implemented yet"
return False
if self._data_format != "nwb":
self.invalid_data_help = "Non NWB format compatibility not yet implemented"
return False
# check is raw traces available
return True
def set_arguments_for_gui(self):
"""
Returns:
"""
CicadaAnalysis.set_arguments_for_gui(self)
def update_original_data(self):
"""
To be called if the data to analyse should be updated after the analysis has been run.
:return: boolean: return True if the data has been modified
"""
pass
def run_analysis(self, **kwargs):
"""
test
:param kwargs:
segmentation
:return:
"""
CicadaAnalysis.run_analysis(self, **kwargs)
start_time = time()
print("SGC assemblies detection: coming soon...")
n_sessions = len(self._data_to_analyse)
self.update_progressbar(start_time, 100 / n_sessions)
from cicada.analysis.cicada_analysis import CicadaAnalysis
from time import time
class CicadaAssembliesIcaCsAnalysis(CicadaAnalysis):
def __init__(self):
"""
"""
CicadaAnalysis.__init__(self, name="ICA Circular Shift", family_id="Assemblies detection",
short_description="Lopes-dos-Santos et al. 2013") # J Neurosci Methods
def check_data(self):
"""
Check the data given one initiating the class and return True if the data given allows the analysis
implemented, False otherwise.
:return: a boolean
"""
super().check_data()
self.invalid_data_help = "Not implemented yet"
return False
if self._data_format != "nwb":
self.invalid_data_help = "Non NWB format compatibility not yet implemented"
return False
# check is raw traces available
return True
def set_arguments_for_gui(self):
"""
Returns:
"""
CicadaAnalysis.set_arguments_for_gui(self)
def update_original_data(self):
"""
To be called if the data to analyse should be updated after the analysis has been run.
:return: boolean: return True if the data has been modified
"""
pass
def run_analysis(self, **kwargs):
"""
test
:param kwargs:
segmentation
:return:
"""
CicadaAnalysis.run_analysis(self, **kwargs)
start_time = time()
print("ICA-CS assemblies detection: coming soon...")
n_sessions = len(self._data_to_analyse)
self.update_progressbar(start_time, 100 / n_sessions)
from cicada.analysis.cicada_analysis import CicadaAnalysis
from time import time
class CicadaAssembliesIcaMpAnalysis(CicadaAnalysis):
def __init__(self):
"""
"""
CicadaAnalysis.__init__(self, name="ICA Marcenko-Pastur", family_id="Assemblies detection",
short_description="Molter et al. 2018 BMC Biology")
def check_data(self):
"""
Check the data given one initiating the class and return True if the data given allows the analysis
implemented, False otherwise.
:return: a boolean
"""
super().check_data()
self.invalid_data_help = "Not implemented yet"
return False
if self._data_format != "nwb":
self.invalid_data_help = "Non NWB format compatibility not yet implemented"
return False
# check is raw traces available
return True
def set_arguments_for_gui(self):
"""
Returns:
"""
CicadaAnalysis.set_arguments_for_gui(self)
def update_original_data(self):
"""
To be called if the data to analyse should be updated after the analysis has been run.
:return: boolean: return True if the data has been modified
"""
pass
def run_analysis(self, **kwargs):
"""
test
:param kwargs:
segmentation
:return:
"""
CicadaAnalysis.run_analysis(self, **kwargs)
start_time = time()
print("ICA-MP assemblies detection: coming soon...")
n_sessions = len(self._data_to_analyse)
self.update_progressbar(start_time, 100 / n_sessions)
from cicada.analysis.cicada_analysis import CicadaAnalysis
from time import time
class CicadaAssembliesMalvacheAnalysis(CicadaAnalysis):
def __init__(self):
"""
"""
CicadaAnalysis.__init__(self, name="Malvache's method", family_id="Assemblies detection",
short_description="Malvache et al. 2016 Science")
def check_data(self):
"""
Check the data given one initiating the class and return True if the data given allows the analysis
implemented, False otherwise.
:return: a boolean
"""
super().check_data()
self.invalid_data_help = "Not implemented yet"
return False
if self._data_format != "nwb":
self.invalid_data_help = "Non NWB format compatibility not yet implemented"
return False
# check is raw traces available
return True
def set_arguments_for_gui(self):
"""
Returns:
"""
CicadaAnalysis.set_arguments_for_gui(self)
def update_original_data(self):
"""
To be called if the data to analyse should be updated after the analysis has been run.
:return: boolean: return True if the data has been modified
"""
pass
def run_analysis(self, **kwargs):
"""
test
:param kwargs:
segmentation
:return:
"""
CicadaAnalysis.run_analysis(self, **kwargs)
start_time = time()
print("Malvache assemblies detection: coming soon...")
n_sessions = len(self._data_to_analyse)
self.update_progressbar(start_time, 100 / n_sessions)
from cicada.analysis.cicada_analysis import CicadaAnalysis
from time import time
class CicadaAssembliesPromaxCsAnalysis(CicadaAnalysis):
def __init__(self):
"""
"""
CicadaAnalysis.__init__(self, name="Promax Circular Shift", family_id="Assemblies detection",
short_description="Romano et al. 2015 Neuron")
def check_data(self):
"""
Check the data given one initiating the class and return True if the data given allows the analysis
implemented, False otherwise.
:return: a boolean
"""
super().check_data()
self.invalid_data_help = "Not implemented yet"
return False
if self._data_format != "nwb":
self.invalid_data_help = "Non NWB format compatibility not yet implemented"
return False
# check is raw traces available
return True
def set_arguments_for_gui(self):
"""
Returns:
"""
CicadaAnalysis.set_arguments_for_gui(self)
def update_original_data(self):
"""
To be called if the data to analyse should be updated after the analysis has been run.
:return: boolean: return True if the data has been modified
"""
pass
def run_analysis(self, **kwargs):
"""
test
:param kwargs:
segmentation
:return:
"""
CicadaAnalysis.run_analysis(self, **kwargs)
start_time = time()
print("Promax CS assemblies detection: coming soon...")
n_sessions = len(self._data_to_analyse)
self.update_progressbar(start_time, 100 / n_sessions)
from cicada.analysis.cicada_analysis import CicadaAnalysis
from time import time
class CicadaAssembliesPromaxMpAnalysis(CicadaAnalysis):
def __init__(self):
"""
"""
CicadaAnalysis.__init__(self, name="Promax Marcenko-Pastur", family_id="Assemblies detection",
short_description="Molter et al. 2018 BMC Biology")
def check_data(self):
"""
Check the data given one initiating the class and return True if the data given allows the analysis
implemented, False otherwise.
:return: a boolean
"""
super().check_data()
self.invalid_data_help = "Not implemented yet"
return False
if self._data_format != "nwb":
self.invalid_data_help = "Non NWB format compatibility not yet implemented"
return False
# check is raw traces available
return True
def set_arguments_for_gui(self):
"""
Returns:
"""
CicadaAnalysis.set_arguments_for_gui(self)
def update_original_data(self):
"""
To be called if the data to analyse should be updated after the analysis has been run.
:return: boolean: return True if the data has been modified
"""
pass
def run_analysis(self, **kwargs):
"""
test
:param kwargs:
segmentation
:return:
"""
CicadaAnalysis.run_analysis(self, **kwargs)
start_time = time()
print("Promax MP assemblies detection: coming soon...")
n_sessions = len(self._data_to_analyse)
self.update_progressbar(start_time, 100 / n_sessions)
from cicada.analysis.cicada_analysis import CicadaAnalysis
from time import time
class CicadaAssembliesRussoAnalysis(CicadaAnalysis):
def __init__(self):
"""
"""
CicadaAnalysis.__init__(self, name="Russo's method", family_id="Assemblies detection",
short_description="Russo et al. 2017 Elife")
def check_data(self):
"""
Check the data given one initiating the class and return True if the data given allows the analysis
implemented, False otherwise.
:return: a boolean
"""
super().check_data()
self.invalid_data_help = "Not implemented yet"
return False
if self._data_format != "nwb":
self.invalid_data_help = "Non NWB format compatibility not yet implemented"
return False
# check is raw traces available
return True
def set_arguments_for_gui(self):
"""
Returns:
"""
CicadaAnalysis.set_arguments_for_gui(self)
def update_original_data(self):
"""
To be called if the data to analyse should be updated after the analysis has been run.
:return: boolean: return True if the data has been modified
"""
pass
def run_analysis(self, **kwargs):
"""
test
:param kwargs:
segmentation
:return:
"""
CicadaAnalysis.run_analysis(self, **kwargs)
start_time = time()
print("Russo assemblies detection: coming soon...")
n_sessions = len(self._data_to_analyse)
self.update_progressbar(start_time, 100 / n_sessions)
from cicada.analysis.cicada_analysis import CicadaAnalysis
from time import time
class CicadaAssembliesSgcAnalysis(CicadaAnalysis):
def __init__(self):
"""
"""
CicadaAnalysis.__init__(self, name="Similarity Graph Clustering", family_id="Assemblies detection",
short_description="Avitan et al. 2015 Curr Biol")
def check_data(self):
"""
Check the data given one initiating the class and return True if the data given allows the analysis
implemented, False otherwise.
:return: a boolean
"""
super().check_data()
self.invalid_data_help = "Not implemented yet"
return False
if self._data_format != "nwb":
self.invalid_data_help = "Non NWB format compatibility not yet implemented"
return False
# check is raw traces available
return True
def set_arguments_for_gui(self):
"""
Returns:
"""
CicadaAnalysis.set_arguments_for_gui(self)
def update_original_data(self):
"""
To be called if the data to analyse should be updated after the analysis has been run.
:return: boolean: return True if the data has been modified
"""
pass
def run_analysis(self, **kwargs):
"""
test
:param kwargs:
segmentation
:return:
"""
CicadaAnalysis.run_analysis(self, **kwargs)
start_time = time()
print("SGC assemblies detection: coming soon...")
n_sessions = len(self._data_to_analyse)
self.update_progressbar(start_time, 100 / n_sessions)
from cicada.analysis.cicada_analysis import CicadaAnalysis
from time import time
class CicadaAssembliesSvdAnalysis(CicadaAnalysis):
def __init__(self):
"""
"""
CicadaAnalysis.__init__(self, name="SVD", family_id="Assemblies detection",
short_description="Carrillo-Reid et al. 2015 Neurosci. 2015")
def check_data(self):
"""
Check the data given one initiating the class and return True if the data given allows the analysis
implemented, False otherwise.
:return: a boolean
"""
super().check_data()
self.invalid_data_help = "Not implemented yet"
return False
if self._data_format != "nwb":
self.invalid_data_help = "Non NWB format compatibility not yet implemented"
return False
# check is raw traces available
return True
def set_arguments_for_gui(self):
"""
Returns:
"""
CicadaAnalysis.set_arguments_for_gui(self)
def update_original_data(self):
"""
To be called if the data to analyse should be updated after the analysis has been run.
:return: boolean: return True if the data has been modified
"""
pass
def run_analysis(self, **kwargs):
"""
testa
:param kwargs:
segmentation
:return:
"""
CicadaAnalysis.run_analysis(self, **kwargs)
start_time = time()
print("SVD assemblies detection: coming soon...")
n_sessions = len(self._data_to_analyse)
self.update_progressbar(start_time, 100 / n_sessions)
from cicada.analysis.cicada_analysis import CicadaAnalysis
from time import time
class CicadaAssembliesTavoniAnalysis(CicadaAnalysis):
def __init__(self):
"""
"""
CicadaAnalysis.__init__(self, name="Connectivity-based model", family_id="Assemblies detection",
short_description="Tavoni et al. 2016 J Comput Neurosci")
def check_data(self):
"""
Check the data given one initiating the class and return True if the data given allows the analysis
implemented, False otherwise.
:return: a boolean
"""
super().check_data()
self.invalid_data_help = "Not implemented yet"
return False
if self._data_format != "nwb":
self.invalid_data_help = "Non NWB format compatibility not yet implemented"
return False
# check is raw traces available
return True
def set_arguments_for_gui(self):
"""
Returns:
"""
CicadaAnalysis.set_arguments_for_gui(self)
def update_original_data(self):
"""
To be called if the data to analyse should be updated after the analysis has been run.
:return: boolean: return True if the data has been modified
"""
pass
def run_analysis(self, **kwargs):
"""
testa
:param kwargs:
segmentation
:return:
"""
CicadaAnalysis.run_analysis(self, **kwargs)
start_time = time()
print("Tavoni assemblies detection: coming soon...")
n_sessions = len(self._data_to_analyse)
self.update_progressbar(start_time, 100 / n_sessions)