private static boolean testGeneralMsaParser() { try { final String msa_str_0 = "seq1 abcd\n\nseq2 efgh\n"; final Msa msa_0 = GeneralMsaParser.parse( new ByteArrayInputStream( msa_str_0.getBytes() ) ); final String msa_str_1 = "seq1 abc\nseq2 ghi\nseq1 def\nseq2 jkm\n"; final Msa msa_1 = GeneralMsaParser.parse( new ByteArrayInputStream( msa_str_1.getBytes() ) ); final String msa_str_2 = "seq1 abc\nseq2 ghi\n\ndef\njkm\n"; final Msa msa_2 = GeneralMsaParser.parse( new ByteArrayInputStream( msa_str_2.getBytes() ) ); final String msa_str_3 = "seq1 abc\n def\nseq2 ghi\n jkm\n"; final Msa msa_3 = GeneralMsaParser.parse( new ByteArrayInputStream( msa_str_3.getBytes() ) ); if ( !msa_1.getSequenceAsString( 0 ).toString().equalsIgnoreCase( "abcdef" ) ) { return false; return false; final Msa msa_4 = GeneralMsaParser.parse( new FileInputStream( PATH_TO_TEST_DATA + "msa_1.txt" ) ); if ( !msa_4.getSequenceAsString( 0 ).toString().equalsIgnoreCase( "abcdefeeeeeeeexx" ) ) { return false; return false; final Msa msa_5 = GeneralMsaParser.parse( new FileInputStream( PATH_TO_TEST_DATA + "msa_2.txt" ) ); if ( !msa_5.getSequenceAsString( 0 ).toString().equalsIgnoreCase( "abcdefxx" ) ) { return false; final Msa msa_6 = GeneralMsaParser.parse( new FileInputStream( PATH_TO_TEST_DATA + "msa_3.txt" ) ); if ( !msa_6.getSequenceAsString( 0 ).toString().equalsIgnoreCase( "abcdefeeeeeeeexx" ) ) { return false;
private static boolean testDistanceCalculationMethods( final File test_dir ) { try { final Msa msa0 = GeneralMsaParser.parse( new FileInputStream( test_dir + ForesterUtil.FILE_SEPARATOR + "bcl.aln" ) ); final BasicSymmetricalDistanceMatrix pwd0 = PairwiseDistanceCalculator.calcKimuraDistances( msa0 ); if ( pwd0.getSize() != 120 ) { return false; } for( int i = 0; i < pwd0.getSize(); ++i ) { if ( !isEqual( pwd0.getValue( i, i ), 0.0 ) ) { return false; } } } catch ( final Exception e ) { e.printStackTrace( System.out ); return false; } return true; }
msa = GeneralMsaParser.parse( is );
msa = GeneralMsaParser.parse( is );
msa = DeleteableMsa.createInstance( GeneralMsaParser.parse( is ) );