+ try
+ {
+ System.out.println("Reading file: " + f);
+ AppletFormatAdapter afa = new AppletFormatAdapter();
+ Runtime r = Runtime.getRuntime();
+ System.gc();
+ long memf = -r.totalMemory() + r.freeMemory();
+ long t1 = -System.currentTimeMillis();
+ AlignmentI al = afa
+ .readFile(args[i], DataSourceType.FILE,
+ new IdentifyFile().identify(args[i],
+ DataSourceType.FILE));
+ t1 += System.currentTimeMillis();
+ System.gc();
+ memf += r.totalMemory() - r.freeMemory();
+ if (al != null)
+ {
+ System.out.println("Alignment contains " + al.getHeight()
+ + " sequences and " + al.getWidth() + " columns.");
+ try
+ {
+ System.out.println(new AppletFormatAdapter().formatSequences(
+ FileFormat.Fasta, al, true));
+ } catch (Exception e)
+ {
+ System.err
+ .println("Couln't format the alignment for output as a FASTA file.");
+ e.printStackTrace(System.err);
+ }
+ }
+ else
+ {
+ System.out.println("Couldn't read alignment");
+ }
+ System.out.println("Read took " + (t1 / 1000.0) + " seconds.");
+ System.out
+ .println("Difference between free memory now and before is "
+ + (memf / (1024.0 * 1024.0) * 1.0) + " MB");
+ } catch (Exception e)
+ {
+ System.err.println("Exception when dealing with " + i
+ + "'th argument: " + args[i] + "\n" + e);
+ }