Skip to content

Commit

Permalink
fix crash when sequence contains ambiguous nucleotide
Browse files Browse the repository at this point in the history
if ambiguous nucleotide, replace it with 'N'

updates #3
  • Loading branch information
feliixx committed Mar 16, 2021
1 parent 0f8be6a commit 146cb3a
Show file tree
Hide file tree
Showing 3 changed files with 121 additions and 120 deletions.
5 changes: 2 additions & 3 deletions transeq/encodedSequence.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ func newEncodedSequence(buf *bytes.Buffer, headerSize int) encodedSequence {
s[headerSize+i] = gCode
case 'T', 'U':
s[headerSize+i] = tCode
case 'N':
s[headerSize+i] = nCode
default:
fmt.Printf("WARNING: invalid char in sequence %s: %s, ignoring", s[headerSize:], string(s[headerSize+i]))
s[headerSize+i] = nCode
fmt.Printf("WARNING: invalid char in sequence %s: '%s' ( pos %d), replacing with 'N'\n", string(s[:headerSize]), string(n), i)
}
}
return s
Expand Down
Loading

0 comments on commit 146cb3a

Please sign in to comment.