code: def build_alignment(self,score,pieces):
  		
  	 	# build text
  		self.open_seqs()
  		text1 = text2 = ""
  		end1  = end2  = None
  		for (start1,start2,length,pctId) in pieces:
  			if (end1 != None):
  				if (start1 == end1): # insertion in sequence 2
  					text1 += self.seq1_gap * (start2-end2)
  					text2 += self.seq2_file.get(end2,start2-end2)
  				else: # insertion in sequence 1
  					text1 += self.seq1_file.get(end1,start1-end1)
  					text2 += self.seq2_gap * (start1-end1)
  
  			text1 += self.seq1_file.get(start1,length)
  			text2 += self.seq2_file.get(start2,length)
  			end1 = start1 + length
  			end2 = start2 + length
  		# create alignment
  		start1 = pieces[0][0]
  		start2 = pieces[0][1]
  		end1   = pieces[-1][0] + pieces[-1][2]
  		end2   = pieces[-1][1] + pieces[-1][2]
  		size1  = end1 - start1
  		size2  = end2 - start2
  		a = Alignment(score=score,species_to_lengths=self.species_to_lengths)
  		#if (self.seq1_strand == "-"): start1 = self.seq1_file.length - end1
  		a.add_component(Component(self.seq1_src,start1,size1,self.seq1_strand,text=text1))
  		#if (self.seq2_strand == "-"): start2 = self.seq2_file.length - end2
  		a.add_component(Component(self.seq2_src,start2,size2,self.seq2_strand,text=text2))
  		return a
docs: converts a score and pieces to an alignment