@@ -75,7 +75,7 @@ def __next__(self):
7575 self .parse_h_stanza ()
7676 continue
7777 if line .startswith ("a {" ):
78- ( score , pieces ) = self .parse_a_stanza ()
78+ score , pieces = self .parse_a_stanza ()
7979 break
8080 if line .endswith ("{" ):
8181 self .parse_unknown_stanza ()
@@ -120,7 +120,7 @@ def open_seqs(self):
120120 name1 = self .path_to_src_name (self .seq1_filename )
121121 except ValueError :
122122 name1 = "seq1"
123- ( species1 , chrom1 ) = src_split (name1 )
123+ species1 , chrom1 = src_split (name1 )
124124 self .seq1_src = src_merge (species1 , chrom1 , contig )
125125 if contig is not None :
126126 chrom1 += f"[{ contig } ]"
@@ -152,7 +152,7 @@ def open_seqs(self):
152152 name2 = self .path_to_src_name (self .seq2_filename )
153153 except ValueError :
154154 name2 = "seq2"
155- ( species2 , chrom2 ) = src_split (name2 )
155+ species2 , chrom2 = src_split (name2 )
156156 self .seq2_src = src_merge (species2 , chrom2 , contig )
157157 if contig is not None :
158158 chrom2 += f"[{ contig } ]"
@@ -180,14 +180,10 @@ def close_seqs(self):
180180 def parse_s_stanza (self ):
181181 self .close_seqs ()
182182 line = self .fetch_line (report = " in s-stanza" )
183- (self .seq1_filename , self .seq1_start , self .seq1_end , self .seq1_strand , self .seq1_contig ) = self .parse_s_seq (
184- line
185- )
183+ self .seq1_filename , self .seq1_start , self .seq1_end , self .seq1_strand , self .seq1_contig = self .parse_s_seq (line )
186184
187185 line = self .fetch_line (report = " in s-stanza" )
188- (self .seq2_filename , self .seq2_start , self .seq2_end , self .seq2_strand , self .seq2_contig ) = self .parse_s_seq (
189- line
190- )
186+ self .seq2_filename , self .seq2_start , self .seq2_end , self .seq2_strand , self .seq2_contig = self .parse_s_seq (line )
191187
192188 line = self .fetch_line (report = " in s-stanza" )
193189 assert line == "}" , f'improper s-stanza terminator (line { self .lineNumber } , "{ line } ")'
@@ -467,7 +463,7 @@ def close(self):
467463 keys = list (self .blockHash )
468464 keys = sort_keys_by_chrom (keys )
469465 for key in keys :
470- ( src1 , strand1 , src2 , strand2 ) = key
466+ src1 , strand1 , src2 , strand2 = key
471467 alignment = self .blockHash [key ][0 ]
472468 self .src1 = src1
473469 self .strand1 = strand1
@@ -485,8 +481,8 @@ def close(self):
485481
486482 def write_s_stanza (self ):
487483 self .write_lav_marker ()
488- ( strand1 , flag1 ) = minus_or_nothing (self .strand1 )
489- ( strand2 , flag2 ) = minus_or_nothing (self .strand2 )
484+ strand1 , flag1 = minus_or_nothing (self .strand1 )
485+ strand2 , flag2 = minus_or_nothing (self .strand2 )
490486 fname1 = build_filename (self .fname1 , self .src1 )
491487 fname2 = build_filename (self .fname2 , self .src2 )
492488 print ("s {" , file = self .file )
@@ -522,7 +518,7 @@ def write_a_stanza(self, alignment):
522518 nonGap = (ch1 != "-" ) and (ch2 != "-" )
523519 if nonGap :
524520 if piece1 is None : # new piece starts
525- ( piece1 , piece2 , idCount ) = (pos1 , pos2 , 0 )
521+ piece1 , piece2 , idCount = (pos1 , pos2 , 0 )
526522 if ch1 == ch2 :
527523 idCount += 1
528524 elif piece1 is not None : # new gap starts
@@ -543,11 +539,11 @@ def write_a_stanza(self, alignment):
543539
544540 # write the block
545541
546- ( start1 , start2 , size , pctId ) = pieces [- 1 ] # get end of final piece
542+ start1 , start2 , size , pctId = pieces [- 1 ] # get end of final piece
547543 end1 = start1 + size
548544 end2 = start2 + size
549545
550- ( start1 , start2 , size , pctId ) = pieces [0 ] # get start of first piece
546+ start1 , start2 , size , pctId = pieces [0 ] # get start of first piece
551547
552548 score = int (round (alignment .score ))
553549
@@ -575,7 +571,7 @@ def sort_keys_by_chrom(keys):
575571
576572
577573def chrom_key (src ):
578- ( species , chrom ) = src_split (src )
574+ species , chrom = src_split (src )
579575 if chrom .startswith ("chr" ):
580576 chrom = chrom [3 :]
581577 try :
@@ -591,7 +587,7 @@ def build_filename(fmt, src):
591587 num = fmt .count ("%s" )
592588 if num == 0 :
593589 return fmt
594- ( species , chrom ) = src_split (src )
590+ species , chrom = src_split (src )
595591 if num == 1 :
596592 return fmt % chrom
597593 return fmt % (species , chrom )
0 commit comments