Now that your study has multiple datasets aligned with participant and time information, you can start to take advantage of the integrated data. In this step you will:

Create Quick Visualizations

There are two quick ways to visualize the data in a column:

Column Visualizations

These plots are shown within the data grid itself and can be saved as part of a grid view.

  • Click the Clinical and Assay Data tab, then click Demographics.
  • Click the header for the Country column and select Pie Chart.
  • A pie chart showing relative prevalance of each value in the country column will be added to the top of the grid.
  • The new chart is part of the grid view. Notice the message "This grid view has been modified." and links to Revert, Edit, or Save this new version.
  • Click Save and in the popup, click Save again leaving the radio button selected to save this as the default grid view for this page.

The types of visualization available on the column pulldown menu depends on the datatype in the column selected. Numeric columns (such as 'Height') include a box and whisker plot style, for example, which wouldn't be useful with a string column like 'Country'.

Hovering over the column visualization itself will reveal an 'x' for deleting it if desired. When you click a column visualization, you open the same chart in the plot editor UI, described below where you could further customize it to save as a standalone visualization.

Quick Charts

Another option on the column header menu is Quick Chart. These charts can be created in one step from a single column of data, but are saved separately from the grid data display.

  • Return to the Demographics dataset if you navigated away (by going to the Clinical and Assay Data tab, then clicking Demographics).
  • Click the header for the Country column again and this time select Quick Chart.
  • LabKey Server will make a "best guess" visualization of the column. In this case, a bar chart plotting the count of each value, including a column for [Blank] values.
  • Notice that you are now in the main plot editor and could change the chart type and layout as you like.
  • Click Save, name the plot "Quick Chart: Country", and click Save.
  • Click the Clinical and Assay Data tab. Notice that the chart has been added to the list.
  • When you view the Demographics dataset again, this chart will also be available on the (Charts) menu.

Join Datasets

What if you want to see how viral load (from the "Lab Results" spreadsheet) might vary with different ARV treatments (recorded in the "Physical Exam" spreadsheet)? Now that the spreadsheets have been imported to the LabKey study as datasets, we can easily create a combined, or joined view, of the two.

  • Go to the Clinical and Assay Data tab.
  • Click the Lab Results dataset.
  • Select (Grid Views) > Customize Grid.
  • In the Available Fields panel, scroll down and open the node DataSets by clicking the .
    • You may notice that DataSets is greyed out, as are the names of the datasets themselves. This only means that these are not "fields" or columns to select for display, but nodes you can open in order to select the columns they contain.
  • Open the node Physical Exam and check the boxes for ARV? and ARVRegimen Type. This indicates that you wish to add these columns to the grid you are viewing. Notice they are added to the list in the Selected Fields panel.
  • Click Save.
  • In the Save Custom Grid View dialog, select Named and enter "Lab Results with ARV Information". Click Save.

You now have a joined data grid containing columns from both the Lab Results and Physical Exam datasets. Notice the view name in the header bar, and you can also open it from the (Grid Views) menu.

Create More Complex Visualizations

Using the joined grid you created, we will introduce the plot editor using the example of visualizing the viral load levels for various ARV treatments.

Plot Integrated Data

  • Click the column header ARV? and select Filter....
  • In the popup, click the label "true" so that only that checkbox will be selected, i.e. you will see only patients receiving ARV treatments.
  • Click OK to apply the filter. This will reduce the number of "blank" values to plot.
  • On the filtered grid select (Charts) > Create Chart. This opens the common plot editor where you can create and customize many types of chart. The Bar plot type is selected by default.
  • For X Axis Categories, select ARV Regimen Type by dragging it from the list of columns on the right into the box. This column came from the "Physical Exam" dataset.
  • For the Y axis, select Viral Load. This column came from the "Lab Results" dataset.
  • By default, the "sum of" viral load will be plotted. In this case the average value might be more useful, so use the pulldown for Aggregate Method to select "Mean".
  • Click Apply.
  • Click Save, name the report "Mean Viral Load by ARV Regimen", and click Save in the popup.
  • Your chart will now be listed on the Clinical and Assay Data tab.

Plot Trends Over Time

A key part of study research is identifying trends in data over time. In this example, we will create a chart that shows lymphocyte levels for the two cohorts over the course of the study.

  • Click the Clinical and Assay Data tab.
  • Click the Lab Results dataset.
  • Select (Charts) > Create Chart.
  • Click Time.
  • Notice there are no columns to plot.

Time charts require that columns used have been explicitly marked as "measures". To do so we edit the dataset definition:

  • Click Cancel to leave the plot editor and return to the grid for Lab Results.
  • Click Manage in the header bar of the grid, then click Edit Definition.
  • Scroll down to the Dataset Fields, and select the Lymphs field by clicking inside the Name or Label text boxes.
  • The field properties editor (a set of tabs) will appear to the right.
  • Select the Reporting tab, and check the box next to Measure.
  • To increase your charting options, repeat for the other 3 fields (CD4, Hemoglobin, Viral Load). Notice that switching rows leaves the same tab open in the property editor. Notice also a wrench icon marks any changed rows.
  • Scroll up and click Save.

Now we are ready to plot lymphocyte levels on a time chart.

  • Click View Data to return to the "Lab Results" data grid.
  • Select (Charts) > Create Chart.
  • Click Time again. Notice now that the columns you marked as measures are listed on the right.
  • Drag the Lymphs column to the Y Axis box.
  • Click Apply.

By default, the time chart plots for the first 5 individual participants in the data grid. To instead compare trends in the cohorts:

  • Click Chart Layout where you can customize the look and feel of a chart.
  • Change the Subject Selection to Participant Groups.
  • Click Apply.

There are now two lines, one for each cohort now, but the data is relatively noisy making it hard to see a general trend. Let's try fewer data points along the X-axis.

  • Click Chart Type this time.
  • In the X-axis panel, change the Time Interval pulldown to "Months".
  • Click Apply.

Now we see a clear trend (in our fictional data) where lymphocyte levels in the HIV negative cohort generally trend up over time, while those in the Acute HIV-1 cohort generally trend somewhat down over the 20 months studied.

  • Click Save.
  • Name your time chart "Lymphocyte Trends" and click Save in the popup.

What's Next?

Using the plot editor lets you explore various ways of visualizing data in one place, with no need to save as you go or start from scratch each time. You can edit Chart Type or Chart Layout using the header bar links. Change any plot to another plot type by clicking the plot type buttons on the left. You can also open the common plot editor by clicking any column visualization, like the pie chart we created above. You needn't save anything until you are satisfied with the look and overall layout.

Related Topics

Previous Step | Next Step (5 of 5)

Was this content helpful?

Log in or register an account to provide feedback


previousnext
 
expand allcollapse all