text: user7244: I'm new here. I need to construct a phylogenetic tree from 16s Sequence data (merged 151 bp) and color the branches/nodes based on my experimental conditions. From this blog, it looks like I need a .phy file to make the tree. I want to use Biopython for this since I'm reasonably comfortable with python.
  I have a csv file with the 16s sequences, the phylogenetic information, and the "name" of the sequence, and the experimental conditions. How can I make a .phy file from this?
  I would appreciate any help.
  Thank you.
  
  user3848: You simply use Biopython's SeqIO and AlignIO.
  The documentation is https://biopython.org/wiki/AlignIO 
  etc ...
  The format you seek is phylip
  
  user6343: Python works great for tying everything together and file manipulations.  I find stepping out of Python, using system calls, best for alignment and tree building.  For example:
  os.system("mafft --auto {} > {}" .format("unaligned_16s_seq_in_file.fasta", "alignment_out_file.fasta"))
  
  os.system("raxml -f a -s {} -p 12345 -x 12345 -# 100 -m GTRCAT -n {}" .format("alignment_out_file.fasta", "tree_out_file.tre"))
  
  
original_text: 7244: <p>I'm new here. I need to construct a phylogenetic tree from 16s Sequence data (merged 151 bp) and color the branches/nodes based on my experimental conditions. From <a href="https://towardsdatascience.com/molecular-phylogenetics-using-bio-phylo-57ce27492ee9" rel="nofollow noreferrer">this blog</a>, it looks like I need a .phy file to make the tree. I want to use Biopython for this since I'm reasonably comfortable with python.</p>
  <p>I have a csv file with the 16s sequences, the phylogenetic information, and the &quot;name&quot; of the sequence, and the experimental conditions. How can I make a .phy file from this?</p>
  <p>I would appreciate any help.
  Thank you.</p>
   3848: <p>You simply use Biopython's SeqIO and AlignIO.
  The documentation is <a href="https://biopython.org/wiki/AlignIO" rel="nofollow noreferrer">https://biopython.org/wiki/AlignIO</a> 
  etc ...
  The format you seek is phylip</p>
   6343: <p>Python works great for tying everything together and file manipulations.  I find stepping out of Python, using system calls, best for alignment and tree building.  For example:</p>
  
  <pre><code>os.system("mafft --auto {} &gt; {}" .format("unaligned_16s_seq_in_file.fasta", "alignment_out_file.fasta"))
  
  os.system("raxml -f a -s {} -p 12345 -x 12345 -# 100 -m GTRCAT -n {}" .format("alignment_out_file.fasta", "tree_out_file.tre"))
  </code></pre>
  