Uploaded image for project: 'Jalview'
  1. Jalview
  2. JAL-4432

Groovy script stopped working with import error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Bug
    • Affects Version/s: 2.11.3.3
    • Fix Version/s: 2.11.4.0
    • Component/s: None
    • Labels:
    • Environment:
      Jalview 2.11.3.3 and Java version 8 update 241

      Description

      I use a groovy script to highlight peptides in a sequence alignment. It reads a txt file and and basically searches peptides and colours them differently.
      This worked fine for a long time, but now out of a sudden, the script reports problems in the import commands.

      I can't remember updating either Jalview nor Java, but the problem is now on different computers where the script worked fine before.

      The error message is:

      groovy.lang.MissingPropertyException: No such property: currentAlignFrame for class: jalview.bin.Jalview
      Possible solutions: currentAlignFrame

      at highlight_peptides.run(highlight_peptides.groovy:6)


      And the groovy script:

      import jalview.util.ColorUtils
      import jalview.datamodel.SequenceFeature
      import jalview.schemes.FeatureColour
      import jalview.analysis.Finder

      def af = jalview.bin.Jalview.currentAlignFrame
      def av = af.viewport
      def fr = af.featureRenderer
      def finder = new Finder(av)

      new File("/Users/user/Downloads/jalview/motifs.txt").eachLine
      {
        line ->
         if (!line.startsWith('#'))
         {
          tokens = line.split("\\t")
          motif = tokens[0]
          featureName = tokens[1]
          featureColour = ColorUtils.parseColourString(tokens[2])
          featureScore = (tokens.length < 4 ? 0 : Float.parseFloat(tokens[3]))
          fr.setColour(featureName, new FeatureColour(featureColour))
          finder.findAll(motif, false, false, false)
          matches = finder.searchResults.results
          matches.each
          {
              sf = new SequenceFeature(featureName, motif, it.start, it.end, featureScore, null)
              it.sequence.addSequenceFeature(sf)
          }
        }
      }
      av.setShowSequenceFeatures(true)
      af.alignPanel.paintAlignment(false, false)


      So, somehow the currentAlignFrame is no longer available?
      Where can I get some help on this issue and where is the best place to ask?
      Thanks in advance
      Mario

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jprocter James Procter
              Reporter:
              drmariod Mario Dejung
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: