0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

[Biopython]直鎖状ゲノムを描画する

Last updated at Posted at 2023-01-01

2024-02-06追記: 直鎖状・環状ゲノムを可視化するスクリプトをパッケージ化しています。お楽しみに

動機

ゲノムダイアグラム描画ソフトにはgggenomesClinkerArtemis comparison tool (ACT)などがあるものの、PythonベースでSVG出力可能なものが欲しかった

plot_linear_genome.py

Generate plot in SVG

Requirements

Usage

$ ./plot_linear_genome.py
usage: plot_linear_genome.py [-h] -i [INPUT ...] [-b [BLAST ...]] [-t TABLE] [-o OUTPUT] [-n NT] [-w WINDOW] [-s STEP]
                             [--separate_strands] [--show_gc] [--align_center] [--evalue EVALUE] [--bitscore BITSCORE]
                             [--identity IDENTITY]

Generate plot in SVG

optional arguments:
  -h, --help            show this help message and exit
  -i [INPUT ...], --input [INPUT ...]
                        genbank (required)
  -b [BLAST ...], --blast [BLAST ...]
                        input BLAST result file in tab-separated format (-outfmt 6 or 7) (optional)
  -t TABLE, --table TABLE
                        color table (optional)
  -o OUTPUT, --output OUTPUT
                        output prefix (default: diagram)
  -n NT, --nt NT        dinucleotide (default: GC).
  -w WINDOW, --window WINDOW
                        window size (default: 1000)
  -s STEP, --step STEP  step size (default: 100)
  --separate_strands    separate forward and reverse strands (default: False). Features of undefined strands are shown
                        on the forward strand.
  --show_gc             plot GC content below genome (default: False).
  --align_center        Align genomes to the center (default: False).
  --evalue EVALUE       evalue threshold (default=1e-2)
  --bitscore BITSCORE   bitscore threshold (default=50)
  --identity IDENTITY   identity threshold (default=0)

GenBank形式ファイル(.gb or .gbk)とBLASTN/TBLASTX出力ファイル(任意; -outfmt 6 or 7)を入力する。
BLAST出力ファイルは、GenBank形式ファイルと同じ配列かつIDのFASTAファイルをもとに作成する。

例としてリンホシスチス病ウイルスのゲノムダイアグラムを描く。

FASTA形式のゲノム配列ファイルについてTBLASTX (or BLASTN; -outfmt 7)で相同性検索

$ tblastx -query NC_001824.fasta -subject NC_033423.fasta -outfmt 7 -out NC_001824_NC_033423.tblastx.out
$ tblastx -query NC_033423.fasta -subject LC534415.fasta -outfmt 7 -out NC_033423_LC534415.tblastx.out

ゲノムダイアグラムを描く。ファイルの順番に注意されたい。

./plot_linear_genome.py -i NC_001824.gb NC_033423.gb LC534415.gb -b NC_001824_NC_033423.tblastx.out NC_033423_LC534415.tblastx.out --separate_strands --align_center --evalue 1e-10 --bitscore 100 # output: out.svg

out

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?