Skip to content
Program for DNA/RNA/protein sequence alignment, read mapping and trimming. Extended python version of PaSWAS, supporting OpenCL and CUDA devices.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
data moved docker folder Nov 3, 2017
pyPaSWAS Better description of error Dec 31, 2018
.gitignore committed .gitignore Feb 6, 2018
LICENSE.txt added new-lines Jan 2, 2018 reverted Oct 17, 2017



Extented python version of PaSWAS. Original papers in PLOS ONE:

For DNA/RNA/protein sequence alignment and trimming.

PaSWAS was developed in C and CUDA/OpenCL. This version uses the CUDA/OpenCL code from PaSWAS and integrates the sequence alignment software with Python. It supports:

  • text output
  • SAM output
  • logging
  • command line options and configuration files
  • Several internal programs: aligner (default) and trimmer
  • Affine gap penalty method

Platforms supported:

  • NVIDIA GPU using CUDA (compute capability 1.3 and higher)
  • NVIDIA GPU using OpenCL
  • Intel CPU using OpenCL
  • Intel Xeon Phi accelerator using OpenCL
  • Other systems supporting OpenCL (AMD, Intel GPUs, etc) should be able to run the software, but are untested.

More information:


The pyPasWAS source contains several docker install files. Clone the repository:

git clone

Then use one of the docker images in the docker folder. For more information, see the README


In most cases it is enough to clone the repository. After that, please install:

  • pip (
  • numpy: sudo pip install numpy (or pip install --user numpy)
  • BioPython: sudo pip install Biopython (or pip install --user Biopython)
  • In some cases, the python development packages are required (Ubuntu: sudo apt-get install python-dev)

Making use of the CUDA version (also recommended when using the OpenCL version on a NVIDIA GPU):

Making use of the OpenCL version:

Getting pyPaSWAS:

Notes on Mac OS X

Installing all the necessary packages on a Mac can be difficult:

  • When confronted with the message that the 'intern' module is missing when running pyPaSWAS using openCL, the 'six' package is not installed correctly. This can be solved by upgrading it to the most recent version: 'sudo pip install --upgrade six'. In some cases this will not help.
  • Although Apple has native support for OpenCL, pyOpenCL might not run with this compiler. Please download the Intel drivers and compiler.
  • NVIDIA CUDA through pyCuda is the best choice when you have a NVIDIA GPU in your Mac.

Running the software

The key command line options are given in Table 1. The two input files are mandatory. Through the options the user can specify the file types of the input files (default: fasta), an output file and a log file. When requested, PyPaSWAS will terminate if the output file already exists.

Run it by calling:

  • python |options| file1 file2

Help file:

  • python --help

Selection your device

By default, pypaswas will use the first CPU device. This can be changed by using:

  • --device_type=[CPU|GPU]
  • --platform_name=[Intel|NVIDIA]
  • --framework=[opencl|CUDA]
  • --device=[int]

For example, this will select the CPU: --device_type=CPU --platform_name=Intel --framework=opencl

This will select the second NVIDIA GPU: --device_type=GPU --platform_name=NVIDIA --framework=CUDA --device=1


See the github wiki at for more examples.

Use a fastq-file:

  • python testSample.fastq adapters.fa -1 fastq -o out.txt --loglevel=DEBUG

Output results in SAM format:

  • python testSample.fastq adapters.fa -1 fastq -o out.sam --outputformat=SAM --loglevel=DEBUG

Remove all matches from file 1. Useful from trimming sequences. Sequences with no hits will not be in output

  • python testSample.fastq adapters.fa -1 fastq -o out.fa --outputformat=trimmedFasta -p trimmer -L /tmp/log.txt --loglevel=DEBUG

Align protein sequences:

  • python myAA.faa product.faa -M BLOSUM62 -o hits.txt -L /tmp/log.txt --loglevel=DEBUG

Table 1. Key command line options

Option Long version Description
-h --help This help
-L --logfile Path to the log file
--loglevel Specify the log level for log file output. Valid options are DEBUG, INFO, WARNING, ERROR and CRITICAL
-o --output Path to the output file. Default ./output
-O --overrideOutput When output file exists, override it (T/F). Default T (true)
-1 --filetype1 File type of the first input file. See bioPython IO for available options. Default fasta
-2 --filetype2 File type of the second input file. See bioPython IO for available options. Default fasta
-G Float value for the gap penalty. Default -5
-g Float value for the gap extension penalty. Memory usage will increase when setting this to anything other than zero. Default 0
-q Float value for a mismatch. Default -3
-r Float value for a match. Default 1
--any Float value for an ambiguous nucleotide. Default 1
--other Float value for an ambiguous nucleotide. Default 1
--device Integer value indicating the device to use. Default 0 for the first device.
-c Option followed by the name of a configuration file. This option allows for short command line calls and administration of used settings.

For questions, e-mail

You can’t perform that action at this time.