Difference between revisions of "INF-BIOX121 H14 RStudio IPython"

From projects/clsi
Jump to: navigation, search
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
Using the IPython Notebook
+
=== Using the IPython Notebook ===
 
 
 
 
 
 
*<span style="font-size: 12px;">login as usual, with X forwarding on&nbsp;</span>tjhe course server
 
*<span style="font-size: 12px;">start a so-called virtual Python environment (virtualenv):</span>
 
 
 
source /opt/ipytest/bin/activate
 
  
 +
*<div><u>note to Windows users</u>: your best option is to click the 'penguin' icon on the desktop and turn your PC into a Linux machine - then follow the instructions for Linux<br/></div>
 +
*<div>login as usual, with X forwarding on the course server</div>
 +
*start a so-called virtual Python environment (virtualenv):
 +
<pre>source /opt/ipytest/bin/activate</pre>
 
*this changes your promt, don't worry.
 
*this changes your promt, don't worry.
 
*move (cd) to a folder if needed, for example where the data is you want to analyse
 
*move (cd) to a folder if needed, for example where the data is you want to analyse
*l<span style="font-size: 12px;">aunch iPython notebook</span>
+
*launch iPython notebook
 
+
<pre>ipython notebook</pre>
ipython notebook
+
*'''Linux'''
 
+
**the notebook should start now
*check where it says "The IPython Notebook is running at: [http://127.0.0.1:8888/ http://127.0.0.1:8888/]" and note the last four digits ('8888' in this case)
+
**if it doesn't, cancel, close your browser and try again
*<span style="font-size: 12px;">MAC/Linux</span>
+
*'''Mac'''
**<span style="font-size: 12px;">start another terminal session and you create a so-called SSH tunnel, make sure to use the same four digits in the middle</span>
+
**check where it says "The IPython Notebook is running at: [http://127.0.0.1:8888/ http://127.0.0.1:8888/]" and note the last four digits ('8888' in this case)
 
+
**start another terminal session and you create a so-called SSH tunnel, make sure to use the same four digits in the middle
<span style="font-size: 12px;">ssh -L 30000:127.0.0.1:8888&nbsp;</span><span style="font-size: 12px;">username@bioinfcourse.hpc.uio.no</span>
+
<pre>ssh -L 30000:127.0.0.1:8888 username@bioinfcourse.hpc.uio.no</pre>
<ul style="margin-left: 40px;">
+
*'''<span style="font-size: 12px;">​Windows</span>'''
<li><span style="font-size: 12px;"><div>leave both terminal windows open</div>Windows users: see [http://howto.ccs.neu.edu/howto/windows/ssh-port-tunneling-with-putty/ http://howto.ccs.neu.edu/howto/windows/ssh-port-tunneling-with-putty/] on how to set up your tunnel</span>
+
**<span style="font-size: 12px;">see </span>[http://howto.ccs.neu.edu/howto/windows/ssh-port-tunneling-with-putty/ http://howto.ccs.neu.edu/howto/windows/ssh-port-tunneling-with-putty/]<span style="font-size: 12px;">on how to set up your tunnel</span>
*source port: 30000
+
**source port: 30000
*destination: 127.0.0.1:8888 (use those same four digits as you noted down above)</li>
+
**destination: [http://127.0.0.1:8888 http://127.0.0.1:8888] (use those same four digits as you noted down above)
 
 
*<span style="font-size: 12px;">on the classroom PC, open a webbrowser (e.g. firefox)</span>
 
*point the browser to<span style="font-size: 12px;">&nbsp;127.0.0.1:30000</span>
 
 
 
Using Rstudio
 
 
 
<span style="font-size: 12px;">2)To use that instance, it is essential that you use SSH tunneling for security purposes. From a Linux or Mac workstation/laptop, you can type something like the one below:</span>
 
 
 
<span class="s1">ssh -L 20000:localhost:8787&nbsp;username@bioinfcourse.hpc.uio.no</span>
 
 
 
 
 
 
 
(The port number on the left (20000) is an example. Choose any large port number > 20000. The one on the right should *always* be 8787)
 
 
 
 
 
 
 
Once you type the above command, login with your SSH username and password, like you normally do. &nbsp;Once you are in, you can THEN point your LOCAL workstation/laptop browser to the URL: localhost:20000, to access the RStudio server login screen. You can then type your username and password to login and access your R environment from your web browser.
 
 
 
 
 
 
 
3)For Windows users, you should use an SSH client like PuTTY. You can then establish a tunnel in a similar way as step 2) above by using this document as a guide:
 
 
 
