X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FFastaFile.java;h=6e3ced88635f906442f3107133741b70732f9214;hb=6a698ae1f2a42d84b287f3095a9244c711e0ce2e;hp=37c96f600a5c9b1f34282255b7ad085088b10fd7;hpb=55e2e9b22b133db8b9ff0979b0338a33081fc8fd;p=jalview.git diff --git a/src/jalview/io/FastaFile.java b/src/jalview/io/FastaFile.java index 37c96f6..6e3ced8 100755 --- a/src/jalview/io/FastaFile.java +++ b/src/jalview/io/FastaFile.java @@ -1,6 +1,6 @@ /* * Jalview - A Sequence Alignment Editor and Viewer -* Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle +* Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -41,16 +41,6 @@ public class FastaFile extends AlignFile /** * Creates a new FastaFile object. * - * @param inStr DOCUMENT ME! - */ - public FastaFile(String inStr) - { - super(inStr); - } - - /** - * Creates a new FastaFile object. - * * @param inFile DOCUMENT ME! * @param type DOCUMENT ME! * @@ -76,12 +66,20 @@ public class FastaFile extends AlignFile while ((line = nextLine()) != null) { + line = line.trim(); if (line.length() > 0) { if (line.charAt(0)=='>') { if (count != 0) { + if (!isValidProteinSequence(sb.toString())) + { + throw new IOException(AppletFormatAdapter.INVALID_CHARACTERS + +" : "+seq.getName() + +" : "+invalidCharacter); + } + seq.setSequence(sb.toString()); seqs.addElement(seq); } @@ -100,9 +98,11 @@ public class FastaFile extends AlignFile if (count > 0) { - if (!isValidProteinSequence(sb.toString().toUpperCase())) + if (!isValidProteinSequence(sb.toString())) { - throw new IOException("Invalid protein sequence"); + throw new IOException(AppletFormatAdapter.INVALID_CHARACTERS + +" : "+seq.getName() + +" : "+invalidCharacter); } seq.setSequence(sb.toString());