Skip to content

Commit

Permalink
Allow numbers flag in VEP online and update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Liu committed Nov 5, 2024
1 parent 8f569d5 commit d454f7a
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 8 deletions.
1 change: 1 addition & 0 deletions includes/snv-indels/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ rule annotate_vars:
--polyphen b \
--sift b \
--hgvs \
--numbers \
--stats_file {output.stats} \
--output_file STDOUT | gzip > {output.vep}\
2> {log}
Expand Down
8 changes: 4 additions & 4 deletions test/data/output/v2/SRR8615409.vardict.summary.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@
"input": "chrM\t8566\t.\tA\tG\t151\tPASS\tSAMPLE=SRR8615409;TYPE=SNV;DP=27;END=8566;VD=27;AF=1;BIAS=0:2;REFBIAS=0:0;VARBIAS=14:13;PMEAN=28.7;PSTD=1;QUAL=31.8;QSTD=1;SBF=1;ODDRATIO=0;MQ=255;SN=5.75;HIAF=1.0000;ADJAF=0.1111;SHIFT3=0;MSI=1;MSILEN=1;NM=2.9;HICNT=23;HICOV=23;LSEQ=CTTCATTCATTGCCCCCACA;RSEQ=TCCTAGGCCTACCCGCCGCA;DUPRATE=0;SPLITREAD=0;SPANPAIR=0\tGT:DP:VD:AD:AF:RD:ALD\t1/1:27:27:0,27:1:0,0:14,13",
"is_in_hotspot": false,
"most_severe_consequence": "missense_variant",
"seq_region_name": "MT",
"seq_region_name": "chrMT",
"start": 8566,
"strand": 1,
"transcript_consequences": [
Expand Down Expand Up @@ -335,7 +335,7 @@
"input": "chrM\t8701\t.\tA\tG\t199\tPASS\tSAMPLE=SRR8615409;TYPE=SNV;DP=48;END=8701;VD=46;AF=0.9583;BIAS=0:2;REFBIAS=0:2;VARBIAS=18:28;PMEAN=27.6;PSTD=1;QUAL=36.2;QSTD=1;SBF=0.52128;ODDRATIO=0;MQ=255;SN=45;HIAF=0.9574;ADJAF=0.0208;SHIFT3=1;MSI=2;MSILEN=1;NM=2.6;HICNT=45;HICOV=47;LSEQ=TAACCTCAAAACAAATGATA;RSEQ=CCATACACAACACTAAAGGA;DUPRATE=0;SPLITREAD=0;SPANPAIR=0\tGT:DP:VD:AD:AF:RD:ALD\t1/1:48:46:2,46:0.9583:0,2:18,28",
"is_in_hotspot": true,
"most_severe_consequence": "missense_variant",
"seq_region_name": "MT",
"seq_region_name": "chrMT",
"start": 8701,
"strand": 1,
"transcript_consequences": [
Expand Down Expand Up @@ -430,7 +430,7 @@
"input": "chrM\t8860\t.\tA\tG\t123\tPASS\tSAMPLE=SRR8615409;TYPE=SNV;DP=13;END=8860;VD=13;AF=1;BIAS=0:2;REFBIAS=0:0;VARBIAS=10:3;PMEAN=20.8;PSTD=1;QUAL=33.5;QSTD=1;SBF=1;ODDRATIO=0;MQ=255;SN=5.5;HIAF=1.0000;ADJAF=0.1538;SHIFT3=0;MSI=1;MSILEN=1;NM=2.8;HICNT=11;HICOV=11;LSEQ=CCATCCCCTTATGAGCGGGC;RSEQ=CAGTGATTATAGGCTTTCGC;DUPRATE=0;SPLITREAD=0;SPANPAIR=0\tGT:DP:VD:AD:AF:RD:ALD\t1/1:13:13:0,13:1:0,0:10,3",
"is_in_hotspot": true,
"most_severe_consequence": "missense_variant",
"seq_region_name": "MT",
"seq_region_name": "chrMT",
"start": 8860,
"strand": 1,
"transcript_consequences": [
Expand Down Expand Up @@ -512,7 +512,7 @@
"input": "chrM\t8390\t.\tT\tA\t166\tPASS\tSAMPLE=SRR8615409;TYPE=SNV;DP=25;END=8390;VD=25;AF=1;BIAS=0:1;REFBIAS=0:0;VARBIAS=24:1;PMEAN=8.8;PSTD=1;QUAL=35.8;QSTD=1;SBF=1;ODDRATIO=0;MQ=255;SN=24;HIAF=1.0000;ADJAF=0.12;SHIFT3=0;MSI=2;MSILEN=1;NM=4.2;HICNT=24;HICOV=24;LSEQ=CCCAACTAAATACTACCGTA;RSEQ=GGCCCACCATAATTACCCCC;DUPRATE=0;SPLITREAD=0;SPANPAIR=0\tGT:DP:VD:AD:AF:RD:ALD\t1/1:25:25:0,25:1:0,0:24,1",
"is_in_hotspot": true,
"most_severe_consequence": "stop_gained",
"seq_region_name": "MT",
"seq_region_name": "chrMT",
"start": 8390,
"strand": 1,
"transcript_consequences": [
Expand Down
13 changes: 9 additions & 4 deletions test/data/output/v2/full-report.summary.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"id": ".",
"input": "chrM\t8566\t.\tA\tG\t.\tPASS\tADP=26;WT=0;HET=0;HOM=1;NC=0\tGT:GQ:SDP:DP:RD:AD:FREQ:PVAL:RBQ:ABQ:RDF:RDR:ADF:ADR\t1/1:129:26:26:0:23:100%:1.2146E-13:0:32:0:0:12:11",
"most_severe_consequence": "missense_variant",
"seq_region_name": "MT",
"seq_region_name": "chrMT",
"start": 8566,
"strand": 1,
"transcript_consequences": [
Expand All @@ -133,6 +133,7 @@
"consequence_terms": [
"missense_variant"
],
"exon": "1/1",
"gene_id": "ENSG00000198899",
"hgvsc": "ENST00000361899.2:c.40A>G",
"hgvsp": "ENSP00000354632.2:p.Ile14Val",
Expand All @@ -158,6 +159,7 @@
"consequence_terms": [
"missense_variant"
],
"exon": "1/1",
"gene_id": "ENSG00000198899",
"hgvsc": "ENST00000361899.2:c.40A>G",
"hgvsp": "ENSP00000354632.2:p.Ile14Val",
Expand Down Expand Up @@ -205,7 +207,7 @@
"id": ".",
"input": "chrM\t8701\t.\tA\tG\t.\tPASS\tADP=45;WT=0;HET=0;HOM=1;NC=0\tGT:GQ:SDP:DP:RD:AD:FREQ:PVAL:RBQ:ABQ:RDF:RDR:ADF:ADR\t1/1:206:45:45:2:39:95.12%:2.1258E-21:33:41:0:2:18:21",
"most_severe_consequence": "missense_variant",
"seq_region_name": "MT",
"seq_region_name": "chrMT",
"start": 8701,
"strand": 1,
"transcript_consequences": [
Expand All @@ -220,6 +222,7 @@
"consequence_terms": [
"missense_variant"
],
"exon": "1/1",
"gene_id": "ENSG00000198899",
"hgvsc": "ENST00000361899.2:c.175A>G",
"hgvsp": "ENSP00000354632.2:p.Thr59Ala",
Expand Down Expand Up @@ -267,7 +270,7 @@
"id": ".",
"input": "chrM\t8860\t.\tA\tG\t.\tPASS\tADP=16;WT=0;HET=0;HOM=1;NC=0\tGT:GQ:SDP:DP:RD:AD:FREQ:PVAL:RBQ:ABQ:RDF:RDR:ADF:ADR\t1/1:64:16:16:0:12:100%:3.698E-7:0:33:0:0:9:3",
"most_severe_consequence": "missense_variant",
"seq_region_name": "MT",
"seq_region_name": "chrMT",
"start": 8860,
"strand": 1,
"transcript_consequences": [
Expand All @@ -282,6 +285,7 @@
"consequence_terms": [
"missense_variant"
],
"exon": "1/1",
"gene_id": "ENSG00000198899",
"hgvsc": "ENST00000361899.2:c.334A>G",
"hgvsp": "ENSP00000354632.2:p.Thr112Ala",
Expand Down Expand Up @@ -331,7 +335,7 @@
"id": ".",
"input": "chrM\t8390\t.\tT\tA\t.\tPASS\tADP=24;WT=0;HET=0;HOM=1;NC=0\tGT:GQ:SDP:DP:RD:AD:FREQ:PVAL:RBQ:ABQ:RDF:RDR:ADF:ADR\t1/1:117:24:24:0:21:100%:1.8578E-12:0:37:0:0:21:0",
"most_severe_consequence": "stop_gained",
"seq_region_name": "MT",
"seq_region_name": "chrMT",
"start": 8390,
"strand": 1,
"transcript_consequences": [
Expand All @@ -346,6 +350,7 @@
"consequence_terms": [
"stop_gained"
],
"exon": "1/1",
"gene_id": "ENSG00000228253",
"hgvsc": "ENST00000361851.1:c.25T>A",
"hgvsp": "ENSP00000355265.1:p.Trp9Ter",
Expand Down
18 changes: 18 additions & 0 deletions test/test_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,24 @@ def test_genes_in_order(workflow_dir):
assert "MT-ATP8" in genes_of_interest[1].values()


@pytest.mark.workflow('test-report')
def test_chr_g_location_exon(workflow_dir):
"""Test if chr ID, genomic location and exon info (e.g, (chr2:20000000, exon 1/12)) are shown in table"""
report = f"{workflow_dir}/report.html"
with open(report) as fin:
soup = bs4.BeautifulSoup(fin, features="html.parser")

# Extract HGVS column
variant_table = soup.find('table', id='var-overview')
HGVS_with_extra_info = variant_table.find_all('td', class_ = 'hgvs')
HGVS_with_extra_info_pattern = r"chr([a-zA-Z0-9]+).*?exon (\d+)"
for hgvs in HGVS_with_extra_info:
hgvs_text = hgvs.get_text(separator=" <br/> ", strip=True)
import re
extra_info = hgvs_text.split("<br/> ")[-1]
match = re.search(HGVS_with_extra_info_pattern, extra_info)
assert match is not None


@pytest.mark.workflow('test-report')
def test_fusion_overview(workflow_dir):
Expand Down

0 comments on commit d454f7a

Please sign in to comment.