Skip to main content

Views

Learn what views are, how to create them and use them for tasks.

Views provide a flexible way to prepare data inputs that match your task requirements. A view is a saved SQL query on top tables in your workspace. By creating a view you can combine, slice, sort, and filter data from multiple tables in a way that aligns with your task's expected schema.

While tables maintain rigid structures to ensure consistent data imports, views give you the freedom to reshape and select exactly the data your task needs.

Views are dynamic and are updated as the data in the underlying tables changes. This means that when new data is added or removed from the table this is visible in the view.

Example

In the example below you can see how a view can combine data from different tables.

Example

Creating a view

Views are created through the API, learn more in /table. This endpoint is used to create both tables and views, to create a view specify kind as VIEW.

Unlike tables, views can be customized freely after their creation. Updating a view can be done through the API. Learn more in /tables.

Using views for tasks

When creating a view for a specific task make sure to include the columns required. To understand requirements for a task see the API reference documentation, learn more in /task/create.

Example

You want to analyze the quality of data you intend to import to Cradle using the task Analyze Data. You see that the following columns are required in the dataset.

reference_sequence
required
string (Reference Sequence)

The sequence to consider as a reference for computing mutations.

required
Table source (any) (TableSource_AssayedSequences_)

The assay data to be used for model training.

The source table must have the following schema:

Column Name Type Required Description
sequence STRING Yes The assayed sequence.
assay_value FLOAT64 Yes The measured value for assay_id.
batch_id STRING Yes The batch this measurement was part of. Measurements with the same batch_id are assumed to be comparable to each other.
assay_id STRING Yes The ID of the assay (as specified in the assays configuration in task parameters).
sample_id STRING Yes A unique identifier assigned to a physical protein sample (such as plate_name+well_name). Useful if the same sequence was measured multiple times in the same batch. The sample ID shows which measurement corresponds to which sample.
Array of objects (Assays) <= 50 items

List of assay metadata entries

You have two tables, one for sequence data and one for assay data. To create a view including all required column types for the task you run a SQL query that combines the data from both tables.

Example