X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Fio%2Fparsers%2FFastaParser.java;h=dc4fc469339791a1ac08d2a17ee3b40e701f8146;hb=7ae646b73c00d1458582858319ec62f05e40c71a;hp=348bec419d0f4006655a58fb42b291b8dd953c91;hpb=656be28debec520e0e35a8b311114398a40ea366;p=jalview.git diff --git a/forester/java/src/org/forester/io/parsers/FastaParser.java b/forester/java/src/org/forester/io/parsers/FastaParser.java index 348bec4..dc4fc46 100644 --- a/forester/java/src/org/forester/io/parsers/FastaParser.java +++ b/forester/java/src/org/forester/io/parsers/FastaParser.java @@ -42,7 +42,7 @@ import org.forester.msa.BasicMsa; import org.forester.msa.Msa; import org.forester.msa.MsaFormatException; import org.forester.sequence.BasicSequence; -import org.forester.sequence.Sequence; +import org.forester.sequence.MolecularSequence; public class FastaParser { @@ -51,7 +51,7 @@ public class FastaParser { private static final Pattern ANYTHING_REGEX = Pattern.compile( "[\\d\\s]+" ); //>gi|71834668|ref|NP_001025424.1| Bcl2 [Danio rerio] public static final Pattern FASTA_DESC_LINE = Pattern - .compile( ">?\\s*([^|]+)\\|([^|]+)\\S*\\s+(.+)\\s+\\[(.+)\\]" ); + .compile( ">?\\s*([^|]+)\\|([^|]+)\\S*\\s+(.+)\\s+\\[(.+)\\]" ); public static void main( final String[] args ) { final String a = ">gi|71834668|ref|NP_001025424.1| Bcl2 [Danio rerio]"; @@ -109,11 +109,11 @@ public class FastaParser { return parseMsa( new ByteArrayInputStream( bytes ) ); } - static public List parse( final File f ) throws IOException { + static public List parse( final File f ) throws IOException { return parse( new FileInputStream( f ) ); } - static public List parse( final InputStream is ) throws IOException { + static public List parse( final InputStream is ) throws IOException { final BufferedReader reader = new BufferedReader( new InputStreamReader( is, "UTF-8" ) ); String line = null; int line_counter = 0; @@ -151,7 +151,7 @@ public class FastaParser { } addSeq( name, current_seq, temp_msa ); reader.close(); - final List seqs = new ArrayList(); + final List seqs = new ArrayList(); for( int i = 0; i < temp_msa.size(); ++i ) { seqs.add( BasicSequence.createAaSequence( temp_msa.get( i )[ 0 ].toString(), temp_msa.get( i )[ 1 ].toString() ) );