Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision bc6bc5271ca8c2cbf8107bdf243352e543f64b8e authored by Brian Angeles (Desktop) on 20 March 2023, 22:34:45 UTC, committed by Brian Angeles (Desktop) on 20 March 2023, 22:34:45 UTC
Added .gitignore file and removed RigChoice.s2s
As a first step to generalizing the code, we removed the need to
comment/uncomment the appropriate rig-specific parameters file and
replace it with a local rig_config.s2s file that is ignored by Git. This
way, changes can be made to this simple file without affecting the
Github repository at all.
1 parent 3d78fa7
  • Files
  • Changes
  • 9b50c67
  • /
  • Projects
  • /
  • Boris - Photometry
  • /
  • Max Code
  • /
  • BorisAnalysisRevised.m
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
revision badge
swh:1:rev:bc6bc5271ca8c2cbf8107bdf243352e543f64b8e
directory badge
swh:1:dir:233eac2eaf9fd131d6456a478c2013586df2a5cd
content badge
swh:1:cnt:d0255c50506a33f30713e5e9421df1b83c8dc9e3

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
BorisAnalysisRevised.m

%% Set Up
clear;clc;close all

% read table and set up parameters
table = readtable('Z:\1_Maxwell_Gagnon\ProjectData_Amin\Boris Recordings\Experiment 2\SegInfo.xlsx');
struct = table2struct(table);
direction = {'L', 'R'};
lightGreen = [117 187 49] ./ 255;

% 0: no filtering, 1: filtering
filter = 0;


%% Run Segments
for iii = 1:length(struct)
    %% Import Data
    switch struct(iii).recNum
        case 1
            load('Z:\1_Maxwell_Gagnon\ProjectData_Amin\Boris Recordings\Experiment 2\drive-download-20180713T210854Z-001\Raymond_071318_LFP_M1\Recording_1\MATLAB Variables\MATLAB Variables_100Hz.mat')
            load('Z:\1_Maxwell_Gagnon\ProjectData_Amin\Boris Recordings\Experiment 2\drive-download-20180713T210854Z-001\Raymond_071318_LFP_M1\Recording_1\MATLAB Variables\MATLAB Variables_100Hz405.mat')
            Chan_405_Control = debleach;
            load('Z:\1_Maxwell_Gagnon\ProjectData_Amin\Boris Recordings\Experiment 2\drive-download-20180713T210854Z-001\Raymond_071318_LFP_M1\Recording_1\MATLAB Variables\MATLAB Variables_100Hz472.mat')
            Chan_472_GCaMP = debleach;
        case 2
            load('Z:\1_Maxwell_Gagnon\ProjectData_Amin\Boris Recordings\Experiment 2\drive-download-20180713T210854Z-001\Raymond_071318_LFP_M1\Recording_2\MATLAB Variables\MATLAB Variables_100Hz.mat')
            load('Z:\1_Maxwell_Gagnon\ProjectData_Amin\Boris Recordings\Experiment 2\drive-download-20180713T210854Z-001\Raymond_071318_LFP_M1\Recording_2\MATLAB Variables\MATLAB Variables_100Hz405.mat')
            Chan_405_Control = debleach;
            load('Z:\1_Maxwell_Gagnon\ProjectData_Amin\Boris Recordings\Experiment 2\drive-download-20180713T210854Z-001\Raymond_071318_LFP_M1\Recording_2\MATLAB Variables\MATLAB Variables_100Hz472.mat')
            Chan_472_GCaMP = debleach;
        case 3
            load('Z:\1_Maxwell_Gagnon\ProjectData_Amin\Boris Recordings\Experiment 2\drive-download-20180713T210854Z-001\Raymond_071318_LFP_M2\Recording_1\MATLAB Variables\MATLAB Variables_100Hz.mat')
            load('Z:\1_Maxwell_Gagnon\ProjectData_Amin\Boris Recordings\Experiment 2\drive-download-20180713T210854Z-001\Raymond_071318_LFP_M2\Recording_1\MATLAB Variables\MATLAB Variables_100Hz405.mat')
            Chan_405_Control = debleach;
            load('Z:\1_Maxwell_Gagnon\ProjectData_Amin\Boris Recordings\Experiment 2\drive-download-20180713T210854Z-001\Raymond_071318_LFP_M2\Recording_1\MATLAB Variables\MATLAB Variables_100Hz472.mat')
            Chan_472_GCaMP = debleach;
    end
    
    %% Create Difference Channel
    Chan_Diff = Chan_472_GCaMP - Chan_405_Control;
    
    %% Filtering
    if filter
        Chan_405_Control = smooth(Chan_405_Control, 10);
        Chan_472_GCaMP = smooth(Chan_472_GCaMP, 10);
        Chan_Diff = smooth(Chan_Diff, 10);
    end
    
    %% Matrix of Segments (Normal)
    if ~(struct(iii).special)
        
        offset = struct(iii).segLen / 4;
        startT = camtime(struct(iii).start) * 100 + offset;
        endT = camtime(struct(iii).stop) * 100;

        segMat_405_Control  = vec2mat(Chan_405_Control(startT:endT),struct(iii).segLen, NaN);
        segMat_472_GCaMP    = vec2mat(Chan_472_GCaMP(startT:endT),struct(iii).segLen, NaN);
        segMat_Diff         = vec2mat(Chan_Diff(startT:endT),struct(iii).segLen, NaN);
        
    %% Matrix of Segments (Special) TODO
    else
        disp('APPLES')
        continue
