> For the complete documentation index, see [llms.txt](https://cmo-ci.gitbook.io/postprocessing_variant_calls/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cmo-ci.gitbook.io/postprocessing_variant_calls/command-description-and-explanation/vardict.md).

# Vardict

This hosts multiple scripts necessary for filtering and processing variant calls in the vcfs/txt file generated by callers.

## Callers Supported

`pv` is the main command for the `postprocessing_variant_calls` package see `pv --help` to see supported variant callers commands.

### Vardict

The sub-command `pv vardict` allows users to perform post-processing on VarDictJava output. The two supported inputs to `pv vardict` from VarDictJava are `single` and `case-control` vcfs.

To specify to `pv vardict`, which input type will be used one of the following sub-commands may be used:

* `pv vardict single` for single sample vcfs
* `pv vardict case-control` for case-controlled vcfs.

Next the user can specify, what post-processing should be done. Right now, `postprocessing_variant_calls` supports filtering:

* `pv vardict single filter`
* `pv vardict case-control filter`

Finally, we can specify the paths and options for our filtering and run our command. Here is an example using the test data provided in this repository:

`pv vardict single filter --inputVcf data/Myeloid200-1.vcf --tsampleName Myeloid200-1 -ad 1 -o data/single`

There are various options and input specifications for filtering so see `pv vardict single filter --help` or `pv vardict single case-sontrol --help` for help.

See `example_calls.sh` for more example calls.

## How the repo was made

Template used: <https://github.com/yxtay/python-project-template>

### Usage

#### External dependencies

* \[Conda]\[conda]
* \[Docker]\[docker]
* \[Make]\[make]

#### Create environment

Use Conda to create a virtual environment and activate it for the project.

```bash
conda env create -f environment.yml
conda activate pv_calls
```

#### Install dependencies

Then install project dependencies with Poetry.

```bash
make deps-install
```

#### Updating Environment

To update the environment after initial setup up run:

```bash
conda env update -f environment.yml
```

instead of `conda create`, and then re-run `make deps-install`

### **Visual representation of how this module works:**

Leveraging the PyVcf package the following filtering is performed:

Case 1: Single sample mode

<figure><img src="/files/QZPx45mTUrrKaDTT4fAp" alt=""><figcaption></figcaption></figure>

Case 2: Case-control mode

<figure><img src="/files/2bvxe24qXTqB3eI45Xli" alt=""><figcaption></figcaption></figure>

Abbreviations

* TVF - Tumor Variant Fraction
* NVF - Normal Variant Fraction
* tmq - tumor minimum quality
* nmq - normal minimum quality
* tdp - total depth&#x20;
* tad - total allele depth


---

# 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:

```
GET https://cmo-ci.gitbook.io/postprocessing_variant_calls/command-description-and-explanation/vardict.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.
