BufferedReader br = new BufferedReader(new InputStreamReader(fis));
while ((line = br.readLine())!=null) {
if (line.length() != 0 && line.charAt(0)=='>') {
if (name != null && !name.equals("")) {
if (seq.length()!=0)
sequences.add(new Sequence(name, seq.toString()));
}
name = line.substring(1);
seq.delete(0, seq.length());
}
else {
appendSequence(seq, line);
}
}
//add the last sequence in the file
if (name != null && !name.equals("")) {
if (seq.length()!=0)
sequences.add(new Sequence(name, seq.toString()));
}
if (sequences.size()==0) {
JOptionPane.showMessageDialog(null, UICaption.dialog_error_fasta_contains_no_sequence, UICaption.dialog_caption_error, JOptionPane.ERROR_MESSAGE);
return false;
}