Skip to content

Commit

Permalink
Merge pull request #7 from tkukavica1/f-FastaReader
Browse files Browse the repository at this point in the history
passed invalid character test
  • Loading branch information
daviortega committed Mar 7, 2017
2 parents ee841db + abcc9ec commit 4531f02
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/FastaReader.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ class FastaReqder {
headersToPush = ''
x++
}
if (chars[x] !== '\n')
if (chars[x] !== '\n') {
if (chars[x] !== 'A' && chars[x] !== 'C' && chars[x] !== 'D' && chars[x] !== 'E' && chars[x] !== 'F' && chars[x] !== 'G' && chars[x] !== 'H' && chars[x] !== 'I' && chars[x] !== 'L' && chars[x] !== 'M' && chars[x] !== 'N' && chars[x] !== 'P' && chars[x] !== 'Q' && chars[x] !== 'R' && chars[x] !== 'S' && chars[x] !== 'T' && chars[x] !== 'V' && chars[x] !== 'Y' && chars[x] !== 'W' && chars[x] !== 'U' && chars[x] !== 'O' && chars[x] !== 'X')
throw Error('Not a valid FASTA - Invalid character in sequence header1')
sequencesToPush += chars[x]
}
}
this.sequences.push(sequencesToPush)
return 0
Expand Down

0 comments on commit 4531f02

Please sign in to comment.