String[] omitHidden = null;
- if (ap.av.hasHiddenColumns)
- {
- System.out.println("PROMPT USER HERE");
- omitHidden = ap.av.getViewAsString(true);
+ System.out.println("PROMPT USER HERE"); // TODO: decide if a prompt happens or we simply trust the user wants wysiwig behaviour
+ SequenceGroup sg = ap.av.getSelectionGroup();
+ ColumnSelection csel = new ColumnSelection(ap.av.getColumnSelection());
+ omitHidden = ap.av.getViewAsString(true);
+ Alignment oal = new Alignment(ap.av.getSequenceSelection());
+ AlignmentAnnotation[] nala = ap.av.alignment.getAlignmentAnnotation();
+ for (int i=0; i<nala.length; i++)
+ {
+ AlignmentAnnotation na =nala[i];
+ oal.addAnnotation(na);
}
-
cap.setText(new FormatAdapter().formatSequences(
- e.getActionCommand(),
- ap.av.getSelectionAsNewSequence(),
- omitHidden));
+ e.getActionCommand(),
+ oal,
+ omitHidden, csel, sg));
+ oal=null;
}
public void pdbFromFile_actionPerformed()
afile.addJVSuffix(
jalview.bin.Cache.getDefault("PFAM_JVSUFFIX", true));
}
+ /* amsa is not supported by this function - it requires an alignment rather than a sequence vector
+ else if (format.equalsIgnoreCase("AMSA"))
+ {
+ afile = new AMSAFile();
+ afile.addJVSuffix(
+ jalview.bin.Cache.getDefault("AMSA_JVSUFFIX", true));
+ }*/
afile.setSeqs(seqs);
}
public String formatSequences(String format, AlignmentI alignment, String[] omitHidden, ColumnSelection colSel)
{
- return formatSequences(format, alignment, omitHidden, getCacheSuffixDefault(format), colSel);
+ return formatSequences(format, alignment, omitHidden, getCacheSuffixDefault(format), colSel, null);
+ }
+ public String formatSequences(String format, AlignmentI alignment, String[] omitHidden, ColumnSelection colSel, SequenceGroup sgp)
+ {
+ return formatSequences(format, alignment, omitHidden, getCacheSuffixDefault(format), colSel, sgp);
}
/**
* hack function to replace seuqences with visible sequence strings before generating a
*/
public String formatSequences(String format, AlignmentI alignment, String[] omitHidden, boolean suffix, ColumnSelection colSel)
{
- AlignFile afile = null;
+ return formatSequences(format, alignment, omitHidden, suffix, colSel, null);
+ }
+
+ public String formatSequences(String format, AlignmentI alignment, String[] omitHidden, boolean suffix,
+ ColumnSelection colSel, jalview.datamodel.SequenceGroup selgp)
+ {
if (omitHidden!=null)
{
//
for (int i=0; i<ala.length; i++)
{
AlignmentAnnotation na = new AlignmentAnnotation(ala[i]);
- colSel.makeVisibleAnnotation(na);
+ if (selgp!=null)
+ {
+ colSel.makeVisibleAnnotation(selgp.getStartRes(),selgp.getEndRes(), na);
+ } else {
+ colSel.makeVisibleAnnotation(na);
+ }
alv.addAnnotation(na);
}
return this.formatSequences(format, alv, suffix);