LabKey's assay framework helps you to share experimental data and metadata with collaborators. It can be a powerful tool for aggregating data across multiple labs and for making decisions on a course of research based on what others are finding. But how can you record data in a way that makes it easily comparable across labs? When different groups use slightly different words for the same thing, how can you ensure that data are entered consistently? How can you guard against the inevitable typo, or entry of the wrong information into the wrong field?
This page introduces a few of the ways LabKey Server can help your team improve consistency and reduce user error during initial data entry:
Use Lookups to Constrain Input
When users upload assay data, they often need to enter information about the data and might use different names for the same thing. For instance, one user might enter "ABI-Qstar" and another simply "Qstar" for the same machine. By defining a lookup for an assay field, you can eliminate this confusion by only allowing a pre-set vocabulary of options for that field.
In this scenario, we want users to choose from a dropdown list of instruments, rather than name them instrument themselves when they upload a run. We modify the assay design to constrain the instrument field to only values available on a given list. The example GeneralAssay design used here comes from the design a general purpose assay tutorial
, so if you have completed that tutorial you may follow these steps yourself.
Create a List to Define Lookup Vocabulary
First you need to create the list from which you want dropdown values to be chosen.
- Download this file: Instruments.xls
- Select (Admin) > Manage Lists.
- Click Create New List.
- Name: Lab Instruments
- Primary Key: InstrumentID
- Primary Key Type: Text (string)
- Import from file checkbox: Checked
- Click Create List.
- Click Browse or Choose File and select the file Instruments.xls you just downloaded.
- Click Import.
Edit the Assay Design
Change the assay design so that the instruments field no longer asks for open user entry, but is a dropdown instead:
- Select (Admin) > Manage Assays.
- Click GenericAssay.
- Select Manage Assay Design > Edit assay design.
- In the Batch Fields section, in the Instrument field, use the Type dropdown menu to select Lookup.
- The panel will open, so you can enter the Lookup Definition Options:
- Target Folder: [current folder]
- Target Schema: lists
- Target Table: Instruments (String)
- Check the box for Ensure Value Exists in Lookup Target to require that the selected value is present in the lookup's target table or query.
- Scroll down and click Save.
If you have now made these changes in your tutorial project, you can see how it will work by starting to import an additional run:
- On the GenericAssay Runs page:
- Click Import Data.
- On the Batch Properties page notice that the Instruments field is now a dropdown list instead of a simple text field.
Set Default Values
When the user must enter the same fixed values repeatedly, or you want to allow prior entries to become new defaults for given fields, you can do so using built in default values for fields. Default values may be scoped to a specific folder or subfolder, which can be useful in a situation where an assay design is defined at the project level, the overall design can be shared among many subfolders, each of which may have different default value requirements.
Configure Data Validation
Field level validation can programmatically ensure that specific fields are required, entries follow given regular expressions, or are within valid ranges.