> For the complete documentation index, see [llms.txt](https://help.connected.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.connected.illumina.com/emedgene/emedgene-analyze-manual/reviewing_a_case/lab_tab/sample-quality-section/dragen-qc-report/prerequisites-for-accessing-the-dragen-qc-report/how-to-i-prepare-metrics-files-generated-by-dragen-to-be-used-as-input-for-emedgene.md).

# Prepare QC files for a NGS VCF case

When creating NGS cases that start from VCF, you can create a browsable [DRAGEN QC report](/emedgene/emedgene-analyze-manual/reviewing_a_case/lab_tab/sample-quality-section/dragen-qc-report.md) from the DRAGEN metrics files. Due to security restrictions, CSV files are not directly ingested, but they can be included when packaged in a TAR file.

{% stepper %}
{% step %}
Navigate to the local directory that contains the metrics files for a specific sample.
{% endstep %}

{% step %}
Define the sample name as a variable:

`samplename="NA12878"`
{% endstep %}

{% step %}
Combine the `find` and `tar` commands to package the files into a `*.metrics.tar.gz` file.

Use this command to find files matching the required patterns:

{% code overflow="wrap" %}

```bash
find . \( -name "*.csv" -o -name "*.tsv" -o -name "*.counts" -o -name "*.counts.gz" -o -name "*.counts.gc-corrected" -o -name "*.counts.gc-corrected.gz" -o -name "*.ploidy.vcf" -o -name "*.correlation.txt.gz" -o -name "*.correlation.txt" -o -name "*.repeats.vcf" -o -name "*.ploidy.vcf.gz" -o -name "*.repeats.vcf.gz" -o -name "*.annotated_cyto.json" \) | xargs tar -czf "${samplename}.metrics.tar.gz"
```

{% endcode %}
{% endstep %}

{% step %}
Upload the `metrics.tar.gz` file to the storage location used for case creation.
{% endstep %}

{% step %}
Add `metrics.tar.gz` to the case creation API JSON payload using the corresponding storage ID.

If the extension is not included in the filename, such as for files from BaseSpace, set `"sample_type": "dragen-metrics"` in the JSON payload.

<details>

<summary>Case creation API JSON</summary>

```json
{
    "test_data":
    {
        "consanguinity": false,
        "inheritance_modes":
        [],
        "sequence_info":
        {},
        "type": "Whole Genome",
        "notes": "",
        "samples":
        [
            {
                "bam_location": "",
                "fastq": "NA12878-PCRF450-1",
                "status": "uploaded",
                "directoryPath": "",
                "sampleFiles":
                [
                    {
                        "filename": "NA12878-PCRF450-1.metrics.tar.gz",
                        "sample_type": "dragen-metrics",
                        "path": "/analysis_output/demo_data_germline_v4_3_6_v2-DRAGEN_Germline_Whole_Genome_4-3-6-v2-75b081e8-a8aa-433e-862b-a20d2d65e492/NA12878-PCRF450-1/NA12878-PCRF450-1.metrics.tar.gz",
                        "size": 0,
                        "storage_id": 420,
                        "status": "uploaded",
                        "vcf_column_name": "NA12878-PCRF450-1",
                        "vcf_column_names":
                        [
                            "NA12878-PCRF450-1"
                        ],
                        "loadingSample": false
                    },
                    {
                        "filename": "NA12878-PCRF450-1.hard-filtered.vcf.gz",
                        "sample_type": "vcf",
                        "path": "/analysis_output/demo_data_germline_v4_3_6_v2-DRAGEN_Germline_Whole_Genome_4-3-6-v2-75b081e8-a8aa-433e-862b-a20d2d65e492/NA12878-PCRF450-1/NA12878-PCRF450-1.hard-filtered.vcf.gz",
                        "size": 0,
                        "storage_id": 420,
                        "status": "uploaded",
                        "vcf_column_name": "NA12878-PCRF450-1",
                        "vcf_column_names":
                        [
                            "NA12878-PCRF450-1"
                        ],
                        "loadingSample": false
                    }
                ],
                "storage_id": 420,
                "sampleType": "vcf"
            }
        ],
        "sample_type": "vcf",
        "patients":
        {
            "proband":
            {
                "fastq_sample": "NA12878-PCRF450-1",
                "gender": "Male",
                "healthy": false,
                "relationship": "Test Subject",
                "notes": "",
                "phenotypes":
                [
                    {
                        "id": "phenotypes/EMG_PHENOTYPE_0001324",
                        "name": "Muscle weakness"
                    }
                ],
                "detailed_ethnicity":
                {
                    "maternal":
                    [],
                    "paternal":
                    []
                },
                "zygosity": "",
                "quality": "",
                "dead": false,
                "ignore": false,
                "id": "proband"
            },
            "other":
            []
        },
        "diseases":
        [],
        "disease_penetrance": 100,
        "disease_severity": "",
        "boostGenes": false,
        "selected_preset_set": "",
        "incidental_findings": null,
        "labels":
        [],
        "gene_list":
        {
            "type": "all",
            "id": 1,
            "visible": false
        }
    },
    "should_upload": false,
    "sharing_level": 0
}
```

</details>
{% endstep %}
{% endstepper %}


---

# 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 dynamically by asking a question.

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

```
GET https://help.connected.illumina.com/emedgene/emedgene-analyze-manual/reviewing_a_case/lab_tab/sample-quality-section/dragen-qc-report/prerequisites-for-accessing-the-dragen-qc-report/how-to-i-prepare-metrics-files-generated-by-dragen-to-be-used-as-input-for-emedgene.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
