4
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 2022-12-31

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

動機

細菌やウイルスのゲノムダイアグラムを描くにはCGviewArtemisといったソフトがポピュラーだが、自分の好みに合った絵柄でSVG出力したかった。
SVG出力することで、Inkscape等を用いて編集可能となる。
Matplotlibでは環状ゲノムの描画が難しかったため、SVGを描画するライブラリ (SVGwrite) を用いて一から実装した。
イントロンにも対応している。

plot_circular_genome.py

Generate genome diagram in SVG
https://github.com/satoshikawato/bio_small_scripts/blob/main/plot_circular_genome.py

Requirements

Usage

$ ./plot_circular_genome.py -h
usage: plot_circular_genome.py [-h] -i INPUT [-t TABLE] [-n NT] [-w WINDOW] [-s STEP]

Generate genome diagram in SVG.

optional arguments:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        Genbank/DDBJ flatfile (required)
  -t TABLE, --table TABLE
                        color table (optional)
  -n NT, --nt NT        dinucleotide (default: GC).
  -w WINDOW, --window WINDOW
                        window size (default: 1000)
  -s STEP, --step STEP  step size (default: 100)

NC_003225
NZ_LR214945
各レーンは外側から

  • +方向 feature (タンパク質:青色、ribosomal RNA: 緑色、transfer RNA: 黄色、misc_feature: 灰色)
  • -方向feature
  • GC skew(エメラルド色:+/紫色:-)
  • GC含量 (灰色)
    を示す。
    ソースコードを編集するか、カラーテーブルを別途指定することで色は変更可能である。
    入力genbankファイルがエントリを複数含む場合 (Vibrioゲノム等)、各エントリのダイアグラムはLOCUS IDをファイル名とした個別のファイルに保存される。この理由から出力ファイル名のオプションは実装していない。
4
1
2

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
4
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?