@@ -37,7 +37,7 @@ def __init__(self, rec, vcf_type, vcf_samples):
37
37
self .vcf_type = vcf_type
38
38
self .hm_record = trh .HarmonizeRecord (vcf_type , rec )
39
39
self .pos = self .hm_record .pos
40
- if vcf_type .name == 'advntr' :
40
+ if vcf_type .name == 'advntr' or vcf_type . name == 'eh' :
41
41
self .pos += 1 # AdVNTR call is 0-based, should change it to 1-based
42
42
self .canonical_motif = GetCanonicalMotif (self .hm_record .motif )
43
43
self .prepend_seq = ''
@@ -195,41 +195,6 @@ def AppendRecordObject(self, ro):
195
195
"""
196
196
self .record_objs .append (ro )
197
197
self .update ()
198
- < << << << HEAD
199
- if ro .vcf_type .name == "hipstr" or ro .vcf_type .name == "eh" :
200
- == == == =
201
- if ro .vcf_type .name == "hipstr" :
202
- > >> >> >> 657 f616723b80e01974824f056da8bff130a5976
203
- self .hipstr_allele_frequency = self .GetHipSTR_freqs (ro )
204
-
205
- def update (self ):
206
- r"""
207
- Update prepend/append sequences
208
- of individual record objects so they
209
- start and end at the same location.
210
- Extends all alleles to the maximum region
211
- spanned by all records in the cluster.
212
- """
213
- self .first_pos = min ([rec .pos for rec in self .record_objs ])
214
- self .last_end = max ([rec .cyvcf2_record .end for rec in self .record_objs ])
215
-
216
- print (f"Analysing record cluster ranged in { self .record_objs [0 ].cyvcf2_record .CHROM } :{ self .first_pos } -{ self .last_end } ." )
217
- ref_record = ""
218
- for rec in self .record_objs :
219
- if rec .pos == self .first_pos :
220
- ref_record = rec
221
- for rec in self .record_objs :
222
- self .vcf_types [convert_type_to_idx [rec .vcf_type ]] = True
223
- chrom = rec .cyvcf2_record .CHROM
224
- if rec .pos > self .first_pos :
225
- # Found a record that starts after
226
- # Should prepend the record
227
- rec .prepend_seq = self .fasta [chrom ][self .first_pos - 1 : rec .pos - 1 ].seq .upper ()
228
- < << << << HEAD
229
- == == == =
230
- #print(self.fasta[chrom][self.first_pos-1 : rec.pos-1].seq.upper(), ref_record.cyvcf2_record.REF[0:(rec.pos-1 - self.first_pos-1)+2].upper())
231
- >> >> >> > 657 f616723b80e01974824f056da8bff130a5976
232
- #assert(self.fasta[chrom][self.first_pos-1 : rec.pos-1].seq.upper() == ref_record.cyvcf2_record.REF[0:(rec.pos-1 - self.first_pos-1)+2].upper()) #This is not necessarily true when the ref record is from EXpansionHunter
233
198
234
199
if rec .cyvcf2_record .end < self .last_end :
235
200
# Found a record that ends before last end
@@ -411,11 +376,8 @@ def GetResolvedPreAlleles(self):
411
376
if len (self .caller_to_nodes [trh .VcfTypes .hipstr ]) == 1 :
412
377
for caller in self .uniq_callers :
413
378
print (caller , len (self .caller_to_nodes [caller ]))
414
- < << << << HEAD
415
379
sys .exit ("This should not happen" )
416
- == == == =
417
380
sys .exit (0 )
418
- >> >> >> > 657 f616723b80e01974824f056da8bff130a5976
419
381
tmp_node = self .caller_to_nodes [trh .VcfTypes .hipstr ][0 ]
420
382
pa = PreAllele (tmp_node , [trh .VcfTypes .hipstr ])
421
383
for node in self .subgraph :
0 commit comments