Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 9 additions & 103 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@ source activate vcf_parse


```
usage: vcf_parse.py [-h] [-v] [-O OUTPUT] [-t TRANSCRIPTS]
[-T TRANSCRIPT_STRICTNESS] [-b BED | -B BED_FOLDER]
[-k KNOWN_VARIANTS] [-c CONFIG] [-l]
input

usage: vcf_parse.py [-h] [-v] [-i INPUT VCF] [-O OUTPUT]
[-t TRANSCRIPTS] [-n NTC]

summary:
Takes a VCF file and parses the variants to produce a tab delimited
variant report.
Expand All @@ -34,109 +32,17 @@ positional arguments:
optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-O OUTPUT, --output OUTPUT

-i INPUT VCF --inp INPUT VCF
VCF file and filepath

-o OUTPUT, --outfile OUTPUT
Filepath to folder where output reports will be saved.
If missing, defaults to current directory.

-t TRANSCRIPTS, --transcripts TRANSCRIPTS

Filepath to preferred transcripts file.

Must be a tab seperated file with preferred transcripts in the second
column. If missing, all entries in the preferred transcript column
will be labelled as 'Unknown'.

-T TRANSCRIPT_STRICTNESS, --transcript_strictness TRANSCRIPT_STRICTNESS

Strictness of matching while annotating preferred transcripts.
Default setting is low.

Options:

high - Transcripts must be an exact match.
e.g. NM_001007553.2 and NM_001007553.1 won't match,
NM_001007553.1 and NM_001007553.1 will.

low - Transcripts will match regardless of the version number. The
version number is after the . at the end of a transcript
e.g. NM_001007553.2 and NM_001007553.1 will match.

-b BED, --bed BED
Filepath to a single BED file.

The BED file will be applied to the variant report and a seperate
report saved with the BED file applied. This report will be saved in
the same output folder as the original variant report, with the BED
file name added to it.
Cannot be used together with -B flag.

-B BED_FOLDER, --bed_folder BED_FOLDER

Filepath to folder containing BED files.

Each BED file will be applied to the variant report and a seperate
report saved with the BED file applied. These reports will be saved in
a new folder within the output folder, named the same as the input BED
folder.
The file names will be the same as the original variant report, with
the BED file name added to them.
Cannot be used together with -b flag.

-k KNOWN_VARIANTS, --known_variants KNOWN_VARIANTS

Filepath to known variants file.

This is a VCF file containing any known variants and an associated
classification. The classification will be added to the variant
report. The VCF must have an annotation named 'Classification' within
the INFO field for each variant.

Key:
0 - Artifact
1 - Benign
2 - Likely benign
3 - VUS
4 - Likely pathogenic
5 - Pathogenic

-c CONFIG, --config CONFIG

Filepath to config file.

This is a tab seperated text file containing a number of rows, where
each row specifies an annotation to be included in the variant report.
Only annotations included in the config file will be included in the
variant report.
The columns in the variant report will be in the same order as the
order in which the annotations appear in the config file.

Each row contains:

Column 1 - Required. Annotation headers, these must match up with how
they appear in the VCF (case sensitive).

Column 2 - Required. Location where to find the data within the VCF,
used to select the correct parsing function.
options: info, format, vep, filter or pref.

Column 3 - Optional. Alternative name for column header.

To make a config file with all available options from a VCF, run:
vcf_parse -l path_to_input_vcf > config.txt

-l, --config_list
Return a list of all availabile config to the screen, then exit.
See CONFIG section for usage.
-t PREFERRED TRANSCRIPT --pref_trans PREFERRED TRANSCRIPT
Preferred transcript file and filepath
```

### Special formatting for report fields:
- % Allele frequency has been calculated from the AD
- Genotypes are reformatted from 0/0, 0/1 and 1/1 to HOM_REF, HET and HOM_ALT, respectively, to prevent them from appearing as dates in Excel
- dbSNP, COSMIC and HGMD are parsed from the 'Existing_variation' VEP field
- All population frequencies from ExAC and 1KG are re-formatted to a percentage
- Intron and exon numberings are renamed from x/y to x|y (where x and y are numbers), to prevent them appearing as dates in Excel
- HGVS coding (HGVSc) and protein (HGVSp) sequences have had the transcript name trimmed off

### Testing
To run unit tests run `python -m unittest test`
31 changes: 0 additions & 31 deletions config/somatic_amplicon_config.txt

This file was deleted.

7 changes: 4 additions & 3 deletions env/vcf_parse.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: vcf_parse
name: vcf_parse_somamp
channels:
- bioconda
dependencies:
- python=2.7
- python=3.9.16
- bedtools=2.27.1
- pip:
- pyvcf==0.6.8
- pyvariantfilter==1.6.2
- pysam==0.20.0
Loading