--- /dev/null
+// do something groovy in jalview
+print "Hello World.\n";
+def alf = Jalview.getAlignframes();
+for (ala in alf)
+{
+ def alignment = ala.viewport.alignment;
+ // ala is an jalview.gui.AlignFrame object
+ print new jalview.io.AnnotationFile().printCSVAnnotations(alignment.getAlignmentAnnotation())+"\n";
+}
\ No newline at end of file
--- /dev/null
+writeAnnot = {
+ new File(it).append(new jalview.io.AnnotationFile().printAnnotations(Jalview.getAlignframes()[0].getViewport().getAlignment().getAlignmentAnnotation(),null,null))
+}
+
+
--- /dev/null
+import jalview.analysis.*;
+import jalview.datamodel.*;
+import jalview.gui.AlignFrame;
+import jalview.gui.AlignViewport;
+
+def af = Jalview.getAlignframes();
+
+for (ala in af)
+{
+ def al = ala.viewport.alignment;
+ if (al!=null && al.getCodonFrames()!=null)
+ {
+ al.getCodonFrames().each {
+ it.getdnaToProt().each {
+ it2 -> println it2.fromShifts+"\n"
+ }
+ }
+ }
+}
+
--- /dev/null
+import jalview.analysis.*;
+import jalview.datamodel.*;
+import jalview.gui.AlignFrame;
+import jalview.gui.AlignViewport;
+
+def af = Jalview.getAlignframes();
+def al = af[0].viewport.alignment;
+ParseProperties pp = new ParseProperties(al);
+pp.getScoresFromDescription("Score", "ScanPS Raw Score", "([-0-9.+]+)");
+def sqs = al.getSequenceAt(0);
+def annots = sqs.getAnnotation();
+
+
--- /dev/null
+// do something groovy in jalview\r
+print "Hello World.\n";\r
+def alf = Jalview.getAlignframes();\r
+for (ala in alf)\r
+{\r
+ // ala is an jalview.gui.AlignFrame object \r
+ print ala.getTitle()+"\n";\r
+ // get the parent jalview.datamodel.Alignment from the alignment viewport\r
+ def alignment = ala.viewport.alignment;\r
+ // get the first sequence from the jalview.datamodel.Alignment object\r
+ def seq = alignment.getSequenceAt(0); \r
+}\r
--- /dev/null
+import jalview.analysis.*;
+import jalview.datamodel.*;
+import jalview.gui.AlignFrame;
+import jalview.gui.AlignViewport;
+
+def af = Jalview.getAlignframes();
+
+def todie = "PDBFile"; // about to delete this type of group
+for (ala in af)
+{
+ def al = ala.viewport.alignment.getDataset();
+ if (al!=null)
+ {
+ SequenceI[] seqs = al.getSequencesArray();
+ for (sq in seqs)
+ {
+ if (sq!=null) {
+ SequenceFeature[] sf = sq.getSequenceFeatures();
+ for (sfpos in sf)
+ {
+ if (sfpos!=null && sfpos.getFeatureGroup().equals(todie))
+ {
+ sq.deleteFeature(sfpos);
+ }
+ }
+ }
+ }
+ }
+}
+
+
--- /dev/null
+import jalview.analysis.*;
+import jalview.datamodel.*;
+import jalview.gui.AlignFrame;
+import jalview.gui.AlignViewport;
+
+def af = Jalview.getAlignframes();
+
+// walk through all alignments, stripping off all text prior to and including last '|' symbol in sequence IDs
+
+for (ala in af)
+{
+ def al = ala.viewport.alignment;
+ if (al!=null)
+ {
+ SequenceI[] seqs = al.getSequencesArray();
+ for (sq in seqs)
+ {
+ if (sq!=null) {
+ if (sq.getName().indexOf("|")>-1)
+ {
+ sq.setName(sq.getName().substring(sq.getName().lastIndexOf("|")+1));
+ if (sq.getDatasetSequence()!=null)
+ {
+ sq.getDatasetSequence().setName(sq.getName());
+ }
+ }
+ }
+ }
+ }
+}
+
\ No newline at end of file