|
Quick Links
|
Listed below are scripting languages available
on the Helix Systems, with brief descriptions and links to more
information about how to use them.
Scripting languages allow a series of commands to be written to a file, and then run by calling the command path with the script file as the argument: [helix]$ /bin/zsh /path/to/script.zsh
Alternatively, the script can contain a '#!' ("shebang") at the top, which will identify which language should interpret the script. In this case, the script can be a stand-alone executable: [helix]$ head -1 script.pl #!/usr/bin/perl [helix]$ ./script.pl To use a particular version of scripting language, you will need to configure your environment prior to running. The easiest way to do this is to use environment modules: [helix]$ module load python/2.7.3 Each section below lists the available versions and module paths needed to configure your environment. The default version is shown in bold. Because multiple versions are available for some of the scripting languages, it is sometimes better to have the shebang use the default version as interpreted from your environment. In this way, you can avoid having to edit your scripts in order to use a different version. #!/usr/bin/env python
Several of the languages are command-line shells, complete with customizable startup files. There are many additional modules available for Perl and Python. Feel free to mail the Helix staff at staff@helix.nih.gov with any module requests. |
PHP is a general-purpose scripting language used mainly for web applications and development.
Version Env Module Path 5.3.3 none - Helix default n/a 5.2.8 php /usr/local/php-5.2.8/bin 5.2.5 php/5.2.5 /usr/local/php-5.2.5/bin 5.1.6 none - Biowulf default n/a
Perl is a highly extensible scripting language, with many modules are available for interfaces to databases, HTML, XML, C, C++, and a wide variety of system functions.
Version Env Module Path 5.12.1, threaded perl /usr/local/perl-5.12.1-threads/bin 5.12.1 perl/5.12.1 /usr/local/perl-5.12.1/bin 5.8.9 perl/5.8.9 /usr/local/perl-5.8.9/bin 5.8.8 perl/5.8.8 /usr/local/perl-5.8.8-x86_64/bin
We maintain an extensive list of Perl modules common in scientific computing and for day to day use. Here's a handy way to list them all:
'find { wanted => sub { print canonpath $_ if /\.pm\z/ }, no_chdir => 1 }, @INC'
or even easier:
To see the version of a module, you can use the command:
perl -M[MODULE] -e 'print $[MODULE]::VERSION\n"'
substituting [MODULE] for the module in question. For example, to find the version of the module Date::Parse,
perl -MDate::Parse -e 'print "$Date::Parse::VERSION\n"' 2.30
The Python programming language emphasizes clear, consistent syntax, object-oriented design and speed. Python code can be compiled with a number of different Python implementations including Jython (for compiling Python into Java byte-code), IronPython (for .Net) and the reference implementation, CPython, which is the most common and the one we maintain here.
The major/minor Python version numbers packaged with the reference implementation not only represent the version of the byte-code compiler and VM, but also the language standard itself. Consequently, projects written for Python 2.4.x may not run under Python 2.5.x and so on. For this reason we maintain several Python installations to suit the needs of researchers:
Version Env Module Path 3.2.1 python/3.2.1 /usr/local/Python/3.2.1/bin 2.7.4 python/2.7.4 /usr/local/Python/2.7.4/bin 2.7.3 python /usr/local/Python/2.7.3/bin 2.7.2 python/2.7.2 /usr/local/Python/2.7.2/bin 2.7.1 python/2.7.1 /usr/local/python-2.7.1/bin 2.6.6 none - Helix default n/a 2.6.4 python/2.6.4 /usr/local/python-2.6_x86_64/bin 2.5.1 python/2.5.1 /usr/local/python-2.5.1_a_x86_64/bin 2.4.3 none - Biowulf default n/a
If you're starting a new project or want to be compatible with other projects, Python 2.7.3 is usually the best choice. It is the most maintained, used and supported version at this time. The 3.x branch may be a good choice as well, however some popular modules are not yet ported for use in Python 3.x.
To use a particular Python one needs only to set one's PATH to find the appropriate "python" command:
export PATH=/usr/local/Python/2.7.3/bin:$PATH
or to simply load an environment module:
module load python/2.7.1
Here is a way of listing the modules available to the currently running Python:
[helix]$ python
Python 2.7.1 (r271:86832, Feb 14 2011, 11:45:43)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> help('modules')
Some popular modules maintained in our installations:
- Numpy/Scipy
- Matplotlib
- HTSeq
- Biopython
- GLU-Genetics
- Parallel Python
- RPY2
- Many more
To see the version of a module, query either the __version__, VERSION or version property.
>>> import HTSeq >>> HTSeq.__version__ '0.5.3'
Mail module requests to staff@helix.nih.gov.
A fast, compliant alternative implementation of the Python language (2.7.2).
Version Env Module Path 1.9 pypy n/a
PyPy can be run just like Python:
$ pypy Python 2.7.2 (341e1e3821fff77db3bb5cdb7a4851626298c44e, Nov 15 2012, 17:55:38) [PyPy 1.9.0 with GCC 4.7.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. And now for something completely different: ``ctypes has a spin of 1/3'' >>>>
A dynamic, open source programming language with a focus on simplicity and productivity.
Version Env Module Path 1.9.3 ruby /usr/local/ruby/bin 1.8.7 none - Helix default n/a
The default shell of Linux operating systems, Bourne-again shell is another derivative of Bourne shell that incorporates many useful features, such as tab completion, associative arrays and array manipulation, pattern matching, command history, aliases, random number generation, user-defined functions/subroutines.
- Path: /bin/bash
- Startup files:
/etc/profile
/etc/profile.d/*
~/.bash_profile (only for interactive login shells)
~/.bash_login
~/.profile
~/.bashrc- Exit files:
~/.bash_logout
The Bourne shell is functional and reliable, with command substitution, for/while/case/if blocks, and output redirection.
- Path: /bin/sh
- Startup files:
~/.profile
C shell (csh) syntax was based on the programming language C. While it has many of the same features as Bourne shell, C shell lacks many others, such as associative arrays, pattern matching, and user-defined functions.
- Path: /bin/csh
- Startup files:
~/.login (only for interactive login shells)
~/.cshrc- Exit files:
~/.logout
A derivative of the Bourne shell and C shell, the Korn shell includes additional scientific functionality, such as floating point arithmetic, date and time manipulation, and more complex TCP client/server functionality.
- Path:
/bin/ksh- Startup files:
~/.profile
A updated version of C shell, with command line completion, pattern matching, search and replace, and even spell checking.
- Path: /bin/tcsh
- Startup files:
~/.login (only for interactive login shells)
~/.tcshrc
~/.cshrc (if ~/.tcshrc is not present)
~/.cshdirs- Exit files:
~/.logout
A recent descendent of bash, with added functionality such as floating-point math, client/server emulation, and the ability to pre-compile scripts.
- Path: /bin/zsh
- Startup files:
~/.zshenv
~/.zprofile (only for interactive login shells)
~/.zshrc
~/.zlogin (only for interactive login shells)
Tcl is a well-known dynamic programming language with many unique features. Tk is a graphical counterpart to Tcl.
- Path: /usr/bin/tclsh

