- BasicTable<String> mapping_table = null;
- try {
- mapping_table = BasicTableParser.parse( mapping_infile, separator, false, true );
- }
- catch ( final Exception e ) {
- ForesterUtil.fatalError( decorator.PRG_NAME,
- "failed to read [" + mapping_infile + "] [" + e.getMessage() + "]" );
- }
- if ( ( key_column < 0 ) || ( key_column >= mapping_table.getNumberOfColumns() ) ) {
- ForesterUtil.fatalError( decorator.PRG_NAME, "illegal value for key column" );
+ if ( field != FIELD.MOL_SEQ ) {
+ BasicTable<String> mapping_table = null;
+ try {
+ mapping_table = BasicTableParser.parse( mapping_infile, separator, true, false );
+ }
+ catch ( final Exception e ) {
+ ForesterUtil.fatalError( decorator.PRG_NAME,
+ "failed to read [" + mapping_infile + "] [" + e.getMessage() + "]" );
+ }
+ if ( ( key_column < 0 ) || ( key_column >= mapping_table.getNumberOfColumns() ) ) {
+ ForesterUtil.fatalError( decorator.PRG_NAME, "illegal value for key column" );
+ }
+ if ( ( value_column < 0 ) || ( value_column >= mapping_table.getNumberOfColumns() ) ) {
+ ForesterUtil.fatalError( decorator.PRG_NAME, "illegal value for value column" );
+ }
+ if ( mapping_table.isEmpty() || ( mapping_table.getNumberOfColumns() < 1 ) ) {
+ ForesterUtil.fatalError( decorator.PRG_NAME, "mapping table is empty" );
+ }
+ if ( mapping_table.getNumberOfColumns() == 1 ) {
+ ForesterUtil.fatalError( decorator.PRG_NAME, "mapping table has only one column" );
+ }
+ map = mapping_table.getColumnsAsMap( key_column, value_column );
+ final Iterator<Entry<String, String>> iter = map.entrySet().iterator();
+ if ( verbose ) {
+ System.out.println();
+ }
+ while ( iter.hasNext() ) {
+ final Entry<String, String> e = iter.next();
+ if ( ForesterUtil.isEmpty( e.getKey() ) ) {
+ ForesterUtil.fatalError( decorator.PRG_NAME, "mapping table contains empty key" );
+ }
+ if ( ForesterUtil.isEmpty( e.getValue() ) ) {
+ ForesterUtil.fatalError( decorator.PRG_NAME, "mapping table contains empty value" );
+ }
+ if ( verbose ) {
+ System.out.println( e.getKey() + " => " + e.getValue() );
+ }
+ }
+ if ( verbose ) {
+ System.out.println();
+ }