<span class="s2">[http://howto.ccs.neu.edu/howto/windows/ssh-port-tunneling-with-putty/ http://howto.ccs.neu.edu/howto/windows/ssh-port-tunneling-with-putty/]</span>
 
  
 +
*'''All'''
 +
**on the classroom PC, open a webbrowser (e.g. firefox)
 +
**point the browser to 127.0.0.1:30000
 +
<div><br/></div>
  
 +
=== Using Rstudio ===
 +
<div><br/></div>
 +
*Linux or Mac
 +
**open a terminal and write
 +
<pre>ssh -L 20000:localhost:8787 username@bioinfcourse.hpc.uio.no</pre>
 +
**the port number on the left (20000) is an example. Choose any large port number > 20000
 +
**the one on the right should *always* be 8787
 +
**Once you type the above command, login with your SSH username and password, like you normally do. &nbsp;
  
For any issues/help, feel free to communicate with me directly.
+
*​Windows
 +
**see [http://howto.ccs.neu.edu/howto/windows/ssh-port-tunneling-with-putty/ http://howto.ccs.neu.edu/howto/windows/ssh-port-tunneling-with-putty/]on how to set up your tunnel
 +
**<span style="font-size: 12px;">source port: 20000 (choose any large port number > 20000)</span>
 +
**destination: localhost:8787 (dont change this number)
 +
*All
 +
**on the classroom PC, open a webbrowser (e.g. firefox)
 +
**point the browser to localhost:20000 to access the RStudio server login screen
 +
**you can then type your username and password to login and access your R environment from your web browser
 +
<div><br/></div>

Latest revision as of 12:52, 10 October 2014

Using the IPython Notebook

  • note to Windows users: your best option is to click the 'penguin' icon on the desktop and turn your PC into a Linux machine - then follow the instructions for Linux
  • login as usual, with X forwarding on the course server
  • start a so-called virtual Python environment (virtualenv):
source /opt/ipytest/bin/activate
  • this changes your promt, don't worry.
  • move (cd) to a folder if needed, for example where the data is you want to analyse
  • launch iPython notebook
ipython notebook
  • Linux
    • the notebook should start now
    • if it doesn't, cancel, close your browser and try again
  • Mac
    • check where it says "The IPython Notebook is running at: http://127.0.0.1:8888/" and note the last four digits ('8888' in this case)
    • start another terminal session and you create a so-called SSH tunnel, make sure to use the same four digits in the middle
ssh -L 30000:127.0.0.1:8888 username@bioinfcourse.hpc.uio.no
  • All
    • on the classroom PC, open a webbrowser (e.g. firefox)
    • point the browser to 127.0.0.1:30000

Using Rstudio


  • Linux or Mac
    • open a terminal and write
ssh -L 20000:localhost:8787 username@bioinfcourse.hpc.uio.no
    • the port number on the left (20000) is an example. Choose any large port number > 20000
    • the one on the right should *always* be 8787
    • Once you type the above command, login with your SSH username and password, like you normally do.  
  • ​Windows
  • All
    • on the classroom PC, open a webbrowser (e.g. firefox)
    • point the browser to localhost:20000 to access the RStudio server login screen
    • you can then type your username and password to login and access your R environment from your web browser