Applications/Anaconda

From HPC
Revision as of 10:15, 12 April 2017 by Pysdlb (talk | contribs)

Jump to: navigation , search

Application Details

There are two types of python provided on Viper, if you looking for the Original Python click here.

  • Description: Python is a high-level interpreted programming language for general-purpose programming, supported by a large number of libraries for many tasks
  • Versions:
    • Python 2.7.11 and 3.5.1
    • Anaconda v4.0 Python 2.7 and 3.5
    • Anaconda v4.1.1 Python 2.7
  • Module names:
    • python/2.7.11 python/3.5.1
    • python/anaconda/4.0/2.7 python/anaconda/4.0/3.5 python/anaconda/4.1.1/2.7
  • License: Free to use

Usage Examples

Interactive

Interactive with command line:

[username@c170 ~]$ module add python/anaconda/4.0/2.7
[username@c170 ~]$ python
Python 2.7.13 |Anaconda custom (64-bit)| (default, Dec 20 2016, 23:09:15)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>>

Interactive with command line with IPython:

[username@c170 ~]$ ipython
Python 2.7.13 |Anaconda custom (64-bit)| (default, Dec 20 2016, 23:09:15)
Type "copyright", "credits" or "license" for more information.

IPython 5.1.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]:

Batch Submission

#!/bin/bash
#SBATCH -J PythonTest                # Job name, you can change it to whatever you want
#SBATCH -N 1                                  # Number of nodes 
#SBATCH --ntasks-per-node 1    # Number of cores per node
#SBATCH -o %N.%j.out                # Standard output will be written here
#SBATCH -e %N.%j.err                 # Standard error will be written here
#SBATCH -p compute                  # Slurm partition, where you want the job to be queued 

 
module purge
module add python/anaconda/4.0/2.7
 
python PythonTest.py

This is then submitted as follows:

[username@login01 ~]$ sbatch Pythontest.job
Submitted batch job 289522

Python Packages

Common packages such as SciPy and NumPy are available across all Python modules. Other commonly used packages are listed below:

Python Package Import Command Description Available in
Biopython import Bio Collection of Python tools for computational biology and bioinformatics, containing classes to represent biological sequences and sequence annotations, and it is able to read and write to a variety of file formats. Also allows for a programmatic means of accessing online databases of biological information, such as those at NCBI. Separate modules extend Biopython's capabilities to sequence alignment, protein structure, population genetics, phylogenetics, sequence motifs, and machine learning. python/anaconda/4.0/2.7 python/anaconda/4.0/3.5
IPython import IPython Enhanced interactive shell for Python, including tools for parallel computing python/anaconda/4.0/2.7 python/anaconda/4.0/3.5 python/anaconda/4.1.1/2.7
Matplotlib import matplotlib Plotting library for Python and its numerical mathematics extension NumPy python/anaconda/4.0/2.7 python/anaconda/4.0/3.5 python/anaconda/4.1.1/2.7
MPI4Py import mpi4py Provides bindings of the Message Passing Interface (MPI) standard for the Python programming language, allowing any Python program to exploit multiple processors. python/anaconda/4.0/3.5
OBITools import obitools Set of programs developed to simplify the manipulation of sequence files, mainly designed to help analyzing Next Generation Sequencer outputs in the context of DNA Metabarcoding python/anaconda/4.0/2.7 python/anaconda/4.0/3.5
Theano import theano Numerical computation library, primarily designed for machine learning python/anaconda/4.0/2.7 python/anaconda/4.1.1/2.7
YT import yt Package for analyzing and visualizing volumetric data python/anaconda/4.0/2.7 python/anaconda/4.0/3.5 python/anaconda/4.1.1/2.7


Further Information

Icon home.png