Package Bio :: Package Sequencing :: Package Applications :: Module _bwa :: Class BwaSampeCommandline
[hide private]
[frames] | no frames]

Class BwaSampeCommandline

source code

                     object --+    
                              |    
Application.AbstractCommandline --+
                                  |
                                 BwaSampeCommandline

Command line wrapper for Burrows Wheeler Aligner (BWA) sampe.

Generate alignments in the SAM format given paired-end reads. Equivalent to:

$ bwa sampe [...] <in.db.fasta> <in1.sai> <in2.sai> <in1.fq> <in2.fq> > <out.sam>

See http://bio-bwa.sourceforge.net/bwa.shtml for details.

Example:

>>> from Bio.Sequencing.Applications import BwaSampeCommandline
>>> reference_genome = "/path/to/reference_genome.fasta"
>>> read_file1 = "/path/to/read_1.fq"
>>> read_file2 = "/path/to/read_2.fq"
>>> sai_file1 = "/path/to/read_1.sai"
>>> sai_file2 = "/path/to/read_2.sai"
>>> output_sam_file = "/path/to/output.sam"
>>> read_group = "@RG       ID:foo  SM:bar"
>>> sampe_cmd = BwaSampeCommandline(reference=reference_genome,
...                                 sai_file1=sai_file1, sai_file2=sai_file2,
...                                 read_file1=read_file1, read_file2=read_file2,
...                                 r=read_group)
>>> print(sampe_cmd)
bwa sampe /path/to/reference_genome.fasta /path/to/read_1.sai /path/to/read_2.sai /path/to/read_1.fq /path/to/read_2.fq -r @RG       ID:foo  SM:bar

You would typically run the command line using sampe_cmd(stdout=output_sam_file) or via the Python subprocess module, as described in the Biopython tutorial.

Instance Methods [hide private]
 
__init__(self, cmd='bwa', **kwargs)
Create a new instance of a command line wrapper object.
source code

Inherited from Application.AbstractCommandline: __call__, __repr__, __setattr__, __str__, set_parameter

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __sizeof__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, cmd='bwa', **kwargs)
(Constructor)

source code 
Create a new instance of a command line wrapper object.
Overrides: object.__init__
(inherited documentation)