• Login
Community
  • Login

PythonScript for protein colorizing

Scheduled Pinned Locked Moved General Discussion
pythonscriptlexer
5 Posts 4 Posters 402 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M
    Mark Olson
    last edited by Mark Olson Nov 4, 2022, 1:09 AM Nov 4, 2022, 1:07 AM

    I thought it would be fun to make a lexer for colorizing protein sequences according to amino acid properties, and the current UDL system doesn’t seem well-suited for this. So I used PythonScript!

    See https://github.com/molsonkiko/NPP_protein_lexer and maybe submit a pull request if you have an idea of how to improve it.

    protein_lexer_after.PNG

    A 1 Reply Last reply Nov 4, 2022, 11:18 AM Reply Quote 4
    • M
      Michael Vincent
      last edited by Michael Vincent Nov 4, 2022, 1:15 AM Nov 4, 2022, 1:15 AM

      @Mark-Olson said in PythonScript for protein colorizing:

      colorizing protein sequences according to amino acid properties,

      I have an idea what you’re talking about but no experience in that field whatsoever. But between this and your JSONTools plugin , I’m happy to see a new talented developer contributing to the Notepad++ ecosystem.

      Keep up the good work!

      Cheers.

      1 Reply Last reply Reply Quote 1
      • A
        Alan Kilborn @Mark Olson
        last edited by Nov 4, 2022, 11:18 AM

        @Mark-Olson

        Just asking, I didn’t look at it: Does it absolutely need its own custom script, or could the EnhanceAnyLexer plugin have been used to do the same thing? This is typically the goto plugin when the UDL system falls short.

        M 1 Reply Last reply Nov 4, 2022, 5:32 PM Reply Quote 3
        • M
          Mark Olson @Alan Kilborn
          last edited by Nov 4, 2022, 5:32 PM

          @Alan-Kilborn
          I wasn’t really familiar with EnhanceAnyLexer prior to making this script, but now that I’ve tried it out this is actually really simple!

          Just need to create a lexer called protein with white text background, install the plugin and add this to EnhanceAnyLexerConfig.ini

          [protein]
          ; default (black)
          0x000000 = [^DEPHKRNQSTILMFWVACGY]
          ; acidic (blue)
          0xbe0000 = [DE]
          ; cyclic (green)
          0x00f600 = P
          ; basic (red)
          0x0000be = [HKR]
          ; hydrophilic (cyan)
          0xb0d000 = [NQST]
          ; amphiphilic (orange)
          0x00b0d0 = [ACGY]
          ; lipophilic
          0x848484 = [ILMFWV]
          ; check in the respective styler xml if the following IDs are valid
          excluded_styles = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,20,21,22,23
          

          and you get the same result, except better because amphiphilic amino acids are now orange.

          D 1 Reply Last reply Nov 4, 2022, 7:44 PM Reply Quote 5
          • D
            David Brigden52 @Mark Olson
            last edited by Nov 4, 2022, 7:44 PM

            @Mark-Olson And now I have to look up “amphophilic”

            Neat

            1 Reply Last reply Reply Quote 0
            3 out of 5
            • First post
              3/5
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors