-
Notifications
You must be signed in to change notification settings - Fork 0
/
using.qmd
188 lines (96 loc) · 13 KB
/
using.qmd
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
---
title: "Accessing and Using Your Workspace"
---
## **Logging into and Logging out of the ADRF**
This video linked below runs through the necessary steps for logging into and logging out of the ADRF. If the video does not play, click [here](https://www.youtube.com/watch?v=_-AE_iOyF9w "https://www.youtube.com/watch?v=_-AE_iOyF9w").
{{< video https://www.youtube.com/watch?v=_-AE_iOyF9w >}}
## **Virtual Desktop Environment**
### What is a VDE? {#sec-tempworkspace}
*Purpose, Contents, Capabilities*\
A virtual desktop environment (VDE) allows you to interact with a remote system as if it were your own personal computer. The majority of your standard desktop functions are available, but the programs, data, and permissions are all controlled by the remote administrator (Coleridge Initiative). Thus, you will be working in a familiar environment while accessing protected data, programs, and systems that would otherwise be difficult to distribute. The ADRF uses a standard Windows environment (Windows Server) and provides a variety of software packages to conduct your analysis. For more on Windows capabilities, see the section on Windows Settings.
![](images/use1.png){fig-alt="adfr desktop" fig-align="center"}
### Temporary Nature of the Environment
While the environment is similar to that on your home computer (for Windows users), there are a handful of key differences. The first is that the environment is temporary in nature. This means that if you are not using it for a prolonged period of time (default is four hours but can vary by project), running programs will stop running and the information stored in temporary locations will be deleted. You will receive on on-screen message before any sessions are terminated. For more on safe, non-temporary storage locations in the ADRF, see the section on Storing Analytic Results.
Given the temporary nature of the ADRF, it is crucial to make sure that your work is saved---and saved in an appropriate location. Once this is complete and you are finished working, make sure that you log out of the ADRF instead of closing the window. To do this, click the rightmost icon on the top taskbar to open up the dropdown menu and select End Session. You will be prompted to double-check that your work is saved prior to ending your session and confirm that you want to end your session.
## **Modifying the Environment**
### Establishing Personal Folders
Establishing your own personal folders is one of the simplest, yet most important, steps to take when setting up your environment. As we note in the section on Storing Analytic Results, the two possible places to store your analytic results or files are in either the U: drive or the P: drive.
You will find your personal folder in the U: drive. The folder name will include your Firstname and Lastname, and may additionally include your project workspace number. This is a personal workspace that only you can access in the ADRF.
### The U: Drive and the P: Drive
The U: drive is your user drive; it's where you will store any files you are working on. Only the user will have access to the U: drive. For example, if user A wants to share information with user B who is on the same project, user A will need to save files to a P: drive folder and not folders in their U: drive since user B will not be able to access user A's U: drive.
The P: drive is the project drive, which will be used to house project-specific folders. Thus, you and other collaborators on the same project will be able to save files to project drive folders.
Both the U: drive and P: drive have defined resource limitations of 150GB. When the workspace exceeds these limits, users will not be able to create new files or save data. The ADRF will not alert users when they approach on 150GB used. Users can check their current usage by right clicking on the user folder and clicking on properties.
### Other Modifications
The top taskbar contains shortcuts to the command prompt, multiple desktop windows, a temporary folder, settings, full-screen view, and toggling multiple monitors.
![](images/use2.png){fig-align="center"}
### Windows Settings
Your desktop will look familiar if you are a Windows user. You will have icons for quick access to programs or browsers on your desktop. The windows icon on the bottom left side of the screen will open up a menu of programs, folders, and other tools, much as you would see on your own desktop. You will have access to PowerShell and several customization settings (e.g., remove bottom taskbar).
![](images/use3.png){fig-alt="windows software"}
## **Software in the ADRF**
### JupyterLab
JupyterLab provides flexible building blocks for interactive, exploratory computing. While JupyterLab has many features found in traditional integrated development environments (IDEs), it remains focused on interactive, exploratory computing. For more on JupyterLab, see the interface documentation.
The JupyterLab interface on the ADRF consists of a main work area containing tabs of documents and activities, a collapsible left sidebar, and a menu bar. The left sidebar contains a file browser, the list of running terminals and kernels, the table of contents, and the extension manager.
![](images/use4.png){fig-alt="jupyter lab"}
When using Jupyter Notebooks, make sure that all your work is saved to your U: drive and the correct director within the U: drive. You can "nd the active directory by reading the path displayed in the file browser. By default, JupyterLab opens with your U: drive as the base directory. Below, the folder icon in the white box is my user folder (not displayed, but titled `Firstname.Lastname`; you will have already set up your folder) and subfolder WDQI.
![](images/use5.png){fig-alt="jupyter lab home folder" fig-align="center"}
### Notebooks
Jupyter Notebooks are documents that combine live runnable code with narrative text (Markdown), equations (LaTeX), images, interactive visualizations, and other rich output. You can create a notebook by clicking the blue + button in the file browser and then selecting a kernel (R, Python3, Stata) in the Launcher tab. For more information on getting started with Jupyter Notebooks, see JupyterLab Notebook documentation.
### Accessing Stored Data from a Notebook
A common question is how to access stored data while writing to and using a Jupyter Notebook. Data in the ADRF are stored in a database using Microsoft SQL Server. For more information on how to access stored data in the ADRF based on choice of program (Python, R, Stata), see the section on Accessing Your Data.
### Python 3
Python is a general-purpose programming language. You can access Python in a multitude of ways:
1. Through the start menu (windows icon). Type in Python. A desktop app called Python 3.7 (64-bit) will populate a window where you can begin programming.
![](images/use6.png){fig-alt="python program"}
2. Through the command prompt in the top taskbar. Once the command prompt window is open, type in python.
![](images/use7.png){fig-alt="python on the command line" fig-align="center"}
3. Through JupyterLab. !is is the recommended way to access Python since it has packages installed and available, and an execution environment for testing and running code (as well as a place to write and save code). Open JupyterLab and make sure your directory is set appropriately in the "le browser. Once there, in your new Launcher window, click the Python 3 icon.
![](images/use8.png){fig-alt="python in jupyter lab" fig-align="center"}
4\. Through Pycharm.
![](images/use9.png){fig-alt="pycharm" fig-align="center"}
### R
R is a general-purpose programming language. You may access R in one of three ways:
1. Through RStudio. This is an integrated development environment (IDE) for R. You can run R code, display variables, debug R code, do inline visualizations, and more. Open RStudio through the desktop shortcut, or type RStudio in the start menu.
2. Through JupyterLab. Open JupyterLab and make sure your directory is set appropriately in the file browser. Once there, in your new Launcher window, click the R icon.
![](images/use10.png){fig-alt="R in jupyter lab" fig-align="center"}
3. Through the R GUI (graphical user interface). Type R in the search bar and click to open the RGui.
### Stata
Stata is a general-purpose statistical so#ware package. Stata can be accessed through the desktop shortcut StataMP 16 or by searching for it using the search or menu bar, or through JupyterLab.
### DBeaver
DBeaver is a universal tool for querying, editing, and managing data stored in Redshift databases. The ADRF stores data using AWS Redshift Server. DBeaver can be accessed through the desktop shortcut DBeaver or by looking it up using the search bar.
Once open, you will need to connect to a Redshift server. Please follow the directions in the Redshift Querying Guide [Appendix -@sec-guide] section of this guide to connect to the appropriate server.
### Database Navigator
On the left side of DBeaver, a pane labeled Database Navigator allows you to easily explore what is in the server to which you are connected. By clicking the arrow, all the items within each server, Database, Schema, etc., are shown. When exploring these data and writing SQL queries, it is frequently useful to have the navigator expanded to see more easily what columns are in each table and their data type; the datatype can be seen in the screenshot to the right in parentheses next to each column name (e.g., clientid(char64) is a text column of length 64--- for our purposes you can ignore the char... and varchar... and simply treat it as text).
![](images/use12.png){fig-alt="Dbeaver guide" fig-align="center"}
### SQL Editor
The SQL Editor is where you can write your own queries to analyze the data. A new script can be opened by clicking on the blue almost-square (looks a bit like an unrolled scroll) on DBeaver's tool bar:
The location of this script button is circled in the red in the upper left of the screenshot below.
> Note: If you use the SQL button to open a new window, it will prompt you to select a data source and enter your username and password.
![](images/use13.png){fig-alt="sql writing window" fig-align="center"}
![](images/use14.png){fig-alt="sql selecting db" fig-align="center"}
Once you have a SQL Editor window open, you can write a query and run it. One option to run a query is to use the keyboard to hit ctrl+enter, and another option is to use the orange triangle.
### Open a saved .sql FIle
You do not have to create a new script every time! You can open a .sql file either by simply dragging and dropping it from the file explorer, or by going to File → Open File and navigating to a .sql file, as shown in the screenshot below:
![](images/use15.png){fig-alt="save sql" fig-align="center"}
Once you have done so, the top of your SQL Editor window should name the server connection inside the angle brackets to the left of the filename (\<Redshift11_projects\>).
![](images/use16.png){fig-alt="run query" fig-align="center"}
### LibreOffice
LibreOffice is an office productivity suite. LibreOffice comes equipped with six different programs: a word processor program (Writer), a spreadsheet program (Calc), a presentation program (Impress), a graphics editor program (Draw), a math equation program (Math), and a database management program akin to Microsoft Access (Base). LibreOffice may be accessed through the desktop shortcut DBeaver or by looking it up using the search bar. Once you've opened up LibreOffice, you can open any of those six programs, using the left sidebar. For more information on LibreOffice, visit the LibreOffice [website](https://www.libreoffice.org/ "https://www.libreoffice.org/").
![](images/use17.png){fig-alt="libreoffice location" fig-align="center"}
Once you click on the icon, you'll see a page with a left sidebar that has a variety of document types under Create. Select the one suited to your needs and double click to open it.
![](images/use18.png){fig-alt="libreoffice navigator" fig-align="center"}
### More...
The ADRF provides a number of additional programs such as a simple text editor (Notepad++), PyCharm (an IDE for Python users), and several web browsers. Please note that web browsers are limited only to approved websites.
## **Available Software**
The ADRF provides numerous software applications to users. Every user in the ADRF has access to:
- R Studio
- R
- Python, through Jupyter Labs or PyCharm
- Jupyter Labs, R and Python kernels available
- DBeaver
- LibreOffice
- Notepad++
- MikTex
- Java
If there is software that you would like to use for your project and is not installed in the ADRF, please email [[support\@coleridgeinitiative.org]{.underline}](mailto:support@coleridgeinitiative.org "mailto:support@coleridgeinitiative.org").
If you would like to add additional packages to your workspace, please see the section on [Adding Additional Packages in R/Python](https://coleridgeinitiative.atlassian.net/wiki/spaces/ADRF/pages/1953890305 "/wiki/spaces/ADRF/pages/1953890305").
If there is a Python/R package you would like installed, please see Additional Packages in R/Python.