From: tcofoegbu Date: Wed, 14 Jun 2017 12:25:28 +0000 (+0100) Subject: JAL-2136 New Phyre2 branch + attempt to resynced with develop X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=c51dbe7933683b64548f5353e67561d2b5e377f7;hp=b8cd52fe7bed59130e5b080acfd42c3ef2effdbb;p=jalview.git JAL-2136 New Phyre2 branch + attempt to resynced with develop --- diff --git a/.classpath b/.classpath index 8aef745..c4a2832 100644 --- a/.classpath +++ b/.classpath @@ -39,7 +39,7 @@ - + diff --git a/RELEASE b/RELEASE index 9bc5817..6dffc29 100644 --- a/RELEASE +++ b/RELEASE @@ -1,2 +1,2 @@ -jalview.release=releases/Release_2_10_1_Branch -jalview.version=2.10.1 +jalview.release=releases/Release_2_10_2_Branch +jalview.version=2.10.2 diff --git a/examples/groovy/colourConserved.groovy b/examples/groovy/colourConserved.groovy new file mode 100644 index 0000000..4a15922 --- /dev/null +++ b/examples/groovy/colourConserved.groovy @@ -0,0 +1,88 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors + * + * This file is part of Jalview. + * + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. + * + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. + */ +import java.awt.Color +import jalview.schemes.ColourSchemeI +import jalview.schemes.ColourSchemes +import jalview.datamodel.AnnotatedCollectionI +import jalview.datamodel.SequenceI +import jalview.datamodel.SequenceCollectionI +import jalview.util.Comparison + +/* + * Closure that defines a colour scheme where fully conserved residues are red, + * partly conserved (match consensus but < 100% consensus) are yellow, + * unconserved and gaps are white + */ +def conserved +conserved = { -> + [ + /* + * name shown in the colour menu + */ + getSchemeName: { -> 'Conserved' }, + + /* + * to make a new instance for each alignment view + */ + getInstance: { AnnotatedCollectionI coll, Map map -> conserved() }, + + /* + * method only needed if colour scheme has to recalculate + * values when an alignment is modified + */ + alignmentChanged: { AnnotatedCollectionI coll, Map map -> }, + + /* + * determine colour for a residue at an aligned position of a + * sequence, given consensus residue(s) for the column and the + * consensus percentage identity score for the column + */ + findColour: { char res, int col, SequenceI seq, String consensus, float pid -> + if ('a' <= res && res <= 'z') + { + res -= ('a' - 'A'); + } + if (Comparison.isGap(res) || !consensus.contains(String.valueOf(res))) + { + Color.white + } else if (pid < 100) + { + Color.yellow + } else + { + Color.red + } + }, + + /* + * true means applicable to nucleotide or peptide data + */ + isApplicableTo: {AnnotatedCollectionI coll -> true}, + + /* + * simple colour schemes are those that depend on the residue + * only (these are also available to colour structure viewers) + */ + isSimple: { false } + ] as ColourSchemeI +} + +ColourSchemes.instance.registerColourScheme(conserved()) diff --git a/examples/groovy/colourUnconserved.groovy b/examples/groovy/colourUnconserved.groovy new file mode 100644 index 0000000..68730f3 --- /dev/null +++ b/examples/groovy/colourUnconserved.groovy @@ -0,0 +1,84 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors + * + * This file is part of Jalview. + * + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. + * + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. + */ +import java.awt.Color +import jalview.schemes.ColourSchemeI +import jalview.schemes.ColourSchemes +import jalview.datamodel.AnnotatedCollectionI +import jalview.datamodel.SequenceI +import jalview.datamodel.SequenceCollectionI +import jalview.util.Comparison + +/* + * Closure that defines a colour scheme where non-consensus residues are pink, + * other residues (and gaps) are white + */ +def unconserved +unconserved = { -> + [ + /* + * name shown in the colour menu + */ + getSchemeName: { -> 'Unconserved' }, + + /* + * to make a new instance for each alignment view + */ + getInstance: { AnnotatedCollectionI coll, Map map -> unconserved() }, + + /* + * method only needed if colour scheme has to recalculate + * values when an alignment is modified + */ + alignmentChanged: { AnnotatedCollectionI coll, Map map -> }, + + /* + * determine colour for a residue at an aligned position of a + * sequence, given consensus residue(s) for the column and the + * consensus percentage identity score for the column + */ + findColour: { char res, int col, SequenceI seq, String consensus, float pid -> + if ('a' <= res && res <= 'z') + { + res -= ('a' - 'A'); + } + if (Comparison.isGap(res) || consensus.contains(String.valueOf(res))) + { + Color.white + } else + { + Color.pink + } + }, + + /* + * true means applicable to nucleotide or peptide data + */ + isApplicableTo: {AnnotatedCollectionI coll -> true}, + + /* + * simple colour schemes are those that depend on the residue + * only (these are also available to colour structure viewers) + */ + isSimple: { false } + ] as ColourSchemeI +} + +ColourSchemes.instance.registerColourScheme(unconserved()) diff --git a/examples/groovy/featureCounter.groovy b/examples/groovy/featureCounter.groovy deleted file mode 100644 index 9059dd0..0000000 --- a/examples/groovy/featureCounter.groovy +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors - * - * This file is part of Jalview. - * - * Jalview is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 - * of the License, or (at your option) any later version. - * - * Jalview is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Jalview. If not, see . - * The Jalview Authors are detailed in the 'AUTHORS' file. - */ - -import jalview.workers.FeatureCounterI; -import jalview.workers.AlignmentAnnotationFactory; - -/* - * Example script that registers two alignment annotation calculators - * - one that counts residues in a column with Pfam annotation - * - one that counts only charged residues with Pfam annotation - * - * To try: - * 1. load uniref50.fa from the examples folder - * 2. load features onto it from from examples/exampleFeatures.txt - * 3. Open this script in the Groovy console. - * 4. Either execute this script from the console, or via Calculate->Run Groovy Script - - * To explore further, try changing this script to count other kinds of occurrences of - * residue and sequence features at columns in an alignment. - */ - -/* - * A closure that returns true for any Charged residue - */ -def isCharged = { residue -> - switch(residue) { - case ['D', 'd', 'E', 'e', 'H', 'h', 'K', 'k', 'R', 'r']: - return true - } - false -} - -/* - * A closure that returns 1 if sequence features include type 'Pfam', else 0 - * Argument should be a list of SequenceFeature - */ -def hasPfam = { features -> - for (sf in features) - { - /* - * Here we inspect the type of the sequence feature. - * You can also test sf.description, sf.score, sf.featureGroup, - * sf.strand, sf.phase, sf.begin, sf.end - * or sf.getValue(attributeName) for GFF 'column 9' properties - */ - if ("Pfam".equals(sf.type)) - { - return true - } - } - false -} - -/* - * Closure that computes an annotation based on - * presence of particular residues and features - * Parameters are - * - the name (label) for the alignment annotation - * - the description (tooltip) for the annotation - * - a closure (groovy function) that tests whether to include a residue - * - a closure that tests whether to increment count based on sequence features - */ -def getColumnCounter = { name, desc, acceptResidue, acceptFeatures -> - [ - getName: { name }, - getDescription: { desc }, - getMinColour: { [0, 255, 255] }, // cyan - getMaxColour: { [0, 0, 255] }, // blue - count: - { res, feats -> - def c = 0 - if (acceptResidue.call(res)) - { - if (acceptFeatures.call(feats)) - { - c++ - } - } - c - } - ] as FeatureCounterI -} - -/* - * Define an annotation row that counts any residue with Pfam domain annotation - */ -def pfamAnnotation = getColumnCounter("Pfam", "Count of residues with Pfam domain annotation", {true}, hasPfam) - -/* - * Define an annotation row that counts charged residues with Pfam domain annotation - */ -def chargedPfamAnnotation = getColumnCounter("Pfam charged", "Count of charged residues with Pfam domain annotation", isCharged, hasPfam) - -/* - * Register the annotations - */ -AlignmentAnnotationFactory.newCalculator(pfamAnnotation) -AlignmentAnnotationFactory.newCalculator(chargedPfamAnnotation) diff --git a/examples/groovy/featuresCounter.groovy b/examples/groovy/featuresCounter.groovy new file mode 100644 index 0000000..dc4c97c --- /dev/null +++ b/examples/groovy/featuresCounter.groovy @@ -0,0 +1,73 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors + * + * This file is part of Jalview. + * + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. + * + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. + */ + +import jalview.workers.AlignmentAnnotationFactory; +import jalview.workers.FeatureSetCounterI; + +/* + * Example script to compute two alignment annotations + * - count of Phosphorylation features + * - count of Turn features + * To try this, first load example file uniref50.fa and load on features file + * exampleFeatures.txt, before running this script + * + * The script only needs to be run once - it will be registered by Jalview + * and recalculated automatically when the alignment changes. + * + * Note: The feature api provided by 2.10.2 is not compatible with scripts + * that worked with earlier Jalview versions. Apologies for the inconvenience. + */ + +def annotator = + [ + getNames: { ['Phosphorylation', 'Turn'] as String[] }, + getDescriptions: { ['Count of Phosphorylation features', 'Count of Turn features'] as String[] }, + getMinColour: { [0, 255, 255] as int[] }, // cyan + getMaxColour: { [0, 0, 255] as int[] }, // blue + count: + { res, feats -> + int phos + int turn + for (sf in feats) + { + /* + * Here we inspect the type of the sequence feature. + * You can also test sf.description, sf.score, sf.featureGroup, + * sf.strand, sf.phase, sf.begin, sf.end + * or sf.getValue(attributeName) for GFF 'column 9' properties + */ + if (sf.type.contains('TURN')) + { + turn++ + } + if (sf.type.contains('PHOSPHORYLATION')) + { + phos++ + } + } + [phos, turn] as int[] + } + ] as FeatureSetCounterI + +/* + * Register the annotation calculator with Jalview + */ +AlignmentAnnotationFactory.newCalculator(annotator) diff --git a/examples/groovy/multipleFeatureAnnotations.groovy b/examples/groovy/multipleFeatureAnnotations.groovy deleted file mode 100644 index 592c7f5..0000000 --- a/examples/groovy/multipleFeatureAnnotations.groovy +++ /dev/null @@ -1,110 +0,0 @@ -import jalview.workers.AlignmentAnnotationFactory; -import jalview.workers.AnnotationProviderI; -import jalview.datamodel.AlignmentAnnotation; -import jalview.datamodel.Annotation; -import jalview.util.ColorUtils; -import jalview.util.Comparison; -import java.awt.Color; - -/* - * Example script to compute two alignment annotations - * - count of Phosphorylation features - * - count of Turn features - * To try this, first load example file uniref50.fa and load on features file - * exampleFeatures.txt, before running this script - * - * The script only needs to be run once - it will be registered by Jalview - * and recalculated automatically when the alignment changes. - */ - -/* - * A closure that returns true if value includes "PHOSPHORYLATION" - */ -def phosCounter = { type -> type.contains("PHOSPHORYLATION") } - -/* - * A closure that returns true if value includes "TURN" - */ -def turnCounter = { type -> type.contains("TURN") } - -/* - * A closure that computes and returns an array of Annotation values, - * one for each column of the alignment - */ -def getAnnotations(al, fr, counter) -{ - def width = al.width - def counts = new int[width] - def max = 0 - - /* - * count features in each column, record the maximum value - */ - for (col = 0 ; col < width ; col++) - { - def count = 0 - for (row = 0 ; row < al.height ; row++) - { - seq = al.getSequenceAt(row) - if (seq != null && col < seq.getLength()) - { - def res = seq.getCharAt(col) - if (!Comparison.isGap(res)) - { - pos = seq.findPosition(col) - features = fr.findFeaturesAtRes(seq, pos) - for (feature in features) - { - if (counter.call(feature.type)) - { - count++ - } - } - } - } - } - counts[col] = count - if (count > max) - { - max = count - } - } - - /* - * make the Annotation objects, with a graduated colour scale - * (from min value to max value) for the histogram bars - */ - def zero = '0' as char - def anns = new Annotation[width] - for (col = 0 ; col < width ; col++) - { - def c = counts[col] - if (c > 0) - { - Color color = ColorUtils.getGraduatedColour(c, 0, Color.cyan, - max, Color.blue) - anns[col] = AlignmentAnnotationFactory.newAnnotation(String.valueOf(c), - String.valueOf(c), zero, c, color) - } - } - anns -} - -/* - * Define the method that performs the calculations, and builds two - * AlignmentAnnotation objects - */ -def annotator = - [ calculateAnnotation: { al, fr -> - def phosAnns = getAnnotations(al, fr, phosCounter) - def ann1 = AlignmentAnnotationFactory.newAlignmentAnnotation("Phosphorylation", "Count of Phosphorylation features", phosAnns) - def turnAnns = getAnnotations(al, fr, turnCounter) - def ann2 = AlignmentAnnotationFactory.newAlignmentAnnotation("Turn", "Count of Turn features", turnAnns) - return [ann1, ann2] - } - ] as AnnotationProviderI - -/* - * Register the annotation calculator with Jalview - */ -AlignmentAnnotationFactory.newCalculator(annotator) diff --git a/examples/groovy/visibleFeaturesCounter.groovy b/examples/groovy/visibleFeaturesCounter.groovy new file mode 100644 index 0000000..b3180f8 --- /dev/null +++ b/examples/groovy/visibleFeaturesCounter.groovy @@ -0,0 +1,89 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors + * + * This file is part of Jalview. + * + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. + * + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. + */ +import jalview.bin.Jalview +import jalview.workers.FeatureSetCounterI +import jalview.workers.AlignmentAnnotationFactory + +/* + * Demonstration of FeatureSetCounterI + * compute annotation tracks counting number of displayed + * features of each type in each column + */ + +/* + * discover features on the current view + */ + +def featuresDisp=Jalview.currentAlignFrame.currentView.featuresDisplayed +if (featuresDisp == null) { + print 'Need at least one feature visible on alignment' +} +def visibleFeatures=featuresDisp.visibleFeatures.toList() +assert 'java.util.ArrayList' == visibleFeatures.class.name + +/* + * A closure that returns an array of features present + * for each feature type in visibleFeatures + * Argument 'features' will be a list of SequenceFeature + */ +def getCounts = + { features -> + int[] obs = new int[visibleFeatures.size] + for (sf in features) + { + /* + * Here we inspect the type of the sequence feature. + * You can also test sf.description, sf.score, sf.featureGroup, + * sf.strand, sf.phase, sf.begin, sf.end + * or sf.getValue(attributeName) for GFF 'column 9' properties + */ + int pos = 0 + for (type in visibleFeatures) + { + if (type.equals(sf.type)) + { + obs[pos]++ + } + pos++ + } + } + obs +} + +/* + * Define something that counts each visible feature type + */ +def columnSetCounter = + [ + getNames: { visibleFeatures as String[] }, + getDescriptions: { visibleFeatures as String[] }, + getMinColour: { [0, 255, 255] as int[] }, // cyan + getMaxColour: { [0, 0, 255] as int[] }, // blue + count: + { res, feats -> + getCounts.call(feats) + } + ] as FeatureSetCounterI + +/* + * and register the counter + */ +AlignmentAnnotationFactory.newCalculator(columnSetCounter) diff --git a/examples/testdata/example_annot_file.jva b/examples/testdata/example_annot_file.jva index 794f42b..1779247 100644 --- a/examples/testdata/example_annot_file.jva +++ b/examples/testdata/example_annot_file.jva @@ -18,5 +18,5 @@ SEQUENCE_GROUP Group_A 30 50 * SEQUENCE_GROUP Group_B 1 351 2-5 SEQUENCE_GROUP Group_C 12 14 -1 seq1 seq2 seq3 PROPERTIES Group_A description=This is the description colour=Helix Propensity pidThreshold=0 outlineColour=red displayBoxes=true displayText=false colourText=false textCol1=black textCol2=black textColThreshold=0 -PROPERTIES Group_B outlineColour=red +PROPERTIES Group_B outlineColour=red colour=None PROPERTIES Group_C colour=Clustal diff --git a/help/help.jhm b/help/help.jhm index 984c2d1..54cce2a 100755 --- a/help/help.jhm +++ b/help/help.jhm @@ -22,7 +22,7 @@ - + @@ -75,6 +75,7 @@ + @@ -130,7 +131,8 @@ - + + @@ -158,4 +160,6 @@ + + diff --git a/help/helpTOC.xml b/help/helpTOC.xml index 482ccdf..a8aadf5 100755 --- a/help/helpTOC.xml +++ b/help/helpTOC.xml @@ -24,6 +24,11 @@ + + + + + @@ -132,7 +137,7 @@ - + @@ -157,7 +162,7 @@ - + diff --git a/help/html/features/chimera.html b/help/html/features/chimera.html index 5ae00af..68ac465 100644 --- a/help/html/features/chimera.html +++ b/help/html/features/chimera.html @@ -211,10 +211,41 @@ structure in the alignment. The regions used to calculate the superposition will be highlighted using the 'Cartoon' rendering style, and the remaining data shown as a chain - trace.
+ trace.

- -
  • Help
    +
  • EXPERIMENTAL FEATURES
    + + These are only available if the Tools→Enable + Experimental Features option is enabled. (Since Jalview 2.10.2) +
      +
    • Write Jalview features
      Selecting + this option will create new residue attributes for any + features currently visible in the associated alignment + views, allowing those positions to be selected and + analysed with via Chimera's 'Render by Attribute' tool + (found in the Tools submenu called Structure Analysis).
      +
      If you use this option, please remember to select + the Refresh Menus option in Chimera's Render by + Attribute dialog box in order to see the attributes + derived from Jalview sequence features. +

      + View + this function's issue in Jalview's bug tracker
    • +
    • Fetch Chimera Attributes
      This + submenu lists available Chimera residue attributes that + can be imported as Jalview features on associated + sequences.
      This is particularly useful for + transferring quantitative positional annotation. For + example, structure similarity for an alignment can be + visualised by transferring the local RMSD attributes + generated by Chimera's Match->Align tool onto aligned + sequences and displayed with a Graduated feature colour + scheme. +
      View + this function's issue in Jalview's bug tracker
    • +
  • +
  • Help
    • Chimera Help
      diff --git a/help/html/features/groovy.html b/help/html/features/groovy.html index 254f92e..ead4436 100644 --- a/help/html/features/groovy.html +++ b/help/html/features/groovy.html @@ -108,9 +108,18 @@ print currentAlFrame.getTitle(); simplified the alignment analysis programming interface in Jalview 2.10 to make it easy for you to add your own dynamic annotation tracks with Groovy. Have a look at the featureCounter.groovy + href="../groovy/featuresCounter.html">featuresCounter.groovy example for more information.

      +

      + Creating custom colourschemes
      + You can create your own alignment colourschemes with a groovy script. We've provided two examples:
      +

      +

      diff --git a/help/html/features/overview.html b/help/html/features/overview.html index 9d36a1c..4f26592 100755 --- a/help/html/features/overview.html +++ b/help/html/features/overview.html @@ -31,6 +31,11 @@

      The red box indicates the currently viewed region of the alignment, this may be moved by clicking and dragging with the mouse.

      +

      Right-click (or CMD-Click) to open the + overview's popup menu. This provides an option to include hidden + regions in the overview (shown as dark-grey rows and columns).

      + The option to include/exclude hidden regions in the + overview was introduced in Jalview 2.10.2.

      diff --git a/help/html/features/preferences.html b/help/html/features/preferences.html index 6e8d3e4..acd7ba6 100755 --- a/help/html/features/preferences.html +++ b/help/html/features/preferences.html @@ -261,7 +261,11 @@ The Custom only button limits the entries in the table to just those you have configured yourself via the Edit Links buttons. Press Show all to clear any filters. -

      +

      +

      The links table is prepoulated with persistent URLs for many common + bioinformatics databases (since 2.10.2). These links are downloaded by Jalview from + the identifiers.org website, and the names and URLs are not + user editable. Read more about configuring URL links.

      diff --git a/help/html/features/splitView.html b/help/html/features/splitView.html index 03b993c..3862c39 100644 --- a/help/html/features/splitView.html +++ b/help/html/features/splitView.html @@ -67,7 +67,11 @@ alignments, the "Format→Font" menu option has an option 'Scale protein residues to codons'. This option will make each protein residue the same width as a DNA - codon (so the alignments 'line up' vertically) + codon (so the alignments 'line up' vertically).

      + The 'Use same + font for cDNA and peptide' checkbox, when enabled, ensures that font or + font-size changes in either the cDNA or Protein alignment will also + be mirrored. (Added in 2.10.2)
    • "View→Protein" (in the cDNA panel) or "View→Nucleotide" (in the protein panel) diff --git a/help/html/groovy/featureCounter.html b/help/html/groovy/featureCounter.html deleted file mode 100644 index 2ebaf45..0000000 --- a/help/html/groovy/featureCounter.html +++ /dev/null @@ -1,269 +0,0 @@ - - - -Extending Jalview with Groovy - Feature Counter Example - - -

      - Extending Jalview with Groovy - A customisable - feature counter

      The groovy script below shows how to - add a new calculation track to a Jalview alignment window. -

      -

      As currently written, it will add two tracks to a protein - alignment view which count Pfam features in each column, and ones - where a charge residue also occur.

      -

      To try it for yourself:

      -
        -
      1. Copy and paste it into the groovy script console
      2. -
      3. Load the example Feredoxin project (the one that opens by - default when you first launched Jalview)
      4. -
      5. Select Calculations→Execute Groovy - Script from the alignment window's menu bar to run the script on - the current view. -
      6. -
      -
      http://www.jalview.org/examples/groovy/featureCounter.groovy - - rendered with hilite.me - -
      -
      -/*
      - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.10)
      - * Copyright (C) 2016 The Jalview Authors
      - * 
      - * This file is part of Jalview.
      - * 
      - * Jalview is free software: you can redistribute it and/or
      - * modify it under the terms of the GNU General Public License 
      - * as published by the Free Software Foundation, either version 3
      - * of the License, or (at your option) any later version.
      - *  
      - * Jalview is distributed in the hope that it will be useful, but 
      - * WITHOUT ANY WARRANTY; without even the implied warranty 
      - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
      - * PURPOSE.  See the GNU General Public License for more details.
      - * 
      - * You should have received a copy of the GNU General Public License
      - * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
      - * The Jalview Authors are detailed in the 'AUTHORS' file.
      - */
      - 
      -import jalview.workers.FeatureCounterI;
      -import jalview.workers.AlignmentAnnotationFactory;
      -
      -/*
      - * Example script that registers two alignment annotation calculators
      - * - one that counts residues in a column with Pfam annotation
      - * - one that counts only charged residues with Pfam annotation
      - *
      - * To try:
      - * 1. load uniref50.fa from the examples folder
      - * 2. load features onto it from from examples/exampleFeatures.txt
      - * 3. Open this script in the Groovy console.
      - * 4. Either execute this script from the console, or via Calculate->Run Groovy Script
      - 
      - * To explore further, try changing this script to count other kinds of occurrences of 
      - * residue and sequence features at columns in an alignment.
      - */
      -
      -/*
      - * A closure that returns true for any Charged residue
      - */
      -def isCharged = { residue ->
      -    switch(residue) {
      -        case ['D', 'd', 'E', 'e', 'H', 'h', 'K', 'k', 'R', 'r']:
      -            return true
      -    }
      -    false
      -} 
      -
      -/*
      - * A closure that returns 1 if sequence features include type 'Pfam', else 0
      - * Argument should be a list of SequenceFeature 
      - */
      -def hasPfam = { features -> 
      -    for (sf in features)
      -    {
      -        /*
      -         * Here we inspect the type of the sequence feature.
      -         * You can also test sf.description, sf.score, sf.featureGroup,
      -         * sf.strand, sf.phase, sf.begin, sf.end
      -         * or sf.getValue(attributeName) for GFF 'column 9' properties
      -         */
      -        if ("Pfam".equals(sf.type))
      -        {
      -            return true
      -        }
      -    }
      -    false
      -}
      -
      -/*
      - * Closure that computes an annotation based on 
      - * presence of particular residues and features
      - * Parameters are
      - * - the name (label) for the alignment annotation
      - * - the description (tooltip) for the annotation
      - * - a closure (groovy function) that tests whether to include a residue
      - * - a closure that tests whether to increment count based on sequence features  
      - */
      -def getColumnCounter = { name, desc, acceptResidue, acceptFeatures ->
      -    [
      -     getName: { name }, 
      -     getDescription: { desc },
      -     getMinColour: { [0, 255, 255] }, // cyan
      -     getMaxColour: { [0, 0, 255] }, // blue
      -     count: 
      -         { res, feats -> 
      -            def c = 0
      -            if (acceptResidue.call(res))
      -            {
      -                if (acceptFeatures.call(feats))
      -                {
      -                    c++
      -                }
      -            }
      -            c
      -         }
      -     ] as FeatureCounterI
      -}
      -
      -/*
      - * Define an annotation row that counts any residue with Pfam domain annotation
      - */
      -def pfamAnnotation = getColumnCounter("Pfam", "Count of residues with Pfam domain annotation", {true}, hasPfam)
      -
      -/*
      - * Define an annotation row that counts charged residues with Pfam domain annotation
      - */
      -def chargedPfamAnnotation = getColumnCounter("Pfam charged", "Count of charged residues with Pfam domain annotation", isCharged, hasPfam)
      -
      -/*
      - * Register the annotations
      - */
      -AlignmentAnnotationFactory.newCalculator(pfamAnnotation) 
      -AlignmentAnnotationFactory.newCalculator(chargedPfamAnnotation)
      -
      -
      - - diff --git a/help/html/groovy/featuresCounter.html b/help/html/groovy/featuresCounter.html new file mode 100644 index 0000000..3b6705b --- /dev/null +++ b/help/html/groovy/featuresCounter.html @@ -0,0 +1,123 @@ + + + +Extending Jalview with Groovy - Feature Counter Example + + +

      + Extending Jalview with Groovy - A customisable + feature counter

      The groovy script below shows how to + add a new calculation track to a Jalview alignment window. +

      +

      As currently written, it will add two tracks to a protein + alignment view which count Pfam features in each column, and ones + where a charge residue also occur.

      +

      To try it for yourself:

      +
        +
      1. Copy and paste it into the groovy script console
      2. +
      3. Load the example Feredoxin project (the one that opens by + default when you first launched Jalview)
      4. +
      5. Select Calculations→Execute Groovy + Script from the alignment window's menu bar to run the script on + the current view. +
      6. +
      + Please note: The 2.10.2 feature counting interface is not compatible with earlier versions.

      + http://www.jalview.org/examples/groovy/featuresCounter.groovy + - rendered with hilite.me +
      /*
      + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
      + * Copyright (C) $$Year-Rel$$ The Jalview Authors
      + * 
      + * This file is part of Jalview.
      + * 
      + * Jalview is free software: you can redistribute it and/or
      + * modify it under the terms of the GNU General Public License 
      + * as published by the Free Software Foundation, either version 3
      + * of the License, or (at your option) any later version.
      + *  
      + * Jalview is distributed in the hope that it will be useful, but 
      + * WITHOUT ANY WARRANTY; without even the implied warranty 
      + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
      + * PURPOSE.  See the GNU General Public License for more details.
      + * 
      + * You should have received a copy of the GNU General Public License
      + * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
      + * The Jalview Authors are detailed in the 'AUTHORS' file.
      + */
      +
      +import jalview.workers.AlignmentAnnotationFactory;
      +import jalview.workers.FeatureSetCounterI;
      +
      +/*
      + * Example script to compute two alignment annotations
      + * - count of Phosphorylation features
      + * - count of Turn features
      + * To try this, first load example file uniref50.fa and load on features file
      + * exampleFeatures.txt, before running this script
      + *
      + * The script only needs to be run once - it will be registered by Jalview
      + * and recalculated automatically when the alignment changes.
      + * 
      + * Note: The feature api provided by 2.10.2 is not compatible with scripts
      + * that worked with earlier Jalview versions. Apologies for the inconvenience.
      + */
      + 
      +def annotator = 
      +    [
      +     getNames: { ['Phosphorylation', 'Turn'] as String[] }, 
      +     getDescriptions:  { ['Count of Phosphorylation features', 'Count of Turn features'] as String[] },
      +     getMinColour: { [0, 255, 255] as int[] }, // cyan
      +     getMaxColour: { [0, 0, 255] as int[] }, // blue
      +     count: 
      +         { res, feats -> 
      +                int phos
      +                int turn
      +                for (sf in feats)
      +                {
      + 		          /*
      +		           * Here we inspect the type of the sequence feature.
      +		           * You can also test sf.description, sf.score, sf.featureGroup,
      +		           * sf.strand, sf.phase, sf.begin, sf.end
      +		           * or sf.getValue(attributeName) for GFF 'column 9' properties
      +		           */
      +		           if (sf.type.contains('TURN'))
      +                   {
      +                      turn++
      +                   }
      +                   if (sf.type.contains('PHOSPHORYLATION'))
      +                   {
      +                      phos++
      +                   }
      +                }
      +                [phos, turn] as int[]
      +         }
      +     ] as FeatureSetCounterI
      +    
      +/*
      + * Register the annotation calculator with Jalview
      + */
      +AlignmentAnnotationFactory.newCalculator(annotator) 
      +
      + + diff --git a/help/html/menus/desktopMenu.html b/help/html/menus/desktopMenu.html index 20e784b..a93ce4b 100755 --- a/help/html/menus/desktopMenu.html +++ b/help/html/menus/desktopMenu.html @@ -86,6 +86,7 @@ the Groovy Console for interactive scripting.
    • +
    • Enable Experimental Features Enable or disable features still under development in Jalview's user interface. This setting is remembered in your preferences.
  • Vamsas For more details, read the diff --git a/help/html/menus/popupMenu.html b/help/html/menus/popupMenu.html index d42f854..7625606 100755 --- a/help/html/menus/popupMenu.html +++ b/help/html/menus/popupMenu.html @@ -189,8 +189,10 @@ href="../features/varna.html">VARNA.
  • Hide Insertions
    - Hides columns containing gaps in the current sequence or - selected region, and reveals columns not including gaps. + Hides columns containing gaps in both the current + sequence and selected region, and reveals columns not including + gaps. (before 2.10.2, this option hid or revealed columns + according to gaps in just the current sequence)
  • Hide Sequences
    Hides the currently selected sequences in this alignment view.
  • diff --git a/help/html/releases.html b/help/html/releases.html index 6f44b3d..97d6789 100755 --- a/help/html/releases.html +++ b/help/html/releases.html @@ -21,6 +21,29 @@ --> Release History +

    @@ -47,6 +70,140 @@

    + 2.10.2
    + 20/6/2017
    +
    + +
    + General +
      +
    • More robust colours and shader model for alignments and groups
    • +
    • Custom shading schemes created via groovy scripts
    • +
    • linked scrolling of CDS/Protein views via Overview or sequence motif search operations
    • +
    • Efficiency improvements for interacting with alignment and overview windows
    • +
    • Hidden columns and sequences can be omitted in Overview
    • +
    • + Posterior probability annotation from + Stockholm files imported as sequence associated annotation +
    • +
    • + Sequence names don't include file + extension when importing structure files without embedded + names or PDB accessions +
    • +
    • Amend sequence features dialog box can be opened by double clicking gaps within sequence feature extent
    • +
    + Application +
      +
    • + + Experimental Features Checkbox in Desktop's Tools + menu to hide or show untested features in the application. +
    • +
    • Warning in alignment status bar when there are not enough columns to superimpose structures in Chimera
    • +
    • Faster Chimera/Jalview communication by file-based command exchange
    • +
    • URLs for viewing database cross-references provided by identifiers.org and the EMBL-EBI's MIRIAM DB
    • +
    • Updated JABAWS client to v2.2
    • +
    + Experimental features +
      +
    • + New entries in the Chimera menu + to transfer Chimera's structure attributes as Jalview + features, and vice-versa. +
    • +
    + Applet +
      +
    • +
    + Test Suite +
  • Added PrivilegedAccessor to test suite
  • +
  • Prevent or clear modal dialogs raised during tests
  • +
  • + +
  • + General +
      +
    • + Fixed incorrect value in BLOSUM 62 score + matrix - C->R should be '3'
      Old matrix restored with + this one-line groovy script:
      jalview.analysis.scoremodels.ScoreModels.instance.BLOSUM62.@matrix[4][1]=3 +
    • +
    • + Fixed Jalview's treatment of gaps in PCA + and substitution matrix based Tree calculations.
      In + earlier versions of Jalview, gaps matching gaps were + penalised, and gaps matching non-gaps penalised even more. + In the PCA calculation, gaps were actually treated as + non-gaps - so different costs were applied, which mean't + Jalview's PCAs were different to those produced by + SeqSpace.
      Jalview now treats gaps in the same way as + SeqSpace (ie it scores them as 0). To restore pre-2.10.2 + behaviour
      + jalview.viewmodel.PCAModel.scoreGapAsAny=true // for + 2.10.1 mode
      + jalview.viewmodel.PCAModel.scoreGapAsAny=false // to + restore 2.10.2 mode +
    • +
    • Reopening Colour by annotation dialog doesn't reselect a specific sequence's associated annotation after it was used for colouring a view
    • +
    • Hidden regions in alignment views are not coloured in linked structure views
    • +
    • Current selection lost if popup menu opened on a region of alignment without groups
    • +
    • Popup menu not always shown for regions of an alignment with overlapping groups
    • +
    • Finder double counts if both a sequence's name and description match
    • +
    • Hiding column selection containing two hidden regions results in incorrect hidden regions
    • +
    • PCA calculation could hang when generating output report when working with highly redundant alignments
    • +
    • Cannot configure feature colours with lightGray or darkGray via features file
    • +
    • Overview window visible region moves erratically when hidden rows or columns are present
    • +
    • Per-residue colourschemes applied via the Structure Viewer's colour menu don't correspond to sequence colouring
    • +
    • Protein specific colours only offered in colour and group colour menu for protein alignments
    • +
    • 'Apply to all groups' setting when changing colour does not apply Conservation slider value to all groups
    • +
    • Colour threshold slider doesn't update to reflect currently selected view or group's shading thresholds
    • +
    • Percentage identity and conservation menu items do not show a tick or allow shading to be disabled
    • +
    • Conservation shading or PID threshold lost when base colourscheme changed if slider not visible
    • +
    • Sequence features shown in tooltip for gaps before start of features
    • +
    • Very large alignments take a long time to load
    • +
    • Cannot load Newick trees from eggnog ortholog database
    • +
    + Application +
      +
    • Easier creation of colours for all 'Lower case' residues (button in colourscheme editor debugged and new documentation and tooltips added)
    • +
    • Text colour threshold's 'Cancel' button doesn't restore group-specific text colour thresholds
    • +
    • Feature settings panel does not update as new features are added to alignment
    • +
    • Structure viewer's View -> Colour By view selection menu changes colours of alignment views
    • +
    • Proxy server address and port always appear enabled in Preferences->Connections
    • +
    • Spurious exceptions in console raised from alignment calculation workers after alignment has been closed
    • +
    • Typo in selection popup menu - Create groups now 'Create Group'
    • +
    • CMD/CTRL and G or Shift G for Create/Undefine group doesn't always work
    • +
    • Tree Viewer's Print Dialog doesn't get shown again after pressing 'Cancel'
    • +
    • DAS registry not found exceptions removed from console output
    • +
    • Above PID colour threshold not recovered when alignment view imported from project
    • +
    • No mappings generated between structure and sequences extracted from structure files imported via URL
    • +
    • + Structures loaded via URL are saved in + Jalview Projects rather than fetched via URL again when + the project is loaded and the structure viewed +
    • +
    • Trackpad horizontal scroll gesture adjusts start position in wrap mode
    • +
    • Status bar doesn't show positions for ambiguous amino acids
    • +
    • Hide insertions in PopUp menu excludes gaps in selection, current sequence and only within selected columns
    • +
    + Applet +
      +
    • Features not rendered as transparent on overview or linked structure view
    • +
    • Colour group by conservation doesn't work (since 2.8)
    • +
    • Hitting Cancel after applying user-defined colourscheme doesn't restore original colourscheme
    • +
    + New Known Issues +
      +
    • Protein/CDS view scrolling not always in phase after a sequence motif find operation
    • +
    • Importing annotation file with rows containing just upper and lower case letters are interpreted as WUSS rna secondary structure symbols
    • +
    + +
    + + +
    2.10.1
    29/11/2016
    @@ -188,6 +345,9 @@ Attempting to view structure for Hen lysozyme results in a PDB Client error dialog box +
  • + Structure View's mapping report switched ranges for PDB and sequence for SIFTS
  • + SIFTS 'Not_Observed' residues mapped to non-existant coordindate data