# Family Based Analysis with Pedigree Information

Workbench allows you to associate pedigree information with your samples, enabling trio or family-based analysis workflows. This guide walks you through the process of adding pedigree data and running workflows with family relationships.

## Adding Pedigree Information

### Upload Pedigree Files

1. Navigate to the **Data** page in the left sidebar.
2. Select the connected storage account containing your sequencing data.
3. Click the **Add Pedigrees** button in the top-right corner.
4. Select one or multiple `.ped` files (standard pedigree file format).
5. Click **Upload** to associate the pedigree information with your samples.

{% hint style="info" %}
Workbench uses a relaxed version of the standard PED format. While the traditional format includes family ID, individual ID, paternal ID, maternal ID, sex, and phenotype information, Workbench allows you to omit sex and phenotype information if these details are not available.\
\
The .ped file should not contain a header before uploading else an error will occur.
{% endhint %}

### Pedigree Management

* **Cross-Storage Relationships**: Family relationships are not storage-scoped. If you have the same samples in multiple storage accounts, the family relationships will be recognized across all accounts.
* **Updating Pedigrees**: To update existing pedigree information, upload a new PED file with the updated relationships. Workbench will update the relationships accordingly.

## Viewing Family Information

Once pedigree information is uploaded, you can:

1. View family groupings on the **Samples** page.
2. Filter samples by **Family ID** to see all samples within a particular family.

## Running Workflows with Family Data

### Running Family-Based Analysis

1. Navigate to the **Data** page and select your storage account.
2. From the **Samples** page, you can:
   * Filter by a specific **Family ID** and select all family members.
   * Manually select individual samples from the table.
3. Click **Run Workflow** after making your selection.

### Workflow Submission Behavior

* **Family Grouping**: When you select multiple samples belonging to the same family, Workbench will group them together in the workflow submission.
* **Automatic Trio Detection**: If you select a proband with parents, Workbench will automatically identify and run them as a trio.
* **Mixed Selections**: If you select samples from different families, each family will be processed as a group, and any remaining samples will be processed as singletons.

### Previewing Workflow Runs

1. After selecting samples and clicking **Run Workflow**, choose the desired workflow and version.
2. Click the **eye icon** to open the **Preview Runs** dialog.
3. Review how the samples will be grouped and processed before submitting.
4. Click **Submit** to start the analysis.

## Supported Metadata Fields

The following metadata fields are supported for individual samples:

* **FAMILY\_ID `String`**
  * Identifier for the family
  * Cannot include spaces
  * Can be set to the same value as `INDIVIDUAL_ID` if the sample is a singleton
  * If individuals are designated as parent & child, they must have the same family ID
* **INDIVIDUAL\_ID `String`**
  * Identifier for the individual
  * Cannot include spaces
  * Must be unique
* **PATERNAL\_ID `String`**
  * 0 if the father is not in the cohort
  * `INDIVIDUAL_ID` of the father if they are in the cohort. Must match an individual with sex set to male, and with the same `FAMILY_ID` as the child
* **MOTHER\_ID `String`**
  * 0 if the mother is not in the cohort
  * `INDIVIDUAL_ID` of the mother if they are in the cohort. Must match an individual with sex set to female, and with the same `FAMILY_ID` as the child
* **SEX** (optional) `Integer`
  * 0 = UNKNOWN
  * 1 = MALE
  * 2 = FEMALE
  * 3 = OTHER
* **PHENOTYPE/Affected status** (optional) `Integer`
  * 0 = UNKNOWN
  * 1 = UNAFFECTED
  * 2 = AFFECTED


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.omics.ai/products/workbench/instruments/adding-pedigrees.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
