Parent Samples: Derivation and Lineage

Documentation: Version 20.7
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.

  • From a Sample Type, select one (or more) sample(s) to use as parent, then click Derive Samples.
  • Specify Source Materials:
    • Name. The source samples are listed here.
    • Role. Roles allow you to label each input with a unique purpose.
      • Create new roles by selecting Add a New Role... and typing the role name in the box.
      • Roles already defined will be on the dropdown list alongside "Add a new role..."
  • Number of Derived Samples. You can create multiple derived samples at once.
  • Target Sample Type. You have the option to make derived samples part of an existing sample type. If you select no existing sample type, the derived output sample becomes part of the generic Materials table. You can access Materials from the Sample Types web part by clicking Show All Materials.
  • Click Next.
  • On the next page, you will see input sample information.
  • Enter a Name (required if no naming pattern is defined) and any properties specific to the Output Sample(s).
  • Click Submit.

  • The Roles specified become labels within the graphical view of the samples. To see the graph, click the link next to Lineage Graph:

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.

DerivedSample-2M-100, M-200

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:

DerivedSample-3M-100, M-200R-100

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.

Display the Parent Column

By default a sample type does not display the parent columns, either the Material Inputs or the Data Inputs. To show these columns:

  • Go the relevant sample type.
  • In the panel Sample Type Contents, click (Grid Views) > Customize Grid.
  • Select Show Hidden Fields.
  • Open the nodes Inputs > Data or the nodes Inputs > Materials.
  • Select the field you would like to show.
  • Save the grid, either for your own viewing, or for sharing with others.

Lineage Graphs

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.

Rendering Differences

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.

Related Topics

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


Was this content helpful?

Log in or register an account to provide feedback

expand all collapse all