JAL-1665 getSequenceFeatures; Desktop.getAlignFrames camel-cased
[jalview.git] / examples / groovy / removeFeaturesByGroup.groovy
1 import jalview.analysis.*;
2 import jalview.datamodel.*;
3 import jalview.gui.AlignFrame;
4 import jalview.gui.AlignViewport;
5
6 def af = Jalview.getAlignFrames();
7
8 def todie = "PDBFile"; // about to delete this type of group
9 for (ala in af)
10 {
11         def al = ala.viewport.alignment.getDataset();
12         if (al!=null)
13         {
14                 SequenceI[] seqs = al.getSequencesArray();
15                 for (sq in seqs)
16                 {
17                         if (sq!=null) {
18                                 SequenceFeature[] sf = sq.getSequenceFeatures();
19                                 for (sfpos in sf)
20                                 {
21                                     if (sfpos!=null && sfpos.getFeatureGroup().equals(todie))
22                                         {
23                                                 sq.deleteFeature(sfpos);
24                                         }
25                                 }
26                         }
27                 }
28         }
29 }
30         
31