Skip to content

Commit

Permalink
Merge pull request #42 from tristansyates/SubMem_Categories
Browse files Browse the repository at this point in the history
add new analyses from revision and some code updates
  • Loading branch information
tristansyates authored Dec 6, 2024
2 parents 5fe9553 + b9e0426 commit 184d5e4
Show file tree
Hide file tree
Showing 8 changed files with 5,624 additions and 589 deletions.
1,070 changes: 1,070 additions & 0 deletions prototype/link/fsf/SubMem_Categories_Binary_DelayLength.fsf.template

Large diffs are not rendered by default.

780 changes: 780 additions & 0 deletions prototype/link/fsf/SubMem_Categories_Binary_Retrieval.fsf.template

Large diffs are not rendered by default.

780 changes: 780 additions & 0 deletions prototype/link/fsf/SubMem_Categories_Binary_Unique.fsf.template

Large diffs are not rendered by default.

780 changes: 780 additions & 0 deletions prototype/link/fsf/SubMem_Categories_LowHighPref.fsf.template

Large diffs are not rendered by default.

552 changes: 552 additions & 0 deletions prototype/link/fsf/SubMem_Categories_Parametric_Retrieval.fsf.template

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
% Start from last trial correctly this time; include encode trials where they look entirely at one or the other image 12/01/2020
% Save more info about relating eye data to test and encode trials; set up
% for retreival timing files 10/07/2021
% Save out a version of pref vs. no pref trials 11/12/2024

function EyeData=EyeTracking_Experiment_SubMem_Categories(varargin)
%% Set up
Expand Down Expand Up @@ -324,6 +325,7 @@
Weights.SubMem_Categories.Parametric.(BlockList{BlockCounter})=zeros(1, length(Data.Experiment_SubMem_Categories.(BlockList{BlockCounter}).Timing.ImageOns));
end


Idxs_Used=[];
EyeData.SubMem_Test.exclude_trial = [];
for TrialCounter=1:length(EyeTest2Encode)
Expand Down Expand Up @@ -372,10 +374,11 @@
%Check if they looked at the encoding image long enough or if we don't
%have data for the encoding trial for some reason
%Just include the response '3' which means on center (index 4 here, since 0 is off screen)
if sum(duration_responses(4)) < (minimum_Encode_fixation)
if sum(duration_responses(4)) < (minimum_Encode_fixation) || sum(duration_responses(2:6)) < (minimum_Encode_fixation)*2
exclude_trial = 1;
end


% Specifically, only take the first presentation of the test trial, unless that presentation
% was all coded as Off-Screen then take the second
% Cycle through all other Test trials and compare to the current one
Expand Down Expand Up @@ -458,8 +461,8 @@
Weights.SubMem_Test.Parametric = ones(1, length(Weights.SubMem_Test.Raw)) * nan;
Weights.SubMem_Test.Parametric(Idxs_Used) = nanzscore(Weights.SubMem_Test.Raw(Idxs_Used));

% Preset for the conditions
Weights.SubMem_Test.Condition=zeros(12, length(Weights.SubMem_Test.Raw)) * nan;
% Preset for the conditions (hard code the number of conditions ...)
Weights.SubMem_Test.Condition=zeros(14, length(Weights.SubMem_Test.Raw)) * nan;

%Condition 1!
%Binarize the data, were they looking to the new stim more than the old stim?
Expand Down Expand Up @@ -554,6 +557,38 @@

Weights.SubMem_Test.Condition(12, Idxs_Used)=Binaries(Idxs_Used);

% Condition 13
% Now we are going to look at trials in which infants showed a strong
% preference in either directions vs. did not show much of a preference
% Cutoff of 0.3-0.7 roughly equated the number of trials in each
% condition across participants
W = zeros(1, length(Weights.SubMem_Test.Raw)) * nan; % reset this again
W(Idxs_Used) = Weights.SubMem_Test.Raw(Idxs_Used);

for Trial=1:length(W)
if W(Trial) < 0.3 % if strong novel
W(Trial) = 2;
elseif W(Trial) > 0.7 % if strong familiar
W(Trial) = 2;
elseif W(Trial) > 0.3 && W(Trial) < 0.7 % if weak preference
W(Trial) = 1;
end
end

Weights.SubMem_Test.Condition(13,:) = W;

% Condition 14
% Now we are going to look at the absolute looking preference in either
% direction
% first get the absolute value of the looking preferences after
% recentering around 0% looking pref (where positive is fam pref)
absolute_preference = abs(Weights.SubMem_Test.Raw -0.5);

% z-score it for use in the timing files
abs_pref_z = nanzscore(absolute_preference);

% set
Weights.SubMem_Test.Condition(14,:)=abs_pref_z;

%% Pair Test with Encode trials
%The moment we have been waiting for!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
% 01/06/2020
% 03/02/2020
% 10/07/2021 now make timing files for retrieval / test events
% 11/12/2024 make no pref vs pref trials

function [Name_Condition, Weights]=Timing_Condition_SubMem_Categories(varargin)

Expand All @@ -36,7 +37,7 @@
%further make timing files based on looking behavior (determine remembered
%vs forgotten)

NumConditions=12; % defined in the eyetracking experiment script
NumConditions=14; % defined in the eyetracking experiment script (HARD CODED)

%Iterate different specifities of looking time
Weights = {};
Expand Down Expand Up @@ -128,8 +129,22 @@
ConditionIdx=EyeData.Weights.SubMem_Categories.Condition.(BlockName)(ConditionCounter, EventCounter);
PossibleNames={'SubMem_Categories-Condition_Binary_DelayLength', 'SubMem_Categories-Condition_Binary_DelayLength'};
Weights{ConditionCounter} = 1;
end


elseif ConditionCounter==13

%What condition is it
ConditionIdx=EyeData.Weights.SubMem_Categories.Condition.(BlockName)(ConditionCounter, EventCounter);
PossibleNames={'SubMem_Categories-Condition_LowPreference', 'SubMem_Categories-Condition_HighPreference'};
Weights{ConditionCounter} = 1;

elseif ConditionCounter==14

ConditionIdx=1;
PossibleNames={'SubMem_Categories-Condition_OverallPref_Z'};
Weights{ConditionCounter} = EyeData.Weights.SubMem_Categories.Condition.(BlockName)(ConditionCounter, EventCounter);

end
%Store the first and second level names
if ConditionIdx~=0
Name_Condition(ConditionCounter).Second{1}=PossibleNames{ConditionIdx};
Expand Down
Loading

0 comments on commit 184d5e4

Please sign in to comment.