forked from shihchengyen/Hippocampus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sortchannel.m
29 lines (27 loc) · 1.01 KB
/
sortchannel.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
function sortchannel()
if(isempty(dir('skipsort.txt')))
% get channel string
[p1, chstr] = nptFileParts(pwd);
% get array string
[p2, arrstr] = nptFileParts(p1);
% get session string
[p3, sesstr] = nptFileParts(p2);
% get day string
[p4, daystr] = nptFileParts(p3);
% make channel direcory on HPC, copy to HPC, cd to channel directory, and then run hmmsort
display('Creating channel directory ...')
syscmd = ['ssh eleys@atlas7 "cd ~/hpctmp/Data; mkdir ' daystr '; cd ' daystr '; mkdir ' sesstr '; cd ' sesstr '; mkdir ' arrstr '; cd ' arrstr '; mkdir ' chstr '"'];
display(syscmd)
system(syscmd);
display('Transferring rplhighpass file ...')
syscmd = ['scp rplhighpass.mat eleys@atlas7:~/hpctmp/Data/' daystr '/' sesstr '/' arrstr '/' chstr];
display(syscmd)
rval=1;
while(rval~=0)
rval=system(syscmd);
end
display('Running spike sorting ...')
syscmd = ['ssh eleys@atlas7 "cd ~/hpctmp/Data/' daystr '/' sesstr '/' arrstr '/' chstr '; ~/hmmsort/hmmsort_pbs.py ~/hmmsort"'];
display(syscmd)
system(syscmd);
end