Skip to content

Commit

Permalink
init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
cdla committed Jan 19, 2022
1 parent a68dbad commit 80f7112
Show file tree
Hide file tree
Showing 3,137 changed files with 1,035,120 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
Binary file added LME_Analysis/.DS_Store
Binary file not shown.
Empty file added LME_Analysis/.Rapp.history
Empty file.
26 changes: 26 additions & 0 deletions LME_Analysis/ieeg_lmer_boxcox.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# install packages if missing
# install.packages("lmerTest")

# other related packages if needed
# install.packages("readxl")
# install.packages("lme4")
# install.packages("nlme")
# library(readxl)
# library(nlme)

# load libraries
library(lmerTest)
library(bestNormalize)

# Read Data
Brain.df <- read.csv("C:/Users/ANUP/Desktop/DMN_Final_Submission/LME_Analysis/CorrIncorr_PTE_DMN_HIPP_Encode_Recall.csv", fileEncoding="UTF-8-BOM")
x = as.numeric(Brain.df$PTE)
xx = bestNormalize(x)
xxt = xx[["x.t"]]
Brain.df$PTE = xxt
# Run Model with subjects as random effects
ieegmodel = lmer(PTE ~ Condition + (1|Subject), data=Brain.df)

# Stats
anova(ieegmodel)

Binary file added scripts_rest/.DS_Store
Binary file not shown.
Binary file added scripts_rest/BN_Atlas_246_2mm.nii
Binary file not shown.
Binary file added scripts_rest/ChIDBipolar.mat
Binary file not shown.
Binary file added scripts_rest/ChIDBipolarArtifactRemove.mat
Binary file not shown.
39 changes: 39 additions & 0 deletions scripts_rest/ChannelIDBipolar.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
%Anup Das
%26 September, 2018
%This program finds the channel indices in the pairs.json files

close all;
clear all;
clc;

load('FileListBipolar.mat');
Njson = size(FileList,1);
ChID = cell(Njson,1);

for i=1:Njson

d = dir(FileList(i).folder);
B = jsondecode(fileread(strcat(FileList(i).folder,'\',d(4).name)));
dynamicPath = {char(fieldnames(B)) 'pairs'};
D = getfield(B, dynamicPath{:});
Nelec = size(fieldnames(D),1);
E = fieldnames(D);
ChIDTemp = zeros(Nelec,2);

for j=1:Nelec

dynamicPath1 = {char(E{j}) 'channel_1'};
dynamicPath2 = {char(E{j}) 'channel_2'};
ChIDTemp(j,1) = getfield(D, dynamicPath1{:});
ChIDTemp(j,2) = getfield(D, dynamicPath2{:});

end

ChID{i,1} = ChIDTemp;

end

save('ChIDBipolar.mat','ChID');



59 changes: 59 additions & 0 deletions scripts_rest/ChannelIDBipolarArtifactRemove.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
%Anup Das
%13 June, 2019
%This program finds the channel indices in the pairs.json files excluding the artifactual channels

close all;
clear all;
clc;

Str = '/oak/stanford/groups/menon/projects/a1das/2018_ECoG_DMN_Project/scripts/Release_20171012_scripts/scripts_rest/Release_Metadata_20171010/electrode_categories/';

load('FileListBipolarSherlock.mat');
Njson = size(FileList,1);
ChID = cell(Njson,1);

for i=1:Njson

d = dir(FileList(i).folder);
Folder = FileList(i).folder;

elec_categ_data = upper(importdata(strcat(Str,Folder(114:119),'_electrode_categories.txt')));
elec_categ_data = strrep(elec_categ_data,' ','');
elec_categ_data = strrep(elec_categ_data,'-','_');

B = jsondecode(fileread(strcat(FileList(i).folder,'/',d(4).name)));
dynamicPath = {char(fieldnames(B)) 'pairs'};
D = getfield(B, dynamicPath{:});
Nelec = size(fieldnames(D),1);
E = fieldnames(D);
ChIDTemp = zeros(Nelec,2);

for j=1:Nelec

dynamicPath1 = {char(E{j}) 'channel_1'};
dynamicPath2 = {char(E{j}) 'channel_2'};

dynamicPath3 = {char(E{j}) 'code'};
newStr = upper(split(getfield(D, dynamicPath3{:}),'-'));

if (isempty(find(ismember(elec_categ_data,newStr{1,1})))==1 && isempty(find(ismember(elec_categ_data,newStr{2,1})))==1)

ChIDTemp(j,1) = getfield(D, dynamicPath1{:});
ChIDTemp(j,2) = getfield(D, dynamicPath2{:});

else

ChIDTemp(j,1) = 0;
ChIDTemp(j,2) = 0;

end

end

ChID{i,1} = ChIDTemp;

end

save('ChIDBipolarArtifactRemove.mat','ChID');


Binary file added scripts_rest/DMN_Electrodes_1229.mat
Binary file not shown.
Binary file added scripts_rest/Distance_Results/.DS_Store
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 80f7112

Please sign in to comment.