Commits

Bob Harris committed b7a3be5

added check for blank header(s) in lav h-stanza

Comments (0)

Files changed (1)

lib/bx/align/lav.py

 		if (line.startswith(">")):
 			self.seq1_header = line[1:].strip()
 			self.seq1_header_prefix = ">"
-		self.seq1_header = self.seq1_header.split()[0]
+		self.seq1_header = self.seq1_header.split(None,1)
+		if (len(self.seq1_header) > 0): self.seq1_header = self.seq1_header[0]
+		else:                           self.seq1_header = "seq1"
 
 		line = self.fetch_line(strip='"',report=" in h-stanza")
 		self.seq2_header = line
 		if (line.startswith(">")):
 			self.seq2_header = line[1:].strip()
 			self.seq2_header_prefix = ">"
-		self.seq2_header = self.seq2_header.split()[0]
+		self.seq2_header = self.seq2_header.split(None,1)
+		if (len(self.seq2_header) > 0): self.seq2_header = self.seq2_header[0]
+		else:                           self.seq2_header = "seq2"
 
 		line = self.fetch_line(report=" in h-stanza")
 		assert (line == "}"), "improper h-stanza terminator (line %d, \"%s\")" \