LabKey Server understands relationships between different samples, including when a sample is an aliquot from a larger parent sample, or when a mixture is created from multiple parent samples. Visualizations of these relationships are shown using "Lineage Graphs".
This topic covers how to capture these sample-to-sample relationships in LabKey Server.
Derive Aliquots or Compounds Using the User Interface
You can derive samples using the user interface, either by splitting samples up into smaller portions to create aliquots or mixing multiple samples together to create compounds. The user interface for both operations is the same, the difference being that for aliquots you would derive from a single parent, and compounds would be composed of multiple samples.
There is also a link to Derive samples from this sample
link on the details view of each individual sample, making creation of aliquots straightforward from here.
Capture Sample Parentage: Alias Parent Column
Within a Sample Type design, you can indicate one or more columns that contain parentage information. The parentage information can exist in the same or a different Sample Type. Parentage information can also exist in a Data Class. On import of new sample data, the Sample Type will look for the indicated column for the parentage information. Note that the column indicated is not
actually added to the Sample Type as a new field, instead the system merely pulls data from indicated column to determine parentage relationships.
For example, if you want to import the following samples table:
You would indicate the parent column alias as "ParentVial" (see screenshot below).
To add parentage columns to a Sample Type:
- Navigate to the folder or project where the Sample Type lives.
- In the Sample Types web part, click the target Sample Type.
- In the Sample Type Properties panel, click Edit Type.
- On the Update Sample Type page, click Add Parent Alias.
- In the Parent Alias enter the column name which contains the parentage information. The column name is case sensitive. The column name you enter here should not refer to a column in the existing Sample Type, instead it should refer to a column in the source data to be imported.
- Use the drop down to indicate the Sample Type (or Data Class) where the parent samples reside. This may be in the same Sample Type "(Current Sample Type)", a different Sample Type, or a Data Class.
- You can add additional parent aliases as needed.
- Click Save.
When importing data, include the indicated parent column and its data, as in the example screenshot below.
The system will parse the parentage information, and create lineage relationships. Learn about lineage graphs below
Update Parent Information During Import
You can also update
parent information during import (change or delete parents) by selecting the "Update data for existing samples during import" checkbox.
Learn more in this topic: Update or Remove Sample Lineage During Import
Capture Sample Parentage: MaterialInputs and DataInputs
When importing samples, you can indicate parentage by including a column named "MaterialInputs/<NameOfSampleType>", where <NameOfSampleType> refers to some existing sample type, either a different sample type, or the current one. Note that the MaterialInputs column is not
actually added to the Sample Type as a new field, instead the system merely pulls data from the column to determine parentage relationships. For example, the following indicates that DerivedSample-1 has a parent named M-100 in the sample type RawMaterials.
You can point to parents in the same or different sample types. The following shows child and parent samples both residing in the sample type MySampleType:
To indicate multiple parents, provide a list separated by commas. The following indicates that DerivedSample-2 is a mixture of two materials M-100 and M-200 in the RawMaterials sample type.
You can indicate parents across multiple sample types by adding multiple MaterialInput columns. The following indicates that DerivedSample-3 has three parents, two from RawMaterials, and one from Reagents:
Samples can be linked to Data Classes
using a similar syntax. The following indicates that DerivedSample-4 is derived from an expression system ES-100
Capture Sample Parentage: API
You can create a LABKEY.Exp.Run
with parent samples as inputs and child derivatives as outputs.
Include Ancestor Metadata in Sample Grids
You can include fields from ancestor samples and sources by customizing grid views. If you are using the Sample Manager or Biologics LIMS products, switch to the LabKey Server interface
and open the Sample Type you want to show ancestor fields for.
For example, if you had a "PBMC" sample type and wanted to include in the grid both the "Draw Date" field from the parent "Blood" sample type AND the "Strain" field from a "Mouse" source, you would follow these steps:
- Open the details page for the "PBMC" sample type.
- Select > Customize Grid.
- Expand the "Ancestors" node, then "Samples", then "Blood".
- Check the box for "Draw Date".
- In the "Ancestors" node, expand the "Registry And Sources" node, then "Mice".
- Check the box for "Strain".
- In the Selected Fields panel, drag the new fields to where you want them to be displayed, in this case to the right of the "Processing Operator" field.
- You can use the to edit the title if desired, shown here we include the name of the parent type in the display title for each column.
- Save the grid view, making sure to share it with all users.
- You can decide whether to save it as the Default grid, or save it with a name that will let you find it under the menu.
- Now the grid will include your fields. You could then filter, sort, and search based on that parent metadata. Shown below, we're showing only samples that come from "BALB/c" mice.
Derived samples are represented graphically using "lineage graphs". To view:
- Go to the Sample Type of interest.
- Click the individual sample id or name.
- In the Standard Properties panel, click the link for the Lineage Graph, i.e.: Lineage for <Your Sample Name>. If there is no parentage information, there will be no link and no graph.
Samples are represented as rectangles and the derivation steps are shown as diamonds. Note that elements in the graph are clickable links that navigate to details pages. By default you will see the Graph Detail View
If you click the Graph Summary View
tab, you will see a different presentation of the same process and lineage.
Clicking Toggle Beta Graph (New!)
from the Graph Summary View
will give you a another way to view the same information. Click any node to reset the point of focus of this graph, explore details in the panel to the right, and zoom/resize the graph using the controls.
Note that lineage graphs can differ depending on the way that the data is entered. When you manually derive multiple child samples from a parent via the Derive Samples button
, the lineage graph summary view will show these child samples on one graph, as shown below in a case where two additional samples have been derived from the "Derived Yeast Sample".
When the sample parent/child relationships are imported via copy-and-paste or via the API, separate lineage graphs will be rendered for each parent/child relationship. A single graph showing all the child sample simultaneously will not be available.
Premium Feature Available
Subscribers to premium editions of LabKey Server can use the Run Builder
to streamline creation of experiments with inputs and outputs:
Learn more about premium editions