1 import jalview.workers.AlignmentAnnotationFactory;
2 import jalview.workers.FeatureSetCounterI;
5 * Example script to compute two alignment annotations
6 * - count of Phosphorylation features
7 * - count of Turn features
8 * To try this, first load example file uniref50.fa and load on features file
9 * exampleFeatures.txt, before running this script
11 * The script only needs to be run once - it will be registered by Jalview
12 * and recalculated automatically when the alignment changes.
16 getNames: { ['Phosphorylation', 'Turn'] as String[] },
17 getDescriptions: { ['Count of Phosphorylation features', 'Count of Turn features'] as String[] },
18 getMinColour: { [0, 255, 255] as int[] }, // cyan
19 getMaxColour: { [0, 0, 255] as int[] }, // blue
27 * Here we inspect the type of the sequence feature.
28 * You can also test sf.description, sf.score, sf.featureGroup,
29 * sf.strand, sf.phase, sf.begin, sf.end
30 * or sf.getValue(attributeName) for GFF 'column 9' properties
32 if (sf.type.contains('TURN'))
36 if (sf.type.contains('PHOSPHORYLATION'))
43 ] as FeatureSetCounterI
46 * Register the annotation calculator with Jalview
48 AlignmentAnnotationFactory.newCalculator(annotator)