Git script guidelines: Difference between revisions

From PyMOLWiki
Jump to navigation Jump to search
m (indent of REDIRECT)
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= Guide lines =
= Guide lines =
To make a good PyMOL wiki page, consider these guidelines.
To make a good PyMOL wiki page, consider these guidelines.
# Make sure that filename for script and wiki page is small and the same.
# Filename for script and wiki page name should be [[Git_intro#Naming_convention|lower case and the same]].
#: You can redirect and copy history for a wikipage, by using the '''move''' button. It is located "top right" under the '''arrow''', next to the search box.  
#: You can redirect and copy history for a wikipage, by using the '''move''' button. It is located "top right" under the '''arrow''', next to the search box.  
#: Or you can make a redirect, from another page. Write only this in the wiki page:  
#: Or you can make a redirect, from another page. Write only this in the wiki page:  
<nowiki> #REDIRECT [[colorbydisplacement]] <\nowiki>
#: <code><nowiki>#REDIRECT [[scriptname]]</nowiki></code>
# Function name should in generally not contain big letters. Instead use "underscore".
# Function name should in generally not contain big letters. Instead use "underscore".
#: '''ColorByDisplacementAll''' should instead be named: '''colorbydisplacement_all'''
#: '''ColorByDisplacementAll''' should instead be named: '''colorbydisplacement_all'''
Line 10: Line 10:
# The code reference part should be almost exactly as in the example here in this post.
# The code reference part should be almost exactly as in the example here in this post.
# Strongly consider to add figures to your post.
# Strongly consider to add figures to your post.
# Make a description in the top of script by using three primes <nowiki>''' Text '''</nowiki>.
#: This text will be displayed in PyMOL, when one writes: help(scriptname)
<syntaxhighlight lang="python">
'''
Described at PyMOL wiki:
http://www.pymolwiki.org/index.php/scriptname
Authors : yourname
Date    : July 2012
'''
</syntaxhighlight>


== Tips and tricks ==
== Tips and tricks ==
Line 22: Line 33:
=== Use of module include ===
=== Use of module include ===
If your code section is very small, and you want to show it directly at the PyMOL wiki page, you can  
If your code section is very small, and you want to show it directly at the PyMOL wiki page, you can  
fetch the code directly from Github and show it on the Wiki page. [http://www.pymolwiki.org/index.php/Git_include Read more here.]
fetch the code directly from Github and show it on the Wiki page. [[Git_include|Read more here]].


=== Categories ===
=== Categories ===
You also should put you script in a category. See available categories here: http://www.pymolwiki.org/index.php/Category:Script_Library
You also should put you script in a category. See available categories here: [[:Category:Script_Library]]


You add your script to a category, by writing these lines in the end of the wiki page. Examples:
You add your script to a category, by writing these lines in the end of the wiki page. Examples:
Line 33: Line 44:
= Template for a new page =
= Template for a new page =
The following sections, can for example be copied to a new page.<br>
The following sections, can for example be copied to a new page.<br>
You can find tips for formatting a mediawiki page here: http://www.mediawiki.org/wiki/Help:Formatting
You can find tips for formatting a mediawiki page here: [http://www.mediawiki.org/wiki/Help:Formatting Help:Formatting]
 
== Author ==
This pymol script is made by you


== Introduction ==  
== Introduction ==  
A little section about what the script can do, and maybe why it has been developed and under which protein discipline it is particularly useful.
A little section about what the script can do, and maybe why it has been developed and under which protein discipline it is particularly useful.<br>
Make the info box from [[Template:Infobox script-repo]].


=== Functions ===
=== Functions ===
Line 47: Line 56:


== Example of use ==
== Example of use ==
Here you can write a link to the protein in the example<br>
http://www.proteopedia.org/wiki/index.php/3ig7 <br>
Here you write some example of use. Try to make examples, that anyone can access right away.<br>
Here you write some example of use. Try to make examples, that anyone can access right away.<br>
Do this by fetching proteins, and if you need other example files, but them in: '''Pymol-script-repo/files_for_examples'''
Do this by fetching proteins, and if you need other example files, but them in: '''Pymol-script-repo/files_for_examples'''
Line 67: Line 79:
ColorByDisplacementAll O5NT, C5NT, super1=resi 26-355, super2=resi 26-355, doColor=t, doAlign=t
ColorByDisplacementAll O5NT, C5NT, super1=resi 26-355, super2=resi 26-355, doColor=t, doAlign=t
</syntaxhighlight>
</syntaxhighlight>
== Python Code ==
{{Template:PymolScriptRepoDownload|colorbydisplacement.py}}


== References ==
== References ==
If you have used a particular article or figure to get inspiration to your script, then make a reference.
If you have used a particular article or figure to get inspiration to your script, then make a reference.


''Title of reference''. Author name. '''Journal name'''. Vol 08/12/2012, p. 54, fig. 5 [http://dx.doi.org/10.1016/0301-0104(89)87019-3  doi:10.1016/0301-0104(89)87019-3]
* ''Title of reference''. Author name. '''Journal name'''. Vol 08/12/2012, p. 54, fig. 5 [http://dx.doi.org/10.1016/0301-0104(89)87019-3  doi:10.1016/0301-0104(89)87019-3]

Latest revision as of 06:39, 13 January 2012

Guide lines

To make a good PyMOL wiki page, consider these guidelines.

  1. Filename for script and wiki page name should be lower case and the same.
    You can redirect and copy history for a wikipage, by using the move button. It is located "top right" under the arrow, next to the search box.
    Or you can make a redirect, from another page. Write only this in the wiki page:
    #REDIRECT [[scriptname]]
  2. Function name should in generally not contain big letters. Instead use "underscore".
    ColorByDisplacementAll should instead be named: colorbydisplacement_all
  3. Make sure that there are examples how to import and use script.
  4. The code reference part should be almost exactly as in the example here in this post.
  5. Strongly consider to add figures to your post.
  6. Make a description in the top of script by using three primes ''' Text '''.
    This text will be displayed in PyMOL, when one writes: help(scriptname)
'''
Described at PyMOL wiki:
http://www.pymolwiki.org/index.php/scriptname

Authors : yourname
Date    : July 2012
'''

Tips and tricks

Use of module syntaxhighlight

You can see here, that PyMOL wiki has the SyntaxHighlight module installed.
Supported languages for Highlighting is listed here.

Put your example code snip, within these brackets.

 <syntaxhighlight lang="python">
 </syntaxhighlight>

Use of module include

If your code section is very small, and you want to show it directly at the PyMOL wiki page, you can fetch the code directly from Github and show it on the Wiki page. Read more here.

Categories

You also should put you script in a category. See available categories here: Category:Script_Library

You add your script to a category, by writing these lines in the end of the wiki page. Examples:

[[Category:Script_Library]] 
[[Category:Structural_Biology_Scripts]] 

Template for a new page

The following sections, can for example be copied to a new page.
You can find tips for formatting a mediawiki page here: Help:Formatting

Introduction

A little section about what the script can do, and maybe why it has been developed and under which protein discipline it is particularly useful.
Make the info box from Template:Infobox script-repo.

Functions

If there are more than one function, you could list them here.

  • Make a dot
    Write under same dot

Example of use

Here you can write a link to the protein in the example
http://www.proteopedia.org/wiki/index.php/3ig7

Here you write some example of use. Try to make examples, that anyone can access right away.
Do this by fetching proteins, and if you need other example files, but them in: Pymol-script-repo/files_for_examples

import colorbydisplacement

fetch 1HP1, async=0
fetch 1HPU, async=0
 
hide everything
### Select asymmetric units from pdb file
create O5NT, /1HP1//A
create C5NT, /1HPU//C
delete 1HP1
delete 1HPU
 
show cartoon, O5NT
show cartoon, C5NT

ColorByDisplacementAll O5NT, C5NT, super1=resi 26-355, super2=resi 26-355, doColor=t, doAlign=t

References

If you have used a particular article or figure to get inspiration to your script, then make a reference.