%         % this vector contains pause lengths
%         m2r1s1 = [0 0 0 4 1 1 1 1 1 1 1 1 4 2  2 2 2 2 2 2  2  2  2 2];
%         % add time for movement
%         m2r1s1 = m2r1s1 + 2;
%         % this vector contains pause lengths
%         m2r1s2 = [3 5 5 5 6 5 4 4 3 4 3 3 4 15 7 9 6 6 7 12 10 14 7 9 17];
%         % add time for movement
%         m2r1s2 = m2r1s2 + 2;
%         
%         segment = m2r1s2;
%         
%         % pre-alocate
%         %R_matrix = NaN(length(segment), (2+max(segment))*400);
%         %L_matrix = NaN(length(segment), (2+max(segment))*400);
%         segmentMatrix = NaN(length(segment), (2+max(segment))*400);
%         startT = camtime(params.segment(1)) * 100;
%         %endT = camtime(params.segment(2))  * 100;
%         
%         for i = 1:length(segment)
%             
%             segmentMatrix(i,1:segment(i)*400) = data(startT:startT+(segment(i)*400)-1);
%             
%             % First movement is always rightward (from MOUSE PERSPECTIVE!!)
%             %     if mod(i, 2) == 1
%             %         R_matrix(i,1:segment(i)*400) = data(startTime:startTime+(segment(i)*400)-1);
%             %     else
%             %         L_matrix(i,1:segment(i)*400) = data(startTime:startTime+(segment(i)*400)-1);
%             %     end
%             
%             startT = startT + (segment(i)+2)*400;
%         end
        % if params.direction == 'R'
        %     segMat_405_Control = segMat_405_Control(1:2:end, :);
        %     segMat_472_GCaMP = segMat_472_GCaMP(1:2:end, :);
        %     segMat_Diff = segMat_Diff(1:2:end, :);
        % else 
        %     segMat_405_Control = segMat_405_Control(2:2:end, :);
        %     segMat_472_GCaMP = segMat_472_GCaMP(2:2:end, :);
        %     segMat_Diff = segMat_Diff(2:2:end, :);
        % end

    end  
    
    %% Plot Individual Traces
    % Boris_IndividualTraces
    
    %% Plot Variation
    % Boris_Variation
    
    %% Plot Window Measures
    % Boris_windowMeasures
    
    
    
    %% Spike Analysis
    disp(iii)
    Boris_spikeAnalysis(segMat_405_Control, struct(iii), direction);
    title('Control')
    Boris_spikeAnalysis(segMat_472_GCaMP, struct(iii), direction);
    title('GCaMP')
    Boris_spikeAnalysis(segMat_Diff, struct(iii), direction);
    title(['Difference ' num2str(struct(iii).mouse) '_R' num2str(struct(iii).recNum) '_S' num2str(struct(iii).segNum)])
    
    
end
%% Let user know it's done
    disp('DONE! :) ')
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API