> For the complete documentation index, see [llms.txt](https://help.bioinsight.illumina.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.bioinsight.illumina.com/connected-insights/configure/configuration/du-introduction/du-custom-pipeline-configuration.md).

# Custom Pipeline Configuration

## Custom Pipeline Configuration

The custom pipeline option is designed to make Connected Insights understand the structure of the secondary analysis output files produced by a pipeline that is not yet compatible with the software. This option also requires the creation of a workflow schema file that describes the content and location of the secondary analysis output files. For an example of a how to configure a custom pipeline for TSO 500 Analysis Module v2.2, refer to [Custom Pipeline Configuration Example](#custom-pipeline-configuration-example).

In Connected Insights v5.5 and later, the same YAML file also **registers the pipeline and its QC thresholds** when uploaded from **Configuration > General > Pipeline & QC Configuration**. For pipeline registration (`pipeline:`), QC thresholds (`threshold:`), and uploading the file, refer to [Pipeline and QC Configuration](/connected-insights/configure/configuration/c-pipeline-and-qc-configuration.md) and [Pipeline and QC Configuration YAML](/connected-insights/configure/configuration/c-pipeline-and-qc-configuration/pipeline-and-qc-yaml-reference.md). The sections below document the **file-layout** portions of the YAML (`sampleSheet`, `jointFiles`, `sampleFiles`).

### Select Custom Pipeline

1. Input secondary analysis output folder to be monitored.
2. In Configuration Settings, select the radio button next to Configure custom pipeline.
3. If necessary, create a workflow schema file by selecting **Download the template file**. For more information on setting up the template file, refer to [Create a Workflow Schema File](#create-a-workflow-schema-file)
4. Select **Choose File** to upload your template file.
5. For Custom Pipeline Name, enter a name for the pipeline.
6. For Test Definition, select the applicable definition.
7. \[Optional] Input the location of the folder where [case metadata data](/connected-insights/configure/configuration/du-introduction/du-custom-case-dataupload.md) is available.
8. Select **Save**.

### Create a Workflow Schema File

To set up data upload for secondary analysis output data that is not yet compatible with Connected Insights, create a workflow schema file (.yaml format). This file specifies the files in the secondary analysis output data that Connected Insights analyzes. This file is only used when configuring a custom pipeline through **Data Upload > From Local Storage**.

Download a workflow schema file template from Connected Insights as follows.

1. On the top toolbar, select **Configuration**.
2. Select the **General** tab.
3. Select **Data Upload**.
4. Select **From Local Storage**.
5. For Define and Monitor Data Uploads, select **Add Path**.
6. For Configuration Settings, select the radio button next to Configure custom pipeline.
7. Select **Download a template file** to download the workflow schema template file.\
   If you do not want to create a pipeline, select **Cancel**. When prompted, select **Yes, clear**.
8. Edit the file as needed to reflect the files for upload. Refer to the following topics that pertain to the workflow schema template file sections:

   * [Pipeline and QC Configuration YAML](/connected-insights/configure/configuration/c-pipeline-and-qc-configuration/pipeline-and-qc-yaml-reference.md) — `pipeline:` registration and `threshold:` QC metrics (required when uploading from **Pipeline & QC Configuration**)
   * [Sample Sheet](#sample-sheet)
   * [Joint Files](#joint-files)
   * [Sample Files](#sample-files)

   <div data-gb-custom-block data-tag="hint" data-style="warning" class="hint hint-warning"><p>If <code>, Optional</code> is after the file name, then Connected Insights uploads the file if it is available or moves on to the next available file.</p></div>
9. After the workflow schema file is edited, create a pipeline. Then, select **Configure manually** under Configuration Settings.
10. Select **Choose File** and upload the edited workflow schema file.
11. Complete the remaining fields and save the pipeline.

    <div data-gb-custom-block data-tag="hint" data-style="warning" class="hint hint-warning"><p>If this pipeline is used for manual uploading, make sure that the pipeline name only consists of numbers, letters, underscores, and dashes. The name cannot include spaces or special characters. This name is used in the --pipeline-name= command listed in <a href="/connected-insights/configure/configuration/du-introduction/du-user-storage.md">On-Demand Data Upload from User Storage (Connected Insights - Cloud Only)</a></p></div>

### Pipeline Registration and QC Thresholds

The `pipeline:` block (display name, version, Platform Core ids, marker files) and the `threshold:` QC section are documented in [Pipeline and QC Configuration YAML](/connected-insights/configure/configuration/c-pipeline-and-qc-configuration/pipeline-and-qc-yaml-reference.md). For uploading a complete configuration file from **Configuration > General > Pipeline & QC Configuration**, refer to [Pipeline and QC Configuration](/connected-insights/configure/configuration/c-pipeline-and-qc-configuration.md).

## File Layout Overview

These three sections tell Connected Insights where each analysis output file lives; they are what populate the Results, Visualize, and Lab QC tabs. The `jointFiles` section is required in practice — it declares the variant files, and an analysis imported without it brings in no variants and may fail; `sampleSheet` and `sampleFiles` are optional. Every file slot takes an **ordered list of candidate glob patterns** (first match wins), and each pattern may carry the trailing `, Optional` marker.

### Sample Sheet

Locates the sample sheet and maps its columns to Connected Insights expected fields.

```yaml
sampleSheet:
  filePath: SampleSheet.csv
  columnAliases:
    sampleType: DnaOrRna
    sampleId: Sample_ID
    pairId: PairID
  dataHeaderRowMarker:
    - "[Sample_Data]"
    - "[Cloud_Sample_Data]"
```

| Key                   | Purpose                                                                                              |
| --------------------- | ---------------------------------------------------------------------------------------------------- |
| `filePath`            | Path to the sample sheet CSV.                                                                        |
| `columnAliases`       | Maps the sample-sheet column names to Connected Insights fields (see below).                         |
| `dataHeaderRowMarker` | The marker row(s) that appear immediately above the column headers (e.g. `[Data]`, `[Sample_Data]`). |

**`columnAliases`** — each is set to the corresponding column name in the lab's sample sheet:

| Alias          | Maps to                                             |
| -------------- | --------------------------------------------------- |
| `sampleId`     | Sample ID (becomes the Case ID)                     |
| `sampleType`   | DNA / RNA sample-type column                        |
| `pairId`       | Pair ID used to group DNA + RNA (or tumor + normal) |
| `caseId`       | Case grouping id                                    |
| `sex`          | Patient sex                                         |
| `specimenType` | Specimen type                                       |
| `subjectId`    | Subject id                                          |
| `disease.id`   | Disease SNOMED CT code                              |
| `disease.name` | Disease SNOMED CT name                              |

For disease aliases, if the disease name or ID is not provided, then the Status column on the Cases page displays Missing Required Data. This message displays until the disease name or ID is added. You can add a disease by uploading disease information as custom case data. You can also open the case in Connected Insights and enter the disease for an individual case. For more information on key genes, refer to [Overview Tab](/connected-insights/interpret-and-report/cm-overview-tab.md).

## Joint Files

Per-case variant, biomarker, and QC files. Each key is one logical file type; all are lists of candidate patterns. At least one variant file type (typically `snvFiles`) must be declared for an analysis to import any variants.

File names can include symbolic references to the files that depend on the Sample ID or Pair ID:

* `{sampleId.DNA}`: Corresponds to the Sample\_ID column when Sample\_Type is DNA.
* `{sampleId.RNA}`: Corresponds to the Sample\_ID column when Sample\_Type is RNA.
* `{sampleId.tumor.DNA}`: Corresponds to the Sample\_ID column when Sample\_Type is DNA and Sample\_Classification is TUMOR.
* `{sampleId.tumor.RNA}`: Corresponds to the Sample\_ID column when Sample\_Type is RNA and Sample\_Classification is TUMOR.
* `{sampleId.normal.DNA}`: Corresponds to the Sample\_ID column when Sample\_Type is DNA and Sample\_Classification is NORMAL.
* `{pairId}`: Corresponds to the Pair\_ID column, used for Case Display ID; the samples with same Pair\_ID will group together as one case.
* `{prefix}`: Corresponds to the Output\_file\_prefix column.

When using the workflow schema file template downloaded from the Configuration page, lines for files that are not uploaded can be deleted. The `, Optional` designation can be removed unless the file is an optional file for the pipeline.

| Key                      | Typical format    | Contents                                             |
| ------------------------ | ----------------- | ---------------------------------------------------- |
| `snvFiles`               | VCF               | Small variants (SNV / MNV / indel)                   |
| `cnvFiles`               | VCF               | Copy-number variants                                 |
| `svFiles`                | VCF               | Structural variants                                  |
| `rnaSpliceFiles`         | VCF               | RNA splice variants                                  |
| `rnaFusionFiles`         | VCF               | RNA fusions                                          |
| `rnaGeneExpressionFiles` | `.quant.genes.sf` | RNA gene expression (TPM)                            |
| `tmbFile`                | JSON / CSV        | Tumor mutational burden                              |
| `msiFile`                | JSON              | Microsatellite instability                           |
| `gisFile`                | JSON              | Genomic instability score                            |
| `hrdFile`                | CSV               | Homologous-recombination deficiency                  |
| `mrdFile`                | JSON              | Minimal residual disease                             |
| `hlaFile`                | TSV               | HLA genotyping                                       |
| `purityPloidyFiles`      | VCF / TSV         | Purity and ploidy                                    |
| `metricsQCFile`          | CSV / TSV         | QC metrics — the source for the `threshold:` section |

### Sample Files

Per-sample alignment and visualization files that drive IGV and the coverage plots. They are grouped by `tumorPairId` and `normalPairId`. For more information on IGV, refer to [IGV Visualizations](/connected-insights/interpret-and-report/inter-variant-grid/inter-igv-visualizations.md).

```yaml
sampleFiles:
  tumorPairId:
    visualizationFiles:
      coverageBedFiles: [ "{sampleId.DNA}/{sampleId.DNA}.target_bed_read_cov_report.bed, Optional" ]
      coverageFiles:    [ "{sampleId.DNA}/{sampleId.DNA}.target.counts.gc-corrected.gz, Optional" ]
    alignmentFiles:
      dnaBamFile:
        - "{sampleId.DNA}/{sampleId.DNA}_tumor.bam, Optional"
        - "{sampleId.DNA}/{sampleId.DNA}_tumor.cram, Optional"
      dnaBaiFile:
        - "{sampleId.DNA}/{sampleId.DNA}_tumor.bam.bai, Optional"
        - "{sampleId.DNA}/{sampleId.DNA}_tumor.cram.crai, Optional"
```

* **`alignmentFiles`** — `dnaBamFile`, `dnaBaiFile`, `rnaBamFile`, `rnaBaiFile` (and generic `bamFile` / `baiFile`) drive the Visualize tab's IGV / BAM track. **CRAM/CRAI** may be supplied in place of BAM/BAI — listing both as candidates, as above, lets Connected Insights ingest whichever is present.
* **`visualizationFiles`** — `coverageFiles`, `coverageBedFiles`, and `ballelesFiles` feed the gene-coverage and B-allele-frequency plots.

{% hint style="info" %}
Because every slot is an ordered list, several naming variants (tumor vs. prefix-based, BAM vs. CRAM, etc.) can be listed for one logical file, and Connected Insights picks the first that exists — useful when a pipeline's output names vary by run.
{% endhint %}

## Custom Pipeline Configuration Example

The following example shows the custom pipeline configuration process using Local Run Manager TruSight Oncology 500 Analysis Module v2.2. For details on this process, refer to [Custom Pipeline Configuration](#custom-pipeline-configuration).

### Uploaded Data

Uploaded data is organized as cases that provide details about the sample. A case is a secondary analysis result that has been imported and annotated.These files include VCF files for genetic variants (or CSV files for TruSight Oncology 500 RNA Fusion variants). The cases page lists all cases for your account or workgroup. The following files can be uploaded, but are not required:

* BAM files
* JSON, TSV, and CSV files for TMB, MSI, and HRD biomarkers or for QC metrics

### Example Sample Sheet

Make sure that the sample sheet is included in the secondary analysis results folder. The following example shows the structure of the `[Data]` section of the sample sheet:

```csv
[Data]
Sample_ID, Sample_Type, Pair_ID, Tumor_Type
DNA_Control, DNA, Control-Case, 255052006
RNA_Control, RNA, Control-Case, 255052006
Lung_DNA_001, DNA, Lung_001, 254637007
Lung_RNA_001, RNA, Lung_001, 254637007
Breast_DNA_002, DNA, Breast_002, 254837009
```

Using this example, Connected Insights creates the following cases:

| **Case ID**  | **Workflow Type** | **Disease**                                              | **Sample ID**                           | **Sample Type**   |
| ------------ | ----------------- | -------------------------------------------------------- | --------------------------------------- | ----------------- |
| Control-Case | DNA and RNA       | Malignant tumor of unknown origin (SNOMEDCT ID255052006) | <p>DNA\_Control<br>RNA\_Control</p>     | <p>DNA<br>RNA</p> |
| Lung\_001    | DNA and RNA       | Non-small cell lung cancer (SNOMEDCT ID 254637007)       | <p>Lung\_DNA\_001<br>Lung\_RNA\_001</p> | <p>DNA<br>RNA</p> |
| Breast\_002  | DNA               | Malignant tumor of breast (SNOMEDCT ID 254837009)        | Breast\_DNA\_002                        | DNA               |

### Example Analysis Results

Open the secondary analysis results folder and find the files that must be identified in the workflow schema file. The following example shows the secondary analysis results folder structure:

![Example analysis results folder](https://1917818526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrkSuX7Vmcc4W5JjlZQyx%2Fuploads%2Fgit-blob-611863841eaeb1e5ebc64c846262d344a85f969b%2Fpipeline_config.png?alt=media)

### Example Workflow Schema File

For more information, refer to Create a Workflow Schema File in [Custom Pipeline Configuration](#custom-pipeline-configuration).

The following example shows the workflow schema file structure:

```yaml
pipeline:
  successMarkerFile: Logs_Intermediates/MetricsOutput/MetricsOutput.tsv
  failureMarkerFile: "./failure.txt"
sampleSheet:
  filePath: SampleSheet.csv
jointFiles:
  purityPloidyFiles: Logs_Intermediates/CombinedVariantOutput/{pairId}/{pairId}_CombinedVariantOutput.tsv, Optional
  gisFile: Logs_Intermediates/Gis/{sampleId.DNA}/{sampleId.DNA}.gis.json, Optional
  msiFile: Logs_Intermediates/Msi/{sampleId.DNA}/{sampleId.DNA}.msi.json, Optional
  tmbFile: Logs_Intermediates/Tmb/{sampleId.DNA}/{sampleId.DNA}.tmb.json, Optional
  lohFiles:
    - Logs_Intermediates/Gis/{sampleId.DNA}/{sampleId.DNA}.abcn_genes.tsv, Optional
  snvFiles: Logs_Intermediates/VariantMatching/{sampleId.DNA}/{sampleId.DNA}_MergedSmallVariants.genome.vcf, Optional
  cnvFiles:
    - Logs_Intermediates/CnvCaller/{sampleId.DNA}/{sampleId.DNA}_CopyNumberVariants.vcf, Optional
  rnaSpliceFiles: Logs_Intermediates/RnaSpliceVariantCalling/{sampleId.RNA}/{sampleId.RNA}_SpliceVariants.vcf, Optional
  rnaFusionFiles:
    - Logs_Intermediates/FusionCalling/{sampleId.RNA}/{sampleId.RNA}.vcf.gz, Optional
    - Logs_Intermediates/RnaFusionMerge/{sampleId.RNA}/{sampleId.RNA}_AllFusions.csv, Optional
  metricsQCFile: Logs_Intermediates/MetricsOutput/MetricsOutput.tsv, Optional
sampleFiles:
  tumorPairId:
    alignmentFiles:
      dnaBamFile: Logs_Intermediates/DnaAlignment/{sampleId.DNA}/{sampleId.DNA}.bam, Optional
      dnaBaiFile: Logs_Intermediates/DnaAlignment/{sampleId.DNA}/{sampleId.DNA}.bam.bai, Optional
      rnaBamFile: Logs_Intermediates/RnaAlignment/{sampleId.RNA}/{sampleId.RNA}.bam, Optional
      rnaBaiFile: Logs_Intermediates/RnaAlignment/{sampleId.RNA}/{sampleId.RNA}.bam.bai, Optional
```

{% hint style="warning" %}
If `, Optional` is after the file name, then Connected Insights uploads the file if it is available or moves on to the next available file.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.bioinsight.illumina.com/connected-insights/configure/configuration/du-introduction/du-custom-pipeline-configuration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
