Skip to content

Commit

Permalink
code eeglab de janvier
Browse files Browse the repository at this point in the history
  • Loading branch information
Nina Forde committed Jan 25, 2022
1 parent 09fd53a commit d3c7a68
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 18 deletions.
7 changes: 7 additions & 0 deletions data/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Automagic ne peut lire que les format de données BIDS ie on met sous un dossier tous les sujets et on donne ce dossier parent comme dossier source
Automagic crée tout seul son dossir résultat, si on le souhaite il fournit une variable project_stat.mat qui contient tous les paramètres nécessaires pour re créer le projet. Exemple: params (pour les options de preprocessing)

Raw Data : c'est les données non pré-traitées fournies par l'article
Stage 2.3 : c'est les données déjà prétraitées

ChanlocsMaster.mat : localisation des electrodes
7 changes: 1 addition & 6 deletions src/codeR/fig2A.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ library(Rfast)
library(Hmisc)


nbparticipants=90;
nbparticipants=100;

#Plotting Setup

Expand Down Expand Up @@ -50,11 +50,6 @@ FFT_APA_Style = theme(axis.line.x = element_line(color="black", size = 0.5), #Ad
data = read.csv('RewP_Waveforms.csv',header = FALSE) #Load ERP data


pdata = read.csv('RewP_Waveforms_AllPs.csv',header = FALSE) #Load participant ERP data
pdata$subject = as.factor(1:nbparticipants) #Add participant ID
pdata$condition = as.factor(c(rep(1,nbparticipants),rep(2,nbparticipants))) #Add condition ID
pdata_original = pdata #Re-allocate variable so not to lose it (later it gets modified)
data_Latency = read.csv('RewP_Latency.csv',header = FALSE) #Load ERP peak time data



Expand Down
8 changes: 4 additions & 4 deletions src/eeglabcode/janvier/100 sujets/version100sujets.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
dirdata='/home/nforde/Documents/StageEEGpre/data/Raw Data Part 13';
cd(dirdata);
filenames = dir('*.vhdr')

for participant = 10:length(filenames) %Cycle through participants
nb=100;
for participant = 50:nb %Cycle through participants


%Get participant name information
Expand Down Expand Up @@ -67,7 +67,7 @@
[ALLEEG EEG] = eeg_store(ALLEEG, EEG, CURRENTSET);

%identifier differents artifacts correspondants
[EEG, varargout] = pop_iclabel(EEG, 'default')
[EEG, varargout] = pop_iclabel(EEG, 'default');

EEG = eeg_checkset( EEG );

Expand All @@ -94,7 +94,7 @@
% EEG = eeg_checkset( EEG );
% eeglab redraw;
%baseline correction
EEG = pop_rmbase( EEG, [-0,2 0] ,[]);
EEG = pop_rmbase( EEG, [-200/1000,0]);
%[ALLEEG EEG CURRENTSET] = pop_newset(ALLEEG, EEG, 5,'gui','off');

%bad segment
Expand Down
11 changes: 7 additions & 4 deletions src/eeglabcode/janvier/10sujets/sujetsv2.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
filenames = dir('*.vhdr')

%for participant = 1:length(filenames) %Cycle through participants
for participant = 1:1%Cycle through participants
for participant = 1:2%Cycle through participants

%Get participant name information
disp(['Participant: ', num2str(participant)]) %Display current participant being processed
Expand Down Expand Up @@ -68,7 +68,7 @@
[ALLEEG EEG] = eeg_store(ALLEEG, EEG, CURRENTSET);

%identifier differents artifacts correspondants
[EEG, varargout] = pop_iclabel(EEG, 'default')
[EEG, varargout] = pop_iclabel(EEG, 'default');

EEG = eeg_checkset( EEG );

Expand All @@ -95,9 +95,12 @@
% EEG = eeg_checkset( EEG );
% eeglab redraw;
%baseline correction
EEG = pop_rmbase( EEG, [-200 0] ,[]);
EEG = pop_rmbase( EEG, [-200/1000,0]);
%[ALLEEG EEG CURRENTSET] = pop_newset(ALLEEG, EEG, 5,'gui','off');


%Baseline Correction
%[EEG] = doBaseline(EEG,[-200/1000,0]); %Baseline correction in ms

%bad segment
% EEG = eeg_checkset( EEG );
EEG = pop_eegthresh(EEG,1,[1:31] ,-50,50,-1,1.998,0,0);
Expand Down
6 changes: 3 additions & 3 deletions src/eeglabcode/janvier/figure1/variablespourfig1.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
cd(dirdata); %Find and change working folder to raw EEG data
%Find and change working folder to saved data from last for loop
filenames = dir('RewardProcessing_S2Final*'); %Compile list of all data

nb=100;
% for participant = 1:length(filenames) %Cycle through participants
for participant = 1:90 %Cycle through participants
for participant = 1:nb %Cycle through participants

disp(['Participant: ', num2str(participant)]); %Display current participant being processed

Expand Down Expand Up @@ -76,7 +76,7 @@
WAV_data1 = permute(squeeze(All_WAV(26,:,151:750,1,:)),[3,1,2]); %Extract participants time-frequency condition 1
WAV_data2 = permute(squeeze(All_WAV(26,:,151:750,2,:)),[3,1,2]); %Extract participants time-frequency condition 2
WAV_diff = WAV_data1-WAV_data2; %Create difference wave
nb=3;

for participant = 1:nb %Cycle through participants
WAV_Delta(participant,:,:) = squeeze(WAV_diff(participant,:,:)).*delta_extract; %Confine data to significant delta activity for difference WAV
WAV_Theta(participant,:,:) = squeeze(WAV_diff(participant,:,:)).*theta_extract; %Confine data to significant theta activity for difference WAV
Expand Down
2 changes: 1 addition & 1 deletion src/eeglabcode/janvier/vhdr copiemod/eeglabhist5.m
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
% EEGLAB history file generated on the 19-Jan-2022
% EEGLAB history file generated on the 21-Jan-2022
% ------------------------------------------------
eeglab redraw;

0 comments on commit d3c7a68

Please sign in to comment.