-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
this closes #8. this was a major bug with a small change to fix.
- Loading branch information
Showing
6 changed files
with
76 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import sys | ||
import gzip | ||
|
||
|
||
for line in gzip.open(sys.argv[1], 'rt'): | ||
if line[0] == '#': continue | ||
|
||
toks = line.strip().split("\t") | ||
assert ";test_filter=OHNO" in toks[7] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import itertools | ||
import random | ||
import sys | ||
|
||
|
||
#random.seed(42) | ||
|
||
fhdb = open("string-issue-8.db.vcf", "w") | ||
fhq = open("string-issue-8.query.vcf", "w") | ||
|
||
header = ("""##fileformat=VCFv4.2 | ||
##FILTER=<ID=PASS,Description="All filters passed"> | ||
##FILTER=<ID=FAIL,Description="All filters passed"> | ||
##FILTER=<ID=OTHER,Description="All filters passed"> | ||
##INFO=<ID=num,Number=1,Type=Integer,Description="random string value"> | ||
##INFO=<ID=val,Number=.,Type=String,Description="random string value"> | ||
##contig=<ID=chr1,length=248956422> | ||
##contig=<ID=1,length=248956422> | ||
#CHROM POS ID REF ALT QUAL FILTER INFO""") | ||
|
||
FILTERS = ["PASS", "FAIL", "OTHER"] | ||
|
||
for fh in (fhdb, fhq): | ||
print(header, file=fh) | ||
|
||
for switch in [1]: | ||
switch = switch<<20 | ||
|
||
ref = "A" | ||
alt = "C" | ||
i = 12345 | ||
|
||
val = random.randint(0, 100) | ||
flt = random.choice(FILTERS) | ||
print(f"chr1\t{i}\t.\t{ref}\t{alt}\t1\t{flt}\tval=s{val};num=3", file=fhdb) | ||
alt = "T" | ||
print(f"chr1\t{i}\t.\t{ref}\t{alt}\t1\t{flt}\tval=s{val};num=3", file=fhq) | ||
|
||
|
||
with open("string-issue-8.json", "w") as fh: | ||
fh.write("""[{"field": "FILTER", "alias":"test_filter", "missing_string": "OHNO"}]""") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters