# Review Structural Variations with Sequencing Coverage

Starting with a SV file from a set of samples and a file declaring the BigWig files for the same set of samples, a Python script generates a JSON file, zip file, and a results table in the csv file for ProteinPaint. The JSON file and zip files support the SV views for the left and right breakpoints, viewable from two URLs in the results table.

## ProteinPaint

A local ProteinPaint instance or access to St. Jude internal servers is required. For external users, please contact the Office of Technology Licensing for assistance. St. Jude internal users, please use this wiki page for instructions.

## Input Files

To recreate this use case, download the example files from the blue Download Example Files button above.
The script requires two tab delimited files.

- SV varient table: with the following columns: sample, chr_a, position_a, strand_a, chr_b, position_b, strand_b. Here is an example of a SV varient table:

          sample  chr_a   position_a  strand_a    chr_b   position_b  strand_b
          SJALL011121_D1  chr10   81841249    +   chr10   81845838    +

- BigWig track table (no header): with the following columns: sample, assay (e.g. WGS, WES, or RNA), and relative file path under the tp directory. Here is an example of a BigWig table:

          SJALL011121_D1 WGS proteinpaint_demo/usecase/svview/SJALL011121_D1.bw
          SJALL011121_G1 WGS proteinpaint_demo/usecase/svview/SJALL011121_G1.bw
          SJALL011121_R1 WGS proteinpaint_demo/usecase/svview/SJALL011121_R1.bw
          SJALL011121_D1 RNA proteinpaint_demo/usecase/svview/SJALL011121_D1_RNA.bw

## Run Script

Download the SV view script. Run the script from the command line with the following arguments:

- SV table ( --sv or -v)
- BigWig table ( --tracks or -t)
- Directory for the output files ( --outDir or -d) - Must be a relative file path under the tp directory
- File name for results ( --out or -o) - Will appear in the working directory unless a full file path is provided
- Genome ( --genome or -g)

Below are usage examples.

            python3 sv_review.py --sv sv.example --track bx.example --outDir ~/tp/proteinpaint_demo/usecases/svview --out myResults --genome hg19

A file path for the results is provided in this example:

            python3 sv_review.py -v sv.example -t bx.example -d ~/tp/proteinpaint_demo/usecases/svview -o ~/tp/proteinpaint_demo/usecases/svview/myResults -g hg19

## Output and Results

Support files for the SV view, SV.gz file and SV.gz.tbi with the SV data as well as a mds.json (see code example below) will appear in the output directory (i.e. from the --outDir or -d argument).

            {
                "name": "SV review",
                "svcnvfile": "proteinpaint_demo/usecases/svview/SV.gz",
                "type": "mdssvcnv"
            }

The results table is found in the csv file, named from the --out or -o argument.

## SV View Example

Open the results from the csv file. Click on the links to review the SV views for both the left and right breakpoints. Shown below is the URL for the left position from the example data.