<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>RAxML &#8211; The Bowman Lab</title>
	<atom:link href="https://www.polarmicrobes.org/tag/raxml/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.polarmicrobes.org</link>
	<description>Marine Microbial Ecology</description>
	<lastBuildDate>Tue, 31 May 2022 04:13:46 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>
<site xmlns="com-wordpress:feed-additions:1">188265837</site>	<item>
		<title>Alignment and phylogenetic inference with hmmalign and RAxML-ng</title>
		<link>https://www.polarmicrobes.org/alignment-and-phylogenetic-inference-with-hmmalign-and-raxml-ng/</link>
					<comments>https://www.polarmicrobes.org/alignment-and-phylogenetic-inference-with-hmmalign-and-raxml-ng/#respond</comments>
		
		<dc:creator><![CDATA[Jeff]]></dc:creator>
		<pubDate>Tue, 31 May 2022 04:13:03 +0000</pubDate>
				<category><![CDATA[Computer tutorials]]></category>
		<category><![CDATA[HMMER]]></category>
		<category><![CDATA[phylogenetic]]></category>
		<category><![CDATA[RAxML]]></category>
		<guid isPermaLink="false">https://www.polarmicrobes.org/?p=3390</guid>

					<description><![CDATA[RAxML is one of the most popular programs around for phylogenetic inference via maximum likelihood. Similarly, hmmalign within HMMER 3 is a popular way to align amino acid sequences against HMMs from Pfam or created de novo. Combine the two &#8230; <a href="https://www.polarmicrobes.org/alignment-and-phylogenetic-inference-with-hmmalign-and-raxml-ng/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<p><a href="https://github.com/amkozlov/raxml-ng">RAxML</a> is one of the most popular programs around for phylogenetic inference via maximum likelihood.  Similarly, hmmalign within <a href="http://hmmer.org/">HMMER 3</a> is a popular way to align amino acid sequences against HMMs from Pfam or created <em>de novo</em>.  Combine the two and you have an excellent method for constructing phylogenetic trees.  But gluing the two together isn&#8217;t exactly seamless and novice users might be deterred by a couple of unexpected hurdles.  Recently, I helped a student develop a workflow which I&#8217;m posting here.</p>



<p>First, define some variables just to make the bash commands a bit cleaner.  REF refers to the name of the Pfam hmm that we&#8217;re aligning against (Bac_rhodopsin.hmm in this case), while QUERY is the sequence file to be aligned (hop and bop gene products, plus a dinoflagellate rhodopsin as outgroup).</p>



<pre class="wp-block-code"><code>REF=Bac_rhodopsin
QUERY=uniprot_hop_bop_reviewed</code></pre>



<p>Now, align and convert the alignment to fasta format (required by RAxML-ng).</p>



<pre class="wp-block-code"><code>hmmalign --amino -o $QUERY.sto $REF.hmm $QUERY.fasta
seqmagick convert $QUERY.sto $QUERY.align.fasta</code></pre>



<p>Test which model is best for these data.  Here we get <code>LG+G4+F</code>.</p>



<pre class="wp-block-code"><code>modeltest-ng -i $QUERY.align.fasta -d aa -p 8</code></pre>



<p>Check your alignment!</p>



<pre class="wp-block-code"><code>raxml-ng --check --msa $QUERY.align.fasta --model LG+G4+F --prefix $QUERY</code></pre>



<p>Oooh&#8230; I bet it failed.  Exciting!  In this case (using sequences from Uniprot) the long sequence descriptions are incompatible with RAxML-ng.  Let&#8217;s do a little Python to clean that up.</p>



<pre class="wp-block-code"><code>from Bio import SeqIO

with open('uniprot_hop_bop_reviewed.align.clean.fasta', 'w') as clean_fasta:
    for record in SeqIO.parse('uniprot_hop_bop_reviewed.align.fasta', 'fasta'):
        record.description = ''
        SeqIO.write(record, clean_fasta, 'fasta')</code></pre>



<p>Check again&#8230;</p>



<pre class="wp-block-code"><code>raxml-ng --check --msa $QUERY.align.clean.fasta --model LG+G4+F --prefix $QUERY</code></pre>



<p>If everything is kosher go ahead and fire up your phylogenetic inference.  Here I&#8217;ve limited bootstrapping to 100 trees.  If you have the time/resources do more.</p>



<pre class="wp-block-code"><code>raxml-ng --all --msa $QUERY.align.clean.fasta --model LG+G4+F --prefix $QUERY --bs-trees 100</code></pre>



<p>Superimpose the bootstrap support values on the best ML tree.</p>



<pre class="wp-block-code"><code>raxml-ng --support --tree $QUERY.raxml.bestTree --bs-trees $QUERY.raxml.bootstraps</code></pre>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" fetchpriority="high" decoding="async" width="640" height="348" src="https://i0.wp.com/www.polarmicrobes.org/wp-content/uploads/2022/05/uniprot_hop_bop_reviewed.raxml_.bestTree.raxml_.png?resize=640%2C348&#038;ssl=1" alt="" class="wp-image-3391" srcset="https://i0.wp.com/www.polarmicrobes.org/wp-content/uploads/2022/05/uniprot_hop_bop_reviewed.raxml_.bestTree.raxml_.png?resize=1024%2C557&amp;ssl=1 1024w, https://i0.wp.com/www.polarmicrobes.org/wp-content/uploads/2022/05/uniprot_hop_bop_reviewed.raxml_.bestTree.raxml_.png?resize=300%2C163&amp;ssl=1 300w, https://i0.wp.com/www.polarmicrobes.org/wp-content/uploads/2022/05/uniprot_hop_bop_reviewed.raxml_.bestTree.raxml_.png?resize=768%2C417&amp;ssl=1 768w, https://i0.wp.com/www.polarmicrobes.org/wp-content/uploads/2022/05/uniprot_hop_bop_reviewed.raxml_.bestTree.raxml_.png?resize=1536%2C835&amp;ssl=1 1536w, https://i0.wp.com/www.polarmicrobes.org/wp-content/uploads/2022/05/uniprot_hop_bop_reviewed.raxml_.bestTree.raxml_.png?w=1748&amp;ssl=1 1748w, https://i0.wp.com/www.polarmicrobes.org/wp-content/uploads/2022/05/uniprot_hop_bop_reviewed.raxml_.bestTree.raxml_.png?w=1280&amp;ssl=1 1280w" sizes="(max-width: 640px) 100vw, 640px" /></figure>



<p>And here&#8217;s our creation as rendered by <a href="https://github.com/cmzmasek/archaeopteryx-js">Archaeopteryx</a>.  Some day I&#8217;ll create a tree that is visually appealing, but today is not that day.  But you get the point.  </p>
<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.polarmicrobes.org%2Falignment-and-phylogenetic-inference-with-hmmalign-and-raxml-ng%2F&amp;linkname=Alignment%20and%20phylogenetic%20inference%20with%20hmmalign%20and%20RAxML-ng" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_mastodon" href="https://www.addtoany.com/add_to/mastodon?linkurl=https%3A%2F%2Fwww.polarmicrobes.org%2Falignment-and-phylogenetic-inference-with-hmmalign-and-raxml-ng%2F&amp;linkname=Alignment%20and%20phylogenetic%20inference%20with%20hmmalign%20and%20RAxML-ng" title="Mastodon" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Fwww.polarmicrobes.org%2Falignment-and-phylogenetic-inference-with-hmmalign-and-raxml-ng%2F&amp;linkname=Alignment%20and%20phylogenetic%20inference%20with%20hmmalign%20and%20RAxML-ng" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.polarmicrobes.org%2Falignment-and-phylogenetic-inference-with-hmmalign-and-raxml-ng%2F&#038;title=Alignment%20and%20phylogenetic%20inference%20with%20hmmalign%20and%20RAxML-ng" data-a2a-url="https://www.polarmicrobes.org/alignment-and-phylogenetic-inference-with-hmmalign-and-raxml-ng/" data-a2a-title="Alignment and phylogenetic inference with hmmalign and RAxML-ng"></a></p>]]></content:encoded>
					
					<wfw:commentRss>https://www.polarmicrobes.org/alignment-and-phylogenetic-inference-with-hmmalign-and-raxml-ng/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3390</post-id>	</item>
	</channel>
</rss>
