Skip to content

Commit

Permalink
Corrected sequence writer
Browse files Browse the repository at this point in the history
  • Loading branch information
fredericlemoine committed Oct 14, 2016
1 parent b1bb115 commit 73fb33b
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions io/fasta/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,13 @@ func WriteSequences(al align.Alignment) string {
buf.WriteString(name)
buf.WriteString("\n")
nbchar := 0
for i := 0; i < len(seq); i += FASTA_LINE {
end := min_int(i+FASTA_LINE, len(seq))
for j := i; j < end; j++ {
if seq[j] != '-' {
buf.WriteRune(seq[j])
nbchar++
if nbchar == FASTA_LINE {
buf.WriteString("\n")
nbchar = 0
}
for i := 0; i < len(seq); i++ {
if seq[i] != '-' {
buf.WriteRune(seq[i])
nbchar++
if nbchar == FASTA_LINE {
buf.WriteString("\n")
nbchar = 0
}
}
}
Expand Down

0 comments on commit 73fb33b

Please sign in to comment.