User Tools

Site Tools


analysis:nsb2017:week1

====== Differences ====== This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
analysis:nsb2017:week1 [2017/07/01 00:19]
mvdm [Using GitHub to acquire the FieldTrip toolbox]
analysis:nsb2017:week1 [2018/04/17 15:20] (current)
Line 12: Line 12:
 Resources: Resources:
   * Recommended:​ [[http://​www.ploscompbiol.org/​article/​info%3Adoi%2F10.1371%2Fjournal.pcbi.1000424|Noble,​ A Quick Guide to Organizing Computational Biology Projects]] ([[http://​www.ploscompbiol.org/​article/​fetchObject.action?​uri=info%3Adoi%2F10.1371%2Fjournal.pcbi.1000424&​representation=PDF|direct link to pdf]]) (yes, yours is one)   * Recommended:​ [[http://​www.ploscompbiol.org/​article/​info%3Adoi%2F10.1371%2Fjournal.pcbi.1000424|Noble,​ A Quick Guide to Organizing Computational Biology Projects]] ([[http://​www.ploscompbiol.org/​article/​fetchObject.action?​uri=info%3Adoi%2F10.1371%2Fjournal.pcbi.1000424&​representation=PDF|direct link to pdf]]) (yes, yours is one)
-  * Optional: Introduction to version control with %%GitHub%%: [[http://​www.youtube.com/​GitHubGuides|Youtube videos]],​[[http://​readwrite.com/​2013/​09/​30/​understanding-github-a-journey-for-beginners-part-1|ReadWrite blog]]+  * Optional: Introduction to version control with %%GitHub%%: ​[[https://​try.github.io/​levels/​1/​challenges/​1 | 
 + Try Git]] interactive game, [[http://​www.youtube.com/​GitHubGuides|Youtube videos]],​[[http://​readwrite.com/​2013/​09/​30/​understanding-github-a-journey-for-beginners-part-1|ReadWrite blog]]
   * More Git and GitHub resources: [[http://​git-scm.com/​book/​en/​Getting-Started-Git-Basics|more detailed doc pages]], [[http://​stackoverflow.com/​questions/​tagged/​git|git tagged questions on StackOverflow]],​ [[https://​github.s3.amazonaws.com/​media/​progit.en.pdf|Pro Git manual]] (surprisingly readable)   * More Git and GitHub resources: [[http://​git-scm.com/​book/​en/​Getting-Started-Git-Basics|more detailed doc pages]], [[http://​stackoverflow.com/​questions/​tagged/​git|git tagged questions on StackOverflow]],​ [[https://​github.s3.amazonaws.com/​media/​progit.en.pdf|Pro Git manual]] (surprisingly readable)
   * Optional: MATLAB documentation on [[http://​www.mathworks.com/​help/​matlab/​matlab_env/​understanding-file-locations-in-matlab.html|File Locations]] and [[http://​www.mathworks.com/​help/​matlab/​matlab_env/​what-is-the-matlab-search-path.html#​br8ch8o|Search Paths]]   * Optional: MATLAB documentation on [[http://​www.mathworks.com/​help/​matlab/​matlab_env/​understanding-file-locations-in-matlab.html|File Locations]] and [[http://​www.mathworks.com/​help/​matlab/​matlab_env/​what-is-the-matlab-search-path.html#​br8ch8o|Search Paths]]
Line 29: Line 30:
 %%GitHub%% is a system for "​distributed version control":​ it keeps track of changes to a set of files, such as pieces of MATLAB code, with one or more contributors. This system makes it easy to keep track of evolving code, and to share improvements between collaborators. Typical scenarios in which such version control is useful include, for instance, if you want to run the exact code that you used to generate some figure a while ago, but you've since made changes to the code; or the same analysis suddenly gives a different result and you want to track down what change caused it. If you are new to %%GitHub%%, you can watch the video under Resources above to get an overall idea of how it works and why it is useful. %%GitHub%% is a system for "​distributed version control":​ it keeps track of changes to a set of files, such as pieces of MATLAB code, with one or more contributors. This system makes it easy to keep track of evolving code, and to share improvements between collaborators. Typical scenarios in which such version control is useful include, for instance, if you want to run the exact code that you used to generate some figure a while ago, but you've since made changes to the code; or the same analysis suddenly gives a different result and you want to track down what change caused it. If you are new to %%GitHub%%, you can watch the video under Resources above to get an overall idea of how it works and why it is useful.
  
-If you don't already have a %%GitHub%% account, go to [[http://​www.github.com|GitHub]] and sign up. E-mail me (mvdm at dartmouth dot edu) your account name, so I can give you write access to the code repository we will use.+For now, you can use the module ​%%GitHub%% account, see the ''​README.txt''​ file on the share for the credentials. You're also welcome to use your own account; if you don't have one yet, go to [[http://​www.github.com|GitHub]] and sign up. E-mail me (mvdm at dartmouth dot edu) your account name, so I can give you write access to the code repository we will use.
  
-Meanwhile, download and install the Git client of your choice if you don't already have one installed. This is a piece of software that will allow you to talk to %%GitHub%%, which is where the code is actually stored. For Windows, I recommend [[http://windows.github.com/​|GitHub Windows]] as a user-friendly way to get started. For installing Git and setting up GitHub on various operating systems, see [[https://​help.github.com/​articles/​set-up-git|GitHub:​ Set Up Git]].+Meanwhile, download and install the Git client of your choice if you don't already have one installed. This is a piece of software that will allow you to talk to %%GitHub%%, which is where the code is actually stored. For Windows, I recommend [[https://github-windows.s3.amazonaws.com/GitHubSetup.exe|GitHub ​Desktop for Windows]] as a user-friendly way to get started. For installing Git and setting up GitHub on various operating systems, see [[https://​help.github.com/​articles/​set-up-git|GitHub:​ Set Up Git]].
  
 Next, configure your client. For %%GitHub%% Windows, after starting up the %%GitHub%% %%GUI%% (the default window that opens when you run %%GitHub%%) you'll first need to sign in with your account, then click Tools > Options. Set the "​Default Storage Directory"​ to something reasonable such as ''​D:​\My_Documents\GitHub\''​). Also check that your username and e-mail address look ok (I am ''​mvdm''​). Next, configure your client. For %%GitHub%% Windows, after starting up the %%GitHub%% %%GUI%% (the default window that opens when you run %%GitHub%%) you'll first need to sign in with your account, then click Tools > Options. Set the "​Default Storage Directory"​ to something reasonable such as ''​D:​\My_Documents\GitHub\''​). Also check that your username and e-mail address look ok (I am ''​mvdm''​).
Line 41: Line 42:
 As an alternative,​ you can navigate to the course repository [[https://​github.com/​mvdm/​nsb2017|web page]] on %%GitHub%%. There, click the button "Clone in desktop",​ and your %%GitHub%% client should prompt you to accept the clone (tested successfully with Chrome, %%YMMV%%). If this fails, you can [[http://​joe.blog.freemansoft.com/​2014/​04/​github-clone-to-desktop-with-windows.html|drag]] the URL from your browser into your %%GitHub%% client. As an alternative,​ you can navigate to the course repository [[https://​github.com/​mvdm/​nsb2017|web page]] on %%GitHub%%. There, click the button "Clone in desktop",​ and your %%GitHub%% client should prompt you to accept the clone (tested successfully with Chrome, %%YMMV%%). If this fails, you can [[http://​joe.blog.freemansoft.com/​2014/​04/​github-clone-to-desktop-with-windows.html|drag]] the URL from your browser into your %%GitHub%% client.
  
-Now, verify that the above steps have resulted in the creation of a ''​nsb2017''​ folder with various subfolders and files in it, indicating that you have a local copy of the codebase. Because Git is tracking the contents of this folder, it is now easy to "​pull"​ the latest version from %%GitHub%%, either from the command line:+Now, verify that the above steps have resulted in the creation of a ''​nsb2017''​ folder with various subfolders and files in it, indicating that you have a local copy of the codebase. Because Git is tracking the contents of this folder, it is now easy to "​pull"​ the latest version from %%GitHub%%, either from the command line (after you ''​cd''​ into the ''​nsb2017''​ folder):
  
 <​code>​ <​code>​
Line 93: Line 94:
 restoredefaultpath;​ clear classes; % start with a clean slate restoredefaultpath;​ clear classes; % start with a clean slate
  
-cd('​D:​\My_Documents\GitHub\nsb2017\shared'​);​ % or, wherever your code is located -- NOTE \shared subfolder!+cd('​D:​\My_Documents\GitHub\nsb2017\code-matlab\shared'​);​ % or, wherever your code is located -- NOTE \shared subfolder!
 p = genpath(pwd);​ % create list of all folders from here p = genpath(pwd);​ % create list of all folders from here
 addpath(p); addpath(p);
  
-cd('​D:​\My_Documents\GitHub\FieldTrip'​);​ % or whatever you chose, obviously +% can optionally add FieldTrip here when needed (commented out for now) 
-ft_defaults;​+cd('​D:​\My_Documents\GitHub\FieldTrip'​);​ % or whatever you chose, obviously 
 +ft_defaults;​ 
 +% rmpath('​D:​\My_Documents\GitHub\GitHub\fieldtrip\external\signal\'​) % needed to preserve use of MATLAB filtfilt.m
 </​code>​ </​code>​
  
 This ensures that whenever you click this button, you have a clean **path** (the set of folders, other than the current working directory, whose contents MATLAB can access) of only the MATLAB default plus your local versions of the two %%GitHub%% repositories. This ensures that whenever you click this button, you have a clean **path** (the set of folders, other than the current working directory, whose contents MATLAB can access) of only the MATLAB default plus your local versions of the two %%GitHub%% repositories.
  
-:!: When setting your path in MATLAB to add the ''​shared''​ folder only and //​not// ​the parent folder ''​nsb2017''​. Adding the entire nsb2017 folder will result in an error when you try to run the LoadCSC command later in the module:+:!: When setting your path in MATLAB to add the ''​shared''​ folder only and //​not// ​parent folder ​such as ''​nsb2017''​. Adding the entire ​''​nsb2017'' ​folder will result in an error when you try to run the LoadCSC command later in the module!
  
 Optional: if you don't like the ''​.git''​ folders in your path, you can get clever with [[http://​www.mathworks.com/​help/​matlab/​matlab_prog/​regular-expressions.html|regular expressions]] to remove these: Optional: if you don't like the ''​.git''​ folders in your path, you can get clever with [[http://​www.mathworks.com/​help/​matlab/​matlab_prog/​regular-expressions.html|regular expressions]] to remove these:
Line 133: Line 136:
 Next, let's get some data! Go to the NS&B share and find the ''​ExampleData''​ folder (within the MouseHippocampus folder). Next, let's get some data! Go to the NS&B share and find the ''​ExampleData''​ folder (within the MouseHippocampus folder).
  
-For this module you will need the ''​R016-2012-10-08''​ folder (containing data from one recording session), which you can find in the /promoted/R016 folder. A good place to put it is in something like ''​D:​\data\promoted\''​ (Rxxx indicate different rats, followed by the date of each session). As mentioned, in general you want to keep your data separate from your code; for instance, multiple analysis projects may use the same data, so you don't want to duplicate it.+For this module you will need the ''​R016-2012-10-08''​ folder (containing data from one recording session), which you can find in the ''​\promoted\R016'' ​folder ​on the share. Copy this folder onto your own computer. A good place to put it is in something like ''​D:​\data\promoted\''​ (Rxxx indicate different rats, followed by the date of each session). As mentioned, in general you want to keep your data separate from your code; for instance, multiple analysis projects may use the same data, so you don't want to duplicate it.
  
 The choice of the folder name ''​promoted''​ indicates that these are data folders for which preprocessing is completed. As will be explained further in Module 2 and others, preprocessing typically includes the renaming of raw data files, annotation, spike sorting, and a few other steps. In general, it is useful to keep promoted data separate from data still in process. The choice of the folder name ''​promoted''​ indicates that these are data folders for which preprocessing is completed. As will be explained further in Module 2 and others, preprocessing typically includes the renaming of raw data files, annotation, spike sorting, and a few other steps. In general, it is useful to keep promoted data separate from data still in process.
analysis/nsb2017/week1.1498868360.txt.gz · Last modified: 2018/04/17 15:21 (external edit)