# Clinical Genomicist Workstation

## Overview

[Clinical Genomicist Workstation](https://www.pieriandx.com/clinical-genomics-software-for-next-generation-sequencing) (CGW) is a secure, n-tiered application where web browser submits requests to application servers that persist the data in a relational database. CGW is used by Washington University Genomic and Pathology Services for clinical genomic testing of many cancers. CGW is a 'soup-to-nuts' solution to track, analyze, interpret, and report clinical genomic diagnostic tests.

{% hint style="info" %}
[**Clinical genomicist workstation.**](https://www.ncbi.nlm.nih.gov/pubmed/24303327?report=docsum)

Sharma MK, Phillips J, Agarwal S, Wiggins WS, Shrivastava S, Koul SB, Bhattacharjee M, Houchins CD, Kalakota RR, George B, Meyer RR, Spencer DH, Lockwood CM, Nguyen TT, Duncavage EJ, Al-Kateb H, Cottrell CE, Godala S, Lokineni R, Sawant SM, Chatti V, Surampudi S, Sunkishala RR, Darbha R, Macharla S, Milbrandt JD, Virgin HW, Mitra RD, Head RD, Kulkarni S, Bredemeyer A, Pfeifer JD, Seibert K, Nagarajan R.

AMIA Jt Summits Transl Sci Proc. 2013 Mar 18;2013:156-7. eCollection 2013.

PMID: 24303327
{% endhint %}

Per the request of our customers, [Labii ELN & LIMS](https://www.labii.com) has developed many widgets to perform CGW analysis directly with Labii interface. CGW widgets is developed to create accessions for new cases, create new sequencing runs for cases, upload appropriate data files (VCF/BAM files) for a given sequencing run, begin bioinformatics jobs for generating a pharmacogenomic report, and retrieve reports in pdf format after they have been signed off on by an accredited individual.

Widgets can take full advantages of Labii LIMS ([Laboratory Information Management System](https://www.labii.com)) to provide sample specific metadata. Labii widgets simplified the usage of CGW with just a few clicks and enabled the documentation of all analysis process.

{% hint style="info" %}
Notes: These widgets are private to a certain customer(s) only.
{% endhint %}

Labii ELN & LIMS currently provides these widgets:

| Widget                          | Type    | Description                   |
| ------------------------------- | ------- | ----------------------------- |
| [CGWCase](#cgwcase)             | Column  | Create a CGW case             |
| [CGWUploadFile](#cgwuploadfile) | Column  | Upload analysis-related files |
| [CGWJob](#cgwjob)               | Section | Generate a job and report     |

## Before starting

Here are some settings needed to be configured before starting using the widgets.

### Metadata

CGW is account specific, your CGW authentication information needs to be provided and configured in the [organization metadata](/admin-guide/organization.md#metadata) (Settings -> Organization Detail -> Metadata).

These metadata is required:

* **CGW\_INSTITUTION**: your account username
* **CGW\_EMAIL**: your email address to login
* **CGW\_PASSWORD**: your password
* **CGW\_VERSION**: v2.0.0

### Tables

The samples and patients are stored in the tables. These tables are required:

* **samples**, to store specimen information
* **patients**, to store the patient information
* **disease**, to store disease code
* **mass**, to store the sample type code

Please create the tables with these settings:

| Name singular | Name plural | Description          | Unique code |
| ------------- | ----------- | -------------------- | ----------- |
| sample        | samples     | Specimen information | SP          |
| patient       | patients    | Patient information  | PA          |
| disease       | diseases    | Disease code         | DS          |
| mass          | masses      | Sample type code     | MS          |

### Columns

The columns are used to store the attribution of a table.

**Samples:**

| Name                     | Description                                                                     | Widget        | Default Value                                                                                                                                                                                 | Is Required |
| ------------------------ | ------------------------------------------------------------------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
| dateAccessioned          |                                                                                 | Date          |                                                                                                                                                                                               | false       |
| firstName                |                                                                                 | Text          |                                                                                                                                                                                               | false       |
| lastName                 |                                                                                 | Text          |                                                                                                                                                                                               | false       |
| dateOfBirth              |                                                                                 | Date          |                                                                                                                                                                                               | false       |
| datecollected            |                                                                                 | Date          |                                                                                                                                                                                               | false       |
| dateReceived             |                                                                                 | Date          |                                                                                                                                                                                               | false       |
| gender                   |                                                                                 | Select        | <p>unknown</p><p>male</p><p>female</p><p>unspecified</p><p>other</p><p>ambiguous</p><p>not\_applicable</p>                                                                                    | false       |
| race                     |                                                                                 | Select        | <p>american\_indian\_or\_alaska\_native</p><p>asian</p><p>black\_or\_african\_american</p><p>native\_hawaiian\_or\_other\_pacific\_islander</p><p>not\_reported</p><p>unknown</p><p>white</p> | false       |
| ethnicity                |                                                                                 | Select        | <p>hispanic\_or\_latino</p><p>not\_hispanic\_or\_latino</p><p>not\_reported</p><p>unknown</p>                                                                                                 | false       |
| externalSpecimenId       |                                                                                 | Text          |                                                                                                                                                                                               | false       |
| hl7SpecimenId            |                                                                                 | Text          |                                                                                                                                                                                               | false       |
| studyIdentifier          |                                                                                 | Text          |                                                                                                                                                                                               | false       |
| studySubjectIdentifier   |                                                                                 | Text          |                                                                                                                                                                                               | false       |
| type                     | Sample Type                                                                     | ForeignKey    | MS                                                                                                                                                                                            | true        |
| panelName                |                                                                                 | Text          |                                                                                                                                                                                               | false       |
| sampleType               |                                                                                 | Select        | patientcare                                                                                                                                                                                   | true        |
| indication               |                                                                                 | Text          |                                                                                                                                                                                               | false       |
| identified               |                                                                                 | Boolean       | 1                                                                                                                                                                                             | false       |
| disease                  |                                                                                 | ForeignKey    | DS                                                                                                                                                                                            | false       |
| physicians               |                                                                                 | ForeignKeys   | PA                                                                                                                                                                                            | false       |
| accessionNumber          |                                                                                 | Text          |                                                                                                                                                                                               | false       |
| case                     |                                                                                 | CGWCase       |                                                                                                                                                                                               | false       |
| lane                     |                                                                                 | Number        | 1                                                                                                                                                                                             | false       |
| barcode                  |                                                                                 | Text          |                                                                                                                                                                                               | false       |
| runType                  | This identifies whether the sequencing was done using paired end or single end. | Select        | pairedEnd                                                                                                                                                                                     | false       |
| analysis\_related\_files |                                                                                 | CGWUploadFile |                                                                                                                                                                                               | false       |

**Patients:**

No specific columns are required. However, the name field have to be:

`[First Name] [Last Name]`

**Disease:**

| Name         | Widget | Default value | Is required |
| ------------ | ------ | ------------- | ----------- |
| code         | Number |               | TRUE        |
| code\_system | Text   | SNOMED-CT     | TRUE        |

**Mass:**

| Name         | Widget | Default value | Is required |
| ------------ | ------ | ------------- | ----------- |
| code         | Number |               | TRUE        |
| code\_system | Text   | SNOMED-CT     | TRUE        |

### Default Sections

Add a default section so that all new records will have the same section. The default section is only needed for samples:

* **Job**, use the widget of **CGWJob**

### Import data

If you already have some data for samples, patients, disease, and/or mass, use [Import](/user-guide/list-view.md#import) function to import them first.

## CGWCase

CGWCase is a widget to create or update a Case.

### Create a case

Click the *edit* icon and the widget shall collect all necessary information to create a case. Error message will be provided if certain data is missing.

Click **Create Case** button to create a case. If successful, a case id will be stored for the column.

### Update a case

The detail of a case can be updated via update a case. To do that, click the *edit* icon, and then click the **Update Case** button.

### Clear case data

If for some reason, you want to discard the case and redo the analysis. You can click **Clear Case** button and then create a new case.

## CGWUploadFile

A \*.vcf file needs to be uploaded to initial the jobs. Use this widget to upload a \*.vcf file. A case needs to be created first for this widget to work.

## CGWJob

One or more CGW jobs can be created for one sample. Each section of CGWJob can create one job.

Before creating a CGW job, a CGW case need to be created and a \*.vcf file need to be uploaded first.

### Create a job

Click **Create a job** button to create a job.

Once a job is created, the job id will be assigned to the job id.

### Cancel a job

Once a job is created, it can be canceled by clicking **Cancel Job** button.

{% hint style="info" %}
Note: Currently, the CGW API to cancel job is not working.
{% endhint %}

### Check report

Once a job is generated, the job will start running immediately. It will take around two hours to finish the CGW scripts.

You can use the button **Check report** to check if the report is complete. If it is complete, a report id will be assigned and you will have the option to download the report.

### Download report

Once a report is completed, the report can be downloaded via clicking Download report button.

The report is generated in PDF format, and zipped in a package **\[Report Id].pdf.gz**.

## CGW Workflow

To start a CGW analysis, please follow these steps. This workflow assumes you have configured everything in [Before starting](#before-starting).

1. Add a new sample, fill in all necessary information.
2. [Create a new case](#create-a-case) from **Case** column.
3. [Upload a \*.vcf file](#cgwuploadfile) from **Analysis related files** column.
4. Add a new section with widget CGWJob (optional, such section will be created automatically if correctly configured in the [default sections](#default-sections)).
5. [Create a new job](#create-a-job).
6. [Check the report](#check-report).
7. [Download the report](#download-report).


---

# 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.labii.com/widgets/section-widgets/combination/cgw.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.
