ivneuro.nex =========== .. py:module:: ivneuro.nex Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/ivneuro/nex/NexData/index /autoapi/ivneuro/nex/nexfile/index /autoapi/ivneuro/nex/pull_nex_data/index Attributes ---------- .. autoapisummary:: ivneuro.nex.__doc__ Classes ------- .. autoapisummary:: ivneuro.nex.NexData Functions --------- .. autoapisummary:: ivneuro.nex.pull_fp ivneuro.nex.pull_events ivneuro.nex.pull_continuous ivneuro.nex.pull_neurons ivneuro.nex.pull_markers ivneuro.nex.pull_centroids Package Contents ---------------- .. py:data:: __doc__ :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ ivneuro.nex ================= A subpackage for extracting data from nex5 files. It can also extract centroids and local field potentials, which do not have their own types in NeuroExplorer, as a different type from continuous. The NexData class puts together all the functions of this subpackage and creates a NexData object, wich contains the extrated variables as attributes. """ .. raw:: html
.. py:function:: pull_fp(fileData, FP_of_interest=[]) Extract field potential variables from a Nex5 file data, previously created using reader.ReadNex5File(). It assumes that "FP" will be in the name of every field potential variable, which is true for Nex files whose original variables names have not been modified. Therefore, restults of this function might be incorrect for files whose variable names have been modified. It also assumes all field potential variables have the same timestamps and sample rate. :param fileData: Data extracted from a nex5 file using reader.ReadNex5File(). :type fileData: dict :param FP_of_interest: List of names of field potentials to extract. If None, the function returns None; if an empty list, all the field potentials are extracted. The default is []. :type FP_of_interest: list, optional :param Returns: :param Dataframe with field potentials (in mV) in each column and timestaps as index.: :param Sampling rate of local field potentials (float).: .. py:function:: pull_events(fileData, events_of_interest=[]) Extract events from a Nex5 file data, previously created using reader.ReadNex5File(). :param fileData: Data extracted from a nex5 file using reader.ReadNex5File(). :type fileData: dict :param events_of_interest: List of names of events to extract. If None, the function returns None; if an empty list, all the events are extracted. The default is []. :type events_of_interest: list, optional :rtype: Dictionary with event names as keys and list of timestamps as values. .. py:function:: pull_continuous(fileData, continuous_of_interest=[]) Extract all continuous variables, except for field potential variables, from a Nex5 file data previously created using reader.ReadNex5File(). It assumes that "FP" will be in the name of every field potential variable, which is true for Nex files whose original variables names have not been modified. Therefore, restults of this function might be incorrect for files whose variable names have been modified. :param fileData: Data extracted from a nex5 file using reader.ReadNex5File(). :type fileData: dict :param continuous_of_interest: List of names of continuous to extract. If None, the function returns None; if an empty list, all non-field potential continuous variables are extracted. The default is []. :type continuous_of_interest: list, optional :rtype: List of pandas DataFrame, each corresponding to a continuous variable values and timestaps as index. .. py:function:: pull_neurons(fileData, neurons_of_interest=[]) Extract neurons from a Nex5 file data, previously created using reader.ReadNex5File(). :param fileData: Data extracted from a nex5 file using reader.ReadNex5File(). :type fileData: dict :param neurons_of_interest: List of names of events to extract. If None, the function returns None; if an empty list, all the neurons are extracted. The default is []. :type neurons_of_interest: list, optional :rtype: Dictionary with neuron names as keys and list of timestamps as values. .. py:function:: pull_markers(fileData, markers_of_interest=[]) Extract markers from a Nex5 file data, previously created using reader.ReadNex5File(). :param fileData: Data extracted from a nex5 file using reader.ReadNex5File(). :type fileData: dict :param markers_of_interest: List of names of markers to extract. If None, the function returns None; if an empty list, all the markers are extracted. The default is []. :type markers_of_interest: list, optional :rtype: Dictionary with markers names as keys and list of timestamps as values. .. py:function:: pull_centroids(fileData, centroids_of_interest=[]) Extract field potential variables from a Nex5 file data, previously created using reader.ReadNex5File(). It assumes that "centroid" (case insensitive) will be in the name of every centroid variable, which is true for Nex files whose original variables names have not been modified. It also exclude field potential variables that contain the string "FP" in their names. Therefore, restults of this function might be incorrect for files whose variable names have been modified. It also assumes that all centroids have the same timestamps. :param fileData: Data extracted from a nex5 file using reader.ReadNex5File(). :type fileData: dict :param centroids_of_interest: List of names of centroids to extract. If None, the function returns None; if an empty list, all centroid variables are extracted. The default is []. :type centroids_of_interest: list, optional :rtype: Dataframe with centroids in each column and timestaps as index. .. py:class:: NexData(file, FP_of_interest=[], events_of_interest=[], continuous_of_interest=[], neurons_of_interest=[], markers_of_interest=[], centroids_of_interest=[], clear_Nex_data=True) Extract variables from a .Nex5 file. :param file: Complete path of the .Nex5 file to extract data from. :type file: str :param FP_of_interest: List of names of field potentials to extract. If None, nothing is extracted; if an empty list, all the field potentials are extracted. The default is []. :type FP_of_interest: list, optional :param events_of_interest: List of names of events to extract. If None, nothing is extracted; if an empty list, all the events are extracted. The default is []. :type events_of_interest: list, optional :param continuous_of_interest: List of names of continuous to extract. If None, nothing is extracted; if an empty list, all non-field potential continuous variables are extracted. The default is []. :type continuous_of_interest: list, optional :param neurons_of_interest: List of names of events to extract. If None, nothing is extracted; if an empty list, all the neurons are extracted. The default is []. :type neurons_of_interest: list, optional :param markers_of_interest: List of names of markers to extract. If None, nothing is extracted; if an empty list, all the markers are extracted. The default is []. :type markers_of_interest: list, optional :param centroids_of_interest: List of names of centroids to extract. If None, nothing is extracted; if an empty list, all centroid variables are extracted. The default is []. :type centroids_of_interest: list, optional :param clear_Nex_data: If True, data atribute is set to None. Otherwise, result of reader.ReadNex5File(file) is stored in data atribute. The default is True. :type clear_Nex_data: bool, optional .. attribute:: file_path File path of the .Nex5 file the data was extracted from. :type: str .. attribute:: FP Field potentials (in mV) in each column and timestaps as index. :type: pandas.DataFrame .. attribute:: FP_sampling_rate Sampling rate of local field potentials. :type: float .. attribute:: events Event names as keys and list of timestamps as values. :type: dict .. attribute:: continuous Each DataFrame of the list contains a column with the continuous values and the timestamps as index,for every continuous variable (excluding field potentials). :type: list of pandas.DataFrames .. attribute:: neurons Neuron names as keys and list of timestamps as values. :type: dict .. attribute:: markers Markers names as keys and list of timestamps as values. :type: dict .. attribute:: centroids Centroids in each column and timestaps as index. :type: pandas.DataFrame .. method:: clear_fileData() Set data atribute to None. .. py:attribute:: file_path .. py:attribute:: _FP_of_interest :value: [] .. py:attribute:: _events_of_interest :value: [] .. py:attribute:: _continuous_of_interest :value: [] .. py:attribute:: _neurons_of_interest :value: [] .. py:attribute:: _markers_of_interest :value: [] .. py:attribute:: _centroids_of_interest :value: [] .. py:attribute:: _clear_Nex_data :value: True .. py:attribute:: data .. py:attribute:: events :value: None .. py:attribute:: continuous :value: None .. py:attribute:: neurons :value: None .. py:attribute:: markers :value: None .. py:attribute:: centroids .. py:method:: __str__() .. py:method:: __repr__() .. py:method:: _pull_fp(FP_of_interest=[]) .. py:method:: _pull_events(events_of_interest=[]) .. py:method:: _pull_continuous(continuous_of_interest=[]) .. py:method:: _pull_neurons(neurons_of_interest=[]) .. py:method:: _pull_markers(markers_of_interest=[]) .. py:method:: _pull_centroids(centroids_of_interest=[]) .. py:method:: clear_fileData()