Create a phylogenetic tree from Biopyton using ClustalW2

A note for myself on how to create a phylogenetic tree from Biopyton using ClustalW2. However, most of the content is just translated into Japanese from what is written in Biopython Tutorial and Cookbook.

Install ClustalW2

First, [Download] ClustalW2 (http://www.clustal.org/clustal2/). In case of Mac, mount .dmg and put the bin file obtained by mounting it under / bin.

スクリーンショット 2016-11-13 23.59.33.png

Prepare the strain for which you want to create a phylogenetic tree

Next, prepare the data of the strain that uses Clustal W2. This time [Metarhizium](https://ja.wikipedia.org/wiki/%E3%83%A1%E3%82%BF%E3%83%AA%E3%82%B8%E3%82%A6%E3 A phylogenetic tree of% 83% A0) (Metarhizium) is created based on Ribosome biogenesis protein YTM1. The file was downloaded from UniProt. The strains used are as follows.

After adding it to the Basket, download it in FASTA format. This time, I saved it as uniprot-yourlist.fasta.

Run Clustal W2 on Biopython

Apply ClustalW2 from Biopython to the prepared stock data.

from Bio.Align.Applications import ClustalwCommandline

clustalw_cline = ClustalwCommandline("clustalw2", infile="uniprot-yourlist.fasta")
stdout, stderr = clustalw_cline()

Then, two files, uniprot-yourlist.aln and uniprot-yourlist.dnd, are generated. Therefore, use the Phylo module of Biopython to read the dnd file and draw a phylogenetic tree.

from Bio import Phylo

tree = Phylo.read("uniprot-yourlist.dnd", "newick")
Phylo.draw(tree)

figure_1.png

If you use the draw_ascii function instead of the draw function, the phylogenetic tree will be output as ASCII art.

  _ tr|E9E7T1|E9E7T1_METAQ
 |
 | , tr|A0A0D9P3B0|A0A0D9P3B0_METAN
 |,|
_||| tr|A0A0A1USL4|A0A0A1USL4_9HYPO
 ||
 || tr|A0A0B4H3C6|A0A0B4H3C6_9HYPO
 |
 |      ______________________________________ tr|A0A0B2X7N3|A0A0B2X7N3_9HYPO
 |_____|
       |______________ tr|A0A167BRY5|A0A167BRY5_9HYPO

Exited with code=0 in 1.1

References

http://biopython.org/DIST/docs/tutorial/Tutorial.html

Peter J. A. Cock, Tiago Antao, Jeffrey T. Chang, Brad A. Chapman, Cymon J. Cox, Andrew Dalke, Iddo Friedberg, Thomas Hamelryck, Frank Kauff, Bartek Wilczynski, Michiel J. L. de Hoon: “Biopython: freely available Python tools for computational molecular biology and bioinformatics”. Bioinformatics 25 (11), 1422–1423 (2009). doi:10.1093/bioinformatics/btp163,

Eric Talevich, Brandon M. Invergo, Peter J.A. Cock, Brad A. Chapman: “Bio.Phylo: A unified toolkit for processing, analyzing and visualizing phylogenetic trees in Biopython”. BMC Bioinformatics 13: 209 (2012). doi:10.1186/1471-2105-13-209

Recommended Posts

Create a phylogenetic tree from Biopyton using ClustalW2
Create a dataframe from excel using pandas
Create a decision tree from 0 with Python (1. Overview)
Create a GCE instance from a GCR Docker image using terraform
Create a python GUI using tkinter
Create a pandas Dataframe from a string.
Create a nested dictionary using defaultdict
Create a CRUD API using FastAPI
Create a C wrapper using Boost.Python
How to create a clone from Github
Create multiple line charts from a data frame at once using Matplotlib
Create a tool to automatically furigana with html using Mecab from Python3
Create a graph using the Sympy module
[Python] Create a Batch environment using AWS-CDK
Create a standings from JFL match results
Create a stack with a queue and a queue with a stack (from LetCode / Implement Stack using Queues, Implement Queue using Stacks)
Create a deb file from a python package
Draw a tree in Python 3 using graphviz
How to create a repository from media
Create a decision tree from 0 with Python and understand it (5. Information Entropy)
Edit Excel from Python to create a PivotTable
Create a GIF file using Pillow in Python
How to create a function object from a string
Create a C array from a Python> Excel sheet
Create a beauty pageant support app using PyLearn2
Create a game UI from scratch with pygame2!
Create a New Todoist Task from Python Script
Create a record table from JFL match results
Create a binary data parser using Kaitai Struct
Create a web map using Python and GDAL
Create wav file from GLSL shader using python3
Create a score ranking from JFL match results
Create a datetime object from a string in Python (Python 3.3)
Run a Python file from html using Django
Create a visitor notification system using Raspberry Pi
Create a Mac app using py2app and Python3! !!
Create a MIDI file in Python using pretty_midi
Run a python script from excel (using xlwings)
Create a Word Cloud from an academic program
Create a GUI on the terminal using curses
Get the nth smallest number from the array with O (logN) using a segment tree
How to create a radial profile from astronomical images (Chandra, XMM etc.) using python
Create a data collection bot in Python using Selenium
Create a color sensor using a Raspberry Pi and a camera
[CRUD] [Django] Create a CRUD site using the Python framework Django ~ 1 ~
[Python] Create a ValueObject with a complete constructor using dataclasses
DJango Note: From the beginning (using a generic view)
Create a pseudo REST API server using GitHub Pages
[CRUD] [Django] Create a CRUD site using the Python framework Django ~ 2 ~
I tried reading data from a file using Node.js.
Python script to create a JSON file from a CSV file
Create a company name extractor with python using JCLdic
[CRUD] [Django] Create a CRUD site using the Python framework Django ~ 3 ~
How to create a kubernetes pod from python code
[CRUD] [Django] Create a CRUD site using the Python framework Django ~ 4 ~
[CRUD] [Django] Create a CRUD site using the Python framework Django ~ 5 ~
A little bit from Python using the Jenkins API
Create a dictionary by searching the table using sqlalchemy
Create a machine learning environment from scratch with Winsows 10
Create a decision tree from 0 with Python and understand it (3. Data analysis library Pandas edition)
How to create an instance of a particular class from dict using __new__ () in python