Parent Samples: Derivation and Lineage

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

The following topics explain 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 samples together to create compounds.

To Derive Aliquots:
  • From a Sample Set, select one sample to use as parents, 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 Set. You have the option to make derived samples part of an existing sample set. If you select no existing sample set, the derived output sample becomes part of the generic Materials table. You can access Materials from the Sample Sets web part by clicking Show All Materials.
  • Click Next.
  • Enter properties specific to the Output Sample(s) if needed.
  • Click Submit.

There is also a link to Derive samples from this sample link on the details view of each individual sample.

To Derive a Compound:
  • From a Sample Set, select multiple samples to use as parents, 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.
  • Number of Derived Samples. You can create multiple derived samples at once.
  • Target Sample Set. You have the option to make derived samples part of an existing sample set.
  • Click Next.
  • Enter properties specific to the Output Sample(s) if needed.
  • 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:

Capture Sample Parentage: Alias Parent Column

Within a Sample Set design, you can indicate one or more columns that contain parentage information. The parentage information can exist in the same or a different Sample Set. Parentage information can also exist in a Data Class. On import of new sample data, the Sample Set will look for the indicated column for the parentage information. Note that the column indicated is not actually added to the Sample Set 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:

NameParentVial
v1 
v1.1v1
v1.2v1

You would indicate the parent column alias as "ParentVial" (see screenshot below).

To add parentage columns to a Sample Set:

  • Navigate to the folder or project where the Sample Set lives.
  • In the Sample Sets web part, click the target Sample Set.
  • In the Sample Set Properties panel, click Edit Set.
  • On the Update Sample Set page, click add parent column import 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 an existing Sample Set, instead it should refer to a column in the source data to be imported.
  • Use the drop down to indicate the Sample Set (or Data Class) where the parent column resides. This may be in the same Sample Set, a different Sample Set, or a Data Class.
  • Click Update.
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, for example, create parentage graphs as shown below.

Capture Sample Parentage: MaterialInputs and DataInputs

When importing samples, you can indicate parentage by including a column named "MaterialInputs/<NameOfSampleSet>", where <NameOfSampleSet> refers to some existing sample set, either a different sample set, or the current one. Note that the MaterialInputs column is not actually added to the Sample Set 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 set RawMaterials.

NameMaterialInputs/RawMaterials
DerivedSample-1M-100

You can point to parents in the same or different sample sets. The following shows child and parent samples both residing in the sample set MySampleSet:

NameMaterialInputs/MySampleSet
ParentSample-1 
ChildSample-1ParentSample-1

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 set.

NameMaterialInputs/RawMaterials
DerivedSample-2M-100, M-200

You can indicate parents across multiple sample sets by adding multiple MaterialInput columns. The following indicates that DerivedSample-3 has three parents, two from RawMaterials, and one from Reagents:

NameMaterialInputs/RawMaterialsMaterialInputs/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

NameDataInputs/ExpressionSystems
DerivedSample-4ES-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 set does not display the parent columns, either the Material Inputs or the Data Inputs. To show these columns:

  • Go the relevant sample set.
  • In the panel Sample Set Contents, click null (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". Sample 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 for other samples.

To view a derivation graph:

  • Go to the sample set of interest.
  • Click the individual sample name or id.
  • On the sample details page, under Standard Properties > Lineage Graph, click the link Lineage for <Your Sample>. If there is no parentage information, there will be no link and no graph.

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

Was this content helpful?

Log in or register an account to provide feedback


previousnext
 
expand allcollapse all