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 1def5532c3cefeba955129117e8c23abb7643cf8 authored by Max's Office PC on 20 November 2019, 03:30:51 UTC, committed by Max's Office PC on 20 November 2019, 03:30:51 UTC
Merge branch 'Master' of https://github.com/RaymondLab/Code into Master
2 parent s 08f15ff + 964f3bd
  • Files
  • Changes
  • 4d2e3a8
  • /
  • Projects
  • /
  • Max - CF Project
  • /
  • ExploreData.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:1def5532c3cefeba955129117e8c23abb7643cf8
directory badge Iframe embedding
swh:1:dir:cac382edddef562293d4732575a6b36b3536f9b6
content badge Iframe embedding
swh:1:cnt:cd54a9521e812b4c6790aa1f2421efb7b912d277

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
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
ExploreData.m
%% Open Excel File
clear;clc;close all

[dataTable] = readtable('G:\My Drive\Expmt Data\Max\Climbing Fiber Project\ExperimentMetadata_B.xlsx');
writetable(dataTable, 'G:\My Drive\Expmt Data\Max\Climbing Fiber Project\ExperimentMetadata_Backup.xlsx')

expmtDataFolder = 'G:\My Drive\Expmt Data\Max\Climbing Fiber Project\Jennifer Data\jennifer_arch';

allFiles = dir([expmtDataFolder, '\**\*']);

csFiles2 = allFiles;
csFiles2(~contains({csFiles2.name}, {'sortedCS'})) = [];
allFiles(~contains({allFiles.name}, {'aligned'})) = [];

%% loop through each one
for j = 1:height(dataTable)
    disp(j)
    
    %% Skip non-related recordings
    
    % Bad Recording Files
    if ~isnan(dataTable.maxRemoved(j))
        continue
    end
    
    % Only Aligned Files
    if ~contains(dataTable.alignedMat(j), 'aligned') 
        continue
    end
    
    % Expmt Condition Filtering
    if ~contains(dataTable.sineStep(j), 'sine')
        continue
    end
    if dataTable.freq(j) ~= .5
        continue
    end
    if ~contains(dataTable.learningType(j), 'x2')
        continue
    end

    % Other Condition
    if isnan(dataTable.maxSortedCS(j))
        continue
    end
    if ~dataTable.maxSortedCS(j)
        continue
    end
%     if isnan(dataTable.goodCSIsolation(j))
%         continue
%     end
%     if dataTable.goodCSIsolation(j) == 0
%         continue
%     end

    %% Open File
    try 
        alignedFile = dataTable.alignedMat{j};
        fileInfo = allFiles(contains({allFiles.name}, {alignedFile}));
        load(fullfile(fileInfo(1).folder, fileInfo(1).name));
    catch
        disp('Opening Failed!')
        continue
    end
    
    %% Add Sorted CS to behavior File
    try
        alignedFile = dataTable.alignedMat{j};
        fileInfo = allFiles(contains({allFiles.name}, {alignedFile}));
        load(fullfile(fileInfo(1).folder, fileInfo(1).name));
        
        figure(1); clf
        timeVec = dattime(behaviorEphysAligned(1,10));
        plot(timeVec, behaviorEphysAligned(10).data)
        title(dataTable.name(j))
        vline(Channel01(:,1)+behaviorEphysAligned(10).tstart)
        behaviorEphysAligned(9).data = Channel01(:,1)+behaviorEphysAligned(10).tstart;
        save(fullfile(fileInfo(1).folder, fileInfo(1).name), 'behaviorEphysAligned')
        
    if ~isempty(behaviorEphysAligned(1,9).data)
        dataTable.sortedCS(j) = 1;
    else
        dataTable.sortedCS(j) = 0;
    end
    catch
        disp('Failed!')
        continue
    end
    
    
    %%
    
    %% Visualize 
%     try
%         figure(2);clf
%         disp(dataTable.maxAlignVal(j))
%         timeVec = dattime(behaviorEphysAligned(10));
%         plot(timeVec(1:end/2), behaviorEphysAligned(10).data(1:end/2))
%         vline(behaviorEphysAligned(8).data(100:150))
%         xlim([behaviorEphysAligned(8).data(100), behaviorEphysAligned(8).data(150)]) 
%         drawnow
%     catch
%         disp('Plotting Failed!')
%         continue
%     end
%     list = {'Good', 'Bad', 'Other'};
%     [indx,tf] = listdlg('ListString',list);
%     if indx-1 == 1 
%         dataTable.maxRemoved(j) = 1;
%     elseif indx-1 == 2
%         disp('apple')
%     end
    
    %% Get Manual Input
%     try
%         ephysData = behaviorEphysAligned(10).data;
%         figure(11); clf
%         ssLocs = zeros(length(ephysData),1);
%         behaviorEphysAligned(8).data(behaviorEphysAligned(8).data < 0) = [];
%         
%         for k = 1:length(behaviorEphysAligned(8).data) 
%             ssLocs(round(behaviorEphysAligned(8).data(k)*behaviorEphysAligned(10).samplerate)) = 1;
%         end
%         [c,lags] = xcorr(ephysData,ssLocs);
%         plot(lags/50000, c);
%         xCorrShiftVal = lags(find(c == max(c)))/behaviorEphysAligned(10).samplerate;    
%         disp(['     ', num2str(xCorrShiftVal)]);
%         [behaviorDat, shiftAmt, shiftConfidence] = alignCXandMaestro(behaviorEphysAligned(1:end-1), behaviorEphysAligned(10).data, 1);
%         
%         dataTable.xcorrAlignVal(j) = xCorrShiftVal;
%     catch
%         disp('xcorr Failed!')
%     end
    
end


%%
writetable(dataTable, 'G:\My Drive\Expmt Data\Max\Climbing Fiber Project\ExperimentMetadata_B.xlsx')
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–2025, 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