Skip to content

Commit

Permalink
Fixed --knownFunction function
Browse files Browse the repository at this point in the history
  • Loading branch information
xiao-chen-xc committed May 15, 2020
1 parent e1a29fa commit 064a0fd
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 27 deletions.
46 changes: 25 additions & 21 deletions caller/construct_star_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,33 +183,37 @@ def get_hap_table(hap_table):
dhap_exon9_x2 = {}
for star1 in EXON9GC_ALLELES:
for star2 in EXON9GC_ALLELES:
for star3 in dstar:
for star4 in dstar:
variant_list = sorted(
dstar[star1].split("_")
+ dstar[star2].split("_")
+ dstar[star3].split("_")
+ dstar[star4].split("_")
)
star_set = "_".join(sorted([star1, star2, star3, star4]))
make_hap_dic(variant_list, star_set, dhap_exon9_x2)

# exon9hybx3. limit the search to EXON9GC_ALLELES
dhap_exon9_x3 = {}
for star1 in EXON9GC_ALLELES:
for star2 in EXON9GC_ALLELES:
for star3 in EXON9GC_ALLELES:
for star4 in dstar:
for star5 in dstar:
if star1 in dstar and star2 in dstar:
for star3 in dstar:
for star4 in dstar:
variant_list = sorted(
dstar[star1].split("_")
+ dstar[star2].split("_")
+ dstar[star3].split("_")
+ dstar[star4].split("_")
+ dstar[star5].split("_")
)
star_set = "_".join(sorted([star1, star2, star3, star4, star5]))
make_hap_dic(variant_list, star_set, dhap_exon9_x3)
star_set = "_".join(sorted([star1, star2, star3, star4]))
make_hap_dic(variant_list, star_set, dhap_exon9_x2)

# exon9hybx3. limit the search to EXON9GC_ALLELES
dhap_exon9_x3 = {}
for star1 in EXON9GC_ALLELES:
for star2 in EXON9GC_ALLELES:
for star3 in EXON9GC_ALLELES:
if star1 in dstar and star2 in dstar and star3 in dstar:
for star4 in dstar:
for star5 in dstar:
variant_list = sorted(
dstar[star1].split("_")
+ dstar[star2].split("_")
+ dstar[star3].split("_")
+ dstar[star4].split("_")
+ dstar[star5].split("_")
)
star_set = "_".join(
sorted([star1, star2, star3, star4, star5])
)
make_hap_dic(variant_list, star_set, dhap_exon9_x3)

# exon9hybx4. limit the search to *10 and *36
dhap_exon9_x4 = {}
Expand Down
14 changes: 8 additions & 6 deletions star_caller.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,14 @@ def d6_star_caller(
ref_read, long_ins_read, short_ins_read = get_allele_counts_42128936(
bamfile, call_parameters.genome
)
long_ins_index = var_list.index("g.42128936-42128937insGGGGCGAAAGGGGCGAAA")
short_ins_index = var_list.index("g.42128936-42128937insGGGGCGAAA")
var_alt[long_ins_index] = long_ins_read
var_ref[long_ins_index] = short_ins_read + ref_read
var_alt[short_ins_index] = short_ins_read
var_ref[short_ins_index] = long_ins_read + ref_read
if "g.42128936-42128937insGGGGCGAAAGGGGCGAAA" in var_list:
long_ins_index = var_list.index("g.42128936-42128937insGGGGCGAAAGGGGCGAAA")
var_alt[long_ins_index] = long_ins_read
var_ref[long_ins_index] = short_ins_read + ref_read
if "g.42128936-42128937insGGGGCGAAA" in var_list:
short_ins_index = var_list.index("g.42128936-42128937insGGGGCGAAA")
var_alt[short_ins_index] = short_ins_read
var_ref[short_ins_index] = long_ins_read + ref_read
# Variants in homology regions. Get read counts at both D6/D7 positions.
var_homo_db = call_parameters.var_homo_db
var_homo_alt, var_homo_ref = get_supporting_reads(
Expand Down

0 comments on commit 064a0fd

Please sign in to comment.