Skip to content

Commit ba2735d

Browse files
author
Helyaneh Ziaei-jam
committed
remove merge issues
1 parent 9e69b48 commit ba2735d

File tree

1 file changed

+1
-39
lines changed

1 file changed

+1
-39
lines changed

ensembletr/recordcluster.py

+1-39
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def __init__(self, rec, vcf_type, vcf_samples):
3737
self.vcf_type = vcf_type
3838
self.hm_record = trh.HarmonizeRecord(vcf_type, rec)
3939
self.pos = self.hm_record.pos
40-
if vcf_type.name == 'advntr':
40+
if vcf_type.name == 'advntr' or vcf_type.name == 'eh':
4141
self.pos += 1 # AdVNTR call is 0-based, should change it to 1-based
4242
self.canonical_motif = GetCanonicalMotif(self.hm_record.motif)
4343
self.prepend_seq = ''
@@ -195,41 +195,6 @@ def AppendRecordObject(self, ro):
195195
"""
196196
self.record_objs.append(ro)
197197
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-
>>>>>>> 657f616723b80e01974824f056da8bff130a5976
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-
>>>>>>> 657f616723b80e01974824f056da8bff130a5976
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
233198

234199
if rec.cyvcf2_record.end < self.last_end:
235200
# Found a record that ends before last end
@@ -411,11 +376,8 @@ def GetResolvedPreAlleles(self):
411376
if len(self.caller_to_nodes[trh.VcfTypes.hipstr]) == 1:
412377
for caller in self.uniq_callers:
413378
print(caller, len(self.caller_to_nodes[caller]))
414-
<<<<<<< HEAD
415379
sys.exit("This should not happen")
416-
=======
417380
sys.exit(0)
418-
>>>>>>> 657f616723b80e01974824f056da8bff130a5976
419381
tmp_node = self.caller_to_nodes[trh.VcfTypes.hipstr][0]
420382
pa = PreAllele(tmp_node, [trh.VcfTypes.hipstr])
421383
for node in self.subgraph:

0 commit comments

Comments
 (0)