Custom protein topology schemes

I need to generate custom graphics of several proteins (in fact nearly 30). I have the domain organisation predicted at the SMART database, the N-glycosylation sites at NetNGlyc and the possible phosphorylation targets at NetPhos. I also have identified short functional motifs at ELM.

Now I need a program that can generate custom graphics that would combine all of these neatly. Finding such a program proved to be not as trivial as I expected. I have used MyDomains, part of PROSITE, which got the job done, however it is not as customizable as I wanted. I briefly tried DomainDraw, which looks neat. Another tool is DOG which I installed locally, but drawing manually will be too laborious for the amount of proteins I have. Last but not least, one remarkably nice tool is PROTTER, which displays the amino acid sequence in a “snake” view. However, this approach is a bit different from what I wanted to achieve.

PFAM

In the end, I came across the PFAM domain images generator. The input form syntax is JSON, which appears to be fairly simple (well, not as simple as MyDomains), understandable even for me. It is versatile and the specifications of the domains/motifs graphics are described in the help section. The web site even provides an example input for generating a simple graphic:

simple

or something more complicated:

complex

Really beautiful, isn’t it?

Syntax highlight

My editor of choice is medit, so I wanted it to display JSON highlight. I found this explanation for gedit and this HowTo (unrelated to JSON) for medit. Therefore, I got this JSON.lang file:

<?xml version="1.0" encoding="UTF-8"?>
<language id="json" _name="JSON" version="2.0" _section="Sources">
  <metadata>
    <property name="mimetypes">application/json</property>
    <property name="globs">*.json</property>
  </metadata>
  <styles>
    <style id="string" _name="String" map-to="def:string"/>
    <style id="escaped-character" _name="Escaped Character" map-to="def:special-char"/>
    <style id="number" _name="Number" map-to="def:number"/>
    <style id="boolean" _name="Boolean" map-to="def:boolean"/>
    <style id="null" _name="Null" map-to="def:special-constant"/>
    <style id="key" _name="Key" map-to="def:type"/>
  </styles>
  <definitions>
    <context id="json">
      <include>
        <context id="array">
          <start>\[</start>
          <end>\]</end>
          <include>
            <context id="value">
              <include>
                <context ref="array"/>
                <context ref="object"/>
                <context id="number" style-ref="number">
                  <match>\b-?([1-9][0-9]*|0)(\.[0-9]+)?([eE][-+]?[0-9]+)?</match>
                </context>
                <context id="boolean" style-ref="boolean">
                  <match>\b(true|false)</match>
                </context>
                <context id="null" style-ref="null">
                  <match>\b(null)</match>
                </context>
                <context id="string" end-at-line-end="true" style-ref="string">
                <start>"</start>
                <end>"</end>
                  <include>
                    <context id="escaped-character" style-ref="escaped-character">
                      <match>\\.</match>
                    </context>
                  </include>
                </context>
              </include>
            </context>
          </include>
        </context>
        <context id="object">
          <start>\{</start>
          <end>\{</end>
          <include>
            <context id="key" style-ref="key">
              <match>"([^"]|\\.)+"[ \t]*:</match>
            </context>
            <context ref="value"/>
          </include>
        </context>
      </include>
    </context>
  </definitions>
</language>

and saved it as ~/.local/share/medit-1/language-specs/json.lang. Only thing left was to restart medit. Now, the new syntax highlight is in Document > Language > Sources.

Great! For the record, I stumbled upon several discussions about drawing custom domains and found this list of some general recommendations.

So far, I like PFAM most :)



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s