Integration of David Corsars Phylip File support
[jalview.git] / src / jalview / io / FormatAdapter.java
index 13dbb95..c2a317a 100755 (executable)
@@ -20,6 +20,7 @@
  */
 package jalview.io;
 
+import jalview.api.AlignViewportI;
 import jalview.datamodel.*;
 
 /**
@@ -199,7 +200,8 @@ public class FormatAdapter extends AppletFormatAdapter
     {
       // TODO consider using AlignmentView to prune to visible region
       // TODO prune sequence annotation and groups to visible region
-      // TODO: JAL-1486 - set start and end for output correctly. basically, AlignmentView.getVisibleContigs does this.
+      // TODO: JAL-1486 - set start and end for output correctly. basically,
+      // AlignmentView.getVisibleContigs does this.
       Alignment alv = new Alignment(replaceStrings(
               alignment.getSequencesArray(), omitHidden));
       AlignmentAnnotation[] ala = alignment.getAlignmentAnnotation();
@@ -246,4 +248,16 @@ public class FormatAdapter extends AppletFormatAdapter
     }
     return AppletFormatAdapter.isValidFormat(format, forwriting);
   }
+
+  /**
+   * Create a flat file representation of a given view or selected region of a view
+   * @param format
+   * @param av
+   * @return String containing flat file
+   */
+  public String formatSequences(String format, AlignViewportI av, boolean selectedOnly)
+  {
+    return formatSequences(format, getCacheSuffixDefault(format), av, selectedOnly);
+  }
+
 }