<?xml version="1.0" encoding="ascii"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Bio.Align.Applications._Mafft.MafftCommandline</title> <link rel="stylesheet" href="epydoc.css" type="text/css" /> <script type="text/javascript" src="epydoc.js"></script> </head> <body bgcolor="white" text="black" link="blue" vlink="#204080" alink="#204080"> <!-- ==================== NAVIGATION BAR ==================== --> <table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> <tr valign="middle"> <!-- Tree link --> <th> <a href="module-tree.html">Trees</a> </th> <!-- Index link --> <th> <a href="identifier-index.html">Indices</a> </th> <!-- Help link --> <th> <a href="help.html">Help</a> </th> <th class="navbar" width="100%"></th> </tr> </table> <table width="100%" cellpadding="0" cellspacing="0"> <tr valign="top"> <td width="100%"> <span class="breadcrumbs"> <a href="Bio-module.html">Package Bio</a> :: <a href="Bio.Align-module.html">Package Align</a> :: <a href="Bio.Align.Applications-module.html">Package Applications</a> :: <a href="Bio.Align.Applications._Mafft-module.html" onclick="show_private();">Module _Mafft</a> :: Class MafftCommandline </span> </td> <td> <table cellpadding="0" cellspacing="0"> <!-- hide/show private --> <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink" onclick="toggle_private();">hide private</a>]</span></td></tr> <tr><td align="right"><span class="options" >[<a href="frames.html" target="_top">frames</a >] | <a href="Bio.Align.Applications._Mafft.MafftCommandline-class.html" target="_top">no frames</a>]</span></td></tr> </table> </td> </tr> </table> <!-- ==================== CLASS DESCRIPTION ==================== --> <h1 class="epydoc">Class MafftCommandline</h1><p class="nomargin-top"><span class="codelink"><a href="Bio.Align.Applications._Mafft-pysrc.html#MafftCommandline">source code</a></span></p> <pre class="base-tree"> object --+ | <a href="Bio.Application.AbstractCommandline-class.html">Application.AbstractCommandline</a> --+ | <strong class="uidshort">MafftCommandline</strong> </pre> <hr /> <p>Command line wrapper for the multiple alignment program MAFFT.</p> <p>http://align.bmr.kyushu-u.ac.jp/mafft/software/</p> <p>Example:</p> <pre class="py-doctest"> <span class="py-prompt">>>> </span><span class="py-keyword">from</span> Bio.Align.Applications <span class="py-keyword">import</span> MafftCommandline <span class="py-prompt">>>> </span>mafft_exe = <span class="py-string">"/opt/local/mafft"</span> <span class="py-prompt">>>> </span>in_file = <span class="py-string">"../Doc/examples/opuntia.fasta"</span> <span class="py-prompt">>>> </span>mafft_cline = MafftCommandline(mafft_exe, input=in_file) <span class="py-prompt">>>> </span><span class="py-keyword">print</span> mafft_cline <span class="py-output">/opt/local/mafft ../Doc/examples/opuntia.fasta</span></pre> <p>If the mafft binary is on the path (typically the case on a Unix style operating system) then you don't need to supply the executable location:</p> <pre class="py-doctest"> <span class="py-prompt">>>> </span><span class="py-keyword">from</span> Bio.Align.Applications <span class="py-keyword">import</span> MafftCommandline <span class="py-prompt">>>> </span>in_file = <span class="py-string">"../Doc/examples/opuntia.fasta"</span> <span class="py-prompt">>>> </span>mafft_cline = MafftCommandline(input=in_file) <span class="py-prompt">>>> </span><span class="py-keyword">print</span> mafft_cline <span class="py-output">mafft ../Doc/examples/opuntia.fasta</span></pre> <p>You would typically run the command line with mafft_cline() or via the Python subprocess module, as described in the Biopython tutorial. Note that MAFFT will write the alignment to stdout, which you may want to save to a file and then parse, e.g.</p> <p>stdout, stderr = mafft_cline() handle = open("aligned.fasta", "w") handle.write(stdout) handle.close() from Bio import AlignIO align = AlignIO.read("aligned.fasta", "fasta")</p> <p>Alternatively, to parse the output with AlignIO directly you can use StringIO to turn the string into a handle:</p> <p>stdout, stderr = mafft_cline() from StringIO import StringIO from Bio import AlignIO align = AlignIO.read(StringIO(stdout), "fasta")</p> <p>Citations:</p> <p>Katoh, Toh (BMC Bioinformatics 9:212, 2008) Improved accuracy of multiple ncRNA alignment by incorporating structural information into a MAFFT-based framework (describes RNA structural alignment methods)</p> <p>Katoh, Toh (Briefings in Bioinformatics 9:286-298, 2008) Recent developments in the MAFFT multiple sequence alignment program (outlines version 6)</p> <p>Katoh, Toh (Bioinformatics 23:372-374, 2007) Errata PartTree: an algorithm to build an approximate tree from a large number of unaligned sequences (describes the PartTree algorithm)</p> <p>Katoh, Kuma, Toh, Miyata (Nucleic Acids Res. 33:511-518, 2005) MAFFT version 5: improvement in accuracy of multiple sequence alignment (describes [ancestral versions of] the G-INS-i, L-INS-i and E-INS-i strategies)</p> <p>Katoh, Misawa, Kuma, Miyata (Nucleic Acids Res. 30:3059-3066, 2002)</p> <p>Last checked against version: MAFFT v6.717b (2009/12/03)</p> <!-- ==================== INSTANCE METHODS ==================== --> <a name="section-InstanceMethods"></a> <table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr bgcolor="#70b0f0" class="table-header"> <td colspan="2" class="table-header"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr valign="top"> <td align="left"><span class="table-header">Instance Methods</span></td> <td align="right" valign="top" ><span class="options">[<a href="#section-InstanceMethods" class="privatelink" onclick="toggle_private();" >hide private</a>]</span></td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="Bio.Align.Applications._Mafft.MafftCommandline-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>, <span class="summary-sig-arg">cmd</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">mafft</code><code class="variable-quote">'</code></span>, <span class="summary-sig-arg">**kwargs</span>)</span><br /> Create a new instance of a command line wrapper object.</td> <td align="right" valign="top"> <span class="codelink"><a href="Bio.Align.Applications._Mafft-pysrc.html#MafftCommandline.__init__">source code</a></span> </td> </tr> </table> </td> </tr> <tr> <td colspan="2" class="summary"> <p class="indent-wrapped-lines"><b>Inherited from <code><a href="Bio.Application.AbstractCommandline-class.html">Application.AbstractCommandline</a></code></b>: <code><a href="Bio.Application.AbstractCommandline-class.html#__call__">__call__</a></code>, <code><a href="Bio.Application.AbstractCommandline-class.html#__repr__">__repr__</a></code>, <code><a href="Bio.Application.AbstractCommandline-class.html#__setattr__">__setattr__</a></code>, <code><a href="Bio.Application.AbstractCommandline-class.html#__str__">__str__</a></code>, <code><a href="Bio.Application.AbstractCommandline-class.html#set_parameter">set_parameter</a></code> </p> <div class="private"> <p class="indent-wrapped-lines"><b>Inherited from <code><a href="Bio.Application.AbstractCommandline-class.html">Application.AbstractCommandline</a></code></b> (private): <code><a href="Bio.Application.AbstractCommandline-class.html#_check_value" onclick="show_private();">_check_value</a></code>, <code><a href="Bio.Application.AbstractCommandline-class.html#_clear_parameter" onclick="show_private();">_clear_parameter</a></code>, <code><a href="Bio.Application.AbstractCommandline-class.html#_get_parameter" onclick="show_private();">_get_parameter</a></code>, <code><a href="Bio.Application.AbstractCommandline-class.html#_validate" onclick="show_private();">_validate</a></code> </p></div> <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>: <code>__delattr__</code>, <code>__format__</code>, <code>__getattribute__</code>, <code>__hash__</code>, <code>__new__</code>, <code>__reduce__</code>, <code>__reduce_ex__</code>, <code>__sizeof__</code>, <code>__subclasshook__</code> </p> </td> </tr> </table> <!-- ==================== PROPERTIES ==================== --> <a name="section-Properties"></a> <table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr bgcolor="#70b0f0" class="table-header"> <td colspan="2" class="table-header"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr valign="top"> <td align="left"><span class="table-header">Properties</span></td> <td align="right" valign="top" ><span class="options">[<a href="#section-Properties" class="privatelink" onclick="toggle_private();" >hide private</a>]</span></td> </tr> </table> </td> </tr> <tr> <td colspan="2" class="summary"> <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>: <code>__class__</code> </p> </td> </tr> </table> <!-- ==================== METHOD DETAILS ==================== --> <a name="section-MethodDetails"></a> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr bgcolor="#70b0f0" class="table-header"> <td colspan="2" class="table-header"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr valign="top"> <td align="left"><span class="table-header">Method Details</span></td> <td align="right" valign="top" ><span class="options">[<a href="#section-MethodDetails" class="privatelink" onclick="toggle_private();" >hide private</a>]</span></td> </tr> </table> </td> </tr> </table> <a name="__init__"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>, <span class="sig-arg">cmd</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">mafft</code><code class="variable-quote">'</code></span>, <span class="sig-arg">**kwargs</span>)</span> <br /><em class="fname">(Constructor)</em> </h3> </td><td align="right" valign="top" ><span class="codelink"><a href="Bio.Align.Applications._Mafft-pysrc.html#MafftCommandline.__init__">source code</a></span> </td> </tr></table> <p>Create a new instance of a command line wrapper object.</p> <dl class="fields"> <dt>Overrides: object.__init__ <dd><em class="note">(inherited documentation)</em></dd> </dt> </dl> </td></tr></table> </div> <br /> <!-- ==================== NAVIGATION BAR ==================== --> <table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> <tr valign="middle"> <!-- Tree link --> <th> <a href="module-tree.html">Trees</a> </th> <!-- Index link --> <th> <a href="identifier-index.html">Indices</a> </th> <!-- Help link --> <th> <a href="help.html">Help</a> </th> <th class="navbar" width="100%"></th> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" width="100%%"> <tr> <td align="left" class="footer"> Generated by Epydoc 3.0.1 on Thu Aug 18 18:19:23 2011 </td> <td align="right" class="footer"> <a target="mainFrame" href="http://epydoc.sourceforge.net" >http://epydoc.sourceforge.net</a> </td> </tr> </table> <script type="text/javascript"> <!-- // Private objects are initially displayed (because if // javascript is turned off then we want them to be // visible); but by default, we want to hide them. So hide // them unless we have a cookie that says to show them. checkCookie(); // --> </script> </body> </html>