Community
    • Login

    PythonScript for protein colorizing

    Scheduled Pinned Locked Moved General Discussion
    pythonscriptlexer
    5 Posts 4 Posters 368 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.
    • Mark OlsonM
      Mark Olson
      last edited by Mark Olson

      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

      Alan KilbornA 1 Reply Last reply Reply Quote 4
      • Michael VincentM
        Michael Vincent
        last edited by Michael Vincent

        @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
        • Alan KilbornA
          Alan Kilborn @Mark Olson
          last edited by

          @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.

          Mark OlsonM 1 Reply Last reply Reply Quote 3
          • Mark OlsonM
            Mark Olson @Alan Kilborn
            last edited by

            @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.

            David Brigden52D 1 Reply Last reply Reply Quote 5
            • David Brigden52D
              David Brigden52 @Mark Olson
              last edited by

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

              Neat